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 4/6 v2] ARM: integrator: initial device tree support
Date: Sat, 1 Sep 2012 18:41:58 +0000	[thread overview]
Message-ID: <201209011841.58977.arnd@arndb.de> (raw)
In-Reply-To: <1346471760-23993-4-git-send-email-linus.walleij@linaro.org>

On Saturday 01 September 2012, Linus Walleij wrote:

> diff --git a/arch/arm/boot/dts/integratorcp.dts b/arch/arm/boot/dts/integratorcp.dts
> new file mode 100644
> index 0000000..8fad5a1
> --- /dev/null
> +++ b/arch/arm/boot/dts/integratorcp.dts
> @@ -0,0 +1,69 @@
> +/*
> + * Device Tree for the ARM Integrator/CP platform
> + */
> +
> +/dts-v1/;
> +/include/ "skeleton.dtsi"
> +
> +/ {
> +	model = "ARM Integrator/CP";
> +	compatible = "arm,integrator-cp";
> +	ranges;
> +
> +	aliases {
> +		arm,integrator-clocksource = &timer2;
> +		arm,integrator-clockevent = &timer1;
> +	};

It looks like this file is almost a direct superset of the integratorap.dts
file. How about including the other file from here and just adding the
extra nodes and overriding the few bits that are actually different?

>  
> +#ifdef CONFIG_OF
> +
...
> +DT_MACHINE_START(INTEGRATOR_AP_DT, "ARM Integrator/AP (Device Tree)")
> +	.reserve	= integrator_reserve,
> +	.map_io		= ap_map_io,
> +	.nr_irqs	= NR_IRQS_INTEGRATOR_AP,
> +	.init_early	= ap_init_early,
> +	.init_irq	= ap_init_irq_of,
> +	.handle_irq	= fpga_handle_irq,
> +	.timer		= &ap_of_timer,
> +	.init_machine	= ap_init,
> +	.restart	= integrator_restart,
> +	.dt_compat      = ap_dt_board_compat,
> +MACHINE_END
> +
> +#else
> +
...
>  MACHINE_START(INTEGRATOR, "ARM-Integrator")
>  	/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
>  	.atag_offset	= 0x100,
> @@ -486,3 +571,5 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator")
>  	.init_machine	= ap_init,
>  	.restart	= integrator_restart,
>  MACHINE_END
> +
> +#endif

I think we discussed this before. It would be nice to replace the #if/#else
with 

#ifdef CONFIG_OF
...
#endif
#ifdef CONFIG_ATAG
...
#endif

so you can actually support both in the same binary. The other alternative
would be to remove the ATAG boot capability right away, as some other
platforms have done when they moved to DT.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>,
	arm-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 4/6 v2] ARM: integrator: initial device tree support
Date: Sat, 1 Sep 2012 18:41:58 +0000	[thread overview]
Message-ID: <201209011841.58977.arnd@arndb.de> (raw)
In-Reply-To: <1346471760-23993-4-git-send-email-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

On Saturday 01 September 2012, Linus Walleij wrote:

> diff --git a/arch/arm/boot/dts/integratorcp.dts b/arch/arm/boot/dts/integratorcp.dts
> new file mode 100644
> index 0000000..8fad5a1
> --- /dev/null
> +++ b/arch/arm/boot/dts/integratorcp.dts
> @@ -0,0 +1,69 @@
> +/*
> + * Device Tree for the ARM Integrator/CP platform
> + */
> +
> +/dts-v1/;
> +/include/ "skeleton.dtsi"
> +
> +/ {
> +	model = "ARM Integrator/CP";
> +	compatible = "arm,integrator-cp";
> +	ranges;
> +
> +	aliases {
> +		arm,integrator-clocksource = &timer2;
> +		arm,integrator-clockevent = &timer1;
> +	};

It looks like this file is almost a direct superset of the integratorap.dts
file. How about including the other file from here and just adding the
extra nodes and overriding the few bits that are actually different?

>  
> +#ifdef CONFIG_OF
> +
...
> +DT_MACHINE_START(INTEGRATOR_AP_DT, "ARM Integrator/AP (Device Tree)")
> +	.reserve	= integrator_reserve,
> +	.map_io		= ap_map_io,
> +	.nr_irqs	= NR_IRQS_INTEGRATOR_AP,
> +	.init_early	= ap_init_early,
> +	.init_irq	= ap_init_irq_of,
> +	.handle_irq	= fpga_handle_irq,
> +	.timer		= &ap_of_timer,
> +	.init_machine	= ap_init,
> +	.restart	= integrator_restart,
> +	.dt_compat      = ap_dt_board_compat,
> +MACHINE_END
> +
> +#else
> +
...
>  MACHINE_START(INTEGRATOR, "ARM-Integrator")
>  	/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
>  	.atag_offset	= 0x100,
> @@ -486,3 +571,5 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator")
>  	.init_machine	= ap_init,
>  	.restart	= integrator_restart,
>  MACHINE_END
> +
> +#endif

I think we discussed this before. It would be nice to replace the #if/#else
with 

#ifdef CONFIG_OF
...
#endif
#ifdef CONFIG_ATAG
...
#endif

so you can actually support both in the same binary. The other alternative
would be to remove the ATAG boot capability right away, as some other
platforms have done when they moved to DT.

	Arnd

  parent reply	other threads:[~2012-09-01 18:41 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-01  3:55 [PATCH 1/6 v2] ARM: integrator: call common init function from machine Linus Walleij
2012-09-01  3:55 ` Linus Walleij
2012-09-01  3:55 ` [PATCH 2/6 v2] ARM: integrator: check PL010 device name rather than base address Linus Walleij
2012-09-01  3:55   ` Linus Walleij
2012-09-01  3:55   ` [PATCH 3/6 v2] ARM: plat-versatile: add DT support to FPGA IRQ controller Linus Walleij
2012-09-01  3:55     ` Linus Walleij
2012-09-01  3:55     ` [PATCH 4/6 v2] ARM: integrator: initial device tree support Linus Walleij
2012-09-01  3:55       ` Linus Walleij
2012-09-01  3:55       ` [PATCH 5/6 v2] ARM: integrator: convert AMBA devices to device tree Linus Walleij
2012-09-01  3:55         ` Linus Walleij
2012-09-01  3:55         ` [PATCH 6/6 v2] ARM: integrator: convert platform devices to Device Tree Linus Walleij
2012-09-01  3:55           ` Linus Walleij
2012-09-01 18:41       ` Arnd Bergmann [this message]
2012-09-01 18:41         ` [PATCH 4/6 v2] ARM: integrator: initial device tree support Arnd Bergmann
2012-09-03 21:43         ` Linus Walleij
2012-09-03 21:43           ` Linus Walleij
2012-09-03 21:55           ` Russell King - ARM Linux
2012-09-03 21:55             ` Russell King - ARM Linux
2012-09-04  7:19             ` Linus Walleij
2012-09-04  7:19               ` Linus Walleij
2012-09-05  5:34               ` Olof Johansson
2012-09-05  5:34                 ` Olof Johansson
2012-09-05  5:47                 ` Linus Walleij
2012-09-05  5:47                   ` Linus Walleij
2012-09-02 22:59       ` Rob Herring
2012-09-02 22:59         ` Rob Herring
2012-09-03 21:51         ` Linus Walleij
2012-09-03 21:51           ` Linus Walleij
2012-09-06 13:20           ` Rob Herring
2012-09-06 13:20             ` Rob Herring
2012-09-06 13:56             ` Linus Walleij
2012-09-06 13:56               ` Linus Walleij
2012-09-06 14:19               ` Arnd Bergmann
2012-09-06 14:19                 ` Arnd Bergmann
2012-09-12 16:52                 ` Linus Walleij
2012-09-12 16:52                   ` Linus Walleij
2012-09-06 15:35               ` Rob Herring
2012-09-06 15:35                 ` Rob Herring
2012-09-06 14:14             ` Russell King - ARM Linux
2012-09-06 14:14               ` Russell King - ARM Linux
2012-09-01 18:32   ` [PATCH 2/6 v2] ARM: integrator: check PL010 device name rather than base address Arnd Bergmann
2012-09-01 18:32     ` Arnd Bergmann
2012-09-03 19:40     ` Linus Walleij
2012-09-03 19:40       ` Linus Walleij
2012-09-03 19:51       ` Linus Walleij
2012-09-03 19:51         ` Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2012-09-05 19:28 [PATCH 4/6 v2] ARM: integrator: initial device tree support Linus Walleij
2012-09-05 19:28 ` Linus Walleij

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