]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00162115 [WDOG]Should suspend timer in LPM
authorAnson Huang <b20788@freescale.com>
Mon, 14 Nov 2011 12:31:30 +0000 (20:31 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:33:27 +0000 (08:33 +0200)
We should set the WDOG timer to suspend in low
power mode, or when system suspend, wdog will continue
to run, and reset the system. This WCR_WDZST is a write
once-only register.

Signed-off-by: Anson Huang <b20788@freescale.com>
drivers/watchdog/imx2_wdt.c

index 86f7cac1026c9c0de69ef0180398e71ecfcbe660..ad2a40fefc6cb491807e39845bfdcec344c97b0f 100644 (file)
@@ -41,6 +41,7 @@
 #define IMX2_WDT_WCR_WT                (0xFF << 8)     /* -> Watchdog Timeout Field */
 #define IMX2_WDT_WCR_WRE       (1 << 3)        /* -> WDOG Reset Enable */
 #define IMX2_WDT_WCR_WDE       (1 << 2)        /* -> Watchdog Enable */
+#define IMX2_WDT_WCR_WDZST     (1 << 0)        /* -> Watchdog timer Suspend */
 
 #define IMX2_WDT_WSR           0x02            /* Service Register */
 #define IMX2_WDT_SEQ1          0x5555          /* -> service sequence 1 */
@@ -85,6 +86,8 @@ static inline void imx2_wdt_setup(void)
 {
        u16 val = __raw_readw(imx2_wdt.base + IMX2_WDT_WCR);
 
+       /* Suspend watch dog timer in low power mode, write once-only */
+       val |= IMX2_WDT_WCR_WDZST;
        /* Strip the old watchdog Time-Out value */
        val &= ~IMX2_WDT_WCR_WT;
        /* Generate reset if WDOG times out */