]> git.sur5r.net Git - u-boot/commitdiff
[MIPS] Introduce _machine_restart
authorShinya Kuribayashi <skuribay@ruby.dti.ne.jp>
Tue, 25 Mar 2008 12:30:07 +0000 (21:30 +0900)
committerShinya Kuribayashi <skuribay@ruby.dti.ne.jp>
Tue, 25 Mar 2008 12:30:07 +0000 (21:30 +0900)
Handles machine specific functions by using weak functions.

Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
board/incaip/incaip.c
board/purple/purple.c
board/tb0229/tb0229.c
cpu/mips/cpu.c
include/asm-mips/reboot.h [new file with mode: 0644]

index dbf0ecc5af3d1d56bfbd9b16c18a2ea27c16ce94..c624b3d82e236e5402ed3fb042ec44429108f599 100644 (file)
 #include <asm/addrspace.h>
 #include <asm/inca-ip.h>
 #include <asm/io.h>
+#include <asm/reboot.h>
 
 extern uint incaip_get_cpuclk(void);
 
+void _machine_restart(void)
+{
+       *INCA_IP_WDT_RST_REQ = 0x3f;
+}
+
 static ulong max_sdram_size(void)
 {
        /* The only supported SDRAM data width is 16bit.
index 74718afb4897d4e690a23ffda5243ed3189d0389..13a14556ba0fd449c8def1f6d1b5a18007680b58 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/io.h>
 #include <asm/addrspace.h>
 #include <asm/cacheops.h>
+#include <asm/reboot.h>
 
 #include "sconsole.h"
 
@@ -52,6 +53,13 @@ extern int   asc_serial_getc         (void);
 extern int     asc_serial_tstc         (void);
 extern void    asc_serial_setbrg       (void);
 
+void _machine_restart(void)
+{
+       void (*f)(void) = (void *) 0xbfc00000;
+
+       f();
+}
+
 static void sdram_timing_init (ulong size)
 {
        register uint pass;
index 61c2e9bd36606f00872c90bd082f12b1f223513e..d08b4224516da4b74eabd2f5061bccfad6a404a3 100644 (file)
 #include <common.h>
 #include <command.h>
 #include <asm/addrspace.h>
-#include <asm/inca-ip.h>
 #include <asm/io.h>
+#include <asm/reboot.h>
 #include <pci.h>
 
+void _machine_restart(void)
+{
+       void (*f)(void) = (void *) 0xbfc00000;
+
+       f();
+}
+
 #if defined(CONFIG_PCI)
 static struct pci_controller hose;
 
index de70c4d6142a430e9fce4d83ce0453abbcded218..8b43d8eb36281c0522e58649c852c0e28d96151a 100644 (file)
@@ -23,9 +23,9 @@
 
 #include <common.h>
 #include <command.h>
-#include <asm/inca-ip.h>
 #include <asm/mipsregs.h>
 #include <asm/cacheops.h>
+#include <asm/reboot.h>
 
 #define cache_op(op,addr)                                              \
        __asm__ __volatile__(                                           \
        :                                                               \
        : "i" (op), "R" (*(unsigned char *)(addr)))
 
+void __attribute__((weak)) _machine_restart(void)
+{
+}
+
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-#if defined(CONFIG_INCA_IP)
-       *INCA_IP_WDT_RST_REQ = 0x3f;
-#elif defined(CONFIG_PURPLE) || defined(CONFIG_TB0229)
-       void (*f)(void) = (void *) 0xbfc00000;
+       _machine_restart();
 
-       f();
-#endif
        fprintf(stderr, "*** reset failed ***\n");
        return 0;
 }
diff --git a/include/asm-mips/reboot.h b/include/asm-mips/reboot.h
new file mode 100644 (file)
index 0000000..978d206
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1997, 1999, 2001, 06 by Ralf Baechle
+ * Copyright (C) 2001 MIPS Technologies, Inc.
+ */
+#ifndef _ASM_REBOOT_H
+#define _ASM_REBOOT_H
+
+extern void _machine_restart(void);
+
+#endif /* _ASM_REBOOT_H */