summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-06-13 22:55:52 +0200
committerIan Campbell <ijc@hellion.org.uk>2014-07-18 19:42:22 +0100
commitae5de5a19df2d25ccf0e58bf59b74ebdb18612a2 (patch)
treeeb28321985fe2b9ed144f2ba58e02f98b4589afc
parent24289208354c143967968755cff5c825a12e3f90 (diff)
sunxi: Fix reset hang on sun5i
Do the same as the Linux kernel does, this fixes the SoC hanging on reset about 50% of the time. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
-rw-r--r--arch/arm/cpu/armv7/sunxi/board.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index 701f9195e2..8f2cef332f 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -77,7 +77,11 @@ void reset_cpu(ulong addr)
/* 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);
+
+ while (1) {
+ /* sun5i sometimes gets stuck without this */
+ writel(WDT_MODE_RESET_EN | WDT_MODE_EN, &wdog->mode);
+ }
}
/* do some early init */