All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [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@gmail.com>

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

WARNING: multiple messages have this Message-ID (diff)
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

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

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-09 16:47 [PATCH 0/3 v2] RFC: marvell dreamplug dft support Jason Cooper
2011-08-09 16:47 ` [PATCH 1/3 v2] RFC: arm/kirkwood: TEMP hack till mach-types is updated Jason Cooper
2012-02-23  1:46   ` Grant Likely
2012-02-23  1:48   ` Grant Likely
2011-08-09 16:47 ` [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support Jason Cooper
2011-08-09 17:25   ` Arnaud Patard (Rtp)
2011-08-09 18:10     ` Jason
2011-08-10 14:31   ` Arnd Bergmann
2011-08-09 16:47 ` [PATCH 3/3 v2] RFC: arm: kirkwood: dreamplug fdt support Jason Cooper
2011-12-07 19:40 ` [PATCH V3] arm: kirkwood: add dreamplug support Jason Cooper
2012-02-22 19:18 ` [PATCH 0/3 v4] arm: kirkwood: add dreamplug/devicetree support Jason Cooper
2012-02-22 19:18   ` Jason Cooper
2012-02-22 19:18   ` [PATCH 1/3] arm: ignore devicetree blobs Jason Cooper
2012-02-22 19:18     ` Jason Cooper
2012-02-22 20:38     ` Arnd Bergmann
2012-02-22 20:38       ` Arnd Bergmann
2012-02-22 22:26     ` Uwe Kleine-König
2012-02-22 22:26       ` Uwe Kleine-König
2012-02-23  9:16       ` Dave Martin
2012-02-23  9:16         ` Dave Martin
2012-02-23 15:56         ` Jason
2012-02-23 15:56           ` Jason
2012-02-22 19:18   ` [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-02-22 19:18     ` Jason Cooper
2012-02-22 20:46     ` Arnd Bergmann
2012-02-22 20:46       ` Arnd Bergmann
2012-02-22 21:17       ` Nicolas Pitre
2012-02-22 21:17         ` Nicolas Pitre
2012-02-23  3:19     ` Rob Herring
2012-02-23  3:19       ` Rob Herring
2012-02-23  7:34       ` Arnd Bergmann [this message]
2012-02-23  7:34         ` Arnd Bergmann
2012-02-23 16:12         ` Jason
2012-02-23 16:12           ` Jason
2012-02-23 18:56           ` Grant Likely
2012-02-23 18:56             ` Grant Likely
2012-02-23 19:00             ` Jason
2012-02-23 19:00               ` Jason
2012-02-22 19:18   ` [PATCH 3/3] arm: kirkwood: convert uart0 to devicetree Jason Cooper
2012-02-22 19:18     ` Jason Cooper
2012-02-22 20:55     ` Arnd Bergmann
2012-02-22 20:55       ` Arnd Bergmann
2012-02-22 21:09       ` Jason
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-23 19:52   ` Jason Cooper
2012-02-23 19:52   ` [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-02-23 19:52     ` Jason Cooper
2012-02-23 20:18     ` Grant Likely
2012-02-23 20:18       ` Grant Likely
2012-02-23 21:11       ` Jason
2012-02-23 21:11         ` Jason
2012-02-23 21:21         ` Grant Likely
2012-02-23 21:21           ` Grant Likely
2012-02-24 14:35           ` Jason
2012-02-24 14:35             ` Jason
2012-02-24 19:36           ` Jason
2012-02-24 19:36             ` Jason
2012-02-23 19:52   ` [PATCH 2/2 v2] arm: kirkwood: convert uart0 to devicetree Jason Cooper
2012-02-23 19:52     ` Jason Cooper
2012-02-26 11:00   ` [PATCH 0/2 v5] arm: kirkwood: add dreamplug/devicetree support Ian Campbell
2012-02-26 11:00     ` Ian Campbell
2012-02-27 14:57     ` Jason
2012-02-27 14:57       ` Jason
2012-02-28  7:20       ` Ian Campbell
2012-02-28  7:20         ` Ian Campbell
2012-02-27 16:07 ` [PATCH 0/2 v6] " Jason Cooper
2012-02-27 16:07   ` Jason Cooper
2012-02-27 16:07   ` [PATCH 1/2 v6] arm: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-02-27 16:07     ` Jason Cooper
2012-02-27 16:07   ` [PATCH 2/2 v2] arm: kirkwood: convert uart0 to devicetree Jason Cooper
2012-02-27 16:07     ` Jason Cooper
2012-02-27 16:29   ` [PATCH 0/2 v6] arm: kirkwood: add dreamplug/devicetree support Arnd Bergmann
2012-02-27 16:29     ` Arnd Bergmann
2012-02-27 17:31     ` Jason
2012-02-27 17:31       ` Jason
  -- strict thread matches above, loose matches on Subject: below --
2012-02-24  7:57 [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support Andrew Lunn
2012-02-24 15:55 ` Jason
2012-02-24 15:55   ` Jason
2012-02-24 19:36 ` Jason
2012-02-24 19:36   ` Jason
2012-02-29 14:44 ` Jason
2012-02-29 14:44   ` Jason
2012-02-29 23:53   ` Andrew Lunn
2012-02-29 23:53     ` Andrew Lunn
2012-03-01 12:20     ` Jason
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@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.