Skip to contentSkip to conversation

watchdog: imx2_wdt: disable watchdog timer during low power mode

PATCH In review Anson Huang 4 participants 4 messages Jan 13, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: imx2_wdt: disable watchdog timer during low power mode

We should set watchdog timer to be disabled in low power mode, as there is no service running in background, otherwise, system will reset unexpected.

---
 drivers/watchdog/imx2_wdt.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/watchdog/imx2_wdt.c +4 -0
index b4786bc..dd51d95 100644
@@ -2,6 +2,7 @@
  * Watchdog driver for IMX2 and later processors
  *
  *  Copyright (C) 2010 Wolfram Sang, Pengutronix e.K. <[email protected]>
+ *  Copyright (C) 2014 Freescale Semiconductor, Inc.
  *
  * some parts adapted by similar drivers from Darius Augulis and Vladimir
  * Zapolskiy, additional improvements by Wim Van Sebroeck.
@@ -40,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 */
@@ -87,6 +89,8 @@ static inline void imx2_wdt_setup(void)
 {
 	u16 val = __raw_readw(imx2_wdt.base + IMX2_WDT_WCR);
 
+	/* Suspend 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 */
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Anson Huang

We should set watchdog timer to be disabled in low power mode, as there is no service running in background, otherwise, system will reset unexpected.

Quoted 37 lines
---
 drivers/watchdog/imx2_wdt.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/watchdog/imx2_wdt.c +4 -0
index b4786bc..dd51d95 100644
@@ -2,6 +2,7 @@
  * Watchdog driver for IMX2 and later processors
  *
  *  Copyright (C) 2010 Wolfram Sang, Pengutronix e.K. <[email protected]>
+ *  Copyright (C) 2014 Freescale Semiconductor, Inc.
  *
  * some parts adapted by similar drivers from Darius Augulis and Vladimir
  * Zapolskiy, additional improvements by Wim Van Sebroeck.
@@ -40,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 */
@@ -87,6 +89,8 @@ static inline void imx2_wdt_setup(void)
 {
 	u16 val = __raw_readw(imx2_wdt.base + IMX2_WDT_WCR);
 
+	/* Suspend 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 */
Signature · 1 line
1.7.9.5
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Anson Huang
Quoted 5 lines · Anson Huang

We should set watchdog timer to be disabled in low power mode, as there is no service running in background, otherwise, system will reset unexpected.

Quoted 34 lines
---
  drivers/watchdog/imx2_wdt.c |    4 ++++
  1 file changed, 4 insertions(+)
drivers/watchdog/imx2_wdt.c +4 -0
index b4786bc..dd51d95 100644
@@ -2,6 +2,7 @@
   * Watchdog driver for IMX2 and later processors
   *
   *  Copyright (C) 2010 Wolfram Sang, Pengutronix e.K. <[email protected]>
+ *  Copyright (C) 2014 Freescale Semiconductor, Inc.
   *
   * some parts adapted by similar drivers from Darius Augulis and Vladimir
   * Zapolskiy, additional improvements by Wim Van Sebroeck.
@@ -40,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 */
@@ -87,6 +89,8 @@ static inline void imx2_wdt_setup(void)
  {
  	u16 val = __raw_readw(imx2_wdt.base + IMX2_WDT_WCR);
 
+	/* Suspend 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 */