diff mbox

[0/6] Integrator devicetree support

Message ID CACRpkdYYgdzAU=nyL7dQbdMLx3z3G+K7ba0uJe1=aX=BLeF_sg@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Linus Walleij Aug. 18, 2012, 11:06 p.m. UTC
On Thu, Aug 16, 2012 at 3:44 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thursday 16 August 2012, Linus Walleij wrote:
>> This patch set moves all the non-DT platform code into
>> #ifndef CONFIG_OF sections for clarity. The plan is to
>> delete them after deprecation.
>
> I'm fine with your playing around with this in any way you
> like, but I think in general we should have a new CONFIG_ATAG
> symbol, so you can build a kernel that supports booting
> both with and without DT for the same platform, depending
> on what the boot loader supports.
>
> Then you can enclose all the non-DT sections in #ifdef
> CONFIG_ATAG and we can remove them at some later stage.

Since we already have CONFIG_USE_OF I think
CONFIG_USE_ATAGS is more apropriate, but I get the
idea. So it begins like this:


But then we hit #ifdeffing and compiling out a lot of dangerous stuff
in arch/arm/kernel and then I get the creeps. I can try, but I think
this is typical Nico territory for example...

Yours,
Linus Walleij

Comments

Arnd Bergmann Aug. 19, 2012, 2:05 p.m. UTC | #1
On Saturday 18 August 2012, Linus Walleij wrote:
> Since we already have CONFIG_USE_OF I think
> CONFIG_USE_ATAGS is more apropriate, but I get the
> idea.

There is both CONFIG_USE_OF and CONFIG_OF. The former is what
a platform selects and it turns on a few other options as well,
while the latter is the one that you typically check in #ifdef.

We might need both of them for ATAG as well, but I think if
we have just one, CONFIG_ATAGS or CONFIG_ATAG would be nicer
because it's slightly shorter.

> So it begins like this:
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index e91c7cd..0764ef7 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1907,6 +1907,12 @@ endmenu
> 
>  menu "Boot options"
> 
> +config USE_ATAGS
> +       bool "ATAGS support"
> +       default y
> +       help
> +         Include support for ATAGS-based machine descriptions.
> +
>  config USE_OF
>         bool "Flattened Device Tree support"
>         select OF
> @@ -2110,6 +2116,7 @@ config KEXEC
> 
>  config ATAGS_PROC
>         bool "Export atags in procfs"
> +       depends on USE_ATAGS
>         depends on KEXEC
>         default y
>         help
> 
> But then we hit #ifdeffing and compiling out a lot of dangerous stuff
> in arch/arm/kernel and then I get the creeps. I can try, but I think
> this is typical Nico territory for example...

We don't have to enclose every single usage of ATAGS with this, but
I think it's helpful in platforms that you want to migrate away
from ATAG to DT-only. I think we should also use this method in
mach-ux500, for instance.

Putting MACHINE_START and DT_MACHINE_START inside of CONFIG_ATAG
and CONFIG_OF respectively would help ensure that we don't
accidentally build support for a board that cannot work.

	Arnd
Nicolas Pitre Aug. 19, 2012, 3:52 p.m. UTC | #2
On Sun, 19 Aug 2012, Linus Walleij wrote:

> But then we hit #ifdeffing and compiling out a lot of dangerous stuff
> in arch/arm/kernel and then I get the creeps. I can try, but I think
> this is typical Nico territory for example...

I did post a patch moving all the ATAG stuff to a separate source file a 
while ago, exactly for that purpose.  I should try to dig it out and 
refresh it.


Nicolas
Nicolas Pitre Aug. 30, 2012, 9:01 p.m. UTC | #3
On Sun, 19 Aug 2012, Nicolas Pitre wrote:

> On Sun, 19 Aug 2012, Linus Walleij wrote:
> 
> > But then we hit #ifdeffing and compiling out a lot of dangerous stuff
> > in arch/arm/kernel and then I get the creeps. I can try, but I think
> > this is typical Nico territory for example...
> 
> I did post a patch moving all the ATAG stuff to a separate source file a 
> while ago, exactly for that purpose.  I should try to dig it out and 
> refresh it.

OK... In this case "a while ago" = 2 years!

Please see the 2 patches to follow.


Nicolas
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e91c7cd..0764ef7 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1907,6 +1907,12 @@  endmenu

 menu "Boot options"

+config USE_ATAGS
+       bool "ATAGS support"
+       default y
+       help
+         Include support for ATAGS-based machine descriptions.
+
 config USE_OF
        bool "Flattened Device Tree support"
        select OF
@@ -2110,6 +2116,7 @@  config KEXEC

 config ATAGS_PROC
        bool "Export atags in procfs"
+       depends on USE_ATAGS
        depends on KEXEC
        default y
        help