mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Christian Hemp <c.hemp@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH] watchdog: i.MX: fix i.MX6 reset
Date: Mon, 12 Jun 2017 09:00:35 +0200	[thread overview]
Message-ID: <1497250835-34583-1-git-send-email-c.hemp@phytec.de> (raw)

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@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


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

             reply	other threads:[~2017-06-12  7:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12  7:00 Christian Hemp [this message]
2017-06-13  7:26 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497250835-34583-1-git-send-email-c.hemp@phytec.de \
    --to=c.hemp@phytec.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox