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>
diff --git a/common/board_r.c b/common/board_r.c
index 9402c0e..c55e33e 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -140,15 +140,12 @@
*/
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
/*