diff options
| author | Tom Rini <[email protected]> | 2026-04-06 12:16:57 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-04-06 12:16:57 -0600 |
| commit | 93f84ee022a8401421cdaab84fe7d106d83fdb4a (patch) | |
| tree | fb15a4af876e8faf9893fd86c1c0e127265dbe9a /env | |
| parent | 88dc2788777babfd6322fa655df549a019aa1e69 (diff) | |
| parent | e2138cf1e6088f12ffa874e87cc8f4b198378635 (diff) | |
Merge branch 'next'
Diffstat (limited to 'env')
| -rw-r--r-- | env/Kconfig | 3 | ||||
| -rw-r--r-- | env/flash.c | 8 | ||||
| -rw-r--r-- | env/sf.c | 3 |
3 files changed, 12 insertions, 2 deletions
diff --git a/env/Kconfig b/env/Kconfig index b312f9b5324..5979f7faa99 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -259,6 +259,7 @@ config ENV_IS_IN_MMC config ENV_IS_IN_NAND bool "Environment in a NAND device" depends on !CHAIN_OF_TRUST + depends on MTD_RAW_NAND help Define this if you have a NAND device which you want to use for the environment. @@ -975,7 +976,7 @@ config USE_BOOTFILE config BOOTFILE string "'bootfile' environment variable value" - default kernel.itb if SPL_ATF && TARGET_SOCFPGA_SOC64 + default kernel.itb if SPL_ATF && ARCH_SOCFPGA_SOC64 depends on USE_BOOTFILE help The value to set the "bootfile" variable to. diff --git a/env/flash.c b/env/flash.c index 0f7393d830c..31dd1656e72 100644 --- a/env/flash.c +++ b/env/flash.c @@ -108,6 +108,14 @@ static int env_flash_init(void) } else if (flag2 == 0xFF) { gd->env_addr = addr2; gd->env_valid = ENV_REDUND; + } else { + /* + * Unrecognized flag pair (e.g. bit-flip on NOR flash). + * Default to primary copy to prevent unintended pointer + * swap in env_flash_load(). + */ + gd->env_addr = addr1; + gd->env_valid = ENV_REDUND; } return 0; @@ -396,7 +396,8 @@ static int env_sf_init_early(void) if (IS_ENABLED(CONFIG_ENV_REDUNDANT)) { read2_fail = spi_flash_read(env_flash, - CONFIG_ENV_OFFSET_REDUND, + IF_ENABLED_INT(CONFIG_ENV_REDUNDANT, + CONFIG_ENV_OFFSET_REDUND), CONFIG_ENV_SIZE, tmp_env2); ret = env_check_redund((char *)tmp_env1, read1_fail, (char *)tmp_env2, read2_fail); |
