Commit c00c29d8 authored by Guy Thouret's avatar Guy Thouret Committed by Tom Rini
Browse files

env_eeprom invalidates gd->env_addr by setting it to an offset value



Patch to fix boot hang when using env on i2c eeprom caused by invalid gd->env_addr
Signed-off-by: default avatarGuy Thouret <guy.thouret@wems.co.uk>
Cc: Heiko Schocher <hs@denx.de>
parent d3bafe32
......@@ -145,11 +145,6 @@ void env_relocate_spec(void)
gd->env_valid = 1;
}
if (gd->env_valid == 2)
gd->env_addr = off_env[1] + offsetof(env_t, data);
else if (gd->env_valid == 1)
gd->env_addr = off_env[0] + offsetof(env_t, data);
#else /* CONFIG_ENV_OFFSET_REDUND */
ulong crc, len, new;
uchar rdbuf[64];
......@@ -175,10 +170,8 @@ void env_relocate_spec(void)
}
if (crc == new) {
gd->env_addr = offsetof(env_t, data);
gd->env_valid = 1;
} else {
gd->env_addr = 0;
gd->env_valid = 0;
}
#endif /* CONFIG_ENV_OFFSET_REDUND */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment