Skip to contentSkip to conversation

OMAP: Add initial support for DT on OMAP4

RFC PATCH New Benoit Cousson 2 participants 10 messages Aug 24, 2011 – Aug 25, 2011

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

cover OMAP: Add initial support for DT on OMAP4

Hi Grant,

Here is the first part of patches to add device-tree support for OMAP4 platforms. It is partially based on initial works done by Manju for i2c. The main difference is the usage of the notifier to create omap_device and the addition of the hwmods bindings.
That series mainly clean the existing DT file and add an empty skeleton for OMAP4 soc.
It adds as well a minimal OMAP4 board file for basic DT support. The goal being to remove even the minimal static devices init in order to have a fully generic OMAP board file.
The next one will start adding some real devices.

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

Thanks to your latest hack, for people who want to play with appended dtb:
make uImage-dtb.omap4-panda
make uImage-dtb.omap4-sdp

Comments are welcome.

Regards,
Benoit

Benoit Cousson (7):
OMAP3+: boards: Fix the __initconst build error arm/dts: Add initial device tree support for OMAP4 SoC arm/dts: Update OMAP4 Panda to include common omap4.dtsi arm/dts: Add support for OMAP4 SDP board
OMAP4: board-panda: Remove DT support from regular board
OMAP4: board-dt: Add generic board with DT support documentation/dt: Add OMAP bindings

 .../devicetree/bindings/arm/omap/omap.txt          |   38 +++++++
 arch/arm/boot/dts/omap4-panda.dts                  |   28 ++++-
 arch/arm/boot/dts/omap4-sdp.dts                    |   29 +++++
 arch/arm/boot/dts/omap4.dtsi                       |   80 ++++++++++++++
 arch/arm/mach-omap2/Kconfig                        |    9 ++
 arch/arm/mach-omap2/Makefile                       |    1 +
 arch/arm/mach-omap2/board-igep0020.c               |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c            |    2 +-
 arch/arm/mach-omap2/board-omap4-dt.c               |  110 ++++++++++++++++++++
 arch/arm/mach-omap2/board-omap4panda.c             |    6 -
 arch/arm/mach-omap2/board-overo.c                  |    2 +-
 11 files changed, 293 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/omap/omap.txt
 create mode 100644 arch/arm/boot/dts/omap4-sdp.dts
 create mode 100644 arch/arm/boot/dts/omap4.dtsi
 create mode 100644 arch/arm/mach-omap2/board-omap4-dt.c
#1 lore raw

RFC PATCH 1/7 OMAP3+: boards: Fix the __initconst build error

The __initconst introduced some build errors with the following compiler version:
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2010.09-50) 4.5.1

arch/arm/mach-omap2/board-omap3beagle.c:566:20: error:
omap3_beagle_dt_match causes a section type conflict

Replace them by __initdata.

---
 arch/arm/mach-omap2/board-igep0020.c    |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c |    2 +-
 arch/arm/mach-omap2/board-omap4panda.c  |    2 +-
 arch/arm/mach-omap2/board-overo.c       |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/board-igep0020.c +1 -1
index 249165a..2521823 100644
@@ -671,7 +671,7 @@ static void __init igep_init(void)
 	}
 }
 
-static const char *igep2_dt_compat[] __initconst = {
+static const char *igep2_dt_compat[] __initdata = {
 	"ISEE,igep-v2",
 	NULL
 };
arch/arm/mach-omap2/board-omap3beagle.c +1 -1
index b3b9cbc..a7923ca 100644
@@ -563,7 +563,7 @@ static void __init omap3_beagle_init(void)
 	beagle_opp_init();
 }
 
-static const char *omap3_beagle_dt_match[] __initconst = {
+static const char *omap3_beagle_dt_match[] __initdata = {
 	"ti,omap3-beagle",
 	NULL
 };
arch/arm/mach-omap2/board-omap4panda.c +1 -1
index b526aa9..1c583c7 100644
@@ -581,7 +581,7 @@ static void __init omap4_panda_map_io(void)
 	omap44xx_map_common_io();
 }
 
-static const char *omap4_panda_match[] __initconst = {
+static const char *omap4_panda_match[] __initdata = {
 	"ti,omap4-panda",
 	NULL,
 };
arch/arm/mach-omap2/board-overo.c +1 -1
index 18ae2c2..f0b8489 100644
@@ -560,7 +560,7 @@ static void __init overo_init(void)
 					"OVERO_GPIO_USBH_CPEN\n");
 }
 
-static const char *omap3_overo_dt_match[] __initconst = {
+static const char *omap3_overo_dt_match[] __initdata = {
 	"gumstix,omap3-overo",
 	NULL
 };
Signature · 1 line
1.7.0.4
#2 lore raw

RFC PATCH 2/7 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 |   80 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 80 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4.dtsi
arch/arm/boot/dts/omap4.dtsi new file +80 -0
new file mode 100644
index 0000000..97a3ea7
@@ -0,0 +1,80 @@
+/*
+ * 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"
+
+/ {
+	model = "TI OMAP4430";
+	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 = "ti,omap4-gic", "arm,gic";
+			interrupt-controller;
+			#interrupt-cells = <1>;
+			reg = <0x48241000 0x1000>,
+			      <0x48240100 0x0200>;
+		};
+	};
+};
Signature · 1 line
1.7.0.4
#3 lore raw

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

Benoit,

Quoted 92 lines · 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 |   80 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 80 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4.dtsi
arch/arm/boot/dts/omap4.dtsi new file +63 -0
new file mode 100644
index 0000000..97a3ea7
@@ -0,0 +1,80 @@
+/*
+ * 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"
+
+/ {
+	model = "TI OMAP4430";
+	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

arch/arm/boot/dts/omap4.dtsi line 73

Quoted 10 lines
arch/arm/boot/dts/omap4.dtsi new file +10 -0
+	 * hierarchy.
+	 */
+	ocp {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		gic: interrupt-controller at 48241000 {
+			compatible = "ti,omap4-gic", "arm,gic";

The gic binding is still being hashed out. This needs binding documentation and handling of PPIs. I'm planning on posting an updated series today with this.

"arm,gic" should be dropped or replaced with "arm,cortex-a9-gic". Non-specific DT bindings are not well received. Is OMAP4 gic different from standard Cortex-A9?

arch/arm/boot/dts/omap4.dtsi line 77

Quoted 4 lines
arch/arm/boot/dts/omap4.dtsi new file +4 -0
+			interrupt-controller;
+			#interrupt-cells = <1>;
+			reg = <0x48241000 0x1000>,
+			      <0x48240100 0x0200>;

Isn't the cpu interface register space 0x100 bytes long?

Rob

Quoted 3 lines
arch/arm/boot/dts/omap4.dtsi new file +3 -0
+		};
+	};
+};
#4 lore raw

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

Hi Rob,

Quoted 1 line · Rob Herring

Benoit,

[...]

Quoted 10 lines

arch/arm/boot/dts/omap4.dtsi line 73

Quoted 2 lines
arch/arm/boot/dts/omap4.dtsi new file +2 -0
+		gic: interrupt-controller at 48241000 {
+			compatible = "ti,omap4-gic", "arm,gic";

The gic binding is still being hashed out. This needs binding documentation and handling of PPIs. I'm planning on posting an updated series today with this.

"arm,gic" should be dropped or replaced with "arm,cortex-a9-gic". Non-specific DT bindings are not well received. Is OMAP4 gic different from standard Cortex-A9?

Not at all. We named it like that based on Grant's comment:
http://permalink.gmane.org/gmane.linux.ports.arm.omap/60393

I'll update it with the new binding.

Quoted 6 lines

arch/arm/boot/dts/omap4.dtsi line 77

Quoted 4 lines
arch/arm/boot/dts/omap4.dtsi new file +4 -0
+			interrupt-controller;
+			#interrupt-cells =<1>;
+			reg =<0x48241000 0x1000>,
+			<0x48240100 0x0200>;

Isn't the cpu interface register space 0x100 bytes long?

I've just checked the spec, and this is indeed 256 bytes. I'll fix that.

Thanks for the comments.

Regards,
Benoit

#5 lore raw

RFC PATCH 3/7 arm/dts: Update OMAP4 Panda to include common omap4.dtsi

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.

Add missing header.

Include the common omap4.dtsi.

Add a "ti,omap4" compatible value for OMAP4 based boards.

Cc Grant Likely <[email protected]>
Cc G, Manjunath Kondaiah <[email protected]>
---
 arch/arm/boot/dts/omap4-panda.dts |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)
arch/arm/boot/dts/omap4-panda.dts +23 -5
index 58909e9..c702657 100644
@@ -1,11 +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/;
 
-/memreserve/ 0x9D000000 0x03000000; /* Frame buffer */
-/memreserve/ 0xB0000000 0x10000000; /* Top 256MB is unaccessable */
-
-/include/ "skeleton.dtsi"
+/include/ "omap4.dtsi"
 
 / {
 	model = "TI OMAP4 PandaBoard";
-	compatible = "ti,omap4-panda", "ti,omap4430";
+	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
#6 lore raw

RFC PATCH 4/7 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
#7 lore raw

RFC PATCH 5/7 OMAP4: board-panda: Remove DT support from regular board

In reply to Benoit Cousson

In order to avoid conflict with the new omap4-dt.c board file, remove the .dt_compat entry from the pandaboard regular board file.
Any DT work for OMAP4 will have to be done on the generic DT board file to avoid breaking the legacy board support until DT migration is done.

---
 arch/arm/mach-omap2/board-omap4panda.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/board-omap4panda.c +0 -6
index 1c583c7..9aaa960 100644
@@ -581,11 +581,6 @@ static void __init omap4_panda_map_io(void)
 	omap44xx_map_common_io();
 }
 
-static const char *omap4_panda_match[] __initdata = {
-	"ti,omap4-panda",
-	NULL,
-};
-
 MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
 	/* Maintainer: David Anders - Texas Instruments Inc */
 	.boot_params	= 0x80000100,
@@ -595,5 +590,4 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
 	.init_irq	= gic_init_irq,
 	.init_machine	= omap4_panda_init,
 	.timer		= &omap4_timer,
-	.dt_compat	= omap4_panda_match,
 MACHINE_END
Signature · 1 line
1.7.0.4
#8 lore raw

RFC PATCH 6/7 OMAP4: board-dt: Add generic board with DT support

In reply to Benoit Cousson

Create an OMAP4 generic board to start the DT migration.

This file is doing the minimal initialization needed to boot properly on a RAMDISK filesystem.

As soon as the OMAP4 specifics will be removed, that board will be converted to an even more generic board-dt.c that will support every OMAP 2+ platform.

---
 arch/arm/mach-omap2/Kconfig          |    9 +++
 arch/arm/mach-omap2/Makefile         |    1 +
 arch/arm/mach-omap2/board-omap4-dt.c |  110 ++++++++++++++++++++++++++++++++++
 3 files changed, 120 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap4-dt.c
arch/arm/mach-omap2/Kconfig +9 -0
index 57b66d5..5d501d2 100644
@@ -326,6 +326,15 @@ config MACH_OMAP4_PANDA
 	select OMAP_PACKAGE_CBS
 	select REGULATOR_FIXED_VOLTAGE
 
+config MACH_OMAP4_DT
+	bool "Generic OMAP4 board (FDT support)"
+	default y
+	depends on ARCH_OMAP4
+	select OMAP_PACKAGE_CBL
+	select OMAP_PACKAGE_CBS
+	select REGULATOR_FIXED_VOLTAGE
+	select USE_OF
+
 config OMAP3_EMU
 	bool "OMAP3 debugging peripherals"
 	depends on ARCH_OMAP3
arch/arm/mach-omap2/Makefile +1 -0
index b1501bd..79e42a1 100644
@@ -223,6 +223,7 @@ obj-$(CONFIG_MACH_OMAP_4430SDP)		+= board-4430sdp.o \
 					   omap_phy_internal.o
 obj-$(CONFIG_MACH_OMAP4_PANDA)		+= board-omap4panda.o \
 					   omap_phy_internal.o
+obj-$(CONFIG_MACH_OMAP4_DT)		+= board-omap4-dt.o
 
 obj-$(CONFIG_MACH_PCM049)		+= board-omap4pcm049.o \
 					   omap_phy_internal.o
arch/arm/mach-omap2/board-omap4-dt.c new file +110 -0

110 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#9 lore raw

RFC PATCH 7/7 documentation/dt: Add OMAP bindings

In reply to Benoit Cousson

Add a documentation to capture the specifics OMAP bindings needed for device-tree support.

Cc Randy Dunlap <[email protected]>
Cc Grant Likely <[email protected]>
---
 .../devicetree/bindings/arm/omap/omap.txt          |   38 ++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/omap/omap.txt
Documentation/devicetree/bindings/arm/omap/omap.txt new file +38 -0
new file mode 100644
index 0000000..845f9f1
@@ -0,0 +1,38 @@
+* Texas Instruments OMAP
+
+OMAP is currently using a static file per SoC family to describe the
+IPs present in the SoC.
+On top of that an omap_device is created to extend the platform_device
+capabilities and to allow binding with one or several hwmods.
+The hwmods will contain all the information to build the device:
+adresse range, irq lines, dma lines, interconnect, PRCM register,
+clock domain, input clocks.
+For the moment just point to the existing hwmod, the next step will be
+to move data from hwmod to device-tree representation.
+
+
+Required properties:
+- compatible: Every devices present in OMAP SoC should be in the
+  form: "ti,XXX"
+- hwmods: list of hwmods attached to a device. Must contain at least
+  one hwmod.
+
+Optional properties:
+- no_idle_on_suspend: When present, it prevents the PM to idle the module
+  during suspend.
+
+
+Example:
+
+spinlock at 1 {
+    compatible = "ti,omap-spinlock";
+    hwmods = "spinlock";
+};
+
+
+Boards:
+- OMAP4 SDP : Software Developement Board
+  compatible = "ti,omap4-sdp", "ti,omap4430"
+
+- OMAP4 PandaBoard : Low cost community board
+  compatible = "ti,omap4-panda", "ti,omap4430"
Signature · 1 line
1.7.0.4