Skip to contentSkip to conversation

ARM: vexpress_ca9x4: Add missing flash width config option

PATCH In review Patryk Biel 3 participants 3 messages Sep 20, 2023 – Oct 10, 2023 Arm/versatile express platform

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: vexpress_ca9x4: Add missing flash width config option

Allow for a proper configuration of CFI flash banks avaialble on the vexpress_ca9x4 board. Without this option, the CFI flash incorrectly detects that the board has two banks of 32MB flash devices, while in reality, the board provides
two flash banks, each with 64MB size. As a result, it becomes impossible to e.g. to save u-boot env in flash. According to device tree for this board and its implementation in QEMU, the CFI width should be set to 32 bits.

After applying this fix, CFI flash will correctly detect both flash banks each with a size of 64MB. As as result the functionality of e.g. saving u-boot env will work correctly.

Tested on QEMU 6.2.0.

Cc Kristian Amlie <[email protected]>
---
 configs/vexpress_ca9x4_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/vexpress_ca9x4_defconfig +1 -0
index 5cacecc7cb..ac9c0e1d71 100644
@@ -55,3 +55,4 @@ CONFIG_SMC911X_32_BIT=y
 CONFIG_BAUDRATE=38400
 CONFIG_CONS_INDEX=0
 CONFIG_SYS_TIMER_COUNTS_DOWN=y
+CONFIG_SYS_FLASH_CFI_WIDTH_32BIT=y
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Patryk Biel

Allow for a proper configuration of CFI flash banks avaialble on the vexpress_ca9x4 board. Without this option, the CFI flash incorrectly detects that the board has two banks of 32MB flash devices, while in reality, the board provides
two flash banks, each with 64MB size. As a result, it becomes impossible to e.g. to save u-boot env in flash. According to device tree for this board and its implementation in QEMU, the CFI width should be set to 32 bits.

After applying this fix, CFI flash will correctly detect both flash banks each with a size of 64MB. As as result the functionality of e.g. saving u-boot env will work correctly.

Tested on QEMU 6.2.0.

Cc Kristian Amlie <[email protected]>
---
  configs/vexpress_ca9x4_defconfig | 1 +
  1 file changed, 1 insertion(+)
configs/vexpress_ca9x4_defconfig +0 -0
index 5cacecc7cb..ac9c0e1d71 100644

configs/vexpress_ca9x4_defconfig CONFIG_SMC911X_32_BIT=y · line 58

Quoted 4 lines
configs/vexpress_ca9x4_defconfig +1 -0
@@ -55,3 +55,4 @@ CONFIG_SMC911X_32_BIT=y
  CONFIG_BAUDRATE=38400
  CONFIG_CONS_INDEX=0
  CONFIG_SYS_TIMER_COUNTS_DOWN=y
+CONFIG_SYS_FLASH_CFI_WIDTH_32BIT=y

I believe this should be fine.

This is probably a recent issue, since we are using the 64MB banks already in our test setup, and it's working. But it's based on v2022.01, so it's a bit older.

Signature · 1 line
Kristian
#2 lore raw
In reply to Patryk Biel
Quoted 11 lines · Patryk Biel

Allow for a proper configuration of CFI flash banks avaialble on the vexpress_ca9x4 board. Without this option, the CFI flash incorrectly detects that the board has two banks of 32MB flash devices, while in reality, the board provides
two flash banks, each with 64MB size. As a result, it becomes impossible to e.g. to save u-boot env in flash. According to device tree for this board and its implementation in QEMU, the CFI width should be set to 32 bits.

After applying this fix, CFI flash will correctly detect both flash banks each with a size of 64MB. As as result the functionality of e.g. saving u-boot env will work correctly.

Quoted 5 lines

Tested on QEMU 6.2.0.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom