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

Shawn Guo shawn.gsc at gmail.com
Thu Dec 2 05:16:29 EST 2010


Hi Uwe,

2010/12/2 Uwe Kleine-König <u.kleine-koenig at pengutronix.de>:
> 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.)
>
Yes, it's a good way to reset mxs SoC.  But the bad thing is the
offset of the register is different between MX23 and MX28.  Also there
is no SET_ADDR for this register.

-- 
Regards,
Shawn



More information about the linux-arm-kernel mailing list