[PATCH 2/2] wdog: imx-wd: Disable watchdog powerdown counter

Markus Pargmann mpa at pengutronix.de
Thu Apr 2 08:36:51 PDT 2015


Disable the watchdog powerdown counter at start. Otherwise this may
trigger a reset or poweroff over the WDOG_B line to a PMIC. This counter
is set to 16 seconds after poweron.

Signed-off-by: Markus Pargmann <mpa at pengutronix.de>
---
 drivers/watchdog/imxwd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index 42edfe00d2bc..3479d7b02da7 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -46,6 +46,7 @@ struct imx_wd {
 #define IMX21_WDOG_WCR	0x00 /* Watchdog Control Register */
 #define IMX21_WDOG_WSR	0x02 /* Watchdog Service Register */
 #define IMX21_WDOG_WSTR	0x04 /* Watchdog Status Register  */
+#define IMX21_WDOG_WMCR	0x08 /* Misc Register */
 #define IMX21_WDOG_WCR_WDE	(1 << 2)
 #define IMX21_WDOG_WCR_SRS	(1 << 4)
 #define IMX21_WDOG_WCR_WDA	(1 << 5)
@@ -158,6 +159,11 @@ static int imx21_wd_init(struct imx_wd *priv)
 {
 	imx_watchdog_detect_reset_source(priv);
 
+	/*
+	 * Disable watchdog powerdown counter
+	 */
+	writew(0x0, priv->base + IMX21_WDOG_WMCR);
+
 	return 0;
 }
 
-- 
2.1.4




More information about the barebox mailing list