mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 4/8] watchdog: imxwd: don't register broken imxwd-warm for i.MX7
Date: Mon, 17 Oct 2022 09:09:56 +0200	[thread overview]
Message-ID: <20221017071000.1458292-5-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20221017071000.1458292-1-a.fatoum@pengutronix.de>

Due to erratum e10574 "Watchdog: A watchdog timeout or software trigger
will not reset the SOC", any use of the watchdog reset must trigger an
external PMIC or reset circuit. Registering imxwd-warm thus serves no
purpose, so don't register it for i.MX7. We'll need an alternative for
reboot mode, which will follow in a later commit.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/watchdog/imxwd.c | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index dba92cb46afb..b669f6702d62 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -213,7 +213,7 @@ static void imx_watchdog_detect_reset_source(struct imx_wd *priv)
 	/* else keep the default 'unknown' state */
 }
 
-static int imx21_wd_init(struct imx_wd *priv)
+static int imx21_wd_init_no_warm_reset(struct imx_wd *priv)
 {
 	imx_watchdog_detect_reset_source(priv);
 
@@ -225,6 +225,17 @@ static int imx21_wd_init(struct imx_wd *priv)
 	return 0;
 }
 
+static int imx21_wd_init(struct imx_wd *priv)
+{
+	priv->restart_warm.name = "imxwd-warm";
+	priv->restart_warm.restart = imxwd_force_soc_reset_internal;
+	priv->restart_warm.priority = RESTART_DEFAULT_PRIORITY - 10;
+
+	restart_handler_register(&priv->restart_warm);
+
+	return imx21_wd_init_no_warm_reset(priv);
+}
+
 static int imx_wd_probe(struct device_d *dev)
 {
 	struct resource *iores;
@@ -294,12 +305,6 @@ static int imx_wd_probe(struct device_d *dev)
 
 	restart_handler_register(&priv->restart);
 
-	priv->restart_warm.name = "imxwd-warm";
-	priv->restart_warm.restart = imxwd_force_soc_reset_internal;
-	priv->restart_warm.priority = RESTART_DEFAULT_PRIORITY - 10;
-
-	restart_handler_register(&priv->restart_warm);
-
 	return 0;
 
 error_unregister:
@@ -310,6 +315,14 @@ on_error:
 	return ret;
 }
 
+static const struct imx_wd_ops imx7d_wd_ops = {
+	.set_timeout = imx21_watchdog_set_timeout,
+	.soc_reset = imx21_soc_reset,
+	.init = imx21_wd_init_no_warm_reset,
+	.is_running = imx21_watchdog_is_running,
+	.timeout_max = 128,
+};
+
 static const struct imx_wd_ops imx21_wd_ops = {
 	.set_timeout = imx21_watchdog_set_timeout,
 	.soc_reset = imx21_soc_reset,
@@ -331,6 +344,9 @@ static __maybe_unused struct of_device_id imx_wdt_dt_ids[] = {
 	}, {
 		.compatible = "fsl,imx21-wdt",
 		.data = &imx21_wd_ops,
+	}, {
+		.compatible = "fsl,imx7d-wdt",
+		.data = &imx7d_wd_ops,
 	}, {
 		/* sentinel */
 	}
-- 
2.30.2




  parent reply	other threads:[~2022-10-17  7:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17  7:09 [PATCH 0/8] ARM: i.MX7: add serial download reboot mode Ahmad Fatoum
2022-10-17  7:09 ` [PATCH 1/8] restart: make restart.h header self-contained Ahmad Fatoum
2022-10-17  7:09 ` [PATCH 2/8] restart: do restart-priority OF parsing in restart_handler_register Ahmad Fatoum
2022-10-17  7:09 ` [PATCH 3/8] restart: add reset -w for warm bootrom reset Ahmad Fatoum
2022-10-17  7:09 ` Ahmad Fatoum [this message]
2022-10-17  7:09 ` [PATCH 5/8] watchdog: imxwd: set imxwd-warm as reboot mode default handler Ahmad Fatoum
2022-10-17  7:09 ` [PATCH 6/8] Documentations: devicetree: bindings: document watchdog-priority Ahmad Fatoum
2022-10-17  7:09 ` [PATCH 7/8] ARM: i.MX7: describe USB serial download boot mode Ahmad Fatoum
2022-10-17  7:10 ` [PATCH 8/8] ARM: stm32mp: mark iwdg2 with barebox,restart-warm-bootrom Ahmad Fatoum
2022-10-18  9:13 ` [PATCH 0/8] ARM: i.MX7: add serial download reboot mode 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=20221017071000.1458292-5-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.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