[U-Boot] [PATCH] ppc: Unlock cache-as-ram in a consistent manner

Peter Tyser ptyser at xes-inc.com
Sat Jul 11 01:46:10 CEST 2009


Previously, non-e500 architectures only unlocked their data cache which
was used as early RAM when booting to Linux using the "bootm" command.
This change causes all PPC boards with CONFIG_SYS_INIT_RAM_LOCK defined
to unlock their data cache during U-Boot's initialization.  This
improves U-Boot performance and provides a common cache state when
booting to different OSes.

Signed-off-by: Peter Tyser <ptyser at xes-inc.com>
---
I've tested this on 86xx boards, it'd be great if someone could test on
83xx and 74xx/7xx.  85xx boards should not be affected by this change.

This change assumes http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/63423
has already been applied, or the lib/ppc patches in the diffs below can
be changed to lib_ppc.

Peter

 lib/ppc/board.c |    6 +++---
 lib/ppc/bootm.c |    9 ---------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/lib/ppc/board.c b/lib/ppc/board.c
index 155171d..1495b3f 100644
--- a/lib/ppc/board.c
+++ b/lib/ppc/board.c
@@ -68,7 +68,7 @@
 #if defined(CONFIG_LOGBUFFER)
 #include <logbuff.h>
 #endif
-#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
+#if defined(CONFIG_SYS_INIT_RAM_LOCK)
 #include <asm/cache.h>
 #endif
 #ifdef CONFIG_PS2KBD
@@ -754,8 +754,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
 	icache_enable ();	/* it's time to enable the instruction cache */
 #endif
 
-#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
-	unlock_ram_in_cache();	/* it's time to unlock D-cache in e500 */
+#if defined(CONFIG_SYS_INIT_RAM_LOCK)
+	unlock_ram_in_cache();	/* it's time to unlock D-cache */
 #endif
 
 #if defined(CONFIG_BAB7xx) || defined(CONFIG_CPC45)
diff --git a/lib/ppc/bootm.c b/lib/ppc/bootm.c
index 0d702bf..e7d2c98 100644
--- a/lib/ppc/bootm.c
+++ b/lib/ppc/bootm.c
@@ -38,11 +38,6 @@
 #include <fdt.h>
 #include <libfdt.h>
 #include <fdt_support.h>
-
-#endif
-
-#ifdef CONFIG_SYS_INIT_RAM_LOCK
-#include <asm/cache.h>
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -71,10 +66,6 @@ static void boot_jump_linux(bootm_headers_t *images)
 
 	show_boot_progress (15);
 
-#if defined(CONFIG_SYS_INIT_RAM_LOCK) && !defined(CONFIG_E500)
-	unlock_ram_in_cache();
-#endif
-
 #if defined(CONFIG_OF_LIBFDT)
 	if (of_flat_tree) {	/* device tree; boot new style */
 		/*
-- 
1.6.2.1



More information about the U-Boot mailing list