Skip to contentSkip to conversation

mach-ux500: add devicetree compat nodes

PATCH New Niklas Hernaeus 3 participants 7 messages Nov 11, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mach-ux500: add devicetree compat nodes

From: Linus Walleij <[email protected]>

This adds devicetree compat members to all the U8500 reference boards.

---
 arch/arm/mach-ux500/board-mop500.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
arch/arm/mach-ux500/board-mop500.c +18 -0
index cd54aba..7cbefa7 100644
@@ -643,6 +643,21 @@ static void __init mop500_init_machine(void)
 	regulator_has_full_constraints();
 }
 
+static const char * mop500_dt_board_compat[] = {
+	"stericsson,mop500",
+	NULL
+};
+
+static const char * hrefv60_dt_board_compat[] = {
+	"stericsson,hrefv60",
+	NULL
+};
+
+static const char * snowball_dt_board_compat[] = {
+	"stericsson,snowball",
+	NULL
+};
+
 MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
 	/* Maintainer: Srinidhi Kasagar <[email protected]> */
 	.boot_params	= 0x100,
@@ -651,6 +666,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
 	/* we re-use nomadik timer here */
 	.timer		= &ux500_timer,
 	.init_machine	= mop500_init_machine,
+	.dt_compat	= mop500_dt_board_compat,
 MACHINE_END
 
 MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
@@ -659,6 +675,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
 	.init_irq	= ux500_init_irq,
 	.timer		= &ux500_timer,
 	.init_machine	= mop500_init_machine,
+	.dt_compat	= hrefv60_dt_board_compat,
 MACHINE_END
 
 MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
@@ -668,4 +685,5 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
 	/* we re-use nomadik timer here */
 	.timer		= &ux500_timer,
 	.init_machine	= mop500_init_machine,
+	.dt_compat	= snowball_dt_board_compat,
 MACHINE_END
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 1/1 mach-ux500: add devicetree compat nodes

Quoted 53 lines · Niklas Hernaeus

From: Linus Walleij <[email protected]>

This adds devicetree compat members to all the U8500 reference boards.

---
 arch/arm/mach-ux500/board-mop500.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
arch/arm/mach-ux500/board-mop500.c +17 -0
index cd54aba..7cbefa7 100644
@@ -643,6 +643,21 @@ static void __init mop500_init_machine(void)
 	regulator_has_full_constraints();
 }
 
+static const char * mop500_dt_board_compat[] = {
+	"stericsson,mop500",
+	NULL
+};
+
+static const char * hrefv60_dt_board_compat[] = {
+	"stericsson,hrefv60",
+	NULL
+};
+
+static const char * snowball_dt_board_compat[] = {
+	"stericsson,snowball",
+	NULL
+};
+
 MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
 	/* Maintainer: Srinidhi Kasagar <[email protected]> */
 	.boot_params	= 0x100,
@@ -651,6 +666,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
 	/* we re-use nomadik timer here */
 	.timer		= &ux500_timer,
 	.init_machine	= mop500_init_machine,
+	.dt_compat	= mop500_dt_board_compat,
 MACHINE_END
 
 MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
@@ -659,6 +675,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
 	.init_irq	= ux500_init_irq,
 	.timer		= &ux500_timer,
 	.init_machine	= mop500_init_machine,
+	.dt_compat	= hrefv60_dt_board_compat,
 MACHINE_END
 
 MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")

arch/arm/mach-ux500/board-mop500.c MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") · line 689

Quoted 5 lines
arch/arm/mach-ux500/board-mop500.c +1 -0
@@ -668,4 +685,5 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
 	/* we re-use nomadik timer here */
 	.timer		= &ux500_timer,
 	.init_machine	= mop500_init_machine,
+	.dt_compat	= snowball_dt_board_compat,
 MACHINE_END

These all look very similar and should be combined. Why do you not have 1 machine for all DT platforms as other SOCs are doing?

Rob

#2 lore raw

PATCH 1/1 mach-ux500: add devicetree compat nodes

Quoted 18 lines · Rob Herring
Quoted 18 lines

?MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
? ? ? /* Maintainer: Srinidhi Kasagar <[email protected]> */ ? ? ? .boot_params ? ?= 0x100,

(quoted diff) +0 -0
@@ -651,6 +666,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")

? ? ? /* we re-use nomadik timer here */
? ? ? .timer ? ? ? ? ?= &ux500_timer,
? ? ? .init_machine ? = mop500_init_machine,
+ ? ? .dt_compat ? ? ?= mop500_dt_board_compat,
?MACHINE_END

?MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")

(quoted diff) +1 -0
@@ -659,6 +675,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
 ? ? ? .init_irq ? ? ? = ux500_init_irq,
 ? ? ? .timer ? ? ? ? ?= &ux500_timer,
 ? ? ? .init_machine ? = mop500_init_machine,
+ ? ? .dt_compat ? ? ?= hrefv60_dt_board_compat,

?MACHINE_END

Quoted 10 lines
Quoted 7 lines

?MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")

(quoted diff) +0 -0
@@ -668,4 +685,5 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")

? ? ? /* we re-use nomadik timer here */
? ? ? .timer ? ? ? ? ?= &ux500_timer,
? ? ? .init_machine ? = mop500_init_machine,
+ ? ? .dt_compat ? ? ?= snowball_dt_board_compat,
?MACHINE_END

These all look very similar and should be combined. Why do you not have 1 machine for all DT platforms as other SOCs are doing?

This needs to be rebased for the latest kernel.
Which looks like this:

MACHINE_START(U8500, "ST-Ericsson MOP500 platform")

        /* Maintainer: Srinidhi Kasagar <[email protected]> */
        .atag_offset    = 0x100,
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
        .timer          = &ux500_timer,
        .init_machine   = mop500_init_machine,

MACHINE_END

MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")

        .atag_offset    = 0x100,
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        .timer          = &ux500_timer,
        .init_machine   = hrefv60_init_machine,

MACHINE_END

MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")

        .atag_offset    = 0x100,
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
        .timer          = &ux500_timer,
        .init_machine   = snowball_init_machine,

MACHINE_END

So - different .init_machine() calls, needed to simplify the board files as of now. (Patch from Lee Jones.)

Yours,
Linus Walleij

#3 lore raw

PATCH 1/1 mach-ux500: add devicetree compat nodes

Quoted 59 lines · Linus Walleij
Quoted 18 lines · Rob Herring
Quoted 18 lines

MACHINE_START(U8500, "ST-Ericsson MOP500 platform")

      /* Maintainer: Srinidhi Kasagar <[email protected]> */
      .boot_params    = 0x100,
arch/arm/mach-ux500/board-mop500.c +2 -0
@@ -651,6 +666,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
      /* we re-use nomadik timer here */
      .timer          = &ux500_timer,
      .init_machine   = mop500_init_machine,
+     .dt_compat      = mop500_dt_board_compat,
 MACHINE_END
 
 MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
@@ -659,6 +675,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
      .init_irq       = ux500_init_irq,
      .timer          = &ux500_timer,
      .init_machine   = mop500_init_machine,
+     .dt_compat      = hrefv60_dt_board_compat,
 MACHINE_END
 
Quoted 10 lines

arch/arm/mach-ux500/board-mop500.c MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") · line 689

Quoted 7 lines
arch/arm/mach-ux500/board-mop500.c +1 -0
 MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
@@ -668,4 +685,5 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
      /* we re-use nomadik timer here */
      .timer          = &ux500_timer,
      .init_machine   = mop500_init_machine,
+     .dt_compat      = snowball_dt_board_compat,
 MACHINE_END

These all look very similar and should be combined. Why do you not have 1 machine for all DT platforms as other SOCs are doing?

This needs to be rebased for the latest kernel.
Which looks like this:

MACHINE_START(U8500, "ST-Ericsson MOP500 platform")

        /* Maintainer: Srinidhi Kasagar <[email protected]> */
        .atag_offset    = 0x100,
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
        .timer          = &ux500_timer,
        .init_machine   = mop500_init_machine,

MACHINE_END

MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")

        .atag_offset    = 0x100,
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        .timer          = &ux500_timer,
        .init_machine   = hrefv60_init_machine,

MACHINE_END

MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")

        .atag_offset    = 0x100,
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
        .timer          = &ux500_timer,
        .init_machine   = snowball_init_machine,
Quoted 5 lines

MACHINE_END

So - different .init_machine() calls, needed to simplify the board files as of now. (Patch from Lee Jones.)

But ultimately I would expect that the init_machine calls to be the same with a DT based machine. This goes back to do we add DT to existing boards or create a new clean DT machine and add to it as boards are converted?

Rob

#4 lore raw

PATCH 1/1 mach-ux500: add devicetree compat nodes

Quoted 9 lines · Rob Herring
Quoted 3 lines · Linus Walleij

So - different .init_machine() calls, needed to simplify the board files as of now. (Patch from Lee Jones.)

But ultimately I would expect that the init_machine calls to be the same with a DT based machine. This goes back to do we add DT to existing boards or create a new clean DT machine and add to it as boards are converted?

Yes that should be the ultimate goal. So the current per-board init functions register the I2C, MMC (SDI), SPI, UART and regulator devices etc. So then these drivers need to be patched to get their board/platform data from DT first.

In that case we should hold this patch off and only keep it for internal testing until all necessary drivers are ready and patched so we can replace all board files with a single DT-based one, instead of this compromise solution.

Is this what everybody else does?

Thanks,
Linus Walleij

#5 lore raw

PATCH 1/1 mach-ux500: add devicetree compat nodes

Quoted 16 lines · Linus Walleij
Quoted 9 lines · Rob Herring
Quoted 3 lines · Linus Walleij

So - different .init_machine() calls, needed to simplify the board files as of now. (Patch from Lee Jones.)

But ultimately I would expect that the init_machine calls to be the same with a DT based machine. This goes back to do we add DT to existing boards or create a new clean DT machine and add to it as boards are converted?

Yes that should be the ultimate goal. So the current per-board init functions register the I2C, MMC (SDI), SPI, UART and regulator devices etc. So then these drivers need to be patched to get their board/platform data from DT first.

Quoted 5 lines

In that case we should hold this patch off and only keep it for internal testing until all necessary drivers are ready and patched so we can replace all board files with a single DT-based one, instead of this compromise solution.

I would not hold off. You only need to have a minimal set that's enough to boot.

Quoted 1 line

Is this what everybody else does?

That was the the consensus in Budapest in May. It's much cleaner to start with a new board file and then ultimately just delete the old ones. But it's really up to the board/SOC maintainer.

Rob

Quoted 2 lines

Thanks,
Linus Walleij

#6 lore raw

PATCH 1/1 mach-ux500: add devicetree compat nodes

Quoted 8 lines · Rob Herring

[Me]

Quoted 5 lines

In that case we should hold this patch off and only keep it for internal testing until all necessary drivers are ready and patched so we can replace all board files with a single DT-based one, instead of this compromise solution.

I would not hold off. You only need to have a minimal set that's enough to boot.

In our case UART, I2C and MMC is necessary to boot, so then we anyway need to wait for these to be patched first. So we'd better hold it back for now I think.

Linus Walleij