Skip to contentSkip to conversation

OMAP: Add initial support for DT on OMAP3 & OMAP4

PATCH New Benoit Cousson 6 participants 33 messages Sep 23, 2011 – May 14, 2012

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

cover OMAP: Add initial support for DT on OMAP3 & OMAP4

Hi Tony, Grant,

Here is the first set of patches to add device-tree support for OMAP3+ platforms.
That series mainly adds a minimal OMAP2+ generic board file for basic DT support on OMAP2420, OMAP2430, OMAP3, OMAP4 and beyond. The goal is to remove even the minimal static devices init in order to have a fully generic OMAP board file. For the moment both UART and I2C need to be initialized statically.

That series is a respin of several RFCs I sent previously and take into account the comments mainly done by Arnd and Grant.

Patches are based on for_3.2/2_omap_device_dt
and are available here:
git://gitorious.org/omap-pm/linux.git for_3.2/3_omap_devicetree

Please note that the Device Tree source files will be stored as well in the following repository:
git://gitorious.org/omap/devicetree.git master

Comments are welcome.

Regards,
Benoit

Benoit Cousson (11):
OMAP2+: Add SoC specific map_io functions arm/dts: Add initial device tree support for OMAP4 SoC arm/dts: Add support for OMAP4 PandaBoard arm/dts: Add support for OMAP4 SDP board
arm/dts: Add initial device tree support for OMAP3 SoC arm/dts: Add support for OMAP3 Beagle board OMAP2+: board-generic: Add DT support to generic board OMAP2+: board-generic: Add i2c static init OMAP2+: l3-noc: Add support for device-tree arm/dts: OMAP4: Add a main ocp entry bound to l3-noc driver arm/dts: OMAP3+: Add mpu, dsp and iva nodes

 Documentation/devicetree/bindings/arm/omap/dsp.txt |   14 ++
 Documentation/devicetree/bindings/arm/omap/iva.txt |   19 +++
 .../devicetree/bindings/arm/omap/l3-noc.txt        |   19 +++
 Documentation/devicetree/bindings/arm/omap/mpu.txt |   27 ++++
 arch/arm/boot/dts/omap3-beagle.dts                 |   29 ++++
 arch/arm/boot/dts/omap3.dtsi                       |   63 ++++++++
 arch/arm/boot/dts/omap4-panda.dts                  |   29 ++++
 arch/arm/boot/dts/omap4-sdp.dts                    |   29 ++++
 arch/arm/boot/dts/omap4.dtsi                       |  103 +++++++++++++
 arch/arm/mach-omap2/Kconfig                        |    8 +-
 arch/arm/mach-omap2/board-generic.c                |  158 ++++++++++++++-----
 arch/arm/mach-omap2/common.c                       |   18 +++
 arch/arm/mach-omap2/devices.c                      |    5 +
 arch/arm/mach-omap2/omap_l3_noc.c                  |   23 +++-
 arch/arm/mach-omap2/pm.c                           |    3 +-
 arch/arm/plat-omap/include/plat/common.h           |    4 +
 16 files changed, 501 insertions(+), 50 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/omap/dsp.txt
 create mode 100644 Documentation/devicetree/bindings/arm/omap/iva.txt
 create mode 100644 Documentation/devicetree/bindings/arm/omap/l3-noc.txt
 create mode 100644 Documentation/devicetree/bindings/arm/omap/mpu.txt
 create mode 100644 arch/arm/boot/dts/omap3-beagle.dts
 create mode 100644 arch/arm/boot/dts/omap3.dtsi
 create mode 100644 arch/arm/boot/dts/omap4-panda.dts
 create mode 100644 arch/arm/boot/dts/omap4-sdp.dts
 create mode 100644 arch/arm/boot/dts/omap4.dtsi
#1 lore raw

PATCH 1/11 OMAP2+: Add SoC specific map_io functions

Add SoC specific map_io function to be used by the generic DT board file. This is an intermediate step before having some generic DT aware map_io function.

---
 arch/arm/mach-omap2/common.c             |   18 ++++++++++++++++++
 arch/arm/plat-omap/include/plat/common.h |    4 ++++
 2 files changed, 22 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/common.c +18 -0
index 3f20cbb..de61f15 100644
@@ -56,6 +56,12 @@ void __init omap2_set_globals_242x(void)
 {
 	__omap2_set_globals(&omap242x_globals);
 }
+
+void __init omap242x_map_io(void)
+{
+	omap2_set_globals_242x();
+	omap242x_map_common_io();
+}
 #endif
 
 #if defined(CONFIG_SOC_OMAP2430)
@@ -74,6 +80,12 @@ void __init omap2_set_globals_243x(void)
 {
 	__omap2_set_globals(&omap243x_globals);
 }
+
+void __init omap243x_map_io(void)
+{
+	omap2_set_globals_243x();
+	omap243x_map_common_io();
+}
 #endif
 
 #if defined(CONFIG_ARCH_OMAP3)
@@ -138,5 +150,11 @@ void __init omap2_set_globals_443x(void)
 	omap2_set_globals_control(&omap4_globals);
 	omap2_set_globals_prcm(&omap4_globals);
 }
+
+void __init omap4_map_io(void)
+{
+	omap2_set_globals_443x();
+	omap44xx_map_common_io();
+}
 #endif
 
arch/arm/plat-omap/include/plat/common.h +4 -0
index 5cac97e..abda2c7 100644
@@ -83,7 +83,11 @@ void omap2_set_globals_sdrc(struct omap_globals *);
 void omap2_set_globals_control(struct omap_globals *);
 void omap2_set_globals_prcm(struct omap_globals *);
 
+void omap242x_map_io(void);
+void omap243x_map_io(void);
 void omap3_map_io(void);
+void omap4_map_io(void);
+
 
 /**
  * omap_test_timeout - busy-loop, testing a condition
Signature · 1 line
1.7.0.4
maintainer
#2 lore raw

PATCH 1/11 OMAP2+: Add SoC specific map_io functions

Quoted 3 lines · Benoit Cousson

Add SoC specific map_io function to be used by the generic DT board file. This is an intermediate step before having some generic DT aware map_io function.

Thanks, I'll apply this into cleanup branch and with the related conversion of board files.

Regards,

Tony

Quoted 68 lines
---
 arch/arm/mach-omap2/common.c             |   18 ++++++++++++++++++
 arch/arm/plat-omap/include/plat/common.h |    4 ++++
 2 files changed, 22 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/common.c +18 -0
index 3f20cbb..de61f15 100644
@@ -56,6 +56,12 @@ void __init omap2_set_globals_242x(void)
 {
 	__omap2_set_globals(&omap242x_globals);
 }
+
+void __init omap242x_map_io(void)
+{
+	omap2_set_globals_242x();
+	omap242x_map_common_io();
+}
 #endif
 
 #if defined(CONFIG_SOC_OMAP2430)
@@ -74,6 +80,12 @@ void __init omap2_set_globals_243x(void)
 {
 	__omap2_set_globals(&omap243x_globals);
 }
+
+void __init omap243x_map_io(void)
+{
+	omap2_set_globals_243x();
+	omap243x_map_common_io();
+}
 #endif
 
 #if defined(CONFIG_ARCH_OMAP3)
@@ -138,5 +150,11 @@ void __init omap2_set_globals_443x(void)
 	omap2_set_globals_control(&omap4_globals);
 	omap2_set_globals_prcm(&omap4_globals);
 }
+
+void __init omap4_map_io(void)
+{
+	omap2_set_globals_443x();
+	omap44xx_map_common_io();
+}
 #endif
 
arch/arm/plat-omap/include/plat/common.h +4 -0
index 5cac97e..abda2c7 100644
@@ -83,7 +83,11 @@ void omap2_set_globals_sdrc(struct omap_globals *);
 void omap2_set_globals_control(struct omap_globals *);
 void omap2_set_globals_prcm(struct omap_globals *);
 
+void omap242x_map_io(void);
+void omap243x_map_io(void);
 void omap3_map_io(void);
+void omap4_map_io(void);
+
 
 /**
  * omap_test_timeout - busy-loop, testing a condition
Signature · 1 line
1.7.0.4
maintainer
#3 lore raw

PATCH 1/11 OMAP2+: Add SoC specific map_io functions

Quoted 7 lines · Tony Lindgren
Quoted 3 lines · Benoit Cousson

Add SoC specific map_io function to be used by the generic DT board file. This is an intermediate step before having some generic DT aware map_io function.

Thanks, I'll apply this into cleanup branch and with the related conversion of board files.

Following replies contain the two related patches.

Tony

maintainer
#4 lore raw

PATCH 1/1 ARM: OMAP2+: Use SoC specifc map_io

There's no longer any need for the board specific
map_io.

arch/arm/mach-omap2/board-2430sdp.c +1 -7
index 618216c..45dafe2 100644
@@ -243,17 +243,11 @@ static void __init omap_2430sdp_init(void)
 			 "Secondary LCD backlight");
 }
 
-static void __init omap_2430sdp_map_io(void)
-{
-	omap2_set_globals_243x();
-	omap243x_map_common_io();
-}
-
 MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
 	/* Maintainer: Syed Khasim - Texas Instruments Inc */
 	.boot_params	= 0x80000100,
 	.reserve	= omap_reserve,
-	.map_io		= omap_2430sdp_map_io,
+	.map_io		= omap243x_map_io,
 	.init_early	= omap2430_init_early,
 	.init_irq	= omap2_init_irq,
 	.init_machine	= omap_2430sdp_init,
arch/arm/mach-omap2/board-4430sdp.c +1 -7
index ab19d30..44a3e2c 100644
@@ -825,17 +825,11 @@ static void __init omap_4430sdp_init(void)
 	omap_4430sdp_display_init();
 }
 
-static void __init omap_4430sdp_map_io(void)
-{
-	omap2_set_globals_443x();
-	omap44xx_map_common_io();
-}
-
 MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
 	/* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
 	.boot_params	= 0x80000100,
 	.reserve	= omap_reserve,
-	.map_io		= omap_4430sdp_map_io,
+	.map_io		= omap4_map_io,
 	.init_early	= omap4430_init_early,
 	.init_irq	= gic_init_irq,
 	.init_machine	= omap_4430sdp_init,
arch/arm/mach-omap2/board-apollon.c +1 -7
index cf546f8..8528436 100644
@@ -337,17 +337,11 @@ static void __init omap_apollon_init(void)
 	omap_sdrc_init(NULL, NULL);
 }
 
-static void __init omap_apollon_map_io(void)
-{
-	omap2_set_globals_242x();
-	omap242x_map_common_io();
-}
-
 MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
 	/* Maintainer: Kyungmin Park <[email protected]> */
 	.boot_params	= 0x80000100,
 	.reserve	= omap_reserve,
-	.map_io		= omap_apollon_map_io,
+	.map_io		= omap242x_map_io,
 	.init_early	= omap2420_init_early,
 	.init_irq	= omap2_init_irq,
 	.init_machine	= omap_apollon_init,
arch/arm/mach-omap2/board-h4.c +1 -7
index 948fde0..fcc5107 100644
@@ -369,17 +369,11 @@ static void __init omap_h4_init(void)
 	h4_init_flash();
 }
 
-static void __init omap_h4_map_io(void)
-{
-	omap2_set_globals_242x();
-	omap242x_map_common_io();
-}
-
 MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
 	/* Maintainer: Paul Mundt <[email protected]> */
 	.boot_params	= 0x80000100,
 	.reserve	= omap_reserve,
-	.map_io		= omap_h4_map_io,
+	.map_io		= omap242x_map_io,
 	.init_early	= omap2420_init_early,
 	.init_irq	= omap_h4_init_irq,
 	.init_machine	= omap_h4_init,
arch/arm/mach-omap2/board-n8x0.c +3 -9
index 77a4e19..d1f4a02 100644
@@ -616,12 +616,6 @@ static struct i2c_board_info n810_i2c_board_info_2[] __initdata = {
 	},
 };
 
-static void __init n8x0_map_io(void)
-{
-	omap2_set_globals_242x();
-	omap242x_map_common_io();
-}
-
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
 	/* I2S codec port pins for McBSP block */
@@ -692,7 +686,7 @@ static void __init n8x0_init_machine(void)
 MACHINE_START(NOKIA_N800, "Nokia N800")
 	.boot_params	= 0x80000100,
 	.reserve	= omap_reserve,
-	.map_io		= n8x0_map_io,
+	.map_io		= omap242x_map_io,
 	.init_early	= omap2420_init_early,
 	.init_irq	= omap2_init_irq,
 	.init_machine	= n8x0_init_machine,
@@ -702,7 +696,7 @@ MACHINE_END
 MACHINE_START(NOKIA_N810, "Nokia N810")
 	.boot_params	= 0x80000100,
 	.reserve	= omap_reserve,
-	.map_io		= n8x0_map_io,
+	.map_io		= omap242x_map_io,
 	.init_early	= omap2420_init_early,
 	.init_irq	= omap2_init_irq,
 	.init_machine	= n8x0_init_machine,
@@ -712,7 +706,7 @@ MACHINE_END
 MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
 	.boot_params	= 0x80000100,
 	.reserve	= omap_reserve,
-	.map_io		= n8x0_map_io,
+	.map_io		= omap242x_map_io,
 	.init_early	= omap2420_init_early,
 	.init_irq	= omap2_init_irq,
 	.init_machine	= n8x0_init_machine,
arch/arm/mach-omap2/board-omap4panda.c +1 -7
index 1bce765..e269290 100644
@@ -570,17 +570,11 @@ static void __init omap4_panda_init(void)
 	omap4_panda_display_init();
 }
 
-static void __init omap4_panda_map_io(void)
-{
-	omap2_set_globals_443x();
-	omap44xx_map_common_io();
-}
-
 MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
 	/* Maintainer: David Anders - Texas Instruments Inc */
 	.boot_params	= 0x80000100,
 	.reserve	= omap_reserve,
-	.map_io		= omap4_panda_map_io,
+	.map_io		= omap4_map_io,
 	.init_early	= omap4430_init_early,
 	.init_irq	= gic_init_irq,
 	.init_machine	= omap4_panda_init,
arch/arm/mach-omap2/board-rm680.c +1 -7
index a3182e8..a98db61 100644
@@ -143,16 +143,10 @@ static void __init rm680_init(void)
 	rm680_peripherals_init();
 }
 
-static void __init rm680_map_io(void)
-{
-	omap2_set_globals_3xxx();
-	omap34xx_map_common_io();
-}
-
 MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
 	.boot_params	= 0x80000100,
 	.reserve	= omap_reserve,
-	.map_io		= rm680_map_io,
+	.map_io		= omap3_map_io,
 	.init_early	= omap3630_init_early,
 	.init_irq	= omap3_init_irq,
 	.init_machine	= rm680_init,
arch/arm/mach-omap2/board-rx51.c +1 -7
index 32a79e2..8677a06 100644
@@ -139,12 +139,6 @@ static void __init rx51_init(void)
 	platform_device_register(&leds_gpio);
 }
 
-static void __init rx51_map_io(void)
-{
-	omap2_set_globals_3xxx();
-	omap34xx_map_common_io();
-}
-
 static void __init rx51_reserve(void)
 {
 	rx51_video_mem_init();
@@ -155,7 +149,7 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
 	/* Maintainer: Lauri Leukkunen <[email protected]> */
 	.boot_params	= 0x80000100,
 	.reserve	= rx51_reserve,
-	.map_io		= rx51_map_io,
+	.map_io		= omap3_map_io,
 	.init_early	= omap3430_init_early,
 	.init_irq	= omap3_init_irq,
 	.init_machine	= rx51_init,
maintainer
#5 lore raw

PATCH 1/1 ARM: OMAP2+: Remove custom init_irq for remaining boards

With SoC specific timers, board specific init_irq is no longer needed. Earlier this was still needed to initialize the gptimer12 on Beagle based boards.

Also convert board-h4.c to use omap2_init_irq accidentally did not get converted earlier.

arch/arm/mach-omap2/board-devkit8000.c +1 -6
index 4b1f6c6..059b74d 100644
@@ -397,11 +397,6 @@ static struct platform_device keys_gpio = {
 	},
 };
 
-static void __init devkit8000_init_irq(void)
-{
-	omap3_init_irq();
-}
-
 #define OMAP_DM9000_BASE	0x2c000000
 
 static struct resource omap_dm9000_resources[] = {
@@ -665,7 +660,7 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
 	.reserve	= omap_reserve,
 	.map_io		= omap3_map_io,
 	.init_early	= omap35xx_init_early,
-	.init_irq	= devkit8000_init_irq,
+	.init_irq	= omap3_init_irq,
 	.init_machine	= devkit8000_init,
 	.timer		= &omap3_secure_timer,
 MACHINE_END
arch/arm/mach-omap2/board-h4.c +1 -6
index fcc5107..8486142 100644
@@ -290,11 +290,6 @@ static struct omap_board_config_kernel h4_config[] __initdata = {
 	{ OMAP_TAG_LCD,		&h4_lcd_config },
 };
 
-static void __init omap_h4_init_irq(void)
-{
-	omap2_init_irq();
-}
-
 static struct at24_platform_data m24c01 = {
 	.byte_len	= SZ_1K / 8,
 	.page_size	= 16,
@@ -375,7 +370,7 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
 	.reserve	= omap_reserve,
 	.map_io		= omap242x_map_io,
 	.init_early	= omap2420_init_early,
-	.init_irq	= omap_h4_init_irq,
+	.init_irq	= omap2_init_irq,
 	.init_machine	= omap_h4_init,
 	.timer		= &omap2_timer,
 MACHINE_END
arch/arm/mach-omap2/board-omap3beagle.c +1 -6
index ce3234d..e085371 100644
@@ -449,11 +449,6 @@ static void __init omap3_beagle_init_early(void)
 	omap2_init_common_infrastructure();
 }
 
-static void __init omap3_beagle_init_irq(void)
-{
-	omap3_init_irq();
-}
-
 static struct platform_device *omap3_beagle_devices[] __initdata = {
 	&leds_gpio,
 	&keys_gpio,
@@ -561,7 +556,7 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
 	.reserve	= omap_reserve,
 	.map_io		= omap3_map_io,
 	.init_early	= omap3_beagle_init_early,
-	.init_irq	= omap3_beagle_init_irq,
+	.init_irq	= omap3_init_irq,
 	.init_machine	= omap3_beagle_init,
 	.timer		= &omap3_secure_timer,
 MACHINE_END
arch/arm/mach-omap2/board-omap3stalker.c +1 -6
index 807c274..fa58a0f 100644
@@ -428,11 +428,6 @@ static int __init omap3_stalker_i2c_init(void)
 static struct omap_board_config_kernel omap3_stalker_config[] __initdata = {
 };
 
-static void __init omap3_stalker_init_irq(void)
-{
-	omap3_init_irq();
-}
-
 static struct platform_device *omap3_stalker_devices[] __initdata = {
 	&keys_gpio,
 };
@@ -492,7 +487,7 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
 	.boot_params		= 0x80000100,
 	.map_io			= omap3_map_io,
 	.init_early		= omap35xx_init_early,
-	.init_irq		= omap3_stalker_init_irq,
+	.init_irq		= omap3_init_irq,
 	.init_machine		= omap3_stalker_init,
 	.timer			= &omap3_secure_timer,
 MACHINE_END
arch/arm/mach-omap2/board-omap3touchbook.c +1 -6
index f7f1809..05488fb 100644
@@ -326,11 +326,6 @@ static struct omap_board_mux board_mux[] __initdata = {
 };
 #endif
 
-static void __init omap3_touchbook_init_irq(void)
-{
-	omap3_init_irq();
-}
-
 static struct platform_device *omap3_touchbook_devices[] __initdata = {
 	&omap3_touchbook_lcd_device,
 	&leds_gpio,
@@ -403,7 +398,7 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
 	.reserve	= omap_reserve,
 	.map_io		= omap3_map_io,
 	.init_early	= omap3430_init_early,
-	.init_irq	= omap3_touchbook_init_irq,
+	.init_irq	= omap3_init_irq,
 	.init_machine	= omap3_touchbook_init,
 	.timer		= &omap3_secure_timer,
 MACHINE_END
#6 lore raw

PATCH 1/11 OMAP2+: Add SoC specific map_io functions

In reply to Benoit Cousson

Hello Benoit,

Le Fri, 23 Sep 2011 22:23:09 +0200,
Benoit Cousson <[email protected]> a ?crit :

Quoted 6 lines

Add SoC specific map_io function to be used by the generic DT board file. This is an intermediate step before having some generic DT aware map_io function.

Do you know if some progress has been made on having a generic DT aware map_io function, or is the per-SoC ->map_io() function still the recommended way of handling SoC having different requirements of static mappings at boot time?

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#7 lore raw

PATCH 1/11 OMAP2+: Add SoC specific map_io functions

Salut Thomas,

Sorry for the delay.

Quoted 9 lines · Thomas Petazzoni

Hello Benoit,

Le Fri, 23 Sep 2011 22:23:09 +0200,
Benoit Cousson<[email protected]> a ?crit :

Quoted 4 lines

Add SoC specific map_io function to be used by the generic DT board file. This is an intermediate step before having some generic DT aware map_io function.

Quoted 7 lines
Quoted 2 lines

Do you know if some progress has been made on having a generic DT aware map_io function, or is the per-SoC ->map_io() function still the recommended way of handling SoC having different requirements of static mappings at boot time?

Mmm, Maybe I'm wrong, but I'm not sure people are really pushing to store that inside DT. But to be honest, I don't really know :-)

Tony might have some clue.

Regards,
Benoit

#8 lore raw

PATCH 1/11 OMAP2+: Add SoC specific map_io functions

Quoted 17 lines · Benoit

Salut Thomas,

Sorry for the delay.

Quoted 12 lines · Thomas Petazzoni

Hello Benoit,

Le Fri, 23 Sep 2011 22:23:09 +0200,
Benoit Cousson<[email protected]> a ?crit :

Quoted 6 lines

Add SoC specific map_io function to be used by the generic DT board file. This is an intermediate step before having some generic DT aware map_io function.

Quoted 7 lines
Quoted 4 lines

Do you know if some progress has been made on having a generic DT aware map_io function, or is the per-SoC ->map_io() function still the recommended way of handling SoC having different requirements of static mappings at boot time?

Mmm, Maybe I'm wrong, but I'm not sure people are really pushing to store that inside DT. But to be honest, I don't really know :-)

In general, static vs dynamic IO mappings are just some Linux implementation details. This distinction does not belong in DT.

Nicolas

#9 lore raw

PATCH 2/11 arm/dts: Add initial device tree support for OMAP4 SoC

In reply to Benoit Cousson

Add initial device-tree support for OMAP4 SoC.

This is based on the original panda board patch done by Manju:
http://permalink.gmane.org/gmane.linux.ports.arm.omap/60393

Add the generic GIC interrupt-controller from ARM.

Add an empty "soc" node to contain non memory mapped IPs (DSP, MPU, IPU...).

Note: Since reg, irq and dma are provided by hwmod for the moment, these attributes will not be present at all in DTS to highlight the gap. They will be added as soon as dma bindings will be there and drivers will be adapted.

Cc Grant Likely <[email protected]>
Cc G, Manjunath Kondaiah <[email protected]>
---
 arch/arm/boot/dts/omap4.dtsi |   79 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 79 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4.dtsi
arch/arm/boot/dts/omap4.dtsi new file +79 -0
new file mode 100644
index 0000000..d4131e3
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * Carveout for multimedia usecases
+ * It should be the last 48MB of the first 512MB memory part
+ * In theory, it should not even exist. That zone should be reserved
+ * dynamically during the .reserve callback.
+ */
+/memreserve/ 0x9d000000 0x03000000;
+
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "ti,omap4430", "ti,omap4";
+	interrupt-parent = <&gic>;
+
+	aliases {
+	};
+
+	/*
+	 * The soc node represents the soc top level view. It is uses for IPs
+	 * that are not memory mapped in the MPU view or for the MPU itself.
+	 */
+	soc {
+		compatible = "ti,omap-infra";
+	};
+
+	/*
+	 * XXX: Use a flat representation of the OMAP4 interconnect.
+	 * The real OMAP interconnect network is quite complex.
+	 *
+	 * MPU -+-- MPU_PRIVATE - GIC, L2
+	 *      |
+	 *      +----------------+----------+
+	 *      |                |          |
+	 *      +            +- EMIF - DDR  |
+	 *      |            |              |
+	 *      |            +     +--------+
+	 *      |            |     |
+	 *      |            +- L4_ABE - AESS, MCBSP, TIMERs...
+	 *      |            |
+	 *      +- L3_MAIN --+- L4_CORE - IPs...
+	 *                   |
+	 *                   +- L4_PER - IPs...
+	 *                   |
+	 *                   +- L4_CFG -+- L4_WKUP - IPs...
+	 *                   |          |
+	 *                   |          +- IPs...
+	 *                   +- IPU ----+
+	 *                   |          |
+	 *                   +- DSP ----+
+	 *                   |          |
+	 *                   +- DSS ----+
+	 *
+	 * Since that will not bring real advantage to represent that in DT for
+	 * the moment, just use a fake OCP bus entry to represent the whole bus
+	 * hierarchy.
+	 */
+	ocp {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		gic: interrupt-controller at 48241000 {
+			compatible = "arm,cortex-a9-gic";
+			interrupt-controller;
+			#interrupt-cells = <1>;
+			reg = <0x48241000 0x1000>,
+			      <0x48240100 0x0100>;
+		};
+	};
+};
Signature · 1 line
1.7.0.4
#10 lore raw

PATCH 3/11 arm/dts: Add support for OMAP4 PandaBoard

In reply to Benoit Cousson

Based on the original omap4-panda.dts file from Manju.
http://www.spinics.net/lists/linux-omap/msg55836.html

Add memory information and a default bootargs to allow a boot from RAMDISK.

Cc Grant Likely <[email protected]>
Cc G, Manjunath Kondaiah <[email protected]>
---
 arch/arm/boot/dts/omap4-panda.dts |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4-panda.dts
arch/arm/boot/dts/omap4-panda.dts new file +29 -0
new file mode 100644
index 0000000..c702657
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+/dts-v1/;
+
+/include/ "omap4.dtsi"
+
+/ {
+	model = "TI OMAP4 PandaBoard";
+	compatible = "ti,omap4-panda", "ti,omap4430", "ti,omap4";
+
+	/*
+	 * Since the initial device tree board file does not create any
+	 * devices (MMC, network...), the only way to boot is to provide a
+	 * ramdisk.
+	 */
+	chosen {
+		bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x40000000>; /* 1 GB */
+	};
+};
Signature · 1 line
1.7.0.4
#11 lore raw

PATCH 3/11 arm/dts: Add support for OMAP4 PandaBoard

Quoted 32 lines · Benoit Cousson

Based on the original omap4-panda.dts file from Manju.
http://www.spinics.net/lists/linux-omap/msg55836.html

Add memory information and a default bootargs to allow a boot from RAMDISK.

Cc Grant Likely <[email protected]>
Cc G, Manjunath Kondaiah <[email protected]>
---
 arch/arm/boot/dts/omap4-panda.dts |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4-panda.dts
arch/arm/boot/dts/omap4-panda.dts new file +12 -0
new file mode 100644
index 0000000..c702657
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+/dts-v1/;
+
+/include/ "omap4.dtsi"
+
+/ {

arch/arm/boot/dts/omap4-panda.dts line 22

Quoted 10 lines
arch/arm/boot/dts/omap4-panda.dts new file +10 -0
+	model = "TI OMAP4 PandaBoard";
+	compatible = "ti,omap4-panda", "ti,omap4430", "ti,omap4";
+
+	/*
+	 * Since the initial device tree board file does not create any
+	 * devices (MMC, network...), the only way to boot is to provide a
+	 * ramdisk.
+	 */
+	chosen {
+		bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug";

Generally, we don't want bootargs in the .dts files; we want them added to the .dtb by the boot firmware. However, we are bootstrapping here, so I'm okay with it in the short term until firmware matures a bit more.

Quoted 10 lines
arch/arm/boot/dts/omap4-panda.dts new file +7 -0
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x40000000>; /* 1 GB */
+	};
+};
Signature · 1 line
1.7.0.4
#12 lore raw

PATCH 3/11 arm/dts: Add support for OMAP4 PandaBoard

Quoted 40 lines · Grant Likely
Quoted 39 lines · Benoit Cousson

Based on the original omap4-panda.dts file from Manju.
http://www.spinics.net/lists/linux-omap/msg55836.html

Add memory information and a default bootargs to allow a boot from RAMDISK.

Cc Grant Likely<[email protected]>
Cc G, Manjunath Kondaiah<[email protected]>
---
  arch/arm/boot/dts/omap4-panda.dts |   29 +++++++++++++++++++++++++++++
  1 files changed, 29 insertions(+), 0 deletions(-)

create mode 100644 arch/arm/boot/dts/omap4-panda.dts

arch/arm/boot/dts/omap4-panda.dts new file +19 -0
new file mode 100644
index 0000000..c702657
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+/dts-v1/;
+
+/include/ "omap4.dtsi"
+
+/ {
+	model = "TI OMAP4 PandaBoard";
+	compatible = "ti,omap4-panda", "ti,omap4430", "ti,omap4";
+
+	/*
+	 * Since the initial device tree board file does not create any
+	 * devices (MMC, network...), the only way to boot is to provide a
+	 * ramdisk.
Quoted 8 lines

arch/arm/boot/dts/omap4-panda.dts line 22

Quoted 3 lines
arch/arm/boot/dts/omap4-panda.dts new file +3 -0
+	 */
+	chosen {
+		bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug";

Generally, we don't want bootargs in the .dts files; we want them added to the .dtb by the boot firmware. However, we are bootstrapping here, so I'm okay with it in the short term until firmware matures a bit more.

Yeah, I had to to that because an old uboot with appended dtb seems to ignore the original bootargs.

Benoit

#13 lore raw

PATCH 4/11 arm/dts: Add support for OMAP4 SDP board

In reply to Benoit Cousson

Add the SDP/Blaze (Software Development Board) support with device tree.
That file is based on the omap4-panda.dts.

Cc Grant Likely <[email protected]>
Cc G, Manjunath Kondaiah <[email protected]>
---
 arch/arm/boot/dts/omap4-sdp.dts |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4-sdp.dts
arch/arm/boot/dts/omap4-sdp.dts new file +29 -0
new file mode 100644
index 0000000..066e28c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+/dts-v1/;
+
+/include/ "omap4.dtsi"
+
+/ {
+	model = "TI OMAP4 SDP board";
+	compatible = "ti,omap4-sdp", "ti,omap4430", "ti,omap4";
+
+	/*
+	 * Since the initial device tree board file does not create any
+	 * devices (MMC, network...), the only way to boot is to provide a
+	 * ramdisk.
+	 */
+	chosen {
+		bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x40000000>; /* 1 GB */
+	};
+};
Signature · 1 line
1.7.0.4
#14 lore raw

PATCH 5/11 arm/dts: Add initial device tree support for OMAP3 SoC

In reply to Benoit Cousson

Add initial OMAP3 soc file with empty ocp bus.

Based on initial patch from Manju:
http://www.spinics.net/lists/linux-omap/msg55830.html

Cc Grant Likely <[email protected]>
Cc G, Manjunath Kondaiah <[email protected]>
---
 arch/arm/boot/dts/omap3.dtsi |   44 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap3.dtsi
arch/arm/boot/dts/omap3.dtsi new file +44 -0
new file mode 100644
index 0000000..d558785
@@ -0,0 +1,44 @@
+/*
+ * Device Tree Source for OMAP3 SoC
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "ti,omap3430", "ti,omap3";
+
+	/*
+	 * The soc node represents the soc top level view. It is uses for IPs
+	 * that are not memory mapped in the MPU view or for the MPU itself.
+	 */
+	soc {
+		compatible = "ti,omap-infra";
+	};
+
+	/*
+	 * XXX: Use a flat representation of the OMAP3 interconnect.
+	 * The real OMAP interconnect network is quite complex.
+	 * Since that will not bring real advantage to represent that in DT for
+	 * the moment, just use a fake OCP bus entry to represent the whole bus
+	 * hierarchy.
+	 */
+	ocp {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		ti,hwmods = "l3_main";
+
+		intc: interrupt-controller at 1 {
+			compatible = "ti,omap3-intc";
+			interrupt-controller;
+			#interrupt-cells = <1>;
+		};
+	};
+};
Signature · 1 line
1.7.0.4
#15 lore raw

PATCH 6/11 arm/dts: Add support for OMAP3 Beagle board

In reply to Benoit Cousson

Add OMAP3 beagleboard DTS file to use the omap3.dtsi SoC file.

Add a default bootargs line to allow a boot from RAMDISK

Add memory node information.

Cc G, Manjunath Kondaiah <[email protected]>
---
 arch/arm/boot/dts/omap3-beagle.dts |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap3-beagle.dts
arch/arm/boot/dts/omap3-beagle.dts new file +29 -0
new file mode 100644
index 0000000..9486be6
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+/dts-v1/;
+
+/include/ "omap3.dtsi"
+
+/ {
+	model = "TI OMAP3 BeagleBoard";
+	compatible = "ti,omap3-beagle", "ti,omap3";
+
+	/*
+	 * Since the initial device tree board file does not create any
+	 * devices (MMC, network...), the only way to boot is to provide a
+	 * ramdisk.
+	 */
+	chosen {
+		bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug earlyprintk";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x80000000 0x20000000>; /* 512 MB */
+	};
+};
Signature · 1 line
1.7.0.4
#16 lore raw

PATCH 7/11 OMAP2+: board-generic: Add DT support to generic board

In reply to Benoit Cousson

Re-cycle the original board-generic file to support Device Tree for every OMAP2+ variants.
Note: Since it is a completely new content in the existing file I removed the original copyright.

The current approach is an intermediate step before having only one machine descriptor that will use some generic DT aware functions.

---
 arch/arm/mach-omap2/Kconfig         |    8 ++-
 arch/arm/mach-omap2/board-generic.c |  129 ++++++++++++++++++++++------------
 2 files changed, 89 insertions(+), 48 deletions(-)
arch/arm/mach-omap2/Kconfig +6 -2
index 7edf802..5934a27 100644
@@ -106,9 +106,13 @@ comment "OMAP Board Type"
 	depends on ARCH_OMAP2PLUS
 
 config MACH_OMAP_GENERIC
-	bool "Generic OMAP board"
-	depends on ARCH_OMAP2
+	bool "Generic OMAP2+ board"
+	depends on ARCH_OMAP2PLUS
+	select USE_OF
 	default y
+	help
+	  Support for generic TI OMAP2+ boards using Flattened Device Tree.
+	  More information at Documentation/devicetree
 
 config MACH_OMAP2_TUSB6010
 	bool
arch/arm/mach-omap2/board-generic.c +83 -46

159 lines not on this page · raw message

Signature · 1 line
1.7.0.4
maintainer
#17 lore raw

PATCH 7/11 OMAP2+: board-generic: Add DT support to generic board

Quoted 4 lines · Benoit Cousson

Re-cycle the original board-generic file to support Device Tree for every OMAP2+ variants.
Note: Since it is a completely new content in the existing file I removed the original copyright.

I'd suggest just keeping it, maybe just update the comments accordingly?

That's because Copyrights in general just don't "disappear".

And the meaning of the board-generic is still the same as originally, that is do the booting based on board-specific data passed from the bootloader like the comments say:

Quoted 5 lines

- * Code for generic OMAP2 board. Should work on many OMAP2 systems where
- * the bootloader passes the board-specific data to the kernel.
- * Do not put any board specific code to this file; create a new machine
- * type if you need custom low-level initializations.
+ * Support for generic OMAP2+ device tree boards.

Regards,

Tony

#18 lore raw

PATCH 7/11 OMAP2+: board-generic: Add DT support to generic board

Quoted 8 lines · Tony Lindgren
Quoted 4 lines · Benoit Cousson

Re-cycle the original board-generic file to support Device Tree for every OMAP2+ variants.
Note: Since it is a completely new content in the existing file I removed the original copyright.

I'd suggest just keeping it, maybe just update the comments accordingly?

Do you mean keeping it and adding the comment? Or removing it and adding the comment?

Quoted 1 line

That's because Copyrights in general just don't "disappear".

OK, maybe, but I thought it is weird to keep an old copyright just because we re-use an already existing file since the content is different.

Quoted 9 lines

And the meaning of the board-generic is still the same as originally, that is do the booting based on board-specific data passed from the bootloader like the comments say:

Quoted 5 lines

- * Code for generic OMAP2 board. Should work on many OMAP2 systems where
- * the bootloader passes the board-specific data to the kernel.
- * Do not put any board specific code to this file; create a new machine
- * type if you need custom low-level initializations.
+ * Support for generic OMAP2+ device tree boards.

Regards,
Benoit

maintainer
#19 lore raw

PATCH 7/11 OMAP2+: board-generic: Add DT support to generic board

Quoted 7 lines · Cousson, Benoit
Quoted 6 lines · Tony Lindgren
Quoted 4 lines · Benoit Cousson

Re-cycle the original board-generic file to support Device Tree for every OMAP2+ variants.
Note: Since it is a completely new content in the existing file I removed the original copyright.

Quoted 5 lines
Quoted 2 lines

I'd suggest just keeping it, maybe just update the comments accordingly?

Do you mean keeping it and adding the comment? Or removing it and adding the comment?

Maybe just update the comment accordingly for DT?

Quoted 5 lines
Quoted 1 line

That's because Copyrights in general just don't "disappear".

OK, maybe, but I thought it is weird to keep an old copyright just because we re-use an already existing file since the content is different.

Yeah.. But it's still a good idea not to mess with the copyrights as as you would need permissions from the copyright holders.

Regards,

Tony

#20 lore raw

PATCH 7/11 OMAP2+: board-generic: Add DT support to generic board

In reply to Benoit Cousson

Hi Benoit,

Quoted 8 lines · Benoit Cousson

Re-cycle the original board-generic file to support Device Tree for every OMAP2+ variants.
Note: Since it is a completely new content in the existing file I removed the original copyright.

The current approach is an intermediate step before having only one machine descriptor that will use some generic DT aware functions.

What config does this work with currently? If I use omap2plus_defconfig should I explicitly disable everything other than say CONFIG_ARCH_OMAP4 if I want it working on OMAP4?

regards,
Rajendra

Quoted 192 lines
---
  arch/arm/mach-omap2/Kconfig         |    8 ++-
  arch/arm/mach-omap2/board-generic.c |  129 ++++++++++++++++++++++------------
  2 files changed, 89 insertions(+), 48 deletions(-)
arch/arm/mach-omap2/Kconfig +6 -2
index 7edf802..5934a27 100644
@@ -106,9 +106,13 @@ comment "OMAP Board Type"
  	depends on ARCH_OMAP2PLUS
 
  config MACH_OMAP_GENERIC
-	bool "Generic OMAP board"
-	depends on ARCH_OMAP2
+	bool "Generic OMAP2+ board"
+	depends on ARCH_OMAP2PLUS
+	select USE_OF
  	default y
+	help
+	  Support for generic TI OMAP2+ boards using Flattened Device Tree.
+	  More information at Documentation/devicetree
 
  config MACH_OMAP2_TUSB6010
  	bool
arch/arm/mach-omap2/board-generic.c +83 -46
index e8d45d3..dcbd64c 100644
@@ -1,76 +1,113 @@
  /*
- * linux/arch/arm/mach-omap2/board-generic.c
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
   *
- * Copyright (C) 2005 Nokia Corporation
- * Author: Paul Mundt<[email protected]>
- *
- * Modified from mach-omap/omap1/board-generic.c
- *
- * Code for generic OMAP2 board. Should work on many OMAP2 systems where
- * the bootloader passes the board-specific data to the kernel.
- * Do not put any board specific code to this file; create a new machine
- * type if you need custom low-level initializations.
+ * Support for generic OMAP2+ device tree boards.
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 
-#include<linux/kernel.h>
-#include<linux/init.h>
-#include<linux/device.h>
+#include<linux/io.h>
+#include<linux/of_platform.h>
+#include<linux/irqdomain.h>
 
  #include<mach/hardware.h>
-#include<asm/mach-types.h>
  #include<asm/mach/arch.h>
-#include<asm/mach/map.h>
 
-#include<mach/gpio.h>
-#include<plat/usb.h>
  #include<plat/board.h>
  #include<plat/common.h>
+#include<mach/omap4-common.h>
 
-static struct omap_board_config_kernel generic_config[] = {
+
+static struct of_device_id omap_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ .compatible = "ti,omap-infra", },
+	{ }
  };
 
-static void __init omap_generic_init_early(void)
-{
-	omap2_init_common_infrastructure();
-}
+static struct of_device_id intc_match[] __initdata = {
+	{ .compatible = "ti,omap3-intc", },
+	{ .compatible = "arm,cortex-a9-gic", },
+	{ }
+};
 
  static void __init omap_generic_init(void)
  {
+	struct device_node *node = of_find_matching_node(NULL, intc_match);
+	if (node)
+		irq_domain_add_simple(node, 0);
+
  	omap_serial_init();
  	omap_sdrc_init(NULL, NULL);
-	omap_board_config = generic_config;
-	omap_board_config_size = ARRAY_SIZE(generic_config);
-}
 
-static void __init omap_generic_map_io(void)
-{
-	if (cpu_is_omap242x()) {
-		omap2_set_globals_242x();
-		omap242x_map_common_io();
-	} else if (cpu_is_omap243x()) {
-		omap2_set_globals_243x();
-		omap243x_map_common_io();
-	} else if (cpu_is_omap34xx()) {
-		omap2_set_globals_3xxx();
-		omap34xx_map_common_io();
-	} else if (cpu_is_omap44xx()) {
-		omap2_set_globals_443x();
-		omap44xx_map_common_io();
-	}
+	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
  }
 
-/* XXX This machine entry name should be updated */
-MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
-	/* Maintainer: Paul Mundt<[email protected]>  */
-	.atag_offset	= 0x100,
+#if defined(CONFIG_SOC_OMAP2420)
+static const char *omap242x_boards_compat[] __initdata = {
+	"ti,omap2420",
+	NULL,
+};
+
+DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
  	.reserve	= omap_reserve,
-	.map_io		= omap_generic_map_io,
-	.init_early	= omap_generic_init_early,
+	.map_io		= omap242x_map_io,
+	.init_early	= omap2420_init_early,
  	.init_irq	= omap2_init_irq,
  	.init_machine	= omap_generic_init,
  	.timer		=&omap2_timer,
+	.dt_compat	= omap242x_boards_compat,
+MACHINE_END
+#endif
+
+#if defined(CONFIG_SOC_OMAP2430)
+static const char *omap243x_boards_compat[] __initdata = {
+	"ti,omap2430",
+	NULL,
+};
+
+DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
+	.reserve	= omap_reserve,
+	.map_io		= omap243x_map_io,
+	.init_early	= omap2430_init_early,
+	.init_irq	= omap2_init_irq,
+	.init_machine	= omap_generic_init,
+	.timer		=&omap2_timer,
+	.dt_compat	= omap243x_boards_compat,
+MACHINE_END
+#endif
+
+#if defined(CONFIG_ARCH_OMAP3)
+static const char *omap3_boards_compat[] __initdata = {
+	"ti,omap3",
+	NULL,
+};
+
+DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
+	.reserve	= omap_reserve,
+	.map_io		= omap3_map_io,
+	.init_early	= omap3430_init_early,
+	.init_irq	= omap3_init_irq,
+	.init_machine	= omap_generic_init,
+	.timer		=&omap3_timer,
+	.dt_compat	= omap3_boards_compat,
+MACHINE_END
+#endif
+
+#if defined(CONFIG_ARCH_OMAP4)
+static const char *omap4_boards_compat[] __initdata = {
+	"ti,omap4",
+	NULL,
+};
+
+DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
+	.reserve	= omap_reserve,
+	.map_io		= omap4_map_io,
+	.init_early	= omap4430_init_early,
+	.init_irq	= gic_init_irq,
+	.init_machine	= omap_generic_init,
+	.timer		=&omap4_timer,
+	.dt_compat	= omap4_boards_compat,
  MACHINE_END
+#endif
#21 lore raw

PATCH 7/11 OMAP2+: board-generic: Add DT support to generic board

Quoted 8 lines · Rajendra

Hi Benoit,

Quoted 5 lines · Benoit Cousson

Re-cycle the original board-generic file to support Device Tree for every OMAP2+ variants.
Note: Since it is a completely new content in the existing file I removed the original copyright.

Quoted 7 lines
Quoted 3 lines

The current approach is an intermediate step before having only one machine descriptor that will use some generic DT aware functions.

What config does this work with currently? If I use omap2plus_defconfig should I explicitly disable everything other than say CONFIG_ARCH_OMAP4 if I want it working on OMAP4?

Nope, in theory, omap2plus_defconfig should work as usual:-) If uboot does not provide and dtb, then the legacy board file will be used. If a dtb is present then only the board-generic can match with the DT mechanism.

Regards,
Benoit

Quoted 197 lines

regards,
Rajendra

Quoted 192 lines
---
   arch/arm/mach-omap2/Kconfig         |    8 ++-
   arch/arm/mach-omap2/board-generic.c |  129 ++++++++++++++++++++++------------
   2 files changed, 89 insertions(+), 48 deletions(-)
arch/arm/mach-omap2/Kconfig +6 -2
index 7edf802..5934a27 100644
@@ -106,9 +106,13 @@ comment "OMAP Board Type"
   	depends on ARCH_OMAP2PLUS
 
   config MACH_OMAP_GENERIC
-	bool "Generic OMAP board"
-	depends on ARCH_OMAP2
+	bool "Generic OMAP2+ board"
+	depends on ARCH_OMAP2PLUS
+	select USE_OF
   	default y
+	help
+	  Support for generic TI OMAP2+ boards using Flattened Device Tree.
+	  More information at Documentation/devicetree
 
   config MACH_OMAP2_TUSB6010
   	bool
arch/arm/mach-omap2/board-generic.c +83 -46
index e8d45d3..dcbd64c 100644
@@ -1,76 +1,113 @@
   /*
- * linux/arch/arm/mach-omap2/board-generic.c
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
    *
- * Copyright (C) 2005 Nokia Corporation
- * Author: Paul Mundt<[email protected]>
- *
- * Modified from mach-omap/omap1/board-generic.c
- *
- * Code for generic OMAP2 board. Should work on many OMAP2 systems where
- * the bootloader passes the board-specific data to the kernel.
- * Do not put any board specific code to this file; create a new machine
- * type if you need custom low-level initializations.
+ * Support for generic OMAP2+ device tree boards.
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License version 2 as
    * published by the Free Software Foundation.
    */
 
-#include<linux/kernel.h>
-#include<linux/init.h>
-#include<linux/device.h>
+#include<linux/io.h>
+#include<linux/of_platform.h>
+#include<linux/irqdomain.h>
 
   #include<mach/hardware.h>
-#include<asm/mach-types.h>
   #include<asm/mach/arch.h>
-#include<asm/mach/map.h>
 
-#include<mach/gpio.h>
-#include<plat/usb.h>
   #include<plat/board.h>
   #include<plat/common.h>
+#include<mach/omap4-common.h>
 
-static struct omap_board_config_kernel generic_config[] = {
+
+static struct of_device_id omap_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ .compatible = "ti,omap-infra", },
+	{ }
   };
 
-static void __init omap_generic_init_early(void)
-{
-	omap2_init_common_infrastructure();
-}
+static struct of_device_id intc_match[] __initdata = {
+	{ .compatible = "ti,omap3-intc", },
+	{ .compatible = "arm,cortex-a9-gic", },
+	{ }
+};
 
   static void __init omap_generic_init(void)
   {
+	struct device_node *node = of_find_matching_node(NULL, intc_match);
+	if (node)
+		irq_domain_add_simple(node, 0);
+
   	omap_serial_init();
   	omap_sdrc_init(NULL, NULL);
-	omap_board_config = generic_config;
-	omap_board_config_size = ARRAY_SIZE(generic_config);
-}
 
-static void __init omap_generic_map_io(void)
-{
-	if (cpu_is_omap242x()) {
-		omap2_set_globals_242x();
-		omap242x_map_common_io();
-	} else if (cpu_is_omap243x()) {
-		omap2_set_globals_243x();
-		omap243x_map_common_io();
-	} else if (cpu_is_omap34xx()) {
-		omap2_set_globals_3xxx();
-		omap34xx_map_common_io();
-	} else if (cpu_is_omap44xx()) {
-		omap2_set_globals_443x();
-		omap44xx_map_common_io();
-	}
+	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
   }
 
-/* XXX This machine entry name should be updated */
-MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
-	/* Maintainer: Paul Mundt<[email protected]>   */
-	.atag_offset	= 0x100,
+#if defined(CONFIG_SOC_OMAP2420)
+static const char *omap242x_boards_compat[] __initdata = {
+	"ti,omap2420",
+	NULL,
+};
+
+DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
   	.reserve	= omap_reserve,
-	.map_io		= omap_generic_map_io,
-	.init_early	= omap_generic_init_early,
+	.map_io		= omap242x_map_io,
+	.init_early	= omap2420_init_early,
   	.init_irq	= omap2_init_irq,
   	.init_machine	= omap_generic_init,
   	.timer		=&omap2_timer,
+	.dt_compat	= omap242x_boards_compat,
+MACHINE_END
+#endif
+
+#if defined(CONFIG_SOC_OMAP2430)
+static const char *omap243x_boards_compat[] __initdata = {
+	"ti,omap2430",
+	NULL,
+};
+
+DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
+	.reserve	= omap_reserve,
+	.map_io		= omap243x_map_io,
+	.init_early	= omap2430_init_early,
+	.init_irq	= omap2_init_irq,
+	.init_machine	= omap_generic_init,
+	.timer		=&omap2_timer,
+	.dt_compat	= omap243x_boards_compat,
+MACHINE_END
+#endif
+
+#if defined(CONFIG_ARCH_OMAP3)
+static const char *omap3_boards_compat[] __initdata = {
+	"ti,omap3",
+	NULL,
+};
+
+DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
+	.reserve	= omap_reserve,
+	.map_io		= omap3_map_io,
+	.init_early	= omap3430_init_early,
+	.init_irq	= omap3_init_irq,
+	.init_machine	= omap_generic_init,
+	.timer		=&omap3_timer,
+	.dt_compat	= omap3_boards_compat,
+MACHINE_END
+#endif
+
+#if defined(CONFIG_ARCH_OMAP4)
+static const char *omap4_boards_compat[] __initdata = {
+	"ti,omap4",
+	NULL,
+};
+
+DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
+	.reserve	= omap_reserve,
+	.map_io		= omap4_map_io,
+	.init_early	= omap4430_init_early,
+	.init_irq	= gic_init_irq,
+	.init_machine	= omap_generic_init,
+	.timer		=&omap4_timer,
+	.dt_compat	= omap4_boards_compat,
   MACHINE_END
+#endif
#22 lore raw

PATCH 8/11 OMAP2+: board-generic: Add i2c static init

In reply to Benoit Cousson

Still needed to boot until the i2c & twl driver is adapted to device-tree. Otherwise the voltage control code will try to access the twl and crash.

---
 arch/arm/mach-omap2/board-generic.c |   41 +++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/board-generic.c +39 -2
index dcbd64c..1186a76 100644
@@ -11,6 +11,7 @@
 #include <linux/io.h>
 #include <linux/of_platform.h>
 #include <linux/irqdomain.h>
+#include <linux/i2c/twl.h>
 
 #include <mach/hardware.h>
 #include <asm/mach/arch.h>
@@ -18,7 +19,31 @@
 #include <plat/board.h>
 #include <plat/common.h>
 #include <mach/omap4-common.h>
+#include "common-board-devices.h"
 
+/*
+ * XXX: Still needed to boot until the i2c & twl driver is adapted to
+ * device-tree
+ */
+static struct twl4030_platform_data sdp4430_twldata = {
+	.irq_base	= TWL6030_IRQ_BASE,
+	.irq_end	= TWL6030_IRQ_END,
+};
+
+static void __init omap4_i2c_init(void)
+{
+	omap4_pmic_init("twl6030", &sdp4430_twldata);
+}
+
+static struct twl4030_platform_data beagle_twldata = {
+	.irq_base	= TWL4030_IRQ_BASE,
+	.irq_end	= TWL4030_IRQ_END,
+};
+
+static void __init omap3_i2c_init(void)
+{
+	omap3_pmic_init("twl4030", &beagle_twldata);
+}
 
 static struct of_device_id omap_dt_match_table[] __initdata = {
 	{ .compatible = "simple-bus", },
@@ -44,6 +69,18 @@ static void __init omap_generic_init(void)
 	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
 }
 
+static void __init omap4_init(void)
+{
+	omap4_i2c_init();
+	omap_generic_init();
+}
+
+static void __init omap3_init(void)
+{
+	omap3_i2c_init();
+	omap_generic_init();
+}
+
 #if defined(CONFIG_SOC_OMAP2420)
 static const char *omap242x_boards_compat[] __initdata = {
 	"ti,omap2420",
@@ -89,7 +126,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
 	.map_io		= omap3_map_io,
 	.init_early	= omap3430_init_early,
 	.init_irq	= omap3_init_irq,
-	.init_machine	= omap_generic_init,
+	.init_machine	= omap3_init,
 	.timer		= &omap3_timer,
 	.dt_compat	= omap3_boards_compat,
 MACHINE_END
@@ -106,7 +143,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
 	.map_io		= omap4_map_io,
 	.init_early	= omap4430_init_early,
 	.init_irq	= gic_init_irq,
-	.init_machine	= omap_generic_init,
+	.init_machine	= omap4_init,
 	.timer		= &omap4_timer,
 	.dt_compat	= omap4_boards_compat,
 MACHINE_END
Signature · 1 line
1.7.0.4
maintainer
#23 lore raw

PATCH 8/11 OMAP2+: board-generic: Add i2c static init

Quoted 3 lines · Benoit Cousson

Still needed to boot until the i2c & twl driver is adapted to device-tree. Otherwise the voltage control code will try to access the twl and crash.

That sounds OK to me for now. For merging these patches, how about the following:

- Kevin queues up the omap_device related changes

- Grant queues up the .dts changes

- I'll queue the map_io and board changes based on Kevin's omap_device changes

Regards,

Tony

#24 lore raw

PATCH 8/11 OMAP2+: board-generic: Add i2c static init

Quoted 8 lines · Tony Lindgren
Quoted 3 lines · Benoit Cousson

Still needed to boot until the i2c & twl driver is adapted to device-tree. Otherwise the voltage control code will try to access the twl and crash.

That sounds OK to me for now. For merging these patches, how about the following:

Quoted 6 lines

- Kevin queues up the omap_device related changes

- Grant queues up the .dts changes

- I'll queue the map_io and board changes based on Kevin's omap_device changes

Go ahead and queue up the .dts changes in your tree. No need to split them up.

g.

maintainer
#25 lore raw

PATCH 8/11 OMAP2+: board-generic: Add i2c static init

Quoted 9 lines · Grant Likely
Quoted 8 lines · Tony Lindgren
Quoted 3 lines · Benoit Cousson

Still needed to boot until the i2c & twl driver is adapted to device-tree. Otherwise the voltage control code will try to access the twl and crash.

That sounds OK to me for now. For merging these patches, how about the following:

Quoted 8 lines
Quoted 6 lines

- Kevin queues up the omap_device related changes

- Grant queues up the .dts changes

- I'll queue the map_io and board changes based on Kevin's omap_device changes

Go ahead and queue up the .dts changes in your tree. No need to split them up.

OK, will do.

Thanks,

Tony

#26 lore raw

PATCH 9/11 OMAP2+: l3-noc: Add support for device-tree

In reply to Benoit Cousson

Add device-tree support for the l3-noc driver.

Use platform_driver_register to defer the probing at device init time.

Add documentation for the l3-noc bindings.

Cc Tony Lindgren <[email protected]>
Cc Santosh Shilimkar <[email protected]>
---
 .../devicetree/bindings/arm/omap/l3-noc.txt        |   19 ++++++++++++++++
 arch/arm/mach-omap2/omap_l3_noc.c                  |   23 +++++++++++++++----
 2 files changed, 37 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/omap/l3-noc.txt
Documentation/devicetree/bindings/arm/omap/l3-noc.txt new file +19 -0
new file mode 100644
index 0000000..6888a5e
@@ -0,0 +1,19 @@
+* TI - L3 Network On Chip (NoC)
+
+This version is an implementation of the generic NoC IP
+provided by Arteris.
+
+Required properties:
+- compatible : Should be "ti,omap3-l3-smx" for OMAP3 family
+               Should be "ti,omap4-l3-noc" for OMAP4 family
+- ti,hwmods: "l3_main_1", ... One hwmod for each noc domain.
+
+Examples:
+
+ocp {
+	compatible = "ti,omap4-l3-noc", "simple-bus";
+	#address-cells = <1>;
+	#size-cells = <1>;
+	ranges;
+	ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
+};
arch/arm/mach-omap2/omap_l3_noc.c +18 -5
index 7b9f190..d618c9d 100644
@@ -120,7 +120,7 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
 	return IRQ_HANDLED;
 }
 
-static int __init omap4_l3_probe(struct platform_device *pdev)
+static int __devinit omap4_l3_probe(struct platform_device *pdev)
 {
 	static struct omap4_l3		*l3;
 	struct resource		*res;
@@ -214,7 +214,7 @@ err0:
 	return ret;
 }
 
-static int __exit omap4_l3_remove(struct platform_device *pdev)
+static int __devexit omap4_l3_remove(struct platform_device *pdev)
 {
 	struct omap4_l3         *l3 = platform_get_drvdata(pdev);
 
@@ -228,16 +228,29 @@ static int __exit omap4_l3_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#if defined(CONFIG_OF)
+static const struct of_device_id l3_noc_match[] = {
+	{.compatible = "ti,omap4-l3-noc", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, l3_noc_match);
+#else
+#define l3_noc_match NULL
+#endif
+
 static struct platform_driver omap4_l3_driver = {
-	.remove		= __exit_p(omap4_l3_remove),
+	.probe		= omap4_l3_probe,
+	.remove		= __devexit_p(omap4_l3_remove),
 	.driver		= {
-	.name		= "omap_l3_noc",
+		.name		= "omap_l3_noc",
+		.owner		= THIS_MODULE,
+		.of_match_table = l3_noc_match,
 	},
 };
 
 static int __init omap4_l3_init(void)
 {
-	return platform_driver_probe(&omap4_l3_driver, omap4_l3_probe);
+	return platform_driver_register(&omap4_l3_driver);
 }
 postcore_initcall_sync(omap4_l3_init);
 
Signature · 1 line
1.7.0.4
#27 lore raw

PATCH 10/11 arm/dts: OMAP4: Add a main ocp entry bound to l3-noc driver

In reply to Benoit Cousson

Used the main OCP node to add bindings with the l3_noc driver. Remove l3_noc static device creation if DT is populated.

Cc Tony Lindgren <[email protected]>
Cc Santosh Shilimkar <[email protected]>
---
 arch/arm/boot/dts/omap4.dtsi  |    3 ++-
 arch/arm/mach-omap2/devices.c |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/boot/dts/omap4.dtsi +2 -1
index d4131e3..b85a39d 100644
@@ -63,10 +63,11 @@
 	 * hierarchy.
 	 */
 	ocp {
-		compatible = "simple-bus";
+		compatible = "ti,omap4-l3-noc", "simple-bus";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges;
+		ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
 
 		gic: interrupt-controller at 48241000 {
 			compatible = "arm,cortex-a9-gic";
arch/arm/mach-omap2/devices.c +5 -0
index 2d4a199..0f8e0eb 100644
@@ -16,6 +16,7 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
@@ -77,6 +78,10 @@ static int __init omap4_l3_init(void)
 	struct platform_device *pdev;
 	char oh_name[L3_MODULES_MAX_LEN];
 
+	/* If dtb is there, the devices will be created dynamically */
+	if (of_have_populated_dt())
+		return -ENODEV;
+
 	/*
 	 * To avoid code running on other OMAPs in
 	 * multi-omap builds
Signature · 1 line
1.7.0.4
maintainer
#28 lore raw

PATCH 10/11 arm/dts: OMAP4: Add a main ocp entry bound to l3-noc driver

Quoted 13 lines · Benoit Cousson

Used the main OCP node to add bindings with the l3_noc driver. Remove l3_noc static device creation if DT is populated.

arch/arm/mach-omap2/devices.c +1 -0
@@ -16,6 +16,7 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>

arch/arm/mach-omap2/devices.c static int __init omap4_l3_init(void) · line 87

Quoted 10 lines
arch/arm/mach-omap2/devices.c +4 -0
@@ -77,6 +78,10 @@ static int __init omap4_l3_init(void)
 	struct platform_device *pdev;
 	char oh_name[L3_MODULES_MAX_LEN];
 
+	/* If dtb is there, the devices will be created dynamically */
+	if (of_have_populated_dt())
+		return -ENODEV;
+
 	/*
 	 * To avoid code running on other OMAPs in
 	 * multi-omap builds

How about just remove omap3_l3_init and omap4_l3_init completely instead?

There should not be any need for the platform glue code if the driver, it's OK for us to require that either DT is passed from the bootloader or as appended DT as soon as the appended DT patches are merged.

Regards,

Tony

#29 lore raw

PATCH 10/11 arm/dts: OMAP4: Add a main ocp entry bound to l3-noc driver

Quoted 28 lines · Tony Lindgren
Quoted 13 lines · Benoit Cousson

Used the main OCP node to add bindings with the l3_noc driver. Remove l3_noc static device creation if DT is populated.

arch/arm/mach-omap2/devices.c +1 -0
@@ -16,6 +16,7 @@
  #include<linux/clk.h>
  #include<linux/err.h>
  #include<linux/slab.h>
+#include<linux/of.h>
 
  #include<mach/hardware.h>
  #include<mach/irqs.h>

arch/arm/mach-omap2/devices.c static int __init omap4_l3_init(void) · line 87

Quoted 10 lines
arch/arm/mach-omap2/devices.c +4 -0
@@ -77,6 +78,10 @@ static int __init omap4_l3_init(void)
  	struct platform_device *pdev;
  	char oh_name[L3_MODULES_MAX_LEN];
 
+	/* If dtb is there, the devices will be created dynamically */
+	if (of_have_populated_dt())
+		return -ENODEV;
+
  	/*
  	 * To avoid code running on other OMAPs in
  	 * multi-omap builds

How about just remove omap3_l3_init and omap4_l3_init completely instead?

Quoted 4 lines

There should not be any need for the platform glue code if the driver, it's OK for us to require that either DT is passed from the bootloader or as appended DT as soon as the appended DT patches are merged.

Yeah, but we should still allow the others board files to work in case DT is not passed by the bootloader. Otherwise the DT support need to be added to every other boards, and in that case that generic board become useless. The effort / duplication will be much important if we start hacking every boards with some DT code in them.

Whereas that code is simple and will be removed easily when the DT migration will be completed.

Regards,
Benoit

maintainer
#30 lore raw

PATCH 10/11 arm/dts: OMAP4: Add a main ocp entry bound to l3-noc driver

Quoted 11 lines · Cousson, Benoit
Quoted 9 lines · Tony Lindgren

* Benoit Cousson<[email protected]> [110923 12:50]:

How about just remove omap3_l3_init and omap4_l3_init completely instead?

There should not be any need for the platform glue code if the driver, it's OK for us to require that either DT is passed from the bootloader or as appended DT as soon as the appended DT patches are merged.

Quoted 6 lines

Yeah, but we should still allow the others board files to work in case DT is not passed by the bootloader. Otherwise the DT support need to be added to every other boards, and in that case that generic board become useless. The effort / duplication will be much important if we start hacking every boards with some DT code in them.

OK..

Quoted 2 lines

Whereas that code is simple and will be removed easily when the DT migration will be completed.

..let's keep it around until we have board-generic booting and mounting root.

Regards,

Tony

#31 lore raw

PATCH 11/11 arm/dts: OMAP3+: Add mpu, dsp and iva nodes

In reply to Benoit Cousson

Add nodes for devices used by PM code (mpu, dsp, iva).

Add an empty cpus node as well as recommended in the DT spec.

Remove mpu, dsp, iva devices init if dt is populated.

Cc Grant Likely <[email protected]>
Cc Kevin Hilman <[email protected]>
---
 Documentation/devicetree/bindings/arm/omap/dsp.txt |   14 ++++++++++
 Documentation/devicetree/bindings/arm/omap/iva.txt |   19 ++++++++++++++
 Documentation/devicetree/bindings/arm/omap/mpu.txt |   27 ++++++++++++++++++++
 arch/arm/boot/dts/omap3.dtsi                       |   19 ++++++++++++++
 arch/arm/boot/dts/omap4.dtsi                       |   23 +++++++++++++++++
 arch/arm/mach-omap2/pm.c                           |    3 +-
 6 files changed, 104 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/omap/dsp.txt
 create mode 100644 Documentation/devicetree/bindings/arm/omap/iva.txt
 create mode 100644 Documentation/devicetree/bindings/arm/omap/mpu.txt
Documentation/devicetree/bindings/arm/omap/dsp.txt new file +14 -0
new file mode 100644
index 0000000..325feef
@@ -0,0 +1,14 @@
+* TI - DSP (Digital Signal Processor)
+
+TI DSP included in OMAP SoC
+
+Required properties:
+- compatible : Should be "ti,omap3-c64" for OMAP3 & 4
+- ti,hwmods: "dsp"
+
+Examples:
+
+dsp {
+    compatible = "ti,omap3-c64";
+    ti,hwmods = "dsp";
+};
Documentation/devicetree/bindings/arm/omap/iva.txt new file +19 -0
new file mode 100644
index 0000000..b889475
@@ -0,0 +1,19 @@
+* TI - IVA (Imaging and Video Accelerator) subsystem
+
+The IVA contain various audio, video or imaging HW accelerator
+depending of the version.
+
+Required properties:
+- compatible : Should be:
+  - "ti,ivahd" for OMAP4
+  - "ti,iva2.2" for OMAP3
+  - "ti,iva2.1" for OMAP2430
+  - "ti,iva1" for OMAP2420
+- ti,hwmods: "iva"
+
+Examples:
+
+iva {
+    compatible = "ti,ivahd", "ti,iva";
+    ti,hwmods = "iva";
+};
Documentation/devicetree/bindings/arm/omap/mpu.txt new file +27 -0
new file mode 100644
index 0000000..5ffbacd
@@ -0,0 +1,27 @@
+* TI - MPU (Main Processor Unit) subsystem
+
+The MPU subsystem contain one or several ARM cores
+depending of the version.
+The MPU contain CPUs, GIC, L2 cache and a local PRCM.
+
+Required properties:
+- compatible : Should be "ti,omap3-mpu" for OMAP3
+               Should be "ti,omap4-mpu" for OMAP4
+- ti,hwmods: "mpu"
+
+Examples:
+
+- For an OMAP4 SMP system:
+
+mpu {
+    compatible = "ti,omap4-mpu";
+    ti,hwmods = "mpu";
+};
+
+
+- For an OMAP3 monocore system:
+
+mpu {
+    compatible = "ti,omap3-mpu";
+    ti,hwmods = "mpu";
+};
arch/arm/boot/dts/omap3.dtsi +19 -0
index d558785..d202bb5 100644
@@ -13,12 +13,31 @@
 / {
 	compatible = "ti,omap3430", "ti,omap3";
 
+	cpus {
+		cpu at 0 {
+			compatible = "arm,cortex-a8";
+		};
+	};
+
 	/*
 	 * The soc node represents the soc top level view. It is uses for IPs
 	 * that are not memory mapped in the MPU view or for the MPU itself.
 	 */
 	soc {
 		compatible = "ti,omap-infra";
+		mpu {
+			compatible = "ti,omap3-mpu";
+			ti,hwmods = "mpu";
+		};
+
+		iva {
+			compatible = "ti,iva2.2";
+			ti,hwmods = "iva";
+
+			dsp {
+				compatible = "ti,omap3-c64";
+			};
+		};
 	};
 
 	/*
arch/arm/boot/dts/omap4.dtsi +23 -0
index b85a39d..4c61c82 100644
@@ -23,12 +23,35 @@
 	aliases {
 	};
 
+	cpus {
+		cpu at 0 {
+			compatible = "arm,cortex-a9";
+		};
+		cpu at 1 {
+			compatible = "arm,cortex-a9";
+		};
+	};
+
 	/*
 	 * The soc node represents the soc top level view. It is uses for IPs
 	 * that are not memory mapped in the MPU view or for the MPU itself.
 	 */
 	soc {
 		compatible = "ti,omap-infra";
+		mpu {
+			compatible = "ti,omap4-mpu";
+			ti,hwmods = "mpu";
+		};
+
+		dsp {
+			compatible = "ti,omap3-c64";
+			ti,hwmods = "dsp";
+		};
+
+		iva {
+			compatible = "ti,ivahd";
+			ti,hwmods = "iva";
+		};
 	};
 
 	/*
arch/arm/mach-omap2/pm.c +2 -1
index 1fd9576..640c266 100644
@@ -217,7 +217,8 @@ static void __init omap4_init_voltages(void)
 
 static int __init omap2_common_pm_init(void)
 {
-	omap2_init_processor_devices();
+	if (!of_have_populated_dt())
+		omap2_init_processor_devices();
 	omap_pm_if_init();
 
 	return 0;
Signature · 1 line
1.7.0.4
#32 lore raw

PATCH 11/11 arm/dts: OMAP3+: Add mpu, dsp and iva nodes

Quoted 9 lines · Benoit Cousson

Add nodes for devices used by PM code (mpu, dsp, iva).

Add an empty cpus node as well as recommended in the DT spec.

Remove mpu, dsp, iva devices init if dt is populated.

Cc Grant Likely <[email protected]>
Cc Kevin Hilman <[email protected]>

Series looks good to me on brief review.

Quoted 183 lines
---
 Documentation/devicetree/bindings/arm/omap/dsp.txt |   14 ++++++++++
 Documentation/devicetree/bindings/arm/omap/iva.txt |   19 ++++++++++++++
 Documentation/devicetree/bindings/arm/omap/mpu.txt |   27 ++++++++++++++++++++
 arch/arm/boot/dts/omap3.dtsi                       |   19 ++++++++++++++
 arch/arm/boot/dts/omap4.dtsi                       |   23 +++++++++++++++++
 arch/arm/mach-omap2/pm.c                           |    3 +-
 6 files changed, 104 insertions(+), 1 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/omap/dsp.txt
 create mode 100644 Documentation/devicetree/bindings/arm/omap/iva.txt
 create mode 100644 Documentation/devicetree/bindings/arm/omap/mpu.txt
Documentation/devicetree/bindings/arm/omap/dsp.txt new file +14 -0
new file mode 100644
index 0000000..325feef
@@ -0,0 +1,14 @@
+* TI - DSP (Digital Signal Processor)
+
+TI DSP included in OMAP SoC
+
+Required properties:
+- compatible : Should be "ti,omap3-c64" for OMAP3 & 4
+- ti,hwmods: "dsp"
+
+Examples:
+
+dsp {
+    compatible = "ti,omap3-c64";
+    ti,hwmods = "dsp";
+};
Documentation/devicetree/bindings/arm/omap/iva.txt new file +19 -0
new file mode 100644
index 0000000..b889475
@@ -0,0 +1,19 @@
+* TI - IVA (Imaging and Video Accelerator) subsystem
+
+The IVA contain various audio, video or imaging HW accelerator
+depending of the version.
+
+Required properties:
+- compatible : Should be:
+  - "ti,ivahd" for OMAP4
+  - "ti,iva2.2" for OMAP3
+  - "ti,iva2.1" for OMAP2430
+  - "ti,iva1" for OMAP2420
+- ti,hwmods: "iva"
+
+Examples:
+
+iva {
+    compatible = "ti,ivahd", "ti,iva";
+    ti,hwmods = "iva";
+};
Documentation/devicetree/bindings/arm/omap/mpu.txt new file +27 -0
new file mode 100644
index 0000000..5ffbacd
@@ -0,0 +1,27 @@
+* TI - MPU (Main Processor Unit) subsystem
+
+The MPU subsystem contain one or several ARM cores
+depending of the version.
+The MPU contain CPUs, GIC, L2 cache and a local PRCM.
+
+Required properties:
+- compatible : Should be "ti,omap3-mpu" for OMAP3
+               Should be "ti,omap4-mpu" for OMAP4
+- ti,hwmods: "mpu"
+
+Examples:
+
+- For an OMAP4 SMP system:
+
+mpu {
+    compatible = "ti,omap4-mpu";
+    ti,hwmods = "mpu";
+};
+
+
+- For an OMAP3 monocore system:
+
+mpu {
+    compatible = "ti,omap3-mpu";
+    ti,hwmods = "mpu";
+};
arch/arm/boot/dts/omap3.dtsi +19 -0
index d558785..d202bb5 100644
@@ -13,12 +13,31 @@
 / {
 	compatible = "ti,omap3430", "ti,omap3";
 
+	cpus {
+		cpu at 0 {
+			compatible = "arm,cortex-a8";
+		};
+	};
+
 	/*
 	 * The soc node represents the soc top level view. It is uses for IPs
 	 * that are not memory mapped in the MPU view or for the MPU itself.
 	 */
 	soc {
 		compatible = "ti,omap-infra";
+		mpu {
+			compatible = "ti,omap3-mpu";
+			ti,hwmods = "mpu";
+		};
+
+		iva {
+			compatible = "ti,iva2.2";
+			ti,hwmods = "iva";
+
+			dsp {
+				compatible = "ti,omap3-c64";
+			};
+		};
 	};
 
 	/*
arch/arm/boot/dts/omap4.dtsi +23 -0
index b85a39d..4c61c82 100644
@@ -23,12 +23,35 @@
 	aliases {
 	};
 
+	cpus {
+		cpu at 0 {
+			compatible = "arm,cortex-a9";
+		};
+		cpu at 1 {
+			compatible = "arm,cortex-a9";
+		};
+	};
+
 	/*
 	 * The soc node represents the soc top level view. It is uses for IPs
 	 * that are not memory mapped in the MPU view or for the MPU itself.
 	 */
 	soc {
 		compatible = "ti,omap-infra";
+		mpu {
+			compatible = "ti,omap4-mpu";
+			ti,hwmods = "mpu";
+		};
+
+		dsp {
+			compatible = "ti,omap3-c64";
+			ti,hwmods = "dsp";
+		};
+
+		iva {
+			compatible = "ti,ivahd";
+			ti,hwmods = "iva";
+		};
 	};
 
 	/*
arch/arm/mach-omap2/pm.c +2 -1
index 1fd9576..640c266 100644
@@ -217,7 +217,8 @@ static void __init omap4_init_voltages(void)
 
 static int __init omap2_common_pm_init(void)
 {
-	omap2_init_processor_devices();
+	if (!of_have_populated_dt())
+		omap2_init_processor_devices();
 	omap_pm_if_init();
 
 	return 0;
Signature · 1 line
1.7.0.4