svn commit: r314540 - stable/11/sys/arm/freescale/imx

Ian Lepore ian at FreeBSD.org
Thu Mar 2 04:55:56 UTC 2017


Author: ian
Date: Thu Mar  2 04:55:54 2017
New Revision: 314540
URL: https://svnweb.freebsd.org/changeset/base/314540

Log:
  MFC r312679:
  
    Handle imx6 erratum ERR004346... to reboot, clear the SRS bit twice within
    the same cycle of the 32khz clock.
  
    I've never actually noticed this error happening, but it's an easy fix.

Modified:
  stable/11/sys/arm/freescale/imx/imx_machdep.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/freescale/imx/imx_machdep.c
==============================================================================
--- stable/11/sys/arm/freescale/imx/imx_machdep.c	Thu Mar  2 04:42:33 2017	(r314539)
+++ stable/11/sys/arm/freescale/imx/imx_machdep.c	Thu Mar  2 04:55:54 2017	(r314540)
@@ -69,11 +69,18 @@ imx_wdog_cpu_reset(vm_offset_t wdcr_phys
 	 * Trigger an immediate reset by clearing the SRS bit in the watchdog
 	 * control register.  The reset happens on the next cycle of the wdog
 	 * 32KHz clock, so hang out in a spin loop until the reset takes effect.
+	 *
+	 * Imx6 erratum ERR004346 says the SRS bit has to be cleared twice
+	 * within the same cycle of the 32khz clock to reliably trigger the
+	 * reset.  Writing it 3 times in a row ensures at least 2 of the writes
+	 * happen in the same 32k clock cycle.
 	 */
 	if ((pcr = devmap_ptov(wdcr_physaddr, sizeof(*pcr))) == NULL) {
 		printf("cpu_reset() can't find its control register... locking up now.");
 	} else {
 		*pcr &= ~WDOG_CR_SRS;
+		*pcr &= ~WDOG_CR_SRS;
+		*pcr &= ~WDOG_CR_SRS;
 	}
 	for (;;)
 		continue;


More information about the svn-src-all mailing list