[U-Boot] [PATCH 10/21] blackfin: Generic system restart support

Kyle Moffett Kyle.D.Moffett at boeing.com
Mon Mar 7 18:37:31 CET 2011


The BlackFin port uses the exact same restart code on all supported
CPUs, so that do_reset() function is simply altered to use the new
prototype for __arch_restart().

Reading the code and CPU documentation does not make it entirely clear
whether or not the implementation is safe to use when the CPU may be in
a bad or undefined state, but it *appears* to be OK.

As a result no separate __arch_emergency_restart() function should be
needed.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett at boeing.com>
Cc: Mike Frysinger <vapier at gentoo.org>
---
 arch/blackfin/cpu/cpu.h         |    1 -
 arch/blackfin/cpu/reset.c       |    4 +---
 board/bf537-stamp/bf537-stamp.c |    5 ++++-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/blackfin/cpu/cpu.h b/arch/blackfin/cpu/cpu.h
index e70560f..32f6414 100644
--- a/arch/blackfin/cpu/cpu.h
+++ b/arch/blackfin/cpu/cpu.h
@@ -27,7 +27,6 @@
 
 #include <command.h>
 
-void board_reset(void) __attribute__((__weak__));
 void bfin_dump(struct pt_regs *reg);
 void bfin_panic(struct pt_regs *reg);
 void dump(struct pt_regs *regs);
diff --git a/arch/blackfin/cpu/reset.c b/arch/blackfin/cpu/reset.c
index 49d0cf8..84be51a 100644
--- a/arch/blackfin/cpu/reset.c
+++ b/arch/blackfin/cpu/reset.c
@@ -80,10 +80,8 @@ static void bfin_reset(void)
  * PC relative call with a 25 bit immediate.  This is not enough
  * to get us from the top of SDRAM into L1.
  */
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_restart(void)
 {
-	if (board_reset)
-		board_reset();
 	while (1)
 		asm("jump (%0);" : : "a" (bfin_reset));
 }
diff --git a/board/bf537-stamp/bf537-stamp.c b/board/bf537-stamp/bf537-stamp.c
index ec888d4..e1ae775 100644
--- a/board/bf537-stamp/bf537-stamp.c
+++ b/board/bf537-stamp/bf537-stamp.c
@@ -43,11 +43,14 @@ int checkboard(void)
 	return 0;
 }
 
-void board_reset(void)
+int __board_restart(void)
 {
 	/* workaround for weak pull ups on ssel */
 	if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
 		bfin_reset_boot_spi_cs(GPIO_PF10);
+
+	/* Fall through to the architecture reset handler */
+	return 0;
 }
 
 #ifdef CONFIG_BFIN_MAC
-- 
1.7.2.3



More information about the U-Boot mailing list