mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
saveenv: spi-nor: fix for data abort issue
This changes update env_flash variable to currently updated memory location by sf probe. So this will avoid accessing of outdated memory location. Signed-off-by: Vandhiadevan Karunamoorthy <vkarunam@codeaurora.org> Change-Id: Ib97c485f3c738d5501ee1cdb62c5ebbf421e8d14
This commit is contained in:
parent
e0fdbf3dfb
commit
465a58cc6b
1 changed files with 10 additions and 14 deletions
|
|
@ -52,7 +52,6 @@ int sf_saveenv(void)
|
|||
u32 saved_size, saved_offset, sector = 1;
|
||||
int ret;
|
||||
|
||||
if (!env_flash) {
|
||||
env_flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
|
||||
CONFIG_SF_DEFAULT_CS,
|
||||
CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE);
|
||||
|
|
@ -60,7 +59,6 @@ int sf_saveenv(void)
|
|||
set_default_env("!spi_flash_probe() failed");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
ret = env_export(&env_new);
|
||||
if (ret)
|
||||
|
|
@ -226,7 +224,6 @@ int sf_saveenv(void)
|
|||
int ret = 1;
|
||||
env_t env_new;
|
||||
|
||||
if (!env_flash) {
|
||||
env_flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS,
|
||||
CONFIG_SF_DEFAULT_CS,
|
||||
CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE);
|
||||
|
|
@ -234,7 +231,6 @@ int sf_saveenv(void)
|
|||
set_default_env("!spi_flash_probe() failed");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Is the sector larger than the env (i.e. embedded) */
|
||||
if (CONFIG_ENV_SECT_SIZE > CONFIG_ENV_RANGE) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue