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] ARM: SPEAr600: Add device-tree support to SPEAr600 boards
Date: Tue, 13 Mar 2012 16:44:11 +0000	[thread overview]
Message-ID: <201203131644.12048.arnd@arndb.de> (raw)
In-Reply-To: <1331650032-15274-1-git-send-email-sr@denx.de>

On Tuesday 13 March 2012, Stefan Roese wrote:
> This patch adds a generic target for SPEAr600 board that can be
> configured via the device-tree. Currently only interrupts are
> configured via device-tree. Other peripheral devices (e.g.
> ethernet, I2C, SMI flash, FSMC NAND flash etc) will follow in
> later patches.
> 
> Only the spear600-evb is currently supported. Other SPEAr600
> based boards will follow later.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Viresh Kumar <viresh.kumar@st.com>

Hi Stefan,

This is very cool, welcome onboard for the DT conversion with spear600!

> +static struct amba_device *amba_devs[] __initdata = {
> +	&gpio_device[0],
> +	&gpio_device[1],
> +	&gpio_device[2],
> +	&uart_device[0],
> +	&uart_device[1],
> +};

I would suggest you convert these to DT next so you can remove the
amba_devs list. Which devices are these? If they are pl061 and
pl010/pl011, the binding should be really easy to do.

> +static struct platform_device *plat_devs[] __initdata = {
> +};

This could be dropped right away, because you would never
add anything here.

> +static void __init spear600_dt_init(void)
> +{
> +	unsigned int i;
> +
> +	/* call spear600 machine init function */
> +	spear600_init();

spear600_init currently is an empty function, I think you can
drop that one too.

> +	/* Add Platform Devices */
> +	platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
> +
> +	/* Add Amba Devices */
> +	for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
> +		amba_device_register(amba_devs[i], &iomem_resource);

So although all of this can go away soon, you will have to
add a call to of_platform_populate() here in order to add the
devices from the device tree.

> +}
> +
> +static const char *spear600_dt_board_compat[] = {
> +	"st,spear600-evb",
> +	NULL
> +};
> +
> +static const struct of_device_id vic_of_match[] __initconst = {
> +	{ .compatible = "arm,pl190-vic", .data = vic_of_init, },
> +	{ /* Sentinel */ }
> +};
> +
> +static void __init spear6xx_dt_init_irq(void)
> +{
> +	of_irq_init(vic_of_match);
> +}
> +
> +DT_MACHINE_START(SPEAR600_DT, "ST-SPEAR600-DT")
> +	.map_io		=	spear6xx_map_io,
> +	.init_irq	=	spear6xx_dt_init_irq,
> +	.handle_irq	=	vic_handle_irq,
> +	.timer		=	&spear6xx_timer,
> +	.init_machine	=	spear600_dt_init,
> +	.restart	=	spear_restart,
> +	.dt_compat	=	spear600_dt_board_compat,
> +MACHINE_END

Since there is only one upstream board file and that is for the same board,
we can soon collapse all of it into the base platform support.

I think you should add all the code from this file to spear6xx.c instead
of adding a new file. We can then delete the spear600.c and spear600_evb.c
files once the DT support has matured.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Stefan Roese <sr@denx.de>,
	spear-devel@list.st.com, devicetree-discuss@ozlabs.org
Subject: Re: [PATCH] ARM: SPEAr600: Add device-tree support to SPEAr600 boards
Date: Tue, 13 Mar 2012 16:44:11 +0000	[thread overview]
Message-ID: <201203131644.12048.arnd@arndb.de> (raw)
In-Reply-To: <1331650032-15274-1-git-send-email-sr@denx.de>

On Tuesday 13 March 2012, Stefan Roese wrote:
> This patch adds a generic target for SPEAr600 board that can be
> configured via the device-tree. Currently only interrupts are
> configured via device-tree. Other peripheral devices (e.g.
> ethernet, I2C, SMI flash, FSMC NAND flash etc) will follow in
> later patches.
> 
> Only the spear600-evb is currently supported. Other SPEAr600
> based boards will follow later.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Viresh Kumar <viresh.kumar@st.com>

Hi Stefan,

This is very cool, welcome onboard for the DT conversion with spear600!

> +static struct amba_device *amba_devs[] __initdata = {
> +	&gpio_device[0],
> +	&gpio_device[1],
> +	&gpio_device[2],
> +	&uart_device[0],
> +	&uart_device[1],
> +};

I would suggest you convert these to DT next so you can remove the
amba_devs list. Which devices are these? If they are pl061 and
pl010/pl011, the binding should be really easy to do.

> +static struct platform_device *plat_devs[] __initdata = {
> +};

This could be dropped right away, because you would never
add anything here.

> +static void __init spear600_dt_init(void)
> +{
> +	unsigned int i;
> +
> +	/* call spear600 machine init function */
> +	spear600_init();

spear600_init currently is an empty function, I think you can
drop that one too.

> +	/* Add Platform Devices */
> +	platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
> +
> +	/* Add Amba Devices */
> +	for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
> +		amba_device_register(amba_devs[i], &iomem_resource);

So although all of this can go away soon, you will have to
add a call to of_platform_populate() here in order to add the
devices from the device tree.

> +}
> +
> +static const char *spear600_dt_board_compat[] = {
> +	"st,spear600-evb",
> +	NULL
> +};
> +
> +static const struct of_device_id vic_of_match[] __initconst = {
> +	{ .compatible = "arm,pl190-vic", .data = vic_of_init, },
> +	{ /* Sentinel */ }
> +};
> +
> +static void __init spear6xx_dt_init_irq(void)
> +{
> +	of_irq_init(vic_of_match);
> +}
> +
> +DT_MACHINE_START(SPEAR600_DT, "ST-SPEAR600-DT")
> +	.map_io		=	spear6xx_map_io,
> +	.init_irq	=	spear6xx_dt_init_irq,
> +	.handle_irq	=	vic_handle_irq,
> +	.timer		=	&spear6xx_timer,
> +	.init_machine	=	spear600_dt_init,
> +	.restart	=	spear_restart,
> +	.dt_compat	=	spear600_dt_board_compat,
> +MACHINE_END

Since there is only one upstream board file and that is for the same board,
we can soon collapse all of it into the base platform support.

I think you should add all the code from this file to spear6xx.c instead
of adding a new file. We can then delete the spear600.c and spear600_evb.c
files once the DT support has matured.

	Arnd

  reply	other threads:[~2012-03-13 16:44 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 14:47 [PATCH] ARM: SPEAr600: Add device-tree support to SPEAr600 boards Stefan Roese
2012-03-13 14:47 ` Stefan Roese
2012-03-13 16:44 ` Arnd Bergmann [this message]
2012-03-13 16:44   ` Arnd Bergmann
2012-03-14  7:08   ` Viresh Kumar
2012-03-14  7:08     ` Viresh Kumar
2012-03-14  9:58     ` Arnd Bergmann
2012-03-14  9:58       ` Arnd Bergmann
2012-03-14 10:02       ` Viresh Kumar
2012-03-14 10:02         ` Viresh Kumar
2012-03-14  7:40   ` Stefan Roese
2012-03-14  7:40     ` Stefan Roese
2012-03-14  9:48     ` Arnd Bergmann
2012-03-14  9:48       ` Arnd Bergmann
2012-03-14 10:36       ` Stefan Roese
2012-03-14 10:36         ` Stefan Roese
2012-03-14 13:27         ` Arnd Bergmann
2012-03-14 13:27           ` Arnd Bergmann
2012-03-14 13:43           ` Stefan Roese
2012-03-14 13:43             ` Stefan Roese
2012-03-14 14:09             ` Arnd Bergmann
2012-03-14 14:09               ` Arnd Bergmann
2012-03-14 13:44           ` Rob Herring
2012-03-14 13:44             ` Rob Herring
2012-03-14  7:05 ` Viresh Kumar
2012-03-14  7:05   ` Viresh Kumar
2012-03-14  7:20   ` Stefan Roese
2012-03-14  7:20     ` Stefan Roese
2012-03-15  8:48   ` Stefan Roese
2012-03-15  8:48     ` Stefan Roese
2012-03-15  9:00     ` Viresh Kumar
2012-03-15  9:00       ` Viresh Kumar
2012-03-15 10:38       ` Stefan Roese
2012-03-15 10:38         ` Stefan Roese
2012-03-15 10:40         ` Viresh Kumar
2012-03-15 10:40           ` Viresh Kumar
2012-03-15 13:39         ` Arnd Bergmann
2012-03-15 13:39           ` Arnd Bergmann
2012-03-21 11:32           ` Viresh Kumar
2012-03-21 11:32             ` Viresh Kumar
2012-03-21 12:36             ` Arnd Bergmann
2012-03-21 12:36               ` Arnd Bergmann
2012-03-21 13:28               ` viresh kumar
2012-03-21 13:28                 ` viresh kumar
2012-03-21 14:04                 ` Arnd Bergmann
2012-03-21 14:04                   ` Arnd Bergmann
2012-03-21 14:18                   ` viresh kumar
2012-03-21 14:18                     ` viresh kumar
2012-03-21 14:42                     ` Arnd Bergmann
2012-03-21 14:42                       ` Arnd Bergmann
2012-03-21 18:26                   ` Arnd Bergmann
2012-03-21 18:26                     ` Arnd Bergmann
2012-03-22  0:45                     ` viresh kumar
2012-03-22  0:45                       ` viresh kumar
2012-03-22  8:10                       ` Arnd Bergmann
2012-03-22  8:10                         ` Arnd Bergmann
     [not found]                         ` <201203220810.00628.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-22  8:51                           ` viresh kumar
     [not found]               ` <201203211236.37891.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-22 13:46                 ` viresh kumar
2012-03-22 14:20                   ` Arnd Bergmann
2012-03-22 14:20                     ` Arnd Bergmann
     [not found]                     ` <201203221420.10127.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-22 14:53                       ` viresh kumar
2012-03-27 10:27                     ` Viresh Kumar
2012-03-27 10:27                       ` Viresh Kumar
2012-03-27 11:15                       ` Arnd Bergmann
2012-03-27 11:15                         ` Arnd Bergmann
2012-03-27 11:27                         ` Viresh Kumar
2012-03-27 11:27                           ` Viresh Kumar
2012-03-27 11:45                           ` Viresh Kumar
2012-03-27 11:45                             ` Viresh Kumar
2012-03-27 11:59                           ` Arnd Bergmann
2012-03-27 11:59                             ` Arnd Bergmann
     [not found]                             ` <201203271159.35306.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-27 13:44                               ` viresh kumar
2012-03-27 13:59                                 ` Arnd Bergmann
2012-03-27 13:59                                   ` Arnd Bergmann
2012-03-28  5:03                                   ` Viresh Kumar
2012-03-28  5:03                                     ` Viresh Kumar
2012-03-28  8:13                                     ` Arnd Bergmann
2012-03-28  8:13                                       ` Arnd Bergmann
2012-03-14  8:48 ` Jean-Christophe PLAGNIOL-VILLARD
2012-03-14  8:48   ` Jean-Christophe PLAGNIOL-VILLARD

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=201203131644.12048.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.