[PATCH 1/6] configs: layerscape qds: disable ENV_RELOC_GD_ENV_ADDR for NOR boot

Vladimir Oltean <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <[email protected]>
CONFIG_ENV_RELOC_GD_ENV_ADDR causes gd->env_addr to be adjusted by
the relocation offset at the start of board_r init:

  gd->env_addr += gd->reloc_off;

On QDS boards with CONFIG_ENV_IS_IN_FLASH=y the environment driver
(env/flash.c) sets env_addr to CONFIG_ENV_ADDR, a fixed memory-mapped
NOR flash address (0x580500000 on LS2088A-QDS). That address is a
hardware constant and must not be adjusted. Applying the relocation
offset corrupts it to an unmapped address (e.g. 0x5fa1fb004).

The first call to env_get() after relocation passes this corrupted
address to env_get_from_linear(), which then issues an AXI read from
the bogus address. The bus returns a SLVERR, which the CPU core buffers
as an asynchronous SError and delivers on the next function epilogue,
producing:

  "Error" handler, esr 0xbf000000
  elr: 00000000fbd68068 lr : 00000000fbd68040
  ...
  Resetting CPU ...
ESR 0xbf000000 decodes as EC=0x2F (SError), IDS=1 (implementation-
defined syndrome), consistent with a Cortex-A72 external abort.

Disable the option for the four QDS TFA defconfigs that combine
CONFIG_ENV_RELOC_GD_ENV_ADDR=y with CONFIG_ENV_IS_IN_FLASH=y:
ls1043aqds_tfa, ls1046aqds_tfa, ls1088aqds_tfa, and ls2088aqds_tfa.
The remaining Layerscape defconfigs that carry RELOC_GD_ENV_ADDR use
SPI_FLASH, MMC, or NAND storage, none of which use a memory-mapped
CONFIG_ENV_ADDR, so they are unaffected.

Since commit 123682c7651d ("env: Rename SYS_RELOC_GD_ENV_ADDR to
ENV_RELOC_GD_ENV_ADDR"), the Kconfig option has been renamed, so
splitting the change for each board is slightly pointless (it can't be
backported as one to individual configs).

Fixes: c43a4f827691 ("configs: nxp: Enable CONFIG_SYS_RELOC_GD_ENV_ADDR")
Fixes: effcb1ebe44a ("configs: ls1088a: Enable CONFIG_SYS_RELOC_ENV_ADDR")
Fixes: 5e736c9397e5 ("configs: ls1046aqds: Configure environment related configs")
Fixes: b10adfac64da ("configs: ls1043aqds: Configure environment related configs")
Signed-off-by: Vladimir Oltean <[email protected]>
---
 configs/ls1043aqds_tfa_defconfig | 2 +-
 configs/ls1046aqds_tfa_defconfig | 2 +-
 configs/ls1088aqds_tfa_defconfig | 2 +-
 configs/ls2088aqds_tfa_defconfig | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/configs/ls1043aqds_tfa_defconfig b/configs/ls1043aqds_tfa_defconfig
index 6021d9a5e512..9e88f912a930 100644
--- a/configs/ls1043aqds_tfa_defconfig
+++ b/configs/ls1043aqds_tfa_defconfig
@@ -65,7 +65,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_SPI_BUS=0
-CONFIG_ENV_RELOC_GD_ENV_ADDR=y
+# CONFIG_ENV_RELOC_GD_ENV_ADDR is not set
 CONFIG_AHCI=y
 CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
diff --git a/configs/ls1046aqds_tfa_defconfig b/configs/ls1046aqds_tfa_defconfig
index 05f9808105a0..c5eafe1064d9 100644
--- a/configs/ls1046aqds_tfa_defconfig
+++ b/configs/ls1046aqds_tfa_defconfig
@@ -66,7 +66,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_SPI_BUS=0
-CONFIG_ENV_RELOC_GD_ENV_ADDR=y
+# CONFIG_ENV_RELOC_GD_ENV_ADDR is not set
 CONFIG_AHCI=y
 CONFIG_SATA=y
 CONFIG_SATA_CEVA=y
diff --git a/configs/ls1088aqds_tfa_defconfig b/configs/ls1088aqds_tfa_defconfig
index 4e6330206d17..a6ca891c7a22 100644
--- a/configs/ls1088aqds_tfa_defconfig
+++ b/configs/ls1088aqds_tfa_defconfig
@@ -61,7 +61,7 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
-CONFIG_ENV_RELOC_GD_ENV_ADDR=y
+# CONFIG_ENV_RELOC_GD_ENV_ADDR is not set
 CONFIG_USE_ETHPRIME=y
 CONFIG_ETHPRIME="DPMAC1@xgmii"
 CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/configs/ls2088aqds_tfa_defconfig b/configs/ls2088aqds_tfa_defconfig
index 566c0affc4a7..79e1c0c70187 100644
--- a/configs/ls2088aqds_tfa_defconfig
+++ b/configs/ls2088aqds_tfa_defconfig
@@ -55,7 +55,7 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
-CONFIG_ENV_RELOC_GD_ENV_ADDR=y
+# CONFIG_ENV_RELOC_GD_ENV_ADDR is not set
 CONFIG_USE_ETHPRIME=y
 CONFIG_ETHPRIME="DPMAC1@xgmii"
 CONFIG_NET_RANDOM_ETHADDR=y
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.