[PATCH] watchdog: i.MX: fix i.MX6 reset

Christian Hemp c.hemp at phytec.de
Mon Jun 12 00:00:35 PDT 2017


According to the Errata ERR004346 (WDOG: WDOG SRS bit requires to be written
twice), add another two writes to ensure there must be at least two
writes happen in the same one 32kHz clock period.
Without this two additional writes, the system will not reset always.

Tested with i.MX6Quad and i.MX6 UltraLite

Signed-off-by: Christian Hemp <c.hemp at phytec.de>
---
 drivers/watchdog/imxwd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index b920c72..0617fc6 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -134,6 +134,10 @@ static void imx21_soc_reset(struct imx_wd *priv)
 		val |= IMX21_WDOG_WCR_WDA; /* do not assert ext-reset */
 
 	writew(val, priv->base + IMX21_WDOG_WCR);
+
+	/* Two additional writes due to errata ERR004346 */
+	writew(val, priv->base + IMX21_WDOG_WCR);
+	writew(val, priv->base + IMX21_WDOG_WCR);
 }
 
 static int imx_watchdog_set_timeout(struct watchdog *wd, unsigned timeout)
-- 
1.9.1




More information about the barebox mailing list