summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJuergen Borleis <jbe@pengutronix.de>2017-06-07 12:45:42 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-06-07 13:59:05 +0200
commit8b1b75441d415de7c73b6f68dd2e29b7e0ead9fb (patch)
tree4552e67fa6ca60273d1919809f483c0365bc1e47 /drivers
parent5f7e0d15333e016100a37b7d38c50d5d4a3b3c85 (diff)
downloadbarebox-8b1b75441d415de7c73b6f68dd2e29b7e0ead9fb.tar.gz
barebox-8b1b75441d415de7c73b6f68dd2e29b7e0ead9fb.tar.xz
i.MX/WD: setup the watchdog according to its datasheet
From earlier SoCs like the i.MX21 up to i.MX7 their datasheets states after reset the watchdog timer has to be set first prior enabling the watchdog itself. This change do it this way. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/watchdog/imxwd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index b920c7234b..5cc178f3e8 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -114,6 +114,12 @@ static int imx21_watchdog_set_timeout(struct imx_wd *priv, unsigned timeout)
if (priv->ext_reset)
val |= IMX21_WDOG_WCR_WDT;
+ /*
+ * set time and some write once bits first prior enabling the
+ * watchdog according to the datasheet
+ */
+ writew(val, priv->base + IMX21_WDOG_WCR);
+
writew(IMX21_WDOG_WCR_WDE | val, priv->base + IMX21_WDOG_WCR);
/* Write Service Sequence */