Skip to contentSkip to conversation

dt: omap: dt binding with omap_device and support for i2c1

PATCH Superseded G, Manjunath Kondaiah 5 participants 32 messages Aug 23, 2011 – Sep 2, 2011 5 messages not in the archive

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

v2 cover dt: omap: dt binding with omap_device and support for i2c1

Patch series reworked from:
http://permalink.gmane.org/gmane.linux.ports.arm.omap/61674
Also added support for i2c1 controller on omap4 based panda board.

Baseline:
=========
git://git.secretlab.ca/git/linux-2.6.git
Branch: devicetree/test
The above branch is rebased with v3.1-rc2 mainline. +
pdev decoupling patches from kevin hilman
http://www.mail-archive.com/[email protected]/msg53534.html

The patch series is also available at:
https://gitorious.org/devicetree/dt_omap/commits/devicetree/dt_rfcv2

Testing:
========
Build : dt and not dt build for omap2plus_defconfig
Boot: OMAP3530 Beagle Board and OMAP4430 Panda board

Limitation:
===========
The current implementation of omap-device build through device tree supports only single instance of hwmod and multiple instances are not supported.

G, Manjunath Kondaiah (13):
OMAP: omap_device: Add device tree node pointer
dt: Add pd_size to AUXDATA structure
dt: omap3: add soc file for handling i2c controllers
dt: omap3: beagle board: set clock freq for i2c devices
dt: omap3: add generic board file for dt support
dt: omap3: add omap-device compatible property
dt: omap: create platform bus for omap devices
dt: omap: i2c: add dt support for i2c1 controller
dt: omap4: add soc file for handling i2c controllers
dt: omap4: panda board: set clock freq for i2c devices
dt: omap4: add generic board file for dt support
dt: omap4: enable dt support for i2c1 controller
dt: omap: i2c: dt usage model documentation

 Documentation/devicetree/bindings/i2c/omap-i2c.txt |   57 +++++++++++++
 arch/arm/boot/dts/omap3-beagle-nunchuck.dts        |   13 +---
 arch/arm/boot/dts/omap3-beagle.dts                 |   18 ++++-
 arch/arm/boot/dts/omap3.dtsi                       |   62 ++++++++++++++
 arch/arm/boot/dts/omap4-panda.dts                  |   25 ++++--
 arch/arm/boot/dts/omap4.dtsi                       |   68 ++++++++++++++++
 arch/arm/mach-omap2/Kconfig                        |   22 +++++
 arch/arm/mach-omap2/Makefile                       |    2 +
 arch/arm/mach-omap2/board-omap3-dt.c               |   84 ++++++++++++++++++++
 arch/arm/mach-omap2/board-omap3beagle.c            |   13 ---
 arch/arm/mach-omap2/board-omap4-dt.c               |   75 +++++++++++++++++
 arch/arm/mach-omap2/board-omap4panda.c             |    6 --
 arch/arm/mach-omap2/devices.c                      |    2 +-
 arch/arm/mach-omap2/mcbsp.c                        |    2 +-
 arch/arm/plat-omap/include/plat/omap_device.h      |   11 +++-
 arch/arm/plat-omap/omap_device.c                   |   46 ++++++++++-
 drivers/i2c/busses/i2c-omap.c                      |   23 +++++-
 drivers/of/platform.c                              |   41 ++++++++++
 include/linux/of_platform.h                        |    5 +
 19 files changed, 526 insertions(+), 49 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/omap-i2c.txt
 create mode 100644 arch/arm/boot/dts/omap3.dtsi
 create mode 100644 arch/arm/boot/dts/omap4.dtsi
 create mode 100644 arch/arm/mach-omap2/board-omap3-dt.c
 create mode 100644 arch/arm/mach-omap2/board-omap4-dt.c
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v2 2/13 dt: Add pd_size to AUXDATA structure

Add pd_size in the AUXDATA structure so that omap HWMOD which require platform_data size can pass along with AUXDATA.

---
 drivers/of/platform.c       |    2 ++
 include/linux/of_platform.h |    5 +++++
 2 files changed, 7 insertions(+), 0 deletions(-)
drivers/of/platform.c +2 -0
index b030fd5..e50ffcb 100644
@@ -565,6 +565,7 @@ static int of_platform_bus_create(struct device_node *bus,
 	struct platform_device *dev;
 	const char *bus_id = NULL;
 	void *platform_data = NULL;
+	int pd_size;
 	int id = -1;
 	int rc = 0;
 
@@ -588,6 +589,7 @@ static int of_platform_bus_create(struct device_node *bus,
 		bus_id = auxdata->name;
 		id = auxdata->id;
 		platform_data = auxdata->platform_data;
+		pd_size = auxdata->pd_size;
 	}
 
 	if (of_device_is_compatible(bus, "arm,primecell")) {
include/linux/of_platform.h +5 -0
index 252246c..a3be980 100644
@@ -47,6 +47,7 @@ struct of_dev_auxdata {
 	char *name;
 	int id;
 	void *platform_data;
+	int pd_size;
 };
 
 /* Macro to simplify populating a lookup table */
@@ -58,6 +59,10 @@ struct of_dev_auxdata {
 	{ .compatible = _compat, .phys_addr = _phys, .name = _name, \
 	  .id = _id, .platform_data = _pdata }
 
+#define OF_DEV_AUXDATA_ID_PDSIZE(_compat,_phys,_name,_id,_pdata,_pd_size) \
+	{ .compatible = _compat, .phys_addr = _phys, .name = _name, \
+	  .id = _id, .platform_data = _pdata, .pd_size = _pd_size }
+
 /**
  * of_platform_driver - Legacy of-aware driver for platform devices.
  *
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH v2 4/13 dt: omap3: beagle board: set clock freq for i2c devices

In reply to G, Manjunath Kondaiah

Update omap3 beagle dts file with required clock frequencies for the i2c client devices existing on beagle board.

Beagle custom board dts file is cleaned up so that it can coexist with omap3 soc dts file.

---
 arch/arm/boot/dts/omap3-beagle-nunchuck.dts |   13 ++-----------
 arch/arm/boot/dts/omap3-beagle.dts          |   18 +++++++++++++++---
 2 files changed, 17 insertions(+), 14 deletions(-)
arch/arm/boot/dts/omap3-beagle-nunchuck.dts +2 -11
index 2607be5..c693163 100644
@@ -1,16 +1,7 @@
-/include/ "omap3-beagle.dts"
+/include/ "omap3.dtsi"
 
 / {
-	i2c@48072000 {
-		compatible = "ti,omap3-i2c";
-		reg = <0x48072000 0x80>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		eeprom@50 {
-			compatible = "at,at24c01";
-			reg = < 0x50 >;
-		};
+	i2c@2 {
 		joystick@52 {
 			compatible = "sparkfun,wiichuck";
 			reg = < 0x52 >;
arch/arm/boot/dts/omap3-beagle.dts +15 -3
index 4439466..c232c52 100644
@@ -1,7 +1,19 @@
-/dts-v1/;
-/include/ "skeleton.dtsi"
+/include/ "omap3.dtsi"
 
 / {
 	model = "TI OMAP3 BeagleBoard";
-	compatible = "ti,omap3-beagle";
+	compatible = "ti,omap3-beagle", "ti,omap3";
+
+
+	i2c1 {
+		clock-frequency = <2600000>;
+	};
+
+	i2c2 {
+		clock-frequency = <400000>;
+	};
+
+	i2c3 {
+		clock-frequency = <400000>;
+	};
 };
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH v2 5/13 dt: omap3: add generic board file for dt support

In reply to G, Manjunath Kondaiah

The generic board file is created and derived from beagle board file. The beagle board file is migrated to boot from flattened device tree and the cleanup of board specific file will happen in different stages.

The changes here focus on minimal configuration to boot beagle board with dt enabled which provides basic platform for converting device drivers for using dt.

---
 arch/arm/mach-omap2/Kconfig             |   11 ++++
 arch/arm/mach-omap2/Makefile            |    1 +
 arch/arm/mach-omap2/board-omap3-dt.c    |   84 +++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/board-omap3beagle.c |   13 -----
 4 files changed, 96 insertions(+), 13 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap3-dt.c
arch/arm/mach-omap2/Kconfig +11 -0
index 57b66d5..4fbb54d 100644
@@ -305,6 +305,17 @@ config MACH_OMAP_3630SDP
 	default y
 	select OMAP_PACKAGE_CBP
 
+config MACH_OMAP3_DT
+	bool "Generic OMAP3 board(FDT support)"
+	depends on ARCH_OMAP3
+	select OMAP_PACKAGE_CBB
+	select USE_OF
+
+	help
+	  Support for generic TI OMAP3 boards using Flattened Device Tree.
+	  Say Y here to enable OMAP3 device tree support
+	  More information at Documentation/devicetree
+
 config MACH_TI8168EVM
 	bool "TI8168 Evaluation Module"
 	depends on SOC_OMAPTI816X
arch/arm/mach-omap2/Makefile +1 -0
index b1501bd..e702e47 100644
@@ -197,6 +197,7 @@ obj-$(CONFIG_MACH_OVERO)		+= board-overo.o
 obj-$(CONFIG_MACH_OMAP3EVM)		+= board-omap3evm.o
 obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o
+obj-$(CONFIG_MACH_OMAP3_DT)		+= board-omap3-dt.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)		+= board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RM680)		+= board-rm680.o \
 					   sdram-nokia.o
arch/arm/mach-omap2/board-omap3-dt.c new file +84 -0

84 lines not on this page · raw message

arch/arm/mach-omap2/board-omap3beagle.c +0 -13
index 268c826..a845e9e 100644
@@ -19,7 +19,6 @@
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/io.h>
-#include <linux/of_platform.h>
 #include <linux/leds.h>
 #include <linux/gpio.h>
 #include <linux/input.h>
@@ -388,9 +387,7 @@ static int __init omap3_beagle_i2c_init(void)
 	/* Bus 3 is attached to the DVI port where devices like the pico DLP
 	 * projector don't work reliably with 400kHz */
 	omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom));
-#ifdef CONFIG_OF
 	omap_register_i2c_bus(2, 100, NULL, 0);
-#endif /* CONFIG_OF */
 	return 0;
 }
 
@@ -528,10 +525,6 @@ static void __init beagle_opp_init(void)
 
 static void __init omap3_beagle_init(void)
 {
-#ifdef CONFIG_OF
-	of_platform_prepare(NULL, NULL);
-#endif /* CONFIG_OF */
-
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap3_beagle_init_rev();
 	omap3_beagle_i2c_init();
@@ -563,11 +556,6 @@ static void __init omap3_beagle_init(void)
 	beagle_opp_init();
 }
 
-static const char *omap3_beagle_dt_match[] __initdata = {
-	"ti,omap3-beagle",
-	NULL
-};
-
 MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
 	/* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
 	.boot_params	= 0x80000100,
@@ -577,5 +565,4 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
 	.init_irq	= omap3_beagle_init_irq,
 	.init_machine	= omap3_beagle_init,
 	.timer		= &omap3_secure_timer,
-	.dt_compat	= omap3_beagle_dt_match,
 MACHINE_END
Signature · 1 line
1.7.4.1
#4 lore raw

PATCH v2 7/13 dt: omap: create platform bus for omap devices

In reply to G, Manjunath Kondaiah

The omap devices will use HWMOD for fetching device information hence it needs to be handled seperately during platform bus creation during dt build.

---
 drivers/of/platform.c |   41 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletions(-)
drivers/of/platform.c +40 -1
index e50ffcb..bd2c089 100644
@@ -24,6 +24,10 @@
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
+#include <plat/omap_device.h>
+#endif
+
 const struct of_device_id of_default_bus_match_table[] = {
 	{ .compatible = "simple-bus", },
 #ifdef CONFIG_ARM_AMBA
@@ -544,6 +548,36 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
 	return NULL;
 }
 
+static struct omap_device_pm_latency omap_device_latency[] = {
+	[0] = {
+		.deactivate_func	= omap_device_idle_hwmods,
+		.activate_func		= omap_device_enable_hwmods,
+		.flags			= OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+	},
+};
+
+int of_omap_device_create(struct device_node *np, const char *name, int id,
+							void *platform_data,
+							int pd_size)
+{
+	struct omap_hwmod *oh;
+	struct platform_device *pdev;
+
+	oh = omap_hwmod_lookup(name);
+	if (!oh) {
+		pr_err("Could not look up %s\n", name);
+		return -EEXIST;
+	}
+
+	pdev = omap_device_build_dt(np, name, id, oh, platform_data,
+				sizeof(platform_data), omap_device_latency,
+				ARRAY_SIZE(omap_device_latency), 0);
+	WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
+
+	pr_info("DT: omap_device build for %s is successful\n", name);
+	return PTR_ERR(pdev);
+}
+
 /**
  * of_platform_bus_create() - Create a device for a node and its children.
  * @bus: device node of the bus to instantiate
@@ -565,7 +599,7 @@ static int of_platform_bus_create(struct device_node *bus,
 	struct platform_device *dev;
 	const char *bus_id = NULL;
 	void *platform_data = NULL;
-	int pd_size;
+	int pd_size = 0;
 	int id = -1;
 	int rc = 0;
 
@@ -597,6 +631,11 @@ static int of_platform_bus_create(struct device_node *bus,
 		return 0;
 	}
 
+	if (of_device_is_compatible(bus, "ti,omap-device")) {
+		of_omap_device_create(bus, bus_id, id, platform_data, pd_size);
+		return 0;
+	}
+
 	dev = of_platform_device_create_pdata(bus, bus_id, platform_data, parent);
 
 	/* override the id if auxdata gives an id */
Signature · 1 line
1.7.4.1
#5 lore raw

PATCH v2 7/13 dt: omap: create platform bus for omap devices

Hi,

This creates a build failure for non-omap platforms as they don't know about struct omap_device_pm_latency, struct omap_hwmod etc.

An empty of_omap_device_create() as inline should do the trick.

Jamie

Quoted 26 lines · Manjunath Kondaiah

The omap devices will use HWMOD for fetching device information hence it needs to be handled seperately during platform bus creation during dt build.

---
 drivers/of/platform.c |   41 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletions(-)
drivers/of/platform.c +4 -0
index e50ffcb..bd2c089 100644
@@ -24,6 +24,10 @@
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
+#include <plat/omap_device.h>
+#endif
+
 const struct of_device_id of_default_bus_match_table[] = {
 	{ .compatible = "simple-bus", },
 #ifdef CONFIG_ARM_AMBA

drivers/of/platform.c static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l · line 549

Quoted 2 lines
drivers/of/platform.c +0 -0
@@ -544,6 +548,36 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
 	return NULL;
 }

#ifdef ARCH_OMAP

Quoted 19 lines
drivers/of/platform.c +19 -0
+static struct omap_device_pm_latency omap_device_latency[] = {
+	[0] = {
+		.deactivate_func	= omap_device_idle_hwmods,
+		.activate_func		= omap_device_enable_hwmods,
+		.flags			= OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+	},
+};
+
+int of_omap_device_create(struct device_node *np, const char *name, int id,
+							void *platform_data,
+							int pd_size)
+{
+	struct omap_hwmod *oh;
+	struct platform_device *pdev;
+
+	oh = omap_hwmod_lookup(name);
+	if (!oh) {
+		pr_err("Could not look up %s\n", name);
+		return -EEXIST;

drivers/of/platform.c static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l · line 579

Quoted 10 lines
drivers/of/platform.c +10 -0
+	}
+
+	pdev = omap_device_build_dt(np, name, id, oh, platform_data,
+				sizeof(platform_data), omap_device_latency,
+				ARRAY_SIZE(omap_device_latency), 0);
+	WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
+
+	pr_info("DT: omap_device build for %s is successful\n", name);
+	return PTR_ERR(pdev);
+}

#else /* ARCH_OMAP */
static inline int of_omap_device_create(struct device_node *np,
const char *name, int id, void *platform_data, int pd_size)

{
	return -ENODEV;
}

#endif /* ARCH_OMAP */

Quoted 32 lines
drivers/of/platform.c +7 -1
+
 /**
  * of_platform_bus_create() - Create a device for a node and its children.
  * @bus: device node of the bus to instantiate
@@ -565,7 +599,7 @@ static int of_platform_bus_create(struct device_node *bus,
 	struct platform_device *dev;
 	const char *bus_id = NULL;
 	void *platform_data = NULL;
-	int pd_size;
+	int pd_size = 0;
 	int id = -1;
 	int rc = 0;
 
@@ -597,6 +631,11 @@ static int of_platform_bus_create(struct device_node *bus,
 		return 0;
 	}
 
+	if (of_device_is_compatible(bus, "ti,omap-device")) {
+		of_omap_device_create(bus, bus_id, id, platform_data, pd_size);
+		return 0;
+	}
+
 	dev = of_platform_device_create_pdata(bus, bus_id, platform_data, parent);
 
 	/* override the id if auxdata gives an id */
Signature · 6 lines
1.7.4.1

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss at lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
#6 lore raw

PATCH v2 7/13 dt: omap: create platform bus for omap devices

Quoted 6 lines · Jamie Iles

Hi,

This creates a build failure for non-omap platforms as they don't know about struct omap_device_pm_latency, struct omap_hwmod etc.

An empty of_omap_device_create() as inline should do the trick.

Thanks. I will introduce this.

-M

Quoted 106 lines

Jamie

Quoted 26 lines · Manjunath Kondaiah

The omap devices will use HWMOD for fetching device information hence it needs to be handled seperately during platform bus creation during dt build.

---
 drivers/of/platform.c |   41 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletions(-)
drivers/of/platform.c +4 -0
index e50ffcb..bd2c089 100644
@@ -24,6 +24,10 @@
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 
+#ifdef CONFIG_ARCH_OMAP2PLUS
+#include <plat/omap_device.h>
+#endif
+
 const struct of_device_id of_default_bus_match_table[] = {
 	{ .compatible = "simple-bus", },
 #ifdef CONFIG_ARM_AMBA

drivers/of/platform.c static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l · line 549

Quoted 2 lines
drivers/of/platform.c +0 -0
@@ -544,6 +548,36 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
 	return NULL;
 }

#ifdef ARCH_OMAP

Quoted 19 lines
drivers/of/platform.c +19 -0
+static struct omap_device_pm_latency omap_device_latency[] = {
+	[0] = {
+		.deactivate_func	= omap_device_idle_hwmods,
+		.activate_func		= omap_device_enable_hwmods,
+		.flags			= OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+	},
+};
+
+int of_omap_device_create(struct device_node *np, const char *name, int id,
+							void *platform_data,
+							int pd_size)
+{
+	struct omap_hwmod *oh;
+	struct platform_device *pdev;
+
+	oh = omap_hwmod_lookup(name);
+	if (!oh) {
+		pr_err("Could not look up %s\n", name);
+		return -EEXIST;

drivers/of/platform.c static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l · line 579

Quoted 10 lines
drivers/of/platform.c +10 -0
+	}
+
+	pdev = omap_device_build_dt(np, name, id, oh, platform_data,
+				sizeof(platform_data), omap_device_latency,
+				ARRAY_SIZE(omap_device_latency), 0);
+	WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
+
+	pr_info("DT: omap_device build for %s is successful\n", name);
+	return PTR_ERR(pdev);
+}

#else /* ARCH_OMAP */
static inline int of_omap_device_create(struct device_node *np,
const char *name, int id, void *platform_data, int pd_size)

{
	return -ENODEV;
}

#endif /* ARCH_OMAP */

Quoted 32 lines
drivers/of/platform.c +7 -1
+
 /**
  * of_platform_bus_create() - Create a device for a node and its children.
  * @bus: device node of the bus to instantiate
@@ -565,7 +599,7 @@ static int of_platform_bus_create(struct device_node *bus,
 	struct platform_device *dev;
 	const char *bus_id = NULL;
 	void *platform_data = NULL;
-	int pd_size;
+	int pd_size = 0;
 	int id = -1;
 	int rc = 0;
 
@@ -597,6 +631,11 @@ static int of_platform_bus_create(struct device_node *bus,
 		return 0;
 	}
 
+	if (of_device_is_compatible(bus, "ti,omap-device")) {
+		of_omap_device_create(bus, bus_id, id, platform_data, pd_size);
+		return 0;
+	}
+
 	dev = of_platform_device_create_pdata(bus, bus_id, platform_data, parent);
 
 	/* override the id if auxdata gives an id */
Signature · 6 lines
1.7.4.1

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss at lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
#7 lore raw

PATCH v2 8/13 dt: omap: i2c: add dt support for i2c1 controller

In reply to G, Manjunath Kondaiah

The device tree support has been added to i2c1 controller and corresponding i2c initilization in generic board file is cleaned up so that platfom device is registered through dt and omap device and not through board i2c initilization.

These changes will not affect non dt builds and existing functionality is retained.

Tested with dt and non dt builds and boot tested on beagle board.

---
 arch/arm/mach-omap2/board-omap3-dt.c |   14 +++++++-------
 drivers/i2c/busses/i2c-omap.c        |   23 ++++++++++++++++++++---
 2 files changed, 27 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/board-omap3-dt.c +7 -7
index 72c59a4..cd11224 100644
@@ -35,11 +35,11 @@ static struct twl4030_platform_data beagle_twldata = {
 	/* platform_data for children goes here */
 };
 
-static int __init omap3_beagle_i2c_init(void)
-{
-	omap3_pmic_init("twl4030", &beagle_twldata);
-	return 0;
-}
+struct of_dev_auxdata omap3_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA_ID_PDSIZE("ti,omap-i2c", 0x48070000, "i2c1", 1,\
+				&beagle_twldata, sizeof(beagle_twldata)),
+	{}
+};
 
 static void __init omap3_init_early(void)
 {
@@ -61,11 +61,11 @@ static struct of_device_id omap_dt_match_table[] __initdata = {
 
 static void __init omap3_init(void)
 {
-	omap3_beagle_i2c_init();
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap_serial_init();
 
-	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
+	of_platform_populate(NULL, omap_dt_match_table, omap3_auxdata_lookup,
+									 NULL);
 }
 
 static const char *omap3_dt_match[] __initdata = {
drivers/i2c/busses/i2c-omap.c +20 -3
index 2a072ff..9e98014 100644
@@ -38,6 +38,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of_i2c.h>
+#include <linux/of_device.h>
 #include <linux/slab.h>
 #include <linux/i2c-omap.h>
 #include <linux/pm_runtime.h>
@@ -972,6 +973,16 @@ static const struct i2c_algorithm omap_i2c_algo = {
 	.functionality	= omap_i2c_func,
 };
 
+#if defined(CONFIG_OF)
+static const struct of_device_id omap_i2c_of_match[] = {
+	{.compatible = "ti,omap-i2c", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, omap_i2c_of_match);
+#else
+#define omap_i2c_of_match NULL
+#endif
+
 static int __devinit
 omap_i2c_probe(struct platform_device *pdev)
 {
@@ -1008,12 +1019,17 @@ omap_i2c_probe(struct platform_device *pdev)
 		goto err_release_region;
 	}
 
+	speed = 100;	/* Default speed */
 	if (pdata != NULL) {
 		speed = pdata->clkrate;
 		dev->set_mpu_wkup_lat = pdata->set_mpu_wkup_lat;
-	} else {
-		speed = 100;	/* Default speed */
-		dev->set_mpu_wkup_lat = NULL;
+#if defined(CONFIG_OF)
+	} else if (pdev->dev.of_node) {
+		u32 prop;
+		if (!of_property_read_u32(pdev->dev.of_node, "clock-frequency",
+									&prop))
+			speed = prop/100;
+#endif
 	}
 
 	dev->speed = speed;
@@ -1178,6 +1194,7 @@ static struct platform_driver omap_i2c_driver = {
 		.name	= "omap_i2c",
 		.owner	= THIS_MODULE,
 		.pm	= OMAP_I2C_PM_OPS,
+		.of_match_table = omap_i2c_of_match,
 	},
 };
 
Signature · 1 line
1.7.4.1
#8 lore raw

PATCH v2 8/13 dt: omap: i2c: add dt support for i2c1 controller

Hi Grant,

Quoted 89 lines · Manjunath Kondaiah

The device tree support has been added to i2c1 controller and corresponding i2c initilization in generic board file is cleaned up so that platfom device is registered through dt and omap device and not through board i2c initilization.

These changes will not affect non dt builds and existing functionality is retained.

Tested with dt and non dt builds and boot tested on beagle board.

---
 arch/arm/mach-omap2/board-omap3-dt.c |   14 +++++++-------
 drivers/i2c/busses/i2c-omap.c        |   23 ++++++++++++++++++++---
 2 files changed, 27 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/board-omap3-dt.c +7 -7
index 72c59a4..cd11224 100644
@@ -35,11 +35,11 @@ static struct twl4030_platform_data beagle_twldata = {
 	/* platform_data for children goes here */
 };
 
-static int __init omap3_beagle_i2c_init(void)
-{
-	omap3_pmic_init("twl4030", &beagle_twldata);
-	return 0;
-}
+struct of_dev_auxdata omap3_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA_ID_PDSIZE("ti,omap-i2c", 0x48070000, "i2c1", 1,\
+				&beagle_twldata, sizeof(beagle_twldata)),
+	{}
+};
 
 static void __init omap3_init_early(void)
 {
@@ -61,11 +61,11 @@ static struct of_device_id omap_dt_match_table[] __initdata = {
 
 static void __init omap3_init(void)
 {
-	omap3_beagle_i2c_init();
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap_serial_init();
 
-	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
+	of_platform_populate(NULL, omap_dt_match_table, omap3_auxdata_lookup,
+									 NULL);
 }
 
 static const char *omap3_dt_match[] __initdata = {
drivers/i2c/busses/i2c-omap.c +12 -0
index 2a072ff..9e98014 100644
@@ -38,6 +38,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of_i2c.h>
+#include <linux/of_device.h>
 #include <linux/slab.h>
 #include <linux/i2c-omap.h>
 #include <linux/pm_runtime.h>
@@ -972,6 +973,16 @@ static const struct i2c_algorithm omap_i2c_algo = {
 	.functionality	= omap_i2c_func,
 };
 
+#if defined(CONFIG_OF)
+static const struct of_device_id omap_i2c_of_match[] = {
+	{.compatible = "ti,omap-i2c", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, omap_i2c_of_match);
+#else
+#define omap_i2c_of_match NULL
+#endif
+
 static int __devinit
 omap_i2c_probe(struct platform_device *pdev)
 {
@@ -1008,12 +1019,17 @@ omap_i2c_probe(struct platform_device *pdev)
 		goto err_release_region;
 	}
 
+	speed = 100;	/* Default speed */
 	if (pdata != NULL) {
 		speed = pdata->clkrate;
 		dev->set_mpu_wkup_lat = pdata->set_mpu_wkup_lat;

drivers/i2c/busses/i2c-omap.c omap_i2c_probe(struct platform_device *pdev) · line 1032

Quoted 10 lines
drivers/i2c/busses/i2c-omap.c +7 -3
-	} else {
-		speed = 100;	/* Default speed */
-		dev->set_mpu_wkup_lat = NULL;
+#if defined(CONFIG_OF)
+	} else if (pdev->dev.of_node) {
+		u32 prop;
+		if (!of_property_read_u32(pdev->dev.of_node, "clock-frequency",
+									&prop))
+			speed = prop/100;
+#endif

This function calls of_i2c_register_devices which attaches all the required parameters reg, irq, archdata etc into i2c adapter. But it will not attach platform_data which results empty pdata pointer in i2c child devices.

Is this done purposefully? If so, how do we get pdata pointer in i2c child device.

-M

Quoted 18 lines
drivers/i2c/busses/i2c-omap.c +1 -0
 	}
 
 	dev->speed = speed;
@@ -1178,6 +1194,7 @@ static struct platform_driver omap_i2c_driver = {
 		.name	= "omap_i2c",
 		.owner	= THIS_MODULE,
 		.pm	= OMAP_I2C_PM_OPS,
+		.of_match_table = omap_i2c_of_match,
 	},
 };
 
Signature · 6 lines
1.7.4.1

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss at lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
#9 lore raw

PATCH v2 8/13 dt: omap: i2c: add dt support for i2c1 controller

Hi Manju,

Quoted 1 line · Manjunath Kondaiah

Hi Grant,

[...]

Quoted 5 lines

This function calls of_i2c_register_devices which attaches all the required parameters reg, irq, archdata etc into i2c adapter. But it will not attach platform_data which results empty pdata pointer in i2c child devices.

Is this done purposefully?

I think so, but anyway, we'd rather spend some time on doing a proper DT implementation than hacking more the AUXDATA temporary solution.

I've just sent a reworked version of that series with a pure dt-no-auxdata-hack approach.

Regards,
Benoit

#10 lore raw

PATCH v2 8/13 dt: omap: i2c: add dt support for i2c1 controller

Hi Benoit,

Quoted 11 lines · Benoit

Hi Manju,

Quoted 1 line · Manjunath Kondaiah

Hi Grant,

[...]

Quoted 4 lines

This function calls of_i2c_register_devices which attaches all the required parameters reg, irq, archdata etc into i2c adapter. But it will not attach platform_data which results empty pdata pointer in i2c child devices.

Quoted 8 lines
Quoted 1 line

Is this done purposefully?

I think so, but anyway, we'd rather spend some time on doing a proper DT implementation than hacking more the AUXDATA temporary solution.

I've just sent a reworked version of that series with a pure dt-no-auxdata-hack approach.

Thanks for initiating aux data cleanup series. Let us syncup on further changes and follow up so that we can have this feature with v3.2 merge window.

Grant, Can you have a look and provide feedback on all the patches which are done for omap dt work.

-M

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw

PATCH v2 8/13 dt: omap: i2c: add dt support for i2c1 controller

Quoted 4 lines

The device tree support has been added to i2c1 controller and corresponding i2c initilization in generic board file is cleaned up so that platfom device is registered through dt and omap device and not through board i2c initilization.

A couple of typos in the changelog.

That patch should be in two parts: the driver DT update and the beagle board update.

Quoted 4 lines

These changes will not affect non dt builds and existing functionality is retained.

Tested with dt and non dt builds and boot tested on beagle board.

Is it crashing at boot time like for panda? In that case a big disclaimer should be in the broken patch changelog as well.

Quoted 79 lines
---
   arch/arm/mach-omap2/board-omap3-dt.c |   14 +++++++-------
   drivers/i2c/busses/i2c-omap.c        |   23 ++++++++++++++++++++---
   2 files changed, 27 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/board-omap3-dt.c +7 -7
index 72c59a4..cd11224 100644
@@ -35,11 +35,11 @@ static struct twl4030_platform_data beagle_twldata = {
   	/* platform_data for children goes here */
   };
 
-static int __init omap3_beagle_i2c_init(void)
-{
-	omap3_pmic_init("twl4030",&beagle_twldata);
-	return 0;
-}
+struct of_dev_auxdata omap3_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA_ID_PDSIZE("ti,omap-i2c", 0x48070000, "i2c1", 1,\
+				&beagle_twldata, sizeof(beagle_twldata)),
+	{}
+};
 
   static void __init omap3_init_early(void)
   {
@@ -61,11 +61,11 @@ static struct of_device_id omap_dt_match_table[]
 __initdata = {
 
   static void __init omap3_init(void)
   {
-	omap3_beagle_i2c_init();
   	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
   	omap_serial_init();
 
-	of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
+	of_platform_populate(NULL, omap_dt_match_table, omap3_auxdata_lookup,
+									 NULL);
   }
 
   static const char *omap3_dt_match[] __initdata = {
drivers/i2c/busses/i2c-omap.c +12 -0
index 2a072ff..9e98014 100644
@@ -38,6 +38,7 @@
   #include<linux/clk.h>
   #include<linux/io.h>
   #include<linux/of_i2c.h>
+#include<linux/of_device.h>
   #include<linux/slab.h>
   #include<linux/i2c-omap.h>
   #include<linux/pm_runtime.h>
@@ -972,6 +973,16 @@ static const struct i2c_algorithm omap_i2c_algo = {
   	.functionality	= omap_i2c_func,
   };
 
+#if defined(CONFIG_OF)
+static const struct of_device_id omap_i2c_of_match[] = {
+	{.compatible = "ti,omap-i2c", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, omap_i2c_of_match);
+#else
+#define omap_i2c_of_match NULL
+#endif
+
   static int __devinit
   omap_i2c_probe(struct platform_device *pdev)
   {
@@ -1008,12 +1019,17 @@ omap_i2c_probe(struct platform_device *pdev)
   		goto err_release_region;
   	}
 
+	speed = 100;	/* Default speed */
   	if (pdata != NULL) {
   		speed = pdata->clkrate;

drivers/i2c/busses/i2c-omap.c omap_i2c_probe(struct platform_device *pdev) · line 1031

Quoted 10 lines
drivers/i2c/busses/i2c-omap.c +6 -3
   		dev->set_mpu_wkup_lat = pdata->set_mpu_wkup_lat;
-	} else {
-		speed = 100;	/* Default speed */
-		dev->set_mpu_wkup_lat = NULL;
+#if defined(CONFIG_OF)
+	} else if (pdev->dev.of_node) {
+		u32 prop;
+		if (!of_property_read_u32(pdev->dev.of_node, "clock-frequency",
+									&prop))
+			speed = prop/100;

Did you check the frequency? It should be prop/1000 to get Hz -> kHz conversion. Otherwise the driver will set the i2c speed at 4 MHz.

Benoit

Quoted 12 lines
drivers/i2c/busses/i2c-omap.c +2 -0
+#endif
   	}
 
   	dev->speed = speed;
@@ -1178,6 +1194,7 @@ static struct platform_driver omap_i2c_driver = {
   		.name	= "omap_i2c",
   		.owner	= THIS_MODULE,
   		.pm	= OMAP_I2C_PM_OPS,
+		.of_match_table = omap_i2c_of_match,
   	},
   };
 
#13 lore raw

PATCH v2 9/13 dt: omap4: add soc file for handling i2c controllers

In reply to G, Manjunath Kondaiah

Add omap4 soc dts file for handling omap4 soc i2c
controllers existing on l4-core bus.

---
 arch/arm/boot/dts/omap4-panda.dts |    7 +---
 arch/arm/boot/dts/omap4.dtsi      |   68 +++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4.dtsi
arch/arm/boot/dts/omap4-panda.dts +1 -6
index 58909e9..c28aa95 100644
@@ -1,9 +1,4 @@
-/dts-v1/;
-
-/memreserve/ 0x9D000000 0x03000000; /* Frame buffer */
-/memreserve/ 0xB0000000 0x10000000; /* Top 256MB is unaccessable */
-
-/include/ "skeleton.dtsi"
+/include/ "omap4.dtsi"
 
 / {
 	model = "TI OMAP4 PandaBoard";
arch/arm/boot/dts/omap4.dtsi new file +68 -0

68 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#14 lore raw

PATCH v2 9/13 dt: omap4: add soc file for handling i2c controllers

Quoted 60 lines · Manjunath Kondaiah

Add omap4 soc dts file for handling omap4 soc i2c
controllers existing on l4-core bus.

---
  arch/arm/boot/dts/omap4-panda.dts |    7 +---
  arch/arm/boot/dts/omap4.dtsi      |   68 +++++++++++++++++++++++++++++++++++++
  2 files changed, 69 insertions(+), 6 deletions(-)

create mode 100644 arch/arm/boot/dts/omap4.dtsi

arch/arm/boot/dts/omap4-panda.dts +1 -6
index 58909e9..c28aa95 100644
@@ -1,9 +1,4 @@
-/dts-v1/;
-
-/memreserve/ 0x9D000000 0x03000000; /* Frame buffer */
-/memreserve/ 0xB0000000 0x10000000; /* Top 256MB is unaccessable */
-
-/include/ "skeleton.dtsi"
+/include/ "omap4.dtsi"
 
  / {
  	model = "TI OMAP4 PandaBoard";
arch/arm/boot/dts/omap4.dtsi new file +28 -0
new file mode 100644
index 0000000..cb055f5
@@ -0,0 +1,68 @@
+/*
+ * Device Tree Source for OMAP4 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.
+ */
+
+/dts-v1/;
+
+/memreserve/ 0x9D000000 0x03000000; /* Frame buffer */
+/memreserve/ 0xB0000000 0x10000000; /* Top 256MB is unaccessable */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	#address-cells =<1>;
+	#size-cells =<1>;
+	model = "ti,omap4";
+
+	aliases {
+		i2c1 =&i2c1;
+		i2c2 =&i2c2;
+		i2c3 =&i2c3;
+		i2c4 =&i2c4;
+	};

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

Quoted 10 lines
arch/arm/boot/dts/omap4.dtsi new file +10 -0
+
+	l4-core {
+		compatible = "ti,omap4-l4-core", "sonics,s3220";
+		#address-cells =<1>;
+		#size-cells =<1>;
+		ranges =<0 0x48000000 0x1000000>;
+
+		i2c1: i2c at 70000 {
+			#address-cells =<1>;
+			#size-cells =<0>;

Are these really needed, given there are no child nodes defined? Same with all other instances.

Quoted 30 lines
arch/arm/boot/dts/omap4.dtsi new file +30 -0
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x70000 0x100>;
+			interrupts =<  88>;
+		};
+
+		i2c2: i2c at 72000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x72000 0x100>;
+			interrupts =<  89>;
+		};
+
+		i2c3: i2c at 60000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x60000 0x100>;
+			interrupts =<  93>;
+		};
+
+		i2c4: i2c at 350000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x350000 0x100>;
+			interrupts =<  94>;
+		};
+	};
+};
#15 lore raw

PATCH v2 9/13 dt: omap4: add soc file for handling i2c controllers

Quoted 66 lines · Rajendra Nayak
Quoted 65 lines · Manjunath Kondaiah

Add omap4 soc dts file for handling omap4 soc i2c
controllers existing on l4-core bus.

---
 arch/arm/boot/dts/omap4-panda.dts |    7 +---
 arch/arm/boot/dts/omap4.dtsi      |   68 +++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap4.dtsi
arch/arm/boot/dts/omap4-panda.dts +1 -6
index 58909e9..c28aa95 100644
@@ -1,9 +1,4 @@
-/dts-v1/;
-
-/memreserve/ 0x9D000000 0x03000000; /* Frame buffer */
-/memreserve/ 0xB0000000 0x10000000; /* Top 256MB is unaccessable */
-
-/include/ "skeleton.dtsi"
+/include/ "omap4.dtsi"
 
 / {
 	model = "TI OMAP4 PandaBoard";
arch/arm/boot/dts/omap4.dtsi new file +33 -0
new file mode 100644
index 0000000..cb055f5
@@ -0,0 +1,68 @@
+/*
+ * Device Tree Source for OMAP4 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.
+ */
+
+/dts-v1/;
+
+/memreserve/ 0x9D000000 0x03000000; /* Frame buffer */
+/memreserve/ 0xB0000000 0x10000000; /* Top 256MB is unaccessable */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	#address-cells =<1>;
+	#size-cells =<1>;
+	model = "ti,omap4";
+
+	aliases {
+		i2c1 =&i2c1;
+		i2c2 =&i2c2;
+		i2c3 =&i2c3;
+		i2c4 =&i2c4;
+	};
+
+	l4-core {
+		compatible = "ti,omap4-l4-core", "sonics,s3220";
+		#address-cells =<1>;
+		#size-cells =<1>;
Quoted 8 lines

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

Quoted 5 lines
arch/arm/boot/dts/omap4.dtsi new file +5 -0
+		ranges =<0 0x48000000 0x1000000>;
+
+		i2c1: i2c at 70000 {
+			#address-cells =<1>;
+			#size-cells =<0>;

Are these really needed, given there are no child nodes defined? Same with all other instances.

This will define all the available resources for a given soc and it can be disabled by using "status=disabled" in property field.

This is ongoing debate whether to have status field or not.

Grant,
What is the final alignment on using status field?

-M

Quoted 32 lines
Quoted 31 lines
arch/arm/boot/dts/omap4.dtsi new file +30 -0
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x70000 0x100>;
+			interrupts =<  88>;
+		};
+
+		i2c2: i2c at 72000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x72000 0x100>;
+			interrupts =<  89>;
+		};
+
+		i2c3: i2c at 60000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x60000 0x100>;
+			interrupts =<  93>;
+		};
+
+		i2c4: i2c at 350000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x350000 0x100>;
+			interrupts =<  94>;
+		};
+	};
+};

A message that is not in the archive (sent off-list or not yet received): [email protected]

#17 lore raw

PATCH v2 9/13 dt: omap4: add soc file for handling i2c controllers

From: G, Manjunath Kondaiah<[email protected]>

Quoted 6 lines

To: devicetree-discuss at lists.ozlabs.org
CC: linux-omap at vger.kernel.org, linux-arm-kernel at lists.infradead.org

Add omap4 soc dts file for handling omap4 soc i2c
controllers existing on l4-core bus.

The subject and changelog is not accurate. You are doing at least 3 things:
Moving the OMAP4 SoC data from panda board file to a SoC specific omap4.dtsi file.
Including the omap4.dtsi into panda.
Adding some i2c nodes.

You should use at least two or three separated patches to avoid in-accurate subject.

Benoit

Quoted 35 lines
---
   arch/arm/boot/dts/omap4-panda.dts |    7 +---
   arch/arm/boot/dts/omap4.dtsi      |   68
+++++++++++++++++++++++++++++++++++++
   2 files changed, 69 insertions(+), 6 deletions(-)

create mode 100644 arch/arm/boot/dts/omap4.dtsi

arch/arm/boot/dts/omap4-panda.dts +1 -6
index 58909e9..c28aa95 100644
@@ -1,9 +1,4 @@
-/dts-v1/;
-
-/memreserve/ 0x9D000000 0x03000000; /* Frame buffer */
-/memreserve/ 0xB0000000 0x10000000; /* Top 256MB is unaccessable */
-
-/include/ "skeleton.dtsi"
+/include/ "omap4.dtsi"
 
   / {
   	model = "TI OMAP4 PandaBoard";
arch/arm/boot/dts/omap4.dtsi new file +4 -0
new file mode 100644
index 0000000..cb055f5
@@ -0,0 +1,68 @@
+/*
+ * Device Tree Source for OMAP4 SoC
+ *
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/

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

Quoted 10 lines
arch/arm/boot/dts/omap4.dtsi new file +10 -0
+ *
+ * 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.
+ */
+
+/dts-v1/;
+
+/memreserve/ 0x9D000000 0x03000000; /* Frame buffer */
+/memreserve/ 0xB0000000 0x10000000; /* Top 256MB is unaccessable */

That information was already there previously but where does it come from? 48 MB is clearly not for the FB, and the top 256 MB should be accessible with highmem.

Benoit

Quoted 54 lines
arch/arm/boot/dts/omap4.dtsi new file +54 -0
+
+/include/ "skeleton.dtsi"
+
+/ {
+	#address-cells =<1>;
+	#size-cells =<1>;
+	model = "ti,omap4";
+
+	aliases {
+		i2c1 =&i2c1;
+		i2c2 =&i2c2;
+		i2c3 =&i2c3;
+		i2c4 =&i2c4;
+	};
+
+	l4-core {
+		compatible = "ti,omap4-l4-core", "sonics,s3220";
+		#address-cells =<1>;
+		#size-cells =<1>;
+		ranges =<0 0x48000000 0x1000000>;
+
+		i2c1: i2c at 70000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x70000 0x100>;
+			interrupts =<  88>;
+		};
+
+		i2c2: i2c at 72000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x72000 0x100>;
+			interrupts =<  89>;
+		};
+
+		i2c3: i2c at 60000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x60000 0x100>;
+			interrupts =<  93>;
+		};
+
+		i2c4: i2c at 350000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x350000 0x100>;
+			interrupts =<  94>;
+		};
+	};
+};
#18 lore raw

PATCH v2 9/13 dt: omap4: add soc file for handling i2c controllers

Quoted 8 lines · Benoit

From: G, Manjunath Kondaiah<[email protected]>

Quoted 6 lines

To: devicetree-discuss at lists.ozlabs.org
CC: linux-omap at vger.kernel.org, linux-arm-kernel at lists.infradead.org

Add omap4 soc dts file for handling omap4 soc i2c
controllers existing on l4-core bus.

Quoted 8 lines

The subject and changelog is not accurate. You are doing at least 3 things:
Moving the OMAP4 SoC data from panda board file to a SoC specific omap4.dtsi file.
Including the omap4.dtsi into panda.
Adding some i2c nodes.

You should use at least two or three separated patches to avoid in-accurate subject.

As these changes are straight forward, I can update patch description with the required information instead of create too many patches.

If you are too specific on splitting the patches, I am ok with that too.

Quoted 45 lines

Benoit

Quoted 41 lines
---
  arch/arm/boot/dts/omap4-panda.dts |    7 +---
  arch/arm/boot/dts/omap4.dtsi      |   68
+++++++++++++++++++++++++++++++++++++
  2 files changed, 69 insertions(+), 6 deletions(-)

create mode 100644 arch/arm/boot/dts/omap4.dtsi

arch/arm/boot/dts/omap4-panda.dts +1 -6
index 58909e9..c28aa95 100644
@@ -1,9 +1,4 @@
-/dts-v1/;
-
-/memreserve/ 0x9D000000 0x03000000; /* Frame buffer */
-/memreserve/ 0xB0000000 0x10000000; /* Top 256MB is unaccessable */
-
-/include/ "skeleton.dtsi"
+/include/ "omap4.dtsi"
 
  / {
  	model = "TI OMAP4 PandaBoard";
arch/arm/boot/dts/omap4.dtsi new file +10 -0
new file mode 100644
index 0000000..cb055f5
@@ -0,0 +1,68 @@
+/*
+ * Device Tree Source for OMAP4 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.
+ */
+
Quoted 8 lines

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

Quoted 4 lines
arch/arm/boot/dts/omap4.dtsi new file +4 -0
+/dts-v1/;
+
+/memreserve/ 0x9D000000 0x03000000; /* Frame buffer */
+/memreserve/ 0xB0000000 0x10000000; /* Top 256MB is unaccessable */

That information was already there previously but where does it come from? 48 MB is clearly not for the FB, and the top 256 MB should be accessible with highmem.

This was originally introduced by Grant and he can provide more info on this change.

39881c4e (Grant Likely 2011-07-05 23:42:31 -0600 4)

-M

Quoted 58 lines

Benoit

Quoted 54 lines
arch/arm/boot/dts/omap4.dtsi new file +54 -0
+
+/include/ "skeleton.dtsi"
+
+/ {
+	#address-cells =<1>;
+	#size-cells =<1>;
+	model = "ti,omap4";
+
+	aliases {
+		i2c1 =&i2c1;
+		i2c2 =&i2c2;
+		i2c3 =&i2c3;
+		i2c4 =&i2c4;
+	};
+
+	l4-core {
+		compatible = "ti,omap4-l4-core", "sonics,s3220";
+		#address-cells =<1>;
+		#size-cells =<1>;
+		ranges =<0 0x48000000 0x1000000>;
+
+		i2c1: i2c at 70000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x70000 0x100>;
+			interrupts =<  88>;
+		};
+
+		i2c2: i2c at 72000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x72000 0x100>;
+			interrupts =<  89>;
+		};
+
+		i2c3: i2c at 60000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x60000 0x100>;
+			interrupts =<  93>;
+		};
+
+		i2c4: i2c at 350000 {
+			#address-cells =<1>;
+			#size-cells =<0>;
+			compatible = "ti,omap-i2c", "ti,omap-device";
+			reg =<0x350000 0x100>;
+			interrupts =<  94>;
+		};
+	};
+};
#19 lore raw

PATCH v2 9/13 dt: omap4: add soc file for handling i2c controllers

Quoted 15 lines · Manjunath Kondaiah
Quoted 14 lines · Benoit

From: G, Manjunath Kondaiah<[email protected]>

Quoted 6 lines

To: devicetree-discuss at lists.ozlabs.org
CC: linux-omap at vger.kernel.org, linux-arm-kernel at lists.infradead.org

Add omap4 soc dts file for handling omap4 soc i2c
controllers existing on l4-core bus.

The subject and changelog is not accurate. You are doing at least 3 things:
Moving the OMAP4 SoC data from panda board file to a SoC specific omap4.dtsi file.
Including the omap4.dtsi into panda.
Adding some i2c nodes.

Quoted 7 lines
Quoted 2 lines

You should use at least two or three separated patches to avoid in-accurate subject.

As these changes are straight forward, I can update patch description with the required information instead of create too many patches.

If you are too specific on splitting the patches, I am ok with that too.

I already fixed partially the OMAP4 patches as part of my upcoming OMAP4 early devices DT migration. So I'll rebase your series on top of it.

I'll send you that tomorrow.

Benoit

#20 lore raw

PATCH v2 11/13 dt: omap4: add generic board file for dt support

In reply to G, Manjunath Kondaiah

The generic board file is created and derived from omap4 panda board file.

The changes here focus on minimal configuration to boot panda board with dt enabled which provides basic platform for converting device drivers for using dt.

---
 arch/arm/boot/dts/omap4-panda.dts      |    2 +-
 arch/arm/mach-omap2/Kconfig            |   11 +++++
 arch/arm/mach-omap2/Makefile           |    1 +
 arch/arm/mach-omap2/board-omap4-dt.c   |   66 ++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/board-omap4panda.c |    6 ---
 5 files changed, 79 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap4-dt.c
arch/arm/boot/dts/omap4-panda.dts +1 -1
index 6b831ca..9d1b17c 100644
@@ -2,7 +2,7 @@
 
 / {
 	model = "TI OMAP4 PandaBoard";
-	compatible = "ti,omap4-panda", "ti,omap4430";
+	compatible = "ti,omap4-panda", "ti,omap4";
 
 	i2c1 {
 		clock-frequency = <400000>;
arch/arm/mach-omap2/Kconfig +11 -0
index 4fbb54d..853b14c 100644
@@ -337,6 +337,17 @@ config MACH_OMAP4_PANDA
 	select OMAP_PACKAGE_CBS
 	select REGULATOR_FIXED_VOLTAGE
 
+config MACH_OMAP4_DT
+	bool "Generic OMAP4 board(FDT support)"
+	depends on ARCH_OMAP4
+	select OMAP_PACKAGE_CBB
+	select USE_OF
+
+	help
+	  Support for generic TI OMAP4 boards using Flattened Device Tree.
+	  Say Y here to enable OMAP3 device tree support
+	  More information at Documentation/devicetree
+
 config OMAP3_EMU
 	bool "OMAP3 debugging peripherals"
 	depends on ARCH_OMAP3
arch/arm/mach-omap2/Makefile +1 -0
index e702e47..8b8c29c 100644
@@ -198,6 +198,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)		+= board-omap3evm.o
 obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o
 obj-$(CONFIG_MACH_OMAP3_DT)		+= board-omap3-dt.o
+obj-$(CONFIG_MACH_OMAP4_DT)		+= board-omap4-dt.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)		+= board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RM680)		+= board-rm680.o \
 					   sdram-nokia.o
arch/arm/mach-omap2/board-omap4-dt.c new file +66 -0

66 lines not on this page · raw message

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.4.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#22 lore raw

PATCH v2 11/13 dt: omap4: add generic board file for dt support

From: G, Manjunath Kondaiah<[email protected]>

Quoted 23 lines

The generic board file is created and derived from omap4 panda board file.

The changes here focus on minimal configuration to boot panda board with dt enabled which provides basic platform for converting device drivers for using dt.

---
   arch/arm/boot/dts/omap4-panda.dts      |    2 +-
   arch/arm/mach-omap2/Kconfig            |   11 +++++
   arch/arm/mach-omap2/Makefile           |    1 +
   arch/arm/mach-omap2/board-omap4-dt.c   |   66
++++++++++++++++++++++++++++++++
   arch/arm/mach-omap2/board-omap4panda.c |    6 ---
   5 files changed, 79 insertions(+), 7 deletions(-)

create mode 100644 arch/arm/mach-omap2/board-omap4-dt.c

arch/arm/boot/dts/omap4-panda.dts +0 -0
index 6b831ca..9d1b17c 100644

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

Quoted 5 lines
arch/arm/boot/dts/omap4-panda.dts +1 -1
@@ -2,7 +2,7 @@
 
   / {
   	model = "TI OMAP4 PandaBoard";
-	compatible = "ti,omap4-panda", "ti,omap4430";
+	compatible = "ti,omap4-panda", "ti,omap4";

That change does not belong here, or at least should be listed in the changelog. Potentially you should keep the ti,omap4430 and just add the ti,omap4 to have the most generic compatible value.

Quoted 8 lines
arch/arm/boot/dts/omap4-panda.dts +0 -0
   	i2c1 {
   		clock-frequency =<400000>;
arch/arm/mach-omap2/Kconfig +0 -0
index 4fbb54d..853b14c 100644

arch/arm/mach-omap2/Kconfig config MACH_OMAP4_PANDA · line 343

Quoted 7 lines
arch/arm/mach-omap2/Kconfig +4 -0
@@ -337,6 +337,17 @@ config MACH_OMAP4_PANDA
   	select OMAP_PACKAGE_CBS
   	select REGULATOR_FIXED_VOLTAGE
 
+config MACH_OMAP4_DT
+	bool "Generic OMAP4 board(FDT support)"
+	depends on ARCH_OMAP4
+	select OMAP_PACKAGE_CBB

Wrong package... it looks like some OMAP3 copy/paste.

arch/arm/mach-omap2/Kconfig config MACH_OMAP4_PANDA · line 348

Quoted 5 lines
arch/arm/mach-omap2/Kconfig +5 -0
+	select USE_OF
+
+	help
+	  Support for generic TI OMAP4 boards using Flattened Device Tree.
+	  Say Y here to enable OMAP3 device tree support

Some more copy/paste evidence:-)

Quoted 10 lines
arch/arm/mach-omap2/Kconfig +2 -0
+	  More information at Documentation/devicetree
+
   config OMAP3_EMU
   	bool "OMAP3 debugging peripherals"
   	depends on ARCH_OMAP3
arch/arm/mach-omap2/Makefile +0 -0
index e702e47..8b8c29c 100644

arch/arm/mach-omap2/Makefile obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o · line 201

Quoted 4 lines
arch/arm/mach-omap2/Makefile +1 -0
@@ -198,6 +198,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)		+= board-omap3evm.o
   obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o
   obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o
   obj-$(CONFIG_MACH_OMAP3_DT)		+= board-omap3-dt.o
+obj-$(CONFIG_MACH_OMAP4_DT)		+= board-omap4-dt.o

Boards are grouped by SoC version.

arch/arm/mach-omap2/board-omap4-dt.c line 2

Quoted 12 lines
arch/arm/mach-omap2/Makefile +0 -0
   obj-$(CONFIG_MACH_NOKIA_N8X0)		+= board-n8x0.o
   obj-$(CONFIG_MACH_NOKIA_RM680)		+= board-rm680.o \
   					   sdram-nokia.o
arch/arm/mach-omap2/board-omap4-dt.c new file +2 -0
new file mode 100644
index 0000000..a4d296c
@@ -0,0 +1,66 @@
+/*
+ * TI OMAP3 device tree board support

One more C&P.

arch/arm/mach-omap2/board-omap4-dt.c

Quoted 13 lines
arch/arm/mach-omap2/board-omap4-dt.c new file +13 -0
+ *
+ * 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.
+ */
+
+#include<linux/kernel.h>
+#include<linux/init.h>
+#include<linux/i2c/twl.h>
+
+#include<mach/omap4-common.h>

nitpicking, but it should go after <plat/common.h>.

Quoted 33 lines
arch/arm/mach-omap2/board-omap4-dt.c new file +33 -0
+#include<asm/mach/arch.h>
+#include<asm/mach/map.h>
+
+#include<plat/common.h>
+
+#include "common-board-devices.h"
+
+static void __init omap4_init_early(void)
+{
+	omap2_init_common_infrastructure();
+	omap2_init_common_devices(NULL, NULL);
+}
+
+static struct twl4030_platform_data omap4_twldata = {
+	.irq_base	= TWL6030_IRQ_BASE,
+	.irq_end	= TWL6030_IRQ_END,
+};
+
+static int __init omap4_i2c_init(void)
+{
+	omap4_pmic_init("twl6030",&omap4_twldata);
+	return 0;
+}
+
+static void __init omap4_init(void)
+{
+	omap4_i2c_init();
+	omap_serial_init();
+}
+
+static void __init omap4_map_io(void)
+{
+	omap2_set_globals_443x();

arch/arm/mach-omap2/board-omap4-dt.c line 58

Quoted 10 lines
arch/arm/mach-omap2/board-omap4-dt.c new file +10 -0
+	omap44xx_map_common_io();
+}
+
+static const char *omap4_match[] __initdata = {
+	"ti,omap4",
+	NULL,
+};
+
+DT_MACHINE_START(OMAP4_DT, "TI OMAP4 (Flattened Device Tree)")
+	.boot_params	= 0x80000100,

Not needed anymore with DT.

arch/arm/mach-omap2/board-omap4panda.c

Quoted 13 lines
arch/arm/mach-omap2/board-omap4-dt.c new file +8 -0
+	.reserve	= omap_reserve,
+	.map_io		= omap4_map_io,
+	.init_early	= omap4_init_early,
+	.init_irq	= gic_init_irq,
+	.init_machine	= omap4_init,
+	.timer		=&omap4_timer,
+	.dt_compat	= omap4_match,
+MACHINE_END
arch/arm/mach-omap2/board-omap4panda.c +0 -0
index 1c583c7..9aaa960 100644

That change does not really belong here or the changelog is not correct. You can potentially do it in an other patch before. It will not really introduce any regression if you do it before adding any information into panda DT.

Regards,
Benoit

#23 lore raw

PATCH v2 11/13 dt: omap4: add generic board file for dt support

Quoted 25 lines · Benoit

From: G, Manjunath Kondaiah<[email protected]>

Quoted 24 lines

The generic board file is created and derived from omap4 panda board file.

The changes here focus on minimal configuration to boot panda board with dt enabled which provides basic platform for converting device drivers for using dt.

---
  arch/arm/boot/dts/omap4-panda.dts      |    2 +-
  arch/arm/mach-omap2/Kconfig            |   11 +++++
  arch/arm/mach-omap2/Makefile           |    1 +
  arch/arm/mach-omap2/board-omap4-dt.c   |   66
++++++++++++++++++++++++++++++++
  arch/arm/mach-omap2/board-omap4panda.c |    6 ---
  5 files changed, 79 insertions(+), 7 deletions(-)

create mode 100644 arch/arm/mach-omap2/board-omap4-dt.c

arch/arm/boot/dts/omap4-panda.dts +0 -0
index 6b831ca..9d1b17c 100644
@@ -2,7 +2,7 @@
 
Quoted 8 lines

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

Quoted 4 lines
arch/arm/boot/dts/omap4-panda.dts +1 -1
  / {
  	model = "TI OMAP4 PandaBoard";
-	compatible = "ti,omap4-panda", "ti,omap4430";
+	compatible = "ti,omap4-panda", "ti,omap4";

That change does not belong here, or at least should be listed in the changelog. Potentially you should keep the ti,omap4430 and just add the ti,omap4 to have the most generic compatible value.

ok.

Quoted 19 lines
Quoted 9 lines
arch/arm/boot/dts/omap4-panda.dts +0 -0
  	i2c1 {
  		clock-frequency =<400000>;
arch/arm/mach-omap2/Kconfig +0 -0
index 4fbb54d..853b14c 100644

arch/arm/mach-omap2/Kconfig config MACH_OMAP4_PANDA · line 343

Quoted 7 lines
arch/arm/mach-omap2/Kconfig +4 -0
@@ -337,6 +337,17 @@ config MACH_OMAP4_PANDA
  	select OMAP_PACKAGE_CBS
  	select REGULATOR_FIXED_VOLTAGE
 
+config MACH_OMAP4_DT
+	bool "Generic OMAP4 board(FDT support)"
+	depends on ARCH_OMAP4
+	select OMAP_PACKAGE_CBB

Wrong package... it looks like some OMAP3 copy/paste.

Quoted 7 lines

arch/arm/mach-omap2/Kconfig config MACH_OMAP4_PANDA · line 348

Quoted 5 lines
arch/arm/mach-omap2/Kconfig +5 -0
+	select USE_OF
+
+	help
+	  Support for generic TI OMAP4 boards using Flattened Device Tree.
+	  Say Y here to enable OMAP3 device tree support

Some more copy/paste evidence:-)

Sorry for this typo. Will fix it.

Quoted 17 lines
Quoted 11 lines
arch/arm/mach-omap2/Kconfig +2 -0
+	  More information at Documentation/devicetree
+
  config OMAP3_EMU
  	bool "OMAP3 debugging peripherals"
  	depends on ARCH_OMAP3
arch/arm/mach-omap2/Makefile +0 -0
index e702e47..8b8c29c 100644

arch/arm/mach-omap2/Makefile obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o · line 201

Quoted 4 lines
arch/arm/mach-omap2/Makefile +1 -0
@@ -198,6 +198,7 @@ obj-$(CONFIG_MACH_OMAP3EVM)		+= board-omap3evm.o
  obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o
  obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o
  obj-$(CONFIG_MACH_OMAP3_DT)		+= board-omap3-dt.o
+obj-$(CONFIG_MACH_OMAP4_DT)		+= board-omap4-dt.o

Boards are grouped by SoC version.

one board file/soc family like board-omap4-dt for omap4xxxx can you please be more specific what changes you are expecting?

Quoted 16 lines

arch/arm/mach-omap2/board-omap4-dt.c line 2

Quoted 13 lines
arch/arm/mach-omap2/Makefile +0 -0
  obj-$(CONFIG_MACH_NOKIA_N8X0)		+= board-n8x0.o
  obj-$(CONFIG_MACH_NOKIA_RM680)		+= board-rm680.o \
  					   sdram-nokia.o
arch/arm/mach-omap2/board-omap4-dt.c new file +2 -0
new file mode 100644
index 0000000..a4d296c
@@ -0,0 +1,66 @@
+/*
+ * TI OMAP3 device tree board support

One more C&P.

Quoted 15 lines

arch/arm/mach-omap2/board-omap4-dt.c

Quoted 13 lines
arch/arm/mach-omap2/board-omap4-dt.c new file +13 -0
+ *
+ * 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.
+ */
+
+#include<linux/kernel.h>
+#include<linux/init.h>
+#include<linux/i2c/twl.h>
+
+#include<mach/omap4-common.h>

nitpicking, but it should go after <plat/common.h>.

ok

Quoted 38 lines
Quoted 38 lines
arch/arm/mach-omap2/board-omap4-dt.c new file +37 -0
+#include<asm/mach/arch.h>
+#include<asm/mach/map.h>
+
+#include<plat/common.h>
+
+#include "common-board-devices.h"
+
+static void __init omap4_init_early(void)
+{
+	omap2_init_common_infrastructure();
+	omap2_init_common_devices(NULL, NULL);
+}
+
+static struct twl4030_platform_data omap4_twldata = {
+	.irq_base	= TWL6030_IRQ_BASE,
+	.irq_end	= TWL6030_IRQ_END,
+};
+
+static int __init omap4_i2c_init(void)
+{
+	omap4_pmic_init("twl6030",&omap4_twldata);
+	return 0;
+}
+
+static void __init omap4_init(void)
+{
+	omap4_i2c_init();
+	omap_serial_init();
+}
+
+static void __init omap4_map_io(void)
+{
+	omap2_set_globals_443x();
+	omap44xx_map_common_io();
+}
+
+static const char *omap4_match[] __initdata = {
Quoted 8 lines

arch/arm/mach-omap2/board-omap4-dt.c line 58

Quoted 6 lines
arch/arm/mach-omap2/board-omap4-dt.c new file +6 -0
+	"ti,omap4",
+	NULL,
+};
+
+DT_MACHINE_START(OMAP4_DT, "TI OMAP4 (Flattened Device Tree)")
+	.boot_params	= 0x80000100,

Not needed anymore with DT.

yes

Quoted 11 lines
Quoted 11 lines
arch/arm/mach-omap2/board-omap4-dt.c new file +8 -0
+	.reserve	= omap_reserve,
+	.map_io		= omap4_map_io,
+	.init_early	= omap4_init_early,
+	.init_irq	= gic_init_irq,
+	.init_machine	= omap4_init,
+	.timer		=&omap4_timer,
+	.dt_compat	= omap4_match,
+MACHINE_END
arch/arm/mach-omap2/board-omap4panda.c +0 -0
Quoted 8 lines

arch/arm/mach-omap2/board-omap4panda.c

Quoted 3 lines

index 1c583c7..9aaa960 100644

arch/arm/mach-omap2/board-omap4panda.c +0 -0

That change does not really belong here or the changelog is not correct. You can potentially do it in an other patch before. It will not really introduce any regression if you do it before adding any information into panda DT.

ok.

-M

#24 lore raw

PATCH v2 12/13 dt: omap4: enable dt support for i2c1 controller

In reply to G, Manjunath Kondaiah

Enable dt support for omap4 i2c1 controller and cleanup legacy i2c device registration in omap4 generic board file.

---
 arch/arm/mach-omap2/board-omap4-dt.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/board-omap4-dt.c +15 -6
index a4d296c..9ade238 100644
@@ -11,6 +11,8 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/i2c/twl.h>
+#include <linux/of_platform.h>
+#include <linux/of_address.h>
 
 #include <mach/omap4-common.h>
 #include <asm/mach/arch.h>
@@ -31,16 +33,23 @@ static struct twl4030_platform_data omap4_twldata = {
 	.irq_end	= TWL6030_IRQ_END,
 };
 
-static int __init omap4_i2c_init(void)
-{
-	omap4_pmic_init("twl6030", &omap4_twldata);
-	return 0;
-}
+struct of_dev_auxdata omap4_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA_ID_PDSIZE("ti,omap-i2c", 0x48070000, "i2c1", 1,\
+				&omap4_twldata, sizeof(omap4_twldata)),
+	{}
+};
+
+static struct of_device_id omap_dt_match_table[] __initdata = {
+	{ .compatible = "ti,omap4-l4-core", },
+	{}
+};
 
 static void __init omap4_init(void)
 {
-	omap4_i2c_init();
 	omap_serial_init();
+
+	of_platform_populate(NULL, omap_dt_match_table, omap4_auxdata_lookup,
+									 NULL);
 }
 
 static void __init omap4_map_io(void)
Signature · 1 line
1.7.4.1
#25 lore raw

PATCH v2 13/13 dt: omap: i2c: dt usage model documentation

In reply to G, Manjunath Kondaiah

Add documentation for using omap i2c controller with device tree support enabled.

---
 Documentation/devicetree/bindings/i2c/omap-i2c.txt |   57 ++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/omap-i2c.txt
Documentation/devicetree/bindings/i2c/omap-i2c.txt new file +57 -0
new file mode 100644
index 0000000..f427445
@@ -0,0 +1,57 @@
+* OMAP I2C
+----------
+
+The OMAP SoC's has multiple I2C controllers and each controller can
+have I2C child devices.
+
+Required properties :
+
+ - clock-frequency : desired I2C bus clock frequency in Hz.
+ - compatible : should be "ti,omap-i2c"
+
+Recommended properties :
+
+ - reg : Offset and length of the register set for the device
+ - interrupts : <a b> where a is the interrupt number and b is a
+   field that represents an encoding of the sense and level
+   information for the interrupt.  This should be encoded based on
+   the information in section 2) depending on the type of interrupt
+   controller you have.
+ - interrupt-parent : the phandle for the interrupt controller that
+   services interrupts for this device.
+
+Optional:
+The driver platform data can not be passed through device tree as of
+now hence aux data structure can be used in board files. The aux data
+is temparory solution and plan is to move it to device tree dts file.
+
+Note: Current implementation uses only clock-frequency field from
+device tree blob and all other data will be fetched from omap hwmod
+data base during device registration. Future plan is to migrate hwmod
+data base contents into device tree blob so that, all the required
+data will be used from device tree dts file.
+
+Examples :
+
+	/* OMAP4 based board */
+	#address-cells = <1>;
+	#size-cells = <1>;
+	ranges = <0 0x48000000 0x1000000>;
+
+	i2c1: i2c@70000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "ti,omap-i2c", "ti,omap-device";
+		reg = <0x70000 0x100>;
+		interrupts = < 88 >;
+		clock-frequency = <400000>;
+	};
+
+	i2c2: i2c@72000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "ti,omap-i2c", "ti,omap-device";
+		reg = <0x72000 0x100>;
+		interrupts = < 89 >;
+		clock-frequency = <400000>;
+	};
Signature · 1 line
1.7.4.1
#26 lore raw

PATCH v2 1/13 OMAP: omap_device: Add device tree node pointer

In reply to G, Manjunath Kondaiah

The omap_device requires new omap_device api to be added in order to support omap dt.

The new api is added and new parameter device node pointer "np" is added to existing api. The users of omap_device api is changed accordingly.

Build and boot tested on omap3 beagle for both dt and not dt build.

---
 arch/arm/mach-omap2/devices.c                 |    2 +-
 arch/arm/mach-omap2/mcbsp.c                   |    2 +-
 arch/arm/plat-omap/include/plat/omap_device.h |   11 +++++-
 arch/arm/plat-omap/omap_device.c              |   46 +++++++++++++++++++++++--
 4 files changed, 55 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/devices.c +1 -1
index 10adf66..d23e4bc 100644
@@ -92,7 +92,7 @@ static int __init omap4_l3_init(void)
 			pr_err("could not look up %s\n", oh_name);
 	}
 
-	pdev = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL,
+	pdev = omap_device_build_ss(NULL, "omap_l3_noc", 0, oh, 3, NULL,
 						     0, NULL, 0, 0);
 
 	WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
arch/arm/mach-omap2/mcbsp.c +1 -1
index 7a42f32..98eb95d 100644
@@ -144,7 +144,7 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
 		(struct omap_mcbsp_dev_attr *)(oh->dev_attr))->sidetone);
 		count++;
 	}
-	pdev = omap_device_build_ss(name, id, oh_device, count, pdata,
+	pdev = omap_device_build_ss(NULL, name, id, oh_device, count, pdata,
 				sizeof(*pdata), omap2_mcbsp_latency,
 				ARRAY_SIZE(omap2_mcbsp_latency), false);
 	kfree(pdata);
arch/arm/plat-omap/include/plat/omap_device.h +10 -1
index d4d9b96..37c231d 100644
@@ -33,6 +33,7 @@
 
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 
 #include <plat/omap_hwmod.h>
 
@@ -94,12 +95,20 @@ struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
 				      struct omap_device_pm_latency *pm_lats,
 				      int pm_lats_cnt, int is_early_device);
 
-struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
+struct platform_device *omap_device_build_ss(struct device_node *np,
+					 const char *pdev_name, int pdev_id,
 					 struct omap_hwmod **oh, int oh_cnt,
 					 void *pdata, int pdata_len,
 					 struct omap_device_pm_latency *pm_lats,
 					 int pm_lats_cnt, int is_early_device);
 
+struct platform_device *omap_device_build_dt(struct device_node *np,
+				      const char *pdev_name, int pdev_id,
+				      struct omap_hwmod *oh, void *pdata,
+				      int pdata_len,
+				      struct omap_device_pm_latency *pm_lats,
+				      int pm_lats_cnt, int is_early_device);
+
 void __iomem *omap_device_get_rt_va(struct omap_device *od);
 
 /* OMAP PM interface */
arch/arm/plat-omap/omap_device.c +43 -3

87 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#27 lore raw

PATCH v2 3/13 dt: omap3: add soc file for handling i2c controllers

In reply to G, Manjunath Kondaiah

Add omap3 soc file for handling omap3 soc i2c controllers existing on l4-core bus.

---
 arch/arm/boot/dts/omap3.dtsi |   62 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/omap3.dtsi
arch/arm/boot/dts/omap3.dtsi new file +62 -0
new file mode 100644
index 0000000..9ea8257
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+
+/dts-v1/;
+/include/ "skeleton.dtsi"
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	model = "ti,omap3";
+
+	aliases {
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		i2c3 = &i2c3;
+	};
+
+	l4-core {
+		compatible = "ti,omap3-l4-core", "sonics,s3220";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0x48000000 0x1000000>;
+
+		i2c1: i2c@70000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "ti,omap-i2c";
+			reg = <0x70000 0x100>;
+			interrupts = < 88 >;
+		};
+
+		i2c2: i2c@72000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "ti,omap-i2c";
+			reg = <0x72000 0x100>;
+			interrupts = < 89 >;
+		};
+
+		i2c3: i2c@60000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "ti,omap-i2c";
+			reg = <0x60000 0x100>;
+			interrupts = < 93 >;
+		};
+	};
+
+	l4-per {
+		compatible = "ti,l4-per";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0x49000000 0x100000>;
+	};
+};
Signature · 1 line
1.7.4.1
#28 lore raw

PATCH v2 6/13 dt: omap3: add omap-device compatible property

In reply to G, Manjunath Kondaiah

Add "omap-device" to the i2c controllers compatible property.

---
 arch/arm/boot/dts/omap3.dtsi |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/omap3.dtsi +3 -3
index 9ea8257..f64c63d 100644
@@ -31,7 +31,7 @@
 		i2c1: i2c@70000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
-			compatible = "ti,omap-i2c";
+			compatible = "ti,omap-i2c", "ti,omap-device";
 			reg = <0x70000 0x100>;
 			interrupts = < 88 >;
 		};
@@ -39,7 +39,7 @@
 		i2c2: i2c@72000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
-			compatible = "ti,omap-i2c";
+			compatible = "ti,omap-i2c", "ti,omap-device";
 			reg = <0x72000 0x100>;
 			interrupts = < 89 >;
 		};
@@ -47,7 +47,7 @@
 		i2c3: i2c@60000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
-			compatible = "ti,omap-i2c";
+			compatible = "ti,omap-i2c", "ti,omap-device";
 			reg = <0x60000 0x100>;
 			interrupts = < 93 >;
 		};
Signature · 1 line
1.7.4.1
#29 lore raw

PATCH v2 10/13 dt: omap4: panda board: set clock freq for i2c devices

In reply to G, Manjunath Kondaiah

Update omap4 panda dts file with required clock frequencies for the i2c client devices existing on panda board.

---
 arch/arm/boot/dts/omap4-panda.dts |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap4-panda.dts +16 -0
index c28aa95..6b831ca 100644
@@ -3,4 +3,20 @@
 / {
 	model = "TI OMAP4 PandaBoard";
 	compatible = "ti,omap4-panda", "ti,omap4430";
+
+	i2c1 {
+		clock-frequency = <400000>;
+	};
+
+	i2c2 {
+		clock-frequency = <400000>;
+	};
+
+	i2c3 {
+		clock-frequency = <400000>;
+	};
+
+	i2c4 {
+		clock-frequency = <400000>;
+	};
 };
Signature · 1 line
1.7.4.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#31 lore raw

PATCH v2 10/13 dt: omap4: panda board: set clock freq for i2c devices

Quoted 29 lines

From: G, Manjunath Kondaiah<[email protected]>
To: devicetree-discuss at lists.ozlabs.org
CC: linux-omap at vger.kernel.org, linux-arm-kernel at lists.infradead.org

Update omap4 panda dts file with required clock frequencies for the i2c client devices existing on panda board.

---
   arch/arm/boot/dts/omap4-panda.dts |   16 ++++++++++++++++
   1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap4-panda.dts +7 -0
index c28aa95..6b831ca 100644
@@ -3,4 +3,20 @@
   / {
   	model = "TI OMAP4 PandaBoard";
   	compatible = "ti,omap4-panda", "ti,omap4430";
+
+	i2c1 {
+		clock-frequency =<400000>;
+	};
+
+	i2c2 {
+		clock-frequency =<400000>;

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

Quoted 10 lines
arch/arm/boot/dts/omap4-panda.dts +9 -0
+	};
+
+	i2c3 {
+		clock-frequency =<400000>;
+	};
+
+	i2c4 {
+		clock-frequency =<400000>;
+	};
   };

Are you sure that this patch is setting the expected frequency? I see 100kHz in the boot log even with that patch.

I took me some time to find the proper syntax, but in order to reference an existing node, you have to use &i2c1 at the top level of the file. If you check the output of the DTC compiler, you will see the property at the proper node.

Benoit

#32 lore raw

PATCH v2 10/13 dt: omap4: panda board: set clock freq for i2c devices

Hi Benoit,

Quoted 43 lines · Benoit
Quoted 29 lines

From: G, Manjunath Kondaiah<[email protected]>
To: devicetree-discuss at lists.ozlabs.org
CC: linux-omap at vger.kernel.org, linux-arm-kernel at lists.infradead.org

Update omap4 panda dts file with required clock frequencies for the i2c client devices existing on panda board.

---
? arch/arm/boot/dts/omap4-panda.dts | ? 16 ++++++++++++++++ ? 1 files changed, 16 insertions(+), 0 deletions(-)

arch/arm/boot/dts/omap4-panda.dts +7 -0
index c28aa95..6b831ca 100644
@@ -3,4 +3,20 @@
 ? / {
 ? ? ? ?model = "TI OMAP4 PandaBoard";
 ? ? ? ?compatible = "ti,omap4-panda", "ti,omap4430";
+
+ ? ? ? i2c1 {
+ ? ? ? ? ? ? ? clock-frequency =<400000>;
+ ? ? ? };
+
+ ? ? ? i2c2 {
+ ? ? ? ? ? ? ? clock-frequency =<400000>;

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

Quoted 10 lines
arch/arm/boot/dts/omap4-panda.dts +9 -0
+ ? ? ? };
+
+ ? ? ? i2c3 {
+ ? ? ? ? ? ? ? clock-frequency =<400000>;
+ ? ? ? };
+
+ ? ? ? i2c4 {
+ ? ? ? ? ? ? ? clock-frequency =<400000>;
+ ? ? ? };
 ? };

Are you sure that this patch is setting the expected frequency? I see 100kHz in the boot log even with that patch.

Quoted 4 lines

I took me some time to find the proper syntax, but in order to reference an existing node, you have to use &i2c1 at the top level of the file. If you check the output of the DTC compiler, you will see the property at the proper node.

Thanks for bringing this issue. This was one of query I have asked to grant in one of the e-mail threads. Even I noticed that, it used to fetch default speed instead of speed assigned in dts file. Let me check with your suggestion.

-Manjunath

A message that is not in the archive (sent off-list or not yet received): [email protected]

#34 lore raw

v2 cover dt: omap: dt binding with omap_device and support for i2c1

Hi Manju,

Few "minor" comments about your subjects in this series.

Quoted 14 lines

Patch series reworked from:
http://permalink.gmane.org/gmane.linux.ports.arm.omap/61674
Also added support for i2c1 controller on omap4 based panda board.

Baseline:
=========
git://git.secretlab.ca/git/linux-2.6.git
Branch: devicetree/test
The above branch is rebased with v3.1-rc2 mainline.
+
pdev decoupling patches from kevin hilman
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg53534.html

Quoted 2 lines

The patch series is also available at:
https://gitorious.org/devicetree/dt_omap/commits/devicetree/dt_rfcv2

Please provide the git URL + branch and not the link to the web page. It will allow to copy paste directly the line and do a git fetch <repo> <branch>.

Quoted 11 lines

Testing:
========
Build : dt and not dt build for omap2plus_defconfig
Boot: OMAP3530 Beagle Board and OMAP4430 Panda board

Limitation:
===========
The current implementation of omap-device build through device tree supports only single instance of hwmod and multiple instances are not supported.

Quoted 14 lines

G, Manjunath Kondaiah (13):
OMAP: omap_device: Add device tree node pointer
dt: Add pd_size to AUXDATA structure
dt: omap3: add soc file for handling i2c controllers
dt: omap3: beagle board: set clock freq for i2c devices
dt: omap3: add generic board file for dt support
dt: omap3: add omap-device compatible property
dt: omap: create platform bus for omap devices
dt: omap: i2c: add dt support for i2c1 controller
dt: omap4: add soc file for handling i2c controllers
dt: omap4: panda board: set clock freq for i2c devices
dt: omap4: add generic board file for dt support
dt: omap4: enable dt support for i2c1 controller
dt: omap: i2c: dt usage model documentation

You should adapt the prefix depending of the subsystem your patch is changing. Most patches are changing files inside mach-omap2 and thus in that case should not be prefix with dt: but rather OMAP2+:
The dts files modification should then be prefixed with arm/dt or arm/dts.

Regards,
Benoit

#35 lore raw

v2 cover dt: omap: dt binding with omap_device and support for i2c1

In reply to G, Manjunath Kondaiah
Quoted 15 lines · Manjunath Kondaiah

Patch series reworked from:
http://permalink.gmane.org/gmane.linux.ports.arm.omap/61674
Also added support for i2c1 controller on omap4 based panda board.

Baseline:
=========
git://git.secretlab.ca/git/linux-2.6.git
Branch: devicetree/test
The above branch is rebased with v3.1-rc2 mainline.
+
pdev decoupling patches from kevin hilman
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg53534.html

Quoted 7 lines

The patch series is also available at:
https://gitorious.org/devicetree/dt_omap/commits/devicetree/dt_rfcv2

Testing:
========
Build : dt and not dt build for omap2plus_defconfig
Boot: OMAP3530 Beagle Board and OMAP4430 Panda board

Correction: This series will support only i2c1 controller and it will not handle i2c1 child devices such as twlxxxx pmic. Due to which, twl read/write's might fail during boot.

I am facing issues in getting platform_data in i2c child device probe function. The issue is reported to grant in patch 08/13 of this series.

-M

Quoted 55 lines

Limitation:
===========
The current implementation of omap-device build through device tree supports only single instance of hwmod and multiple instances are not supported.

G, Manjunath Kondaiah (13):
OMAP: omap_device: Add device tree node pointer
dt: Add pd_size to AUXDATA structure
dt: omap3: add soc file for handling i2c controllers
dt: omap3: beagle board: set clock freq for i2c devices
dt: omap3: add generic board file for dt support
dt: omap3: add omap-device compatible property
dt: omap: create platform bus for omap devices
dt: omap: i2c: add dt support for i2c1 controller
dt: omap4: add soc file for handling i2c controllers
dt: omap4: panda board: set clock freq for i2c devices
dt: omap4: add generic board file for dt support
dt: omap4: enable dt support for i2c1 controller
dt: omap: i2c: dt usage model documentation

 Documentation/devicetree/bindings/i2c/omap-i2c.txt |   57 +++++++++++++
 arch/arm/boot/dts/omap3-beagle-nunchuck.dts        |   13 +---
 arch/arm/boot/dts/omap3-beagle.dts                 |   18 ++++-
 arch/arm/boot/dts/omap3.dtsi                       |   62 ++++++++++++++
 arch/arm/boot/dts/omap4-panda.dts                  |   25 ++++--
 arch/arm/boot/dts/omap4.dtsi                       |   68 ++++++++++++++++
 arch/arm/mach-omap2/Kconfig                        |   22 +++++
 arch/arm/mach-omap2/Makefile                       |    2 +
 arch/arm/mach-omap2/board-omap3-dt.c               |   84 ++++++++++++++++++++
 arch/arm/mach-omap2/board-omap3beagle.c            |   13 ---
 arch/arm/mach-omap2/board-omap4-dt.c               |   75 +++++++++++++++++
 arch/arm/mach-omap2/board-omap4panda.c             |    6 --
 arch/arm/mach-omap2/devices.c                      |    2 +-
 arch/arm/mach-omap2/mcbsp.c                        |    2 +-
 arch/arm/plat-omap/include/plat/omap_device.h      |   11 +++-
 arch/arm/plat-omap/omap_device.c                   |   46 ++++++++++-
 drivers/i2c/busses/i2c-omap.c                      |   23 +++++-
 drivers/of/platform.c                              |   41 ++++++++++
 include/linux/of_platform.h                        |    5 +
 19 files changed, 526 insertions(+), 49 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/omap-i2c.txt
 create mode 100644 arch/arm/boot/dts/omap3.dtsi
 create mode 100644 arch/arm/boot/dts/omap4.dtsi
 create mode 100644 arch/arm/mach-omap2/board-omap3-dt.c
 create mode 100644 arch/arm/mach-omap2/board-omap4-dt.c
Signature · 6 lines
1.7.4.1

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss at lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
#36 lore raw

v2 cover dt: omap: dt binding with omap_device and support for i2c1

Hi Manju

Quoted 19 lines · Manjunath Kondaiah
Quoted 18 lines · Manjunath Kondaiah

Patch series reworked from:
http://permalink.gmane.org/gmane.linux.ports.arm.omap/61674
Also added support for i2c1 controller on omap4 based panda board.

Baseline:
=========
git://git.secretlab.ca/git/linux-2.6.git
Branch: devicetree/test
The above branch is rebased with v3.1-rc2 mainline.
+
pdev decoupling patches from kevin hilman
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg53534.html

The patch series is also available at:
https://gitorious.org/devicetree/dt_omap/commits/devicetree/dt_rfcv2

Quoted 8 lines
Quoted 4 lines

Testing:
========
Build : dt and not dt build for omap2plus_defconfig
Boot: OMAP3530 Beagle Board and OMAP4430 Panda board

Correction: This series will support only i2c1 controller and it will not handle i2c1 child devices such as twlxxxx pmic. Due to which, twl read/write's might fail during boot.

You mean will fail :-) At least on OMAP4.

[    2.680480] [<c025d438>] (twl_i2c_read+0x34/0x128) from [<c0024368>] (twl6030_uv_to_vsel+0x28/0x84)
[    2.690032] [<c0024368>] (twl6030_uv_to_vsel+0x28/0x84) from [<c0028274>] (_pre_volt_scale+0xac/0x174)
[    2.699829] [<c0028274>] (_pre_volt_scale+0xac/0x174) from [<c0028354>] (vp_forceupdate_scale_voltage+0x18/0x2b0)
[    2.710601] [<c0028354>] (vp_forceupdate_scale_voltage+0x18/0x2b0) from [<c00280a0>] (omap_voltage_scale_vdd+0x54/0x64)
[    2.721954] [<c00280a0>] (omap_voltage_scale_vdd+0x54/0x64) from [<c056ac94>] (omap2_set_init_voltage+0xf0/0x130)
[    2.732757] [<c056ac94>] (omap2_set_init_voltage+0xf0/0x130) from [<c056ad34>] (omap2_common_pm_late_init+0x60/0xb0)
[    2.743835] [<c056ad34>] (omap2_common_pm_late_init+0x60/0xb0) from [<c0008900>] (do_one_initcall+0x94/0x168)
[    2.754272] [<c0008900>] (do_one_initcall+0x94/0x168) from [<c0562828>] (kernel_init+0x80/0x12c)
[    2.763549] [<c0562828>] (kernel_init+0x80/0x12c) from [<c001338c>] (kernel_thread_exit+0x0/0x8)
[    2.772796] Code: 8a000008 e59f70ec e1a09080 e59731ac (e7d32080)

That being said, it looks like the voltage layer should be a little bit more robust and should check the i2c status before using it blindly.

Adding Kevin, Paul and Nishanth in Cc since the voltage layer is currently being cleaned.

Quoted 26 lines

I am facing issues in getting platform_data in i2c child device probe function. The issue is reported to grant in patch 08/13 of this series.

-M

Quoted 21 lines

Limitation:
===========
The current implementation of omap-device build through device tree supports only single instance of hwmod and multiple instances are not supported.

G, Manjunath Kondaiah (13):
OMAP: omap_device: Add device tree node pointer
dt: Add pd_size to AUXDATA structure
dt: omap3: add soc file for handling i2c controllers
dt: omap3: beagle board: set clock freq for i2c devices
dt: omap3: add generic board file for dt support
dt: omap3: add omap-device compatible property
dt: omap: create platform bus for omap devices
dt: omap: i2c: add dt support for i2c1 controller
dt: omap4: add soc file for handling i2c controllers
dt: omap4: panda board: set clock freq for i2c devices
dt: omap4: add generic board file for dt support
dt: omap4: enable dt support for i2c1 controller
dt: omap: i2c: dt usage model documentation

Because of the broken i2c support, you should probably re-organize your series to provide at least the basic DT support for people who want to start hacking DT. The i2c support for both OMAP3 & 4 should be added at the very last time with a big disclaimer. Ideally, you should maybe fix it first:-)

Regards,
Benoit