]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
MIPS: qemu-malta: add reset support
authorGabor Juhos <juhosg@openwrt.org>
Wed, 22 May 2013 03:57:38 +0000 (03:57 +0000)
committerTom Rini <trini@ti.com>
Wed, 24 Jul 2013 13:51:03 +0000 (09:51 -0400)
The MIPS Malta board has a SOFTRES register. Writing a
magic value into that register initiates a board reset.

Use this feature to implement reset support.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
arch/mips/include/asm/malta.h
board/qemu-malta/qemu-malta.c

index b2151649f06c8798120392c942ff9797891337d4..f2bbf0fc255939c56015cca9c75987d8edda7c06 100644 (file)
@@ -13,4 +13,7 @@
 
 #define MALTA_UART_BASE                (MALTA_IO_PORT_BASE + 0x3f8)
 
+#define MALTA_RESET_BASE       0x1f000500
+#define GORESET                        0x42
+
 #endif /* _MIPS_ASM_MALTA_H */
index 9ba711dba3d19cc18fa0b20e284549322e6d6a6a..449da9c85919bf50e5ca15f8ebac24d457f632a9 100644 (file)
@@ -8,6 +8,9 @@
 
 #include <common.h>
 
+#include <asm/io.h>
+#include <asm/malta.h>
+
 phys_size_t initdram(int board_type)
 {
        return CONFIG_SYS_MEM_SIZE;
@@ -18,3 +21,11 @@ int checkboard(void)
        puts("Board: MIPS Malta CoreLV (Qemu)\n");
        return 0;
 }
+
+void _machine_restart(void)
+{
+       void __iomem *reset_base;
+
+       reset_base = (void __iomem *)CKSEG1ADDR(MALTA_RESET_BASE);
+       __raw_writel(GORESET, reset_base);
+}