diff options
author | Anson Huang <b20788@freescale.com> | 2014-01-13 06:58:34 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2014-01-28 15:25:20 -0500 |
commit | 1a9c5efa576eccadd2836a1e53dcea21f999c180 (patch) | |
tree | f4fe2e240c1be663676174dca36b2a807c5c1389 /drivers/watchdog/imx2_wdt.c | |
parent | cffc9a60ebac3b560a370553abd885fa43d8b286 (diff) |
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.
Signed-off-by: Anson Huang <b20788@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/imx2_wdt.c')
-rw-r--r-- | drivers/watchdog/imx2_wdt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index b4786bccc42c..dd51d9539b33 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * Watchdog driver for IMX2 and later processors | 2 | * Watchdog driver for IMX2 and later processors |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Wolfram Sang, Pengutronix e.K. <w.sang@pengutronix.de> | 4 | * Copyright (C) 2010 Wolfram Sang, Pengutronix e.K. <w.sang@pengutronix.de> |
5 | * Copyright (C) 2014 Freescale Semiconductor, Inc. | ||
5 | * | 6 | * |
6 | * some parts adapted by similar drivers from Darius Augulis and Vladimir | 7 | * some parts adapted by similar drivers from Darius Augulis and Vladimir |
7 | * Zapolskiy, additional improvements by Wim Van Sebroeck. | 8 | * Zapolskiy, additional improvements by Wim Van Sebroeck. |
@@ -40,6 +41,7 @@ | |||
40 | #define IMX2_WDT_WCR_WT (0xFF << 8) /* -> Watchdog Timeout Field */ | 41 | #define IMX2_WDT_WCR_WT (0xFF << 8) /* -> Watchdog Timeout Field */ |
41 | #define IMX2_WDT_WCR_WRE (1 << 3) /* -> WDOG Reset Enable */ | 42 | #define IMX2_WDT_WCR_WRE (1 << 3) /* -> WDOG Reset Enable */ |
42 | #define IMX2_WDT_WCR_WDE (1 << 2) /* -> Watchdog Enable */ | 43 | #define IMX2_WDT_WCR_WDE (1 << 2) /* -> Watchdog Enable */ |
44 | #define IMX2_WDT_WCR_WDZST (1 << 0) /* -> Watchdog timer Suspend */ | ||
43 | 45 | ||
44 | #define IMX2_WDT_WSR 0x02 /* Service Register */ | 46 | #define IMX2_WDT_WSR 0x02 /* Service Register */ |
45 | #define IMX2_WDT_SEQ1 0x5555 /* -> service sequence 1 */ | 47 | #define IMX2_WDT_SEQ1 0x5555 /* -> service sequence 1 */ |
@@ -87,6 +89,8 @@ static inline void imx2_wdt_setup(void) | |||
87 | { | 89 | { |
88 | u16 val = __raw_readw(imx2_wdt.base + IMX2_WDT_WCR); | 90 | u16 val = __raw_readw(imx2_wdt.base + IMX2_WDT_WCR); |
89 | 91 | ||
92 | /* Suspend timer in low power mode, write once-only */ | ||
93 | val |= IMX2_WDT_WCR_WDZST; | ||
90 | /* Strip the old watchdog Time-Out value */ | 94 | /* Strip the old watchdog Time-Out value */ |
91 | val &= ~IMX2_WDT_WCR_WT; | 95 | val &= ~IMX2_WDT_WCR_WT; |
92 | /* Generate reset if WDOG times out */ | 96 | /* Generate reset if WDOG times out */ |