[PATCH 2/6] configs: ls2088aqds_tfa: fix NOR flash write failure
Vladimir Oltean <[email protected]>
| Newsgroups | org.u-boot-project.lists.u-boot |
|---|---|
| Message-ID | <[email protected]> |
saveenv fails on the LS2088A-QDS board with:
Flash buffer write timeout at address 580500000 data fffffffffec6fec6
The NOR flash (Spansion S29GL01GT) is connected to the IFC as a 16-bit
device, as reflected by the CSPR_PORT_SIZE_16 setting in the board
configuration. However, CONFIG_SYS_FLASH_CFI_WIDTH is not set, so the
CFI probe loop starts at portwidth=1 (8-bit) and stops as soon as it
finds a valid CFI QRY signature, which it does at portwidth=1 because
the S29GL01GT supports x8 mode and the IFC byte-lane routing makes the
8-bit probe succeed first. As a result, flinfo reports "(8 x 8)" instead
of the correct "(16 x 16)".
With the wrong port width, all flash commands - unlock sequences, buffer
write, write confirm - are issued to incorrect byte addresses. The
AMD/Spansion chip rejects the malformed write command sequence by
toggling DQ6 indefinitely, which the cfi_flash driver reports as a
buffer write timeout.
Commit 53879b17382f ("cfi_flash: Fix detection of 8-bit bus flash
devices via address shift") introduced the address-shift probing logic
that causes the 8-bit probe to match before the correct 16-bit one.
An identical fix to this one was applied to the ls2088ardb platform in
commit ed56fda586fc ("config: ls2088ardb: Add config
CONFIG_SYS_FLASH_CFI_WIDTH"), but it was not realized that it should
apply to ls2088aqds as well.
Set CONFIG_SYS_FLASH_CFI_WIDTH_16BIT to force the CFI probe to start
at the correct 16-bit port width.
Fixes: 53879b17382f ("cfi_flash: Fix detection of 8-bit bus flash devices via address shift")
Signed-off-by: Vladimir Oltean <[email protected]>
---
configs/ls2088aqds_tfa_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/ls2088aqds_tfa_defconfig b/configs/ls2088aqds_tfa_defconfig
index 79e1c0c70187..6b499c4dbfbc 100644
--- a/configs/ls2088aqds_tfa_defconfig
+++ b/configs/ls2088aqds_tfa_defconfig
@@ -83,6 +83,7 @@ CONFIG_FLASH_CFI_DRIVER=y
CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
CONFIG_SYS_FLASH_EMPTY_INFO=y
CONFIG_SYS_FLASH_CFI=y
+CONFIG_SYS_FLASH_CFI_WIDTH_16BIT=y
CONFIG_SYS_FLASH_QUIET_TEST=y
CONFIG_SYS_MAX_FLASH_SECT=1024
CONFIG_SYS_MAX_FLASH_BANKS=2
--
2.34.1