summaryrefslogtreecommitdiff
path: root/arch/arm/cpu
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-06-09 09:36:56 (GMT)
committerIan Campbell <ijc@hellion.org.uk>2014-07-06 19:12:44 (GMT)
commitc7e79dec85f324565cee03f5be1d1a7765481573 (patch)
tree15381b8ae19d3b4ef99c25d3a9a490e50d317d8d /arch/arm/cpu
parentb6ae6765c5a9e5daa3799e4d65562d3184712506 (diff)
downloadu-boot-c7e79dec85f324565cee03f5be1d1a7765481573.tar.xz
sunxi: Implement reset_cpu
There is no way to reset the cpu, so use the watchdog for this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/armv7/sunxi/board.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index 49c9448..c80b421 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -56,6 +56,13 @@ int gpio_init(void)
void reset_cpu(ulong addr)
{
+ static const struct sunxi_wdog *wdog =
+ &((struct sunxi_timer_reg *)SUNXI_TIMER_BASE)->wdog;
+
+ /* Set the watchdog for its shortest interval (.5s) and wait */
+ writel(WDT_MODE_RESET_EN | WDT_MODE_EN, &wdog->mode);
+ writel(WDT_CTRL_KEY | WDT_CTRL_RESTART, &wdog->ctl);
+ while (1);
}
/* do some early init */