From f3443867e90d2979a7dd1c65b0d537777e1f9850 Mon Sep 17 00:00:00 2001
From: Stefan Roese <sr@denx.de>
Date: Sat, 7 Oct 2006 11:30:52 +0200
Subject: [PATCH] Add CONFIG_BOARD_RESET to configure board specific reset
 function Patch by Stefan Roese, 07 Oct 2006

---
 CHANGELOG                            |  3 +++
 board/amcc/yellowstone/yellowstone.c |  6 ++++++
 board/amcc/yosemite/yosemite.c       |  6 ++++++
 cpu/ppc4xx/cpu.c                     | 20 ++++++++------------
 include/configs/yellowstone.h        |  1 +
 include/configs/yosemite.h           |  1 +
 6 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index e5fa93bc052..4af02002ab3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@
 Changes since U-Boot 1.1.4:
 ======================================================================
 
+* Add CONFIG_BOARD_RESET to configure board specific reset function
+  Patch by Stefan Roese, 07 Oct 2006
+
 * Remove compile warnings in fpga code
   Patch by Stefan Roese, 18 Sep 2006
 
diff --git a/board/amcc/yellowstone/yellowstone.c b/board/amcc/yellowstone/yellowstone.c
index 92dc9d4c028..754ae449c13 100644
--- a/board/amcc/yellowstone/yellowstone.c
+++ b/board/amcc/yellowstone/yellowstone.c
@@ -552,3 +552,9 @@ void hw_watchdog_reset(void)
 
 }
 #endif
+
+void board_reset(void)
+{
+	/* give reset to BCSR */
+	*(unsigned char *)(CFG_BCSR_BASE | 0x06) = 0x09;
+}
diff --git a/board/amcc/yosemite/yosemite.c b/board/amcc/yosemite/yosemite.c
index 7f2e718203b..588ee900dad 100644
--- a/board/amcc/yosemite/yosemite.c
+++ b/board/amcc/yosemite/yosemite.c
@@ -548,3 +548,9 @@ void hw_watchdog_reset(void)
 
 }
 #endif
+
+void board_reset(void)
+{
+	/* give reset to BCSR */
+	*(unsigned char *)(CFG_BCSR_BASE | 0x06) = 0x09;
+}
diff --git a/cpu/ppc4xx/cpu.c b/cpu/ppc4xx/cpu.c
index 94478dbb109..4e81ce24011 100644
--- a/cpu/ppc4xx/cpu.c
+++ b/cpu/ppc4xx/cpu.c
@@ -41,6 +41,10 @@
 DECLARE_GLOBAL_DATA_PTR;
 #endif
 
+#if defined(CONFIG_BOARD_RESET)
+void board_reset(void);
+#endif
+
 #if defined(CONFIG_440)
 #define FREQ_EBC		(sys_info.freqEPB)
 #else
@@ -414,23 +418,15 @@ int ppc440spe_revB() {
 
 int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-#if defined(CONFIG_YOSEMITE) || defined(CONFIG_YELLOWSTONE)
-	/*give reset to BCSR*/
-	*(unsigned char*)(CFG_BCSR_BASE | 0x06) = 0x09;
-
+#if defined(CONFIG_BOARD_RESET)
+	board_reset();
 #else
-
 	/*
 	 * Initiate system reset in debug control register DBCR
 	 */
-	__asm__ __volatile__("lis   3, 0x3000" ::: "r3");
-#if defined(CONFIG_440)
-	__asm__ __volatile__("mtspr 0x134, 3");
-#else
-	__asm__ __volatile__("mtspr 0x3f2, 3");
-#endif
+	mtspr(dbcr0, 0x30000000);
+#endif /* defined(CONFIG_BOARD_RESET) */
 
-#endif/* defined(CONFIG_YOSEMITE) || defined(CONFIG_YELLOWSTONE)*/
 	return 1;
 }
 
diff --git a/include/configs/yellowstone.h b/include/configs/yellowstone.h
index ba27f37f6eb..58717f8a60c 100644
--- a/include/configs/yellowstone.h
+++ b/include/configs/yellowstone.h
@@ -37,6 +37,7 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F 1     /* Call board_early_init_f	*/
 #define CONFIG_MISC_INIT_R	1	/* call misc_init_r()		*/
+#define CONFIG_BOARD_RESET	1	/* call board_reset()		*/
 
 /*-----------------------------------------------------------------------
  * Base addresses -- Note these are effective addresses where the
diff --git a/include/configs/yosemite.h b/include/configs/yosemite.h
index 3d7b4a2f4bc..6e942abcaae 100644
--- a/include/configs/yosemite.h
+++ b/include/configs/yosemite.h
@@ -37,6 +37,7 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F 1     /* Call board_early_init_f	*/
 #define CONFIG_MISC_INIT_R	1	/* call misc_init_r()		*/
+#define CONFIG_BOARD_RESET	1	/* call board_reset()		*/
 
 /*-----------------------------------------------------------------------
  * Base addresses -- Note these are effective addresses where the
-- 
GitLab