mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] watchdog: imxwd: don't claim a warm reset with fsl,ext-reset-output
@ 2026-11-27  8:11 Johannes Schneider
  2026-11-27  9:12 ` Ahmad Fatoum
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schneider @ 2026-11-27  8:11 UTC (permalink / raw)
  To: barebox, Sascha Hauer; +Cc: Johannes Schneider, Ahmad Fatoum

With fsl,ext-reset-output, imxwd resets the SoC by asserting WDOG_B
instead of the internal reset. The external reset circuit, usually the
PMIC, then takes the SoC through a power-on reset, which clears the SRC
general purpose registers the BootROM evaluates on a warm reset. A
reboot mode set beforehand, such as serial download, is lost, yet
imxwd is listed as warm restart capable and picked by reset -w.

Register imxwd as warm restart capable only when it uses the internal
reset.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
---
 drivers/watchdog/imxwd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index e74638f941..6e537e6c7a 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -225,7 +225,8 @@ static int imx21_wd_init_no_warm_reset(struct imx_wd *priv)
 
 static int imx21_wd_init(struct imx_wd *priv)
 {
-	priv->restart.flags = RESTART_WARM;
+	if (!priv->ext_reset)
+		priv->restart.flags = RESTART_WARM;
 	return imx21_wd_init_no_warm_reset(priv);
 }
 
-- 
2.43.0




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

* Re: [PATCH] watchdog: imxwd: don't claim a warm reset with fsl,ext-reset-output
  2026-11-27  8:11 [PATCH] watchdog: imxwd: don't claim a warm reset with fsl,ext-reset-output Johannes Schneider
@ 2026-11-27  9:12 ` Ahmad Fatoum
  2026-11-27  9:23   ` Johannes Schneider
  0 siblings, 1 reply; 3+ messages in thread
From: Ahmad Fatoum @ 2026-11-27  9:12 UTC (permalink / raw)
  To: Johannes Schneider, barebox, Sascha Hauer

Hello Johannes,

On 11/27/26 09:11, Johannes Schneider wrote:
> With fsl,ext-reset-output, imxwd resets the SoC by asserting WDOG_B
> instead of the internal reset. The external reset circuit, usually the
> PMIC, then takes the SoC through a power-on reset, which clears the SRC
> general purpose registers the BootROM evaluates on a warm reset. A
> reboot mode set beforehand, such as serial download, is lost, yet
> imxwd is listed as warm restart capable and picked by reset -w.
> 
> Register imxwd as warm restart capable only when it uses the internal
> reset.

imxwd_force_soc_reset() has

if (flags & RESTART_WARM)       
        priv->ext_reset = false;

and imx21_soc_reset() then has:

/* Use internal reset or external - not both */
if (priv->ext_reset)
        val |= IMX21_WDOG_WCR_SRS; /* do not assert int reset */
else
        val |= IMX21_WDOG_WCR_WDA; /* do not assert ext-reset */


so a reset -w should not be toggling WDOG_B. Did you observe the
toggling or infer it?

Cheers,
Ahmad
 

> 
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
> ---
>  drivers/watchdog/imxwd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
> index e74638f941..6e537e6c7a 100644
> --- a/drivers/watchdog/imxwd.c
> +++ b/drivers/watchdog/imxwd.c
> @@ -225,7 +225,8 @@ static int imx21_wd_init_no_warm_reset(struct imx_wd *priv)
>  
>  static int imx21_wd_init(struct imx_wd *priv)
>  {
> -	priv->restart.flags = RESTART_WARM;
> +	if (!priv->ext_reset)
> +		priv->restart.flags = RESTART_WARM;
>  	return imx21_wd_init_no_warm_reset(priv);
>  }
>  


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

* Re: [PATCH] watchdog: imxwd: don't claim a warm reset with fsl,ext-reset-output
  2026-11-27  9:12 ` Ahmad Fatoum
@ 2026-11-27  9:23   ` Johannes Schneider
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Schneider @ 2026-11-27  9:23 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Hello Ahmad,

On 11/27/26 10:12, Ahmad Fatoum wrote:
> so a reset -w should not be toggling WDOG_B. Did you observe the
> toggling or infer it?

Inferred, and wrongly: I missed that imxwd_force_soc_reset() drops
ext_reset for a warm restart. Please disregard this patch.

Thanks,
Johannes



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

end of thread, other threads:[~2026-11-27  9:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-27  8:11 [PATCH] watchdog: imxwd: don't claim a warm reset with fsl,ext-reset-output Johannes Schneider
2026-11-27  9:12 ` Ahmad Fatoum
2026-11-27  9:23   ` Johannes Schneider

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