]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
MX31: Disable watchdog during low-power modes
authorFabio Estevam <fabio.estevam@freescale.com>
Wed, 21 Sep 2011 03:29:17 +0000 (03:29 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Fri, 30 Sep 2011 20:01:00 +0000 (22:01 +0200)
Turn on the watchdog WDZST bit so that watchdog timer does not count during low power modes.

Prior to applying this patch mx31pdk board got watchdog resets because when it booted in the Linux prompt
and there was no activity, the system entered into idle mode while watchdog timer was still active.

Fix this by disabling watchdog timer during idle mode.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
arch/arm/cpu/arm1136/mx31/timer.c
arch/arm/include/asm/arch-mx31/imx-regs.h

index c05a39d084ad47f5803b2494ebbbb85fe56d324e..717a2b72bd9c88783b9a6865011c1b5556c272dd 100644 (file)
@@ -173,8 +173,8 @@ void mxc_hw_watchdog_enable(void)
 #else
        secs = 64;
 #endif
-       writew(readw(&wdog->wcr) | (secs << WDOG_WT_SHIFT) | WDOG_ENABLE,
-               &wdog->wcr);
+       setbits_le16(&wdog->wcr, (secs << WDOG_WT_SHIFT) | WDOG_ENABLE
+                                                        | WDOG_WDZST);
 }
 
 
index 2064870f44103e0c8c645d5d94483036746e3ca5..0dcd9fe7eb62f3b0bedcf837a4fc73ce671e5363 100644 (file)
@@ -71,6 +71,8 @@ struct cspi_regs {
 /* Watchdog Timer (WDOG) registers */
 #define WDOG_ENABLE    (1 << 2)
 #define WDOG_WT_SHIFT  8
+#define WDOG_WDZST     (1 << 0)
+
 struct wdog_regs {
        u16 wcr;        /* Control */
        u16 wsr;        /* Service */