From: Hans de Goede Date: Fri, 13 Jun 2014 20:55:52 +0000 (+0200) Subject: sunxi: Fix reset hang on sun5i X-Git-Tag: v2014.10-rc1~38^2~13^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae5de5a19df2d25ccf0e58bf59b74ebdb18612a2;p=platform%2Fkernel%2Fu-boot.git 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 Acked-by: Ian Campbell --- diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c index 701f919..8f2cef3 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 */