]> git.sur5r.net Git - u-boot/commitdiff
sunxi: Fix reset hang on sun5i
authorHans de Goede <hdegoede@redhat.com>
Fri, 13 Jun 2014 20:55:52 +0000 (22:55 +0200)
committerIan Campbell <ijc@hellion.org.uk>
Fri, 18 Jul 2014 18:42:22 +0000 (19:42 +0100)
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>
arch/arm/cpu/armv7/sunxi/board.c

index 701f9195e211dcbbd78643c6972e6757e166a6b1..8f2cef332f4f90d1329957216d0f3f9e20a4c43e 100644 (file)
@@ -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 */