mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] i.MX/WD: setup the watchdog according to its datasheet
@ 2017-06-07 10:45 Juergen Borleis
  2017-06-07 11:59 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Juergen Borleis @ 2017-06-07 10:45 UTC (permalink / raw)
  To: barebox

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>
---
 drivers/watchdog/imxwd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index b920c7234..5cc178f3e 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 */
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-07 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-07 10:45 [PATCH] i.MX/WD: setup the watchdog according to its datasheet Juergen Borleis
2017-06-07 11:59 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox