[PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
Jason Cooper
jason at lakedaemon.net
Tue Mar 13 09:12:27 EDT 2012
On Tue, Mar 13, 2012 at 10:10:42AM +0000, Arnd Bergmann wrote:
> On Tuesday 13 March 2012, Jason Cooper wrote:
> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> > Then, switched to SPI based NOR flash.
> >
> > After talking to Arnd Bergman, chose an incremental approach to adding
> > devicetree support. First, we use the dtb to tell us we are on the
> > dreamplug, then we gradually port over drivers.
> >
> > Driver porting will start with the uart (see next patch), and progress
> > from there. Next, all drivers not needing common clock (kirkwood_tclk)
> > or pinmux. Then, remain drivers as that support hits the tree.
> >
> > We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
> > convert drivers, we can remove the platform call, eg
> > kirkwood_rtc_init(). This maintains compatibility with non-fdt
> > configurations because they still call kirkwood_init() in common.c.
> >
> > As drivers are converted, we will reinstate the 'static' qualifier in
> > common.c.
> >
> > Signed-off-by: Jason Cooper <jason at lakedaemon.net>
>
> Patches 4 and 5 both look ok, but since I merged the earlier versions
> of these into the stable next/board branch of arm-soc.git, you will have
> to generate these as incremental patches now, and adapt the changeset
> comments accordingly.
Ok.
> One small issue:
>
> > --- a/arch/arm/mach-kirkwood/Kconfig
> > +++ b/arch/arm/mach-kirkwood/Kconfig
> > @@ -44,6 +44,20 @@ config MACH_GURUPLUG
> > Say 'Y' here if you want your kernel to support the
> > Marvell GuruPlug Reference Board.
> >
> > +config ARCH_KIRKWOOD_DT
> > + bool "Marvell Kirkwood Flattened Device Tree"
> > + select USE_OF
> > + help
> > + Say 'Y' here if you want your kernel to support the
> > + Marvell Kirkwood using flattened device tree.
> > +
> > +config MACH_DREAMPLUG_DT
> > + bool "Marvell DreamPlug (Flattened Device Tree)"
> > + select ARCH_KIRKWOOD_DT
> > + help
> > + Say 'Y' here if you want your kernel to support the
> > + Marvell DreamPlug (Flattened Device Tree).
> > +
>
> You allow ARCH_KIRKWOOD_DT to be enabled without also enabling
> dreamplug. That is ok, but
>
> > +
> > + if (of_machine_is_compatible("globalscale,dreamplug"))
> > + dreamplug_init();
> > +
>
> you call a function from dreamplug.o in board-dt.o and
>
> > +/* board init functions for drivers not converted to fdt */
> > +void dreamplug_init(void);
>
> you have an unconditional forward declaration in the header.
>
> The idiomatic way to deal with this is to replace turn the
> declaration into
>
> #ifdef CONFIG_DREAMPLUG_DT
> void dreamplug_init(void);
> #else
> static inline void dreamplug_init(void) {}
> #endif
Will do, thanks.
Jason.
More information about the linux-arm-kernel
mailing list