diff options
author | Simon Goldschmidt | 2018-09-27 12:38:34 +0200 |
---|---|---|
committer | Tom Rini | 2018-10-06 09:04:18 -0400 |
commit | 6c6add602970ee6b542b38ad6daf4f8e1e9f39d4 (patch) | |
tree | e3c90f9e737b67d27fe94a27e64a002494c2b9aa /common/board_r.c | |
parent | c906f372b2ec55222b841b2affb50fd72d985086 (diff) |
configs: drop CONFIG_SYS_EXTRA_ENV_RELOC
Instead of manually specifying CONFIG_SYS_EXTRA_ENV_RELOC
for every board that needs it, it shouldn't hurt to let
initr_reloc_global_data() always relocate gd->env_addr
unless we know this pointer is outside the initial binary.
To achieve this, the relocation is omitted if
CONFIG_ENV_ADDR is defined (and ENV_IS_EMBEDDED is not).
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Diffstat (limited to 'common/board_r.c')
-rw-r--r-- | common/board_r.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/common/board_r.c b/common/board_r.c index 9402c0ef219..c55e33eec27 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -140,15 +140,12 @@ static int initr_reloc_global_data(void) */ fixup_cpu(); #endif -#ifdef CONFIG_SYS_EXTRA_ENV_RELOC +#if !defined(CONFIG_ENV_ADDR) || defined(ENV_IS_EMBEDDED) /* - * Some systems need to relocate the env_addr pointer early because the - * location it points to will get invalidated before env_relocate is - * called. One example is on systems that might use a L2 or L3 cache - * in SRAM mode and initialize that cache from SRAM mode back to being - * a cache in cpu_init_r. + * Relocate the early env_addr pointer unless we know it is not inside + * the binary. Some systems need this and for the rest, it doesn't hurt. */ - gd->env_addr += gd->relocaddr - CONFIG_SYS_MONITOR_BASE; + gd->env_addr += gd->reloc_off; #endif #ifdef CONFIG_OF_EMBED /* |