devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
Date: Thu, 23 Feb 2012 07:34:33 +0000	[thread overview]
Message-ID: <201202230734.33583.arnd@arndb.de> (raw)
In-Reply-To: <4F45B043.1080302-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Thursday 23 February 2012, Rob Herring wrote:
> On 02/22/2012 01:18 PM, Jason Cooper wrote:

> > diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> > index 7fc603b..6095884 100644
> > --- 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)"
> > +	depends on ARCH_KIRKWOOD_DT
> > +	help
> > +	  Say 'Y' here if you want your kernel to support the
> > +	  Marvell DreamPlug (Flattened Device Tree).
> 
> Why do you need 2 entries?

The first one is used to build the board file for all DT based machines,
the second one is used to select the dts file. I would be enough to have just
the first one, but that makes it harder to find for people looking for
dreamplug.

Maybe change the text to "Generic Marvell Kirkwood DT based (e.g. DreamPlug)"?

> > +
> > +static unsigned int dreamplug_mpp_config[] __initdata = {
> > +	MPP0_SPI_SCn,
> > +	MPP1_SPI_MOSI,
> > +	MPP2_SPI_SCK,
> > +	MPP3_SPI_MISO,
> > +	MPP47_GPIO,	/* Bluetooth LED */
> > +	MPP48_GPIO,	/* Wifi LED */
> > +	MPP49_GPIO,	/* Wifi AP LED */
> > +	0
> > +};
> 
> Do you need this to boot? All this data should come from the dtb.

Putting this into the dtb would require converting kirkwood to use the
pinctrl subsystem first, if we want to have proper bindings. When I
did the hands-on review of the code with Jason during ELC, we decided
to leave this being done the legacy way for now, which also matches
how Tegra does it until we have the pinctrl bindings.

Also note how the patch description says "Driver porting will start
with the uart (see next patch), and progress from there.  Possibly,
spi/flash/partitions will be next." I think this is the best approach
indeed and I'd probably leave the pinctrl stuff until the end.

> > +
> > +static void __init kirkwood_dt_init(void)
> > +{
> > +	kirkwood_init();
> > +
> > +	if (!of_machine_is_compatible("kirkwood,dreamplug"))
> 
> Huh? Your string doesn't match your dts file.
> 
> You've already matched against "marvell,dreamplug", so is this check
> necessary?

It's wrong, and the condition is negated. It should be

	if (of_machine_is_compatible("marvell,dreamplug"))
		dreamplug_init();

The idea is that there is one init function for all dt based
kirkwood machines, which contains special setup functions for
those boards that don't (yet) describe all the hardware in the
dt.

> > +
> > +static const char *kirkwood_dt_board_compat[] = {
> > +	"marvell,dreamplug",
> > +	NULL
> > +};

Since you mention the name, it should probably be "globalscale,dreamplug"
because the device is made by GlobalScale instead of Marvell.

	Arnd

  parent reply	other threads:[~2012-02-23  7:34 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1312906908.git.jason@lakedaemon.net>
2012-02-22 19:18 ` [PATCH 0/3 v4] arm: kirkwood: add dreamplug/devicetree support Jason Cooper
2012-02-22 19:18 ` [PATCH 1/3] arm: ignore devicetree blobs Jason Cooper
     [not found]   ` <3629df9b5b96d3a3a63a34ebf6ddfca2fd72ccfc.1329936660.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-02-22 20:38     ` Arnd Bergmann
2012-02-22 22:26     ` Uwe Kleine-König
     [not found]       ` <20120222222619.GY14173-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-23  9:16         ` Dave Martin
2012-02-23 15:56           ` Jason
2012-02-22 19:18 ` [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support Jason Cooper
     [not found]   ` <8532afcdc4adbb3771e6f742bcc33ef9c0347858.1329936660.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-02-22 20:46     ` Arnd Bergmann
     [not found]       ` <201202222046.28707.arnd-r2nGTMty4D4@public.gmane.org>
2012-02-22 21:17         ` Nicolas Pitre
2012-02-23  3:19     ` Rob Herring
     [not found]       ` <4F45B043.1080302-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-02-23  7:34         ` Arnd Bergmann [this message]
2012-02-23 16:12           ` Jason
     [not found]             ` <20120223161210.GN23524-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-02-23 18:56               ` Grant Likely
2012-02-23 19:00                 ` Jason
2012-02-22 19:18 ` [PATCH 3/3] arm: kirkwood: convert uart0 to devicetree Jason Cooper
     [not found]   ` <0ad28cac6d608253b01e1d57bb479a29754ae823.1329936660.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-02-22 20:55     ` Arnd Bergmann
2012-02-22 21:09       ` Jason
2012-02-23 19:52 ` [PATCH 0/2 v5] arm: kirkwood: add dreamplug/devicetree support Jason Cooper
2012-02-26 11:00   ` Ian Campbell
     [not found]     ` <1330254038.10008.24.camel-ztPmHsLffjjnO4AKDKe2m+kiAK3p4hvP@public.gmane.org>
2012-02-27 14:57       ` Jason
2012-02-28  7:20         ` Ian Campbell
2012-02-23 19:52 ` [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-02-23 20:18   ` Grant Likely
     [not found]     ` <CACxGe6vjzXUwvGu73p+5L2-cW5EOJtFcR8JW8-gOUrRt-choJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-23 21:11       ` Jason
     [not found]         ` <20120223211138.GP23524-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-02-23 21:21           ` Grant Likely
2012-02-24 14:35             ` Jason
     [not found]             ` <CACxGe6uMcOWC6ukTGF1soyfeTkT2fkmewhKUKA-AiK8hQDzCGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-24 19:36               ` Jason
2012-02-23 19:52 ` [PATCH 2/2 v2] arm: kirkwood: convert uart0 to devicetree Jason Cooper
     [not found] ` <cover.1312906908.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-02-27 16:07   ` [PATCH 0/2 v6] arm: kirkwood: add dreamplug/devicetree support Jason Cooper
     [not found]   ` <cover.1330358323.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-02-27 16:07     ` [PATCH 2/2 v2] arm: kirkwood: convert uart0 to devicetree Jason Cooper
2012-02-27 16:29     ` [PATCH 0/2 v6] arm: kirkwood: add dreamplug/devicetree support Arnd Bergmann
2012-02-27 17:31       ` Jason
2012-02-27 16:07 ` [PATCH 1/2 v6] arm: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-02-24  7:57 [PATCH 2/3 v4] " Andrew Lunn
     [not found] ` <20120224075753.GA24858-g2DYL2Zd6BY@public.gmane.org>
2012-02-24 15:55   ` Jason
2012-02-24 19:36   ` Jason
2012-02-29 14:44   ` Jason
     [not found]     ` <20120229144450.GB23524-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-02-29 23:53       ` Andrew Lunn
     [not found]         ` <20120229235326.GA3207-g2DYL2Zd6BY@public.gmane.org>
2012-03-01 12:20           ` Jason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201202230734.33583.arnd@arndb.de \
    --to=arnd-r2ngtmty4d4@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).