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

Shawn Guo shawn.gsc at gmail.com
Thu Dec 9 03:51:08 EST 2010


2010/12/9 Uwe Kleine-König <u.kleine-koenig at pengutronix.de>:
> Hi Lothar,
>
> On Wed, Dec 08, 2010 at 08:33:32AM +0100, Lothar Waßmann wrote:
>> Hi,
>>
>> Shawn Guo writes:
>> >  - The mxs wdog is implemented in RTC block.
>> >  - There is a generic software reset routine for most modules on mxs.
>> >
>> > Signed-off-by: Shawn Guo <shawn.guo at freescale.com>
>> > ---
>> > Changes for v3:
>> >  - Change wdog timeout to 10ms for safety
>> >  - Simplify function mxs_reset_block() to get it look better
>> >
>> > Changes for v2:
>> >  - Move rtc clock enabling from arch_reset() into mxs_arch_reset_init()
>> >
>> mxs_arch_reset_init() is currently being called from the .map_io hook
>> in mach-mxs/mm-mx23.c and mm-mx28.c which is called before clocks are
>> registered.
>> But IMO this should be removed from the .map_io hook anyway (as well
>> as mxs_iomux_init()).
> I assume you want to make this an initcall?
>
Here is how they look.

static int __init mxs_arch_reset_init(void)
{
        struct clk *clk;

        wdog_base = cpu_is_mx23() ? MX23_IO_ADDRESS(MX23_RTC_BASE_ADDR) :
                                    MX28_IO_ADDRESS(MX28_RTC_BASE_ADDR);

        clk = clk_get_sys("rtc", NULL);
        if (!IS_ERR(clk))
                clk_enable(clk);
        else

        return 0;
}
core_initcall(mxs_arch_reset_init);

static int __init mxs_iomux_init(void)
{
        iomux_base = MXS_IO_ADDRESS(MXS_PINCTRL_BASE_ADDR);

        return 0;
}
core_initcall(mxs_iomux_init);

-- 
Regards,
Shawn



More information about the linux-arm-kernel mailing list