[PATCH v2 03/15] ARM: mxs: Add reset routines

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Thu Dec 2 04:40:45 EST 2010


Hello Shawn

On Mon, Nov 29, 2010 at 07:59:13PM +0800, Shawn Guo wrote:
> +/*
> + * Reset the system. It is called by machine_restart().
> + */
> +void arch_reset(char mode, const char *cmd)
> +{
> +	/* Set wdog count */
> +	__raw_writel(1, wdog_base + MXS_RTC_WATCHDOG);
> +
> +	/* Assert SRS signal */
> +	__raw_writel(MXS_WATCHDOG_EN, wdog_base + MXS_SET_ADDR);
> +
> +	/* Wait for reset to assert... */
> +	mdelay(500);
> +
> +	pr_err("Watchdog reset failed to assert reset\n");
> +
> +	/* Delay to allow the serial port to show the message */
> +	mdelay(50);
> +
> +	/* We'll take a jump through zero as a poor second */
> +	cpu_reset(0);
After reading a bit in IMX28RM, I wonder why do you bother with the
watchdog at all?  Doesn't 

	__raw_writel(MXS_CLKCTRL_RESET_CHIP, MXS_CLKCTRL_RESET + MXS_SET_ADDR);

work easier and without the need to worry about timeouts, sleeping while
clk_{get,enable} and races?
(Note I didn't check if i.MX23 has the same register at the same
address.)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



More information about the linux-arm-kernel mailing list