reset / watchdog on an imx7d soc

Lucas Stach l.stach at pengutronix.de
Thu Jul 2 12:05:48 EDT 2020


Hi Giorgio,

Am Donnerstag, den 02.07.2020, 17:28 +0200 schrieb Giorgio Dal Molin:
[...]
> barebox does something similar to trigger the wdog but afterwards also calls
> mdelay() and a printf() before falling in the endless loop:
> 
> static void imx21_soc_reset(struct imx_wd *priv)
> {
> ...
> 	imxwd_write(priv, IMX21_WDOG_WCR, val);
> 
> 	/* Two additional writes due to errata ERR004346 */
> 	imxwd_write(priv, IMX21_WDOG_WCR, val);
> 	imxwd_write(priv, IMX21_WDOG_WCR, val);
> 

I'm not sure if the i.MX7 needs the same double write. Just in case,
can you add a dummy read to the IMX21_WDOG_WCR register after the
writes to make sure the writes actually get flushed to the device
before the delay?

Regards,
Lucas

> ...
> 
> 	mdelay(1000);
> 
> 	hang(); // <== this also calls printf() before for(;;);
> 
> 
> What I've found is that if I put the endless loop right at the end of
> imx21_soc_reset(), after the imxwd_write's, then the reboot process becomes
> reliable.
> 
> (The changes in the DCD with the addition of the write:
> 
> wm 32 0x30391000 0x00000003
> 
> at the beginning, before the write:
> 
> wm 32 0x30391000 0x00000002
> 
> are also essential, only the delay between the two seems to be not a big deal).
> 
> giorgio
> 
> > > giorgio
> > > 
> > > > _______________________________________________
> > > > barebox mailing list
> > > > barebox at lists.infradead.org
> > > > http://lists.infradead.org/mailman/listinfo/barebox
> > 
> > -- 
> > 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 |
> > 
> > _______________________________________________
> > barebox mailing list
> > barebox at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox




More information about the barebox mailing list