FreeBSD/sys/arm/freescale/imx/imx_machdep.c
/*
 * This code which manipulates the watchdog hardware is here to implement
 * cpu_reset() because the watchdog is the only way for software to reset the
 * chip.  Why here and not in imx_wdog.c?  Because there's no requirement that
 * the watchdog driver be compiled in, but it's nice to be able to reboot even
 * if it's not.
 */
This code which manipulates the watchdog hardware is here to implement
cpu_reset() because the watchdog is the only way for software to reset the
chip.  Why here and not in imx_wdog.c.  Because there's no requirement that
the watchdog driver be compiled in, but it's nice to be able to reboot even
if it's not.
This code which manipulates the watchdog hardware is here to implement cpu_reset () because the watchdog is the only way for software to reset the chip . Why here and not in imx_wdog . c . Because there ' s no requirement that the watchdog driver be compiled in but it ' s nice to be able to reboot even if it ' s not .
void
imx_wdog_cpu_reset(vm_offset_t wdcr_physaddr)
{
	volatile uint16_t * pcr;
	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;
	}
	for (;;)
		continue;
}
void imx_wdog_cpu_reset ( vm_offset_t wdcr_physaddr ) { volatile uint16_t * pcr ; if ( ( pcr = devmap_ptov ( wdcr_physaddr , sizeof ( * pcr ) ) ) == NULL ) { printf ( " " ) ; } else { * pcr &= ~ WDOG_CR_SRS ; } for ( ; ; ) continue ; }
This code which manipulates the watchdog hardware is here to implement
 cpu_reset() because the watchdog is the only way for software to reset the
 chip.
This code which manipulates the watchdog hardware is here to implement cpu_reset () because the watchdog is the only way for software to reset the chip .
/*
	 * 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.
	 */