public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] powerpc/85xx: Introduce CONFIG_SYS_EXTRA_ENV_RELOC
@ 2010-11-18 20:30 Kumar Gala
  2010-11-29 14:47 ` Kumar Gala
  0 siblings, 1 reply; 2+ messages in thread
From: Kumar Gala @ 2010-11-18 20:30 UTC (permalink / raw)
  To: u-boot

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.

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.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
* Fixed comments per becky feedback

 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(-)

diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 2e0749d..40d8c92 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -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 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.
+	 */
+	gd->env_addr += dest_addr - CONFIG_SYS_MONITOR_BASE;
+#endif
+
 #ifdef CONFIG_SERIAL_MULTI
 	serial_initialize();
 #endif
diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h
index 850665a..50d282c 100644
--- a/include/configs/MPC8536DS.h
+++ b/include/configs/MPC8536DS.h
@@ -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
diff --git a/include/configs/MPC8569MDS.h b/include/configs/MPC8569MDS.h
index c7973b4..20fd672 100644
--- a/include/configs/MPC8569MDS.h
+++ b/include/configs/MPC8569MDS.h
@@ -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
diff --git a/include/configs/P1_P2_RDB.h b/include/configs/P1_P2_RDB.h
index 610f3ed..8069b55 100644
--- a/include/configs/P1_P2_RDB.h
+++ b/include/configs/P1_P2_RDB.h
@@ -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
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH v2] powerpc/85xx: Introduce CONFIG_SYS_EXTRA_ENV_RELOC
  2010-11-18 20:30 [U-Boot] [PATCH v2] powerpc/85xx: Introduce CONFIG_SYS_EXTRA_ENV_RELOC Kumar Gala
@ 2010-11-29 14:47 ` Kumar Gala
  0 siblings, 0 replies; 2+ messages in thread
From: Kumar Gala @ 2010-11-29 14:47 UTC (permalink / raw)
  To: u-boot


On Nov 18, 2010, at 2:30 PM, Kumar Gala wrote:

> 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.
> 
> 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.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> * Fixed comments per becky feedback
> 
> 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(-)

Comments on this?  Should I just pull it in via 85xx tree?

- k

> 
> diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
> index 2e0749d..40d8c92 100644
> --- a/arch/powerpc/lib/board.c
> +++ b/arch/powerpc/lib/board.c
> @@ -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 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.
> +	 */
> +	gd->env_addr += dest_addr - CONFIG_SYS_MONITOR_BASE;
> +#endif
> +
> #ifdef CONFIG_SERIAL_MULTI
> 	serial_initialize();
> #endif
> diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h
> index 850665a..50d282c 100644
> --- a/include/configs/MPC8536DS.h
> +++ b/include/configs/MPC8536DS.h
> @@ -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
> diff --git a/include/configs/MPC8569MDS.h b/include/configs/MPC8569MDS.h
> index c7973b4..20fd672 100644
> --- a/include/configs/MPC8569MDS.h
> +++ b/include/configs/MPC8569MDS.h
> @@ -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
> diff --git a/include/configs/P1_P2_RDB.h b/include/configs/P1_P2_RDB.h
> index 610f3ed..8069b55 100644
> --- a/include/configs/P1_P2_RDB.h
> +++ b/include/configs/P1_P2_RDB.h
> @@ -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
> -- 
> 1.7.2.3
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-29 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18 20:30 [U-Boot] [PATCH v2] powerpc/85xx: Introduce CONFIG_SYS_EXTRA_ENV_RELOC Kumar Gala
2010-11-29 14:47 ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox