summaryrefslogtreecommitdiffstats
path: root/sys/arm/freescale
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2015-11-21 23:30:47 +0000
committerian <ian@FreeBSD.org>2015-11-21 23:30:47 +0000
commitfcebee2f660cbe219b4786fc93aceea4da0ce62a (patch)
tree35635463f46e7ea605994628b6079ce87fff6ba1 /sys/arm/freescale
parentda8f89637149826dce1c50fb1a19a558cd71660a (diff)
downloadFreeBSD-src-fcebee2f660cbe219b4786fc93aceea4da0ce62a.zip
FreeBSD-src-fcebee2f660cbe219b4786fc93aceea4da0ce62a.tar.gz
Update the imx5/imx6 cpu_reset() implementation based on a new understanding
of the SRS (software reset) bit in the watchdog control register. Despite what the manual seems to imply, this bit DOES trigger an immediate reset, as opposed to simply flagging the type of reset as software-triggered.
Diffstat (limited to 'sys/arm/freescale')
-rw-r--r--sys/arm/freescale/imx/imx_machdep.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/arm/freescale/imx/imx_machdep.c b/sys/arm/freescale/imx/imx_machdep.c
index 3618637..2362607 100644
--- a/sys/arm/freescale/imx/imx_machdep.c
+++ b/sys/arm/freescale/imx/imx_machdep.c
@@ -72,16 +72,14 @@ imx_wdog_cpu_reset(vm_offset_t wdcr_physaddr)
volatile uint16_t * pcr;
/*
- * The deceptively simple write of WDOG_CR_WDE enables the watchdog,
- * sets the timeout to its minimum value (half a second), and also
- * clears the SRS bit which results in the SFTW (software-requested
- * reset) bit being set in the watchdog status register after the reset.
- * This is how software can distinguish a reset from a wdog timeout.
+ * 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.
*/
if ((pcr = arm_devmap_ptov(wdcr_physaddr, sizeof(*pcr))) == NULL) {
printf("cpu_reset() can't find its control register... locking up now.");
} else {
- *pcr = WDOG_CR_WDE;
+ *pcr &= ~WDOG_CR_SRS;
}
for (;;)
continue;
OpenPOWER on IntegriCloud