On 10/17/07, Marian Balakowicz <[EMAIL PROTECTED]> wrote: > > Add common helper routines: mpc52xx_map_wdt() and mpc52xx_restart(). > > This patch relies on Sascha Hauer's patch published in: > http://patchwork.ozlabs.org/linuxppc/patch?id=8910. > > Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]> > Signed-off-by: Sascha Hauer <[EMAIL PROTECTED]> > --- > > arch/powerpc/platforms/52xx/mpc52xx_common.c | 45 > +++++++++++++++++++++++++++ > include/asm-powerpc/mpc52xx.h | 3 + > 2 files changed, 48 insertions(+) > > diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c > b/arch/powerpc/platforms/52xx/mpc52xx_common.c > index 74b4b41..553937b 100644 > --- a/arch/powerpc/platforms/52xx/mpc52xx_common.c > +++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c > @@ -18,6 +18,13 @@ #include <asm/io.h> > #include <asm/prom.h> > #include <asm/mpc52xx.h> > > +/* > + * This variable is mapped in mpc52xx_map_wdt() and used in > mpc52xx_restart(). > + * Permanent mapping is required because mpc52xx_restart() can be called > + * from interrupt context while node mapping (which calls iorenmap()) > + * cannot be used at such point. > + */ > +static volatile struct mpc52xx_gpt *mpc52xx_wdt = NULL; > > static void __iomem * > mpc52xx_map_node(struct device_node *ofn) > @@ -126,3 +133,41 @@ mpc52xx_declare_of_platform_devices(void > "Error while probing of_platform bus\n"); > } > > +void __init > +mpc52xx_map_wdt(void) > +{ > + const void *has_wdt; > + struct device_node *np; > + > + /* mpc52xx_wdt is mapped here and used in mpc52xx_restart, > + * possibly from a interrupt context. */ > + > + for (np = NULL; > + (np = of_find_compatible_node(np, NULL, "fsl,mpc5200-gpt")) != > NULL; > + ) { > + /* wdt is only implement on gpt0, check has-wdt property. */ > + has_wdt = of_get_property(np, "fsl,has-wdt", NULL);
Test for both "has-wdt" and "fsl,has-wdt" for now. Otherwise, looks good. Cheers, g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. [EMAIL PROTECTED] (403) 399-0195 _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev