powerpc/85xx: Introduce CONFIG_SYS_EXTRA_ENV_RELOC
PATCH 1/1 powerpc/85xx: Introduce CONFIG_SYS_EXTRA_ENV_RELOC
Some systems need to relocate the env_addr pointer early because the location its point 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.
We set this on the 85xx boards that have support for NAND, SPI, or SDHC/MMC boot support as they use a secondary cache in SRAM mode and need the env_addr pointer relocated since we change from SRAM to normal cache mode in cpu_init_r.
--- arch/powerpc/lib/board.c | 11 +++++++++++ include/configs/MPC8536DS.h | 1 + include/configs/MPC8569MDS.h | 1 + include/configs/P1_P2_RDB.h | 1 + 4 files changed, 14 insertions(+), 0 deletions(-)
arch/powerpc/lib/board.c +11 -0
@@ -645,6 +645,17 @@ void board_init_r (gd_t *id, ulong dest_addr) gd->cpu += dest_addr -CONFIG_SYS_MONITOR_BASE ;#endif +#ifdef CONFIG_SYS_EXTRA_ENV_RELOC +/* +* Some systems need to relocate the env_addr pointer early because the +* location its point 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. +*/ + gd->env_addr += dest_addr -CONFIG_SYS_MONITOR_BASE ; +#endif +#ifdef CONFIG_SERIAL_MULTI serial_initialize ();#endif
include/configs/MPC8536DS.h +1 -0
@@ -245,6 +245,7 @@#if defined(CONFIG_SYS_SPL ) || defined(CONFIG_RAMBOOT_NAND ) \ || defined(CONFIG_RAMBOOT_SDCARD ) || defined(CONFIG_RAMBOOT_SPIFLASH )#define CONFIG_SYS_RAMBOOT +#define CONFIG_SYS_EXTRA_ENV_RELOC #else #undef CONFIG_SYS_RAMBOOT#endif
include/configs/MPC8569MDS.h +1 -0
@@ -205,6 +205,7 @@ extern unsigned long get_clock_freq(void);#if defined(CONFIG_SYS_SPL ) || defined(CONFIG_RAMBOOT_NAND )#define CONFIG_SYS_RAMBOOT +#define CONFIG_SYS_EXTRA_ENV_RELOC #else #undef CONFIG_SYS_RAMBOOT#endif
include/configs/P1_P2_RDB.h +1 -0
@@ -204,6 +204,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);#if defined(CONFIG_SYS_SPL ) || defined(CONFIG_RAMBOOT_NAND ) \ || defined(CONFIG_RAMBOOT_SDCARD ) || defined(CONFIG_RAMBOOT_SPIFLASH )#define CONFIG_SYS_RAMBOOT +#define CONFIG_SYS_EXTRA_ENV_RELOC #else #undef CONFIG_SYS_RAMBOOT#endif
Signature · 1 line
1.7.2.3
PATCH 1/1 powerpc/85xx: Introduce CONFIG_SYS_EXTRA_ENV_RELOC
Quoted 11 lines · Kumar Gala
Some systems need to relocate the
env_addrpointer early because the location its point to will get invalidated beforeenv_relocateis 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 incpu_init_r.We set this on the 85xx boards that have support for NAND, SPI, or SDHC/MMC boot support as they use a secondary cache in SRAM mode and need the
env_addrpointer relocated since we change from SRAM to normal cache mode incpu_init_r.
Quoted 7 lines
Signed-off-by Kumar Gala <[email protected]>---
arch/powerpc/lib/board.c | 11 +++++++++++ include/configs/MPC8536DS.h | 1 + include/configs/MPC8569MDS.h | 1 + include/configs/P1_P2_RDB.h | 1 + 4 files changed, 14 insertions(+), 0 deletions(-)
Wolfgang,
I dont think either of us are happy with this solution but not really sure what else to do. Please ack if you're grudgingly ok with this. :)
- k
PATCH 1/1 powerpc/85xx: Introduce CONFIG_SYS_EXTRA_ENV_RELOC
In reply to Kumar GalaQuoted 24 lines · Kumar Gala
Some systems need to relocate the
env_addrpointer early because the location its point to will get invalidated beforeenv_relocateis 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 incpu_init_r.We set this on the 85xx boards that have support for NAND, SPI, or SDHC/MMC boot support as they use a secondary cache in SRAM mode and need the
env_addrpointer relocated since we change from SRAM to normal cache mode incpu_init_r.Signed-off-by Kumar Gala <[email protected]>---
arch/powerpc/lib/board.c | 11 +++++++++++ include/configs/MPC8536DS.h | 1 + include/configs/MPC8569MDS.h | 1 + include/configs/P1_P2_RDB.h | 1 + 4 files changed, 14 insertions(+), 0 deletions(-)arch/powerpc/lib/board.c +0
-0
arch/powerpc/lib/board.c void board_init_r (gd_t *id, ulong dest_addr) · line 651
Quoted 7 lines
arch/powerpc/lib/board.c +4
-0@@ -645,6 +645,17 @@ void board_init_r (gd_t *id, ulong dest_addr) gd->cpu += dest_addr -CONFIG_SYS_MONITOR_BASE ;#endif +#ifdef CONFIG_SYS_EXTRA_ENV_RELOC +/* +* Some systems need to relocate the env_addr pointer early because the +* location its point to will get invalidated before env_relocate is
^^^^^^^^^^^^^^^^^^^^^^
Not to nitpick, but please correct this - I think you meant "location it points to"?
-B