Skip to contentSkip to conversation

arm: mvebu: Set common SPI flash default speed and mode

PATCH RESEND In review Tony Dinh 2 participants 3 messages Mar 3, 2023 – Mar 24, 2023

Subsystems (3)
lore
Share & tools
lore

Tony Dinh

author
#0 lore raw

PATCH RESEND 1/1 arm: mvebu: Set common SPI flash default speed and mode

CONFIG_SF_DEFAULT_SPEED is used in SPL SPI to configure and probe the flash device during DM SPI uclass probing process, if the spi-max-frequency is not available in the DTB. Currently the max frequency is not available, because of the probing mechanism in SPI uclass has not been fully updated to DM.

The CONFIG_SF_DEFAULT_SPEED is set to 1Mhz if a board defconfig does not specify it. This speed is too slow and result in a few seconds delay while the u-boot image is loaded from flash. Based on a survey of the device tree specifications for MVEBU boards, a sane default value should be 10Mhz. The default of 10Mhz enables an almost instantaneously loading of the u-boot image.

Note that this patch depends on this patch series (has been merged to u-boot-marvell/next):
https://lists.denx.de/pipermail/u-boot/2023-March/511038.html

- RESEND: correct spelling of SF_DEFAULT_MODE

---

 arch/arm/mach-mvebu/Kconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/mach-mvebu/Kconfig +10 -0
index cdb1776a66..8f744e2177 100644
@@ -424,6 +424,16 @@ config SECURED_MODE_CSK_INDEX
 	default 0
 	depends on SECURED_MODE_IMAGE
 
+config SF_DEFAULT_SPEED
+	int "Default speed for SPI flash in Hz"
+	default 10000000
+	depends on MVEBU_SPL_BOOT_DEVICE_SPI
+
+config SF_DEFAULT_MODE
+	hex "Default mode for SPI flash"
+	default 0x0
+	depends on MVEBU_SPL_BOOT_DEVICE_SPI
+
 source "board/solidrun/clearfog/Kconfig"
 source "board/kobol/helios4/Kconfig"
 
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Tony Dinh

CONFIG_SF_DEFAULT_SPEED is used in SPL SPI to configure and probe the flash device during DM SPI uclass probing process, if the spi-max-frequency is not available in the DTB. Currently the max frequency is not available, because of the probing mechanism in SPI uclass has not been fully updated to DM.

The CONFIG_SF_DEFAULT_SPEED is set to 1Mhz if a board defconfig does not specify it. This speed is too slow and result in a few seconds delay while the u-boot image is loaded from flash. Based on a survey of the device tree specifications for MVEBU boards, a sane default value should be 10Mhz. The default of 10Mhz enables an almost instantaneously loading of the u-boot image.

Quoted 7 lines

Note that this patch depends on this patch series (has been merged to u-boot-marvell/next):
https://lists.denx.de/pipermail/u-boot/2023-March/511038.html

- RESEND: correct spelling of SF_DEFAULT_MODE

Thanks,
Stefan

Quoted 16 lines

---

  arch/arm/mach-mvebu/Kconfig | 10 ++++++++++
  1 file changed, 10 insertions(+)
arch/arm/mach-mvebu/Kconfig +3 -0
index cdb1776a66..8f744e2177 100644
@@ -424,6 +424,16 @@ config SECURED_MODE_CSK_INDEX
  	default 0
  	depends on SECURED_MODE_IMAGE
 
+config SF_DEFAULT_SPEED
+	int "Default speed for SPI flash in Hz"
+	default 10000000

arch/arm/mach-mvebu/Kconfig config SECURED_MODE_CSK_INDEX · line 439

Quoted 10 lines
arch/arm/mach-mvebu/Kconfig +7 -0
+	depends on MVEBU_SPL_BOOT_DEVICE_SPI
+
+config SF_DEFAULT_MODE
+	hex "Default mode for SPI flash"
+	default 0x0
+	depends on MVEBU_SPL_BOOT_DEVICE_SPI
+
  source "board/solidrun/clearfog/Kconfig"
  source "board/kobol/helios4/Kconfig"
 

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#2 lore raw
In reply to Tony Dinh
Quoted 13 lines · Tony Dinh

CONFIG_SF_DEFAULT_SPEED is used in SPL SPI to configure and probe the flash device during DM SPI uclass probing process, if the spi-max-frequency is not available in the DTB. Currently the max frequency is not available, because of the probing mechanism in SPI uclass has not been fully updated to DM.

The CONFIG_SF_DEFAULT_SPEED is set to 1Mhz if a board defconfig does not specify it. This speed is too slow and result in a few seconds delay while the u-boot image is loaded from flash. Based on a survey of the device tree specifications for MVEBU boards, a sane default value should be 10Mhz. The default of 10Mhz enables an almost instantaneously loading of the u-boot image.

Quoted 7 lines

Note that this patch depends on this patch series (has been merged to u-boot-marvell/next):
https://lists.denx.de/pipermail/u-boot/2023-March/511038.html

- RESEND: correct spelling of SF_DEFAULT_MODE

Applied to u-boot-marvell/next

Thanks,
Stefan

Quoted 16 lines

---

  arch/arm/mach-mvebu/Kconfig | 10 ++++++++++
  1 file changed, 10 insertions(+)
arch/arm/mach-mvebu/Kconfig +3 -0
index cdb1776a66..8f744e2177 100644
@@ -424,6 +424,16 @@ config SECURED_MODE_CSK_INDEX
  	default 0
  	depends on SECURED_MODE_IMAGE
 
+config SF_DEFAULT_SPEED
+	int "Default speed for SPI flash in Hz"
+	default 10000000

arch/arm/mach-mvebu/Kconfig config SECURED_MODE_CSK_INDEX · line 439

Quoted 10 lines
arch/arm/mach-mvebu/Kconfig +7 -0
+	depends on MVEBU_SPL_BOOT_DEVICE_SPI
+
+config SF_DEFAULT_MODE
+	hex "Default mode for SPI flash"
+	default 0x0
+	depends on MVEBU_SPL_BOOT_DEVICE_SPI
+
  source "board/solidrun/clearfog/Kconfig"
  source "board/kobol/helios4/Kconfig"
 

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]