watchdog: i.MX: fix i.MX6 reset
Subsystems (2)
PATCH 1/1 watchdog: i.MX: fix i.MX6 reset
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 <[email protected]>
--- drivers/watchdog/imxwd.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/watchdog/imxwd.c +4 -0
@@ -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)
Signature · 7 lines
1.9.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 8 lines · Christian Hemp
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 <[email protected]>
Applied, thanks
Sascha
Quoted 28 lines
--- drivers/watchdog/imxwd.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/watchdog/imxwd.c +4
-0@@ -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)Signature · 7 lines
1.9.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox