* [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1
@ 2011-08-23 5:03 G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 01/13] OMAP: omap_device: Add device tree node pointer G, Manjunath Kondaiah
` (14 more replies)
0 siblings, 15 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel, grant.likely
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@vger.kernel.org/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
--
1.7.4.1
^ permalink raw reply [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 01/13] OMAP: omap_device: Add device tree node pointer
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 02/13] dt: Add pd_size to AUXDATA structure G, Manjunath Kondaiah
` (13 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
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.
Signed-off-by: G, Manjunath Kondaiah <manjugk-l0cyMroinI0@public.gmane.org>
---
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(-)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 10adf66..d23e4bc 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -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);
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index 7a42f32..98eb95d 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -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);
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index d4d9b96..37c231d 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -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 */
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index d8f2299..3347115 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -85,6 +85,7 @@
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/pm_runtime.h>
+#include <linux/of_device.h>
#include <plat/omap_device.h>
#include <plat/omap_hwmod.h>
@@ -391,6 +392,7 @@ static int omap_device_fill_resources(struct omap_device *od,
/**
* omap_device_build - build and register an omap_device with one omap_hwmod
* @pdev_name: name of the platform_device driver to use
+ * @np: device node pointer for attaching it to of_node pointer
* @pdev_id: this platform_device's connection ID
* @oh: ptr to the single omap_hwmod that backs this omap_device
* @pdata: platform_data ptr to associate with the platform_device
@@ -405,7 +407,8 @@ static int omap_device_fill_resources(struct omap_device *od,
* information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
* passes along the return value of omap_device_build_ss().
*/
-struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
+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,
@@ -416,12 +419,44 @@ struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
if (!oh)
return ERR_PTR(-EINVAL);
- return omap_device_build_ss(pdev_name, pdev_id, ohs, 1, pdata,
+ return omap_device_build_ss(np, pdev_name, pdev_id, ohs, 1, pdata,
pdata_len, pm_lats, pm_lats_cnt,
is_early_device);
}
/**
+ * omap_device_build - build and register an omap_device with one omap_hwmod
+ * @pdev_name: name of the platform_device driver to use
+ * @pdev_id: this platform_device's connection ID
+ * @oh: ptr to the single omap_hwmod that backs this omap_device
+ * @pdata: platform_data ptr to associate with the platform_device
+ * @pdata_len: amount of memory pointed to by @pdata
+ * @pm_lats: pointer to a omap_device_pm_latency array for this device
+ * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
+ * @is_early_device: should the device be registered as an early device or not
+ *
+ * Convenience function for building and registering a single
+ * omap_device record, which in turn builds and registers a
+ * platform_device record. See omap_device_build_ss() for more
+ * information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
+ * passes along the return value of omap_device_build_ss().
+ */
+struct platform_device *omap_device_build(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)
+{
+ struct omap_hwmod *ohs[] = { oh };
+
+ if (!oh)
+ return ERR_PTR(-EINVAL);
+
+ return omap_device_build_ss(NULL, pdev_name, pdev_id, ohs, 1, pdata,
+ pdata_len, pm_lats, pm_lats_cnt, is_early_device);
+}
+
+/**
* omap_device_build_ss - build and register an omap_device with multiple hwmods
* @pdev_name: name of the platform_device driver to use
* @pdev_id: this platform_device's connection ID
@@ -438,7 +473,8 @@ struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
* platform_device record. Returns an ERR_PTR() on error, or passes
* along the return value of omap_device_register().
*/
-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 **ohs, int oh_cnt,
void *pdata, int pdata_len,
struct omap_device_pm_latency *pm_lats,
@@ -497,6 +533,10 @@ struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
goto odbs_exit3;
}
+#ifdef CONFIG_OF_DEVICE
+ pdev->dev.of_node = of_node_get(np);
+#endif
+
ret = platform_device_add_data(pdev, pdata, pdata_len);
if (ret)
goto odbs_exit3;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 02/13] dt: Add pd_size to AUXDATA structure
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 01/13] OMAP: omap_device: Add device tree node pointer G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 03/13] dt: omap3: add soc file for handling i2c controllers G, Manjunath Kondaiah
` (12 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel, grant.likely
Add pd_size in the AUXDATA structure so that omap HWMOD which require
platform_data size can pass along with AUXDATA.
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
---
drivers/of/platform.c | 2 ++
include/linux/of_platform.h | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index b030fd5..e50ffcb 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -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")) {
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 252246c..a3be980 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -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.
*
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 03/13] dt: omap3: add soc file for handling i2c controllers
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 01/13] OMAP: omap_device: Add device tree node pointer G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 02/13] dt: Add pd_size to AUXDATA structure G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 04/13] dt: omap3: beagle board: set clock freq for i2c devices G, Manjunath Kondaiah
` (11 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Add omap3 soc file for handling omap3 soc i2c controllers existing
on l4-core bus.
Signed-off-by: G, Manjunath Kondaiah <manjugk-l0cyMroinI0@public.gmane.org>
---
arch/arm/boot/dts/omap3.dtsi | 62 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 62 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/boot/dts/omap3.dtsi
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
new file mode 100644
index 0000000..9ea8257
--- /dev/null
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -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>;
+ };
+};
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 04/13] dt: omap3: beagle board: set clock freq for i2c devices
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
` (2 preceding siblings ...)
2011-08-23 5:03 ` [RFC/PATCH v2 03/13] dt: omap3: add soc file for handling i2c controllers G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 05/13] dt: omap3: add generic board file for dt support G, Manjunath Kondaiah
` (10 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel, grant.likely
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.
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
---
arch/arm/boot/dts/omap3-beagle-nunchuck.dts | 13 ++-----------
arch/arm/boot/dts/omap3-beagle.dts | 18 +++++++++++++++---
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/arch/arm/boot/dts/omap3-beagle-nunchuck.dts b/arch/arm/boot/dts/omap3-beagle-nunchuck.dts
index 2607be5..c693163 100644
--- a/arch/arm/boot/dts/omap3-beagle-nunchuck.dts
+++ b/arch/arm/boot/dts/omap3-beagle-nunchuck.dts
@@ -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 >;
diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
index 4439466..c232c52 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -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>;
+ };
};
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 05/13] dt: omap3: add generic board file for dt support
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
` (3 preceding siblings ...)
2011-08-23 5:03 ` [RFC/PATCH v2 04/13] dt: omap3: beagle board: set clock freq for i2c devices G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 06/13] dt: omap3: add omap-device compatible property G, Manjunath Kondaiah
` (9 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel, grant.likely
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.
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
---
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
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 57b66d5..4fbb54d 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -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
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b1501bd..e702e47 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -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
diff --git a/arch/arm/mach-omap2/board-omap3-dt.c b/arch/arm/mach-omap2/board-omap3-dt.c
new file mode 100644
index 0000000..72c59a4
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap3-dt.c
@@ -0,0 +1,84 @@
+/*
+ * TI OMAP3 device tree board support
+ *
+ * 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/platform_device.h>
+#include <linux/err.h>
+#include <linux/gpio.h>
+#include <linux/of_platform.h>
+#include <linux/of_address.h>
+
+#include <linux/regulator/machine.h>
+#include <linux/i2c/twl.h>
+
+#include <asm/mach/arch.h>
+
+#include <plat/common.h>
+#include <plat/omap_device.h>
+
+#include "mux.h"
+#include "common-board-devices.h"
+#include "hsmmc.h"
+
+#include "sdram-micron-mt46h32m32lf-6.h"
+
+static struct twl4030_platform_data beagle_twldata = {
+ .irq_base = TWL4030_IRQ_BASE,
+ .irq_end = TWL4030_IRQ_END,
+
+ /* platform_data for children goes here */
+};
+
+static int __init omap3_beagle_i2c_init(void)
+{
+ omap3_pmic_init("twl4030", &beagle_twldata);
+ return 0;
+}
+
+static void __init omap3_init_early(void)
+{
+ omap2_init_common_infrastructure();
+ omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
+ mt46h32m32lf6_sdrc_params);
+}
+
+#ifdef CONFIG_OMAP_MUX
+static struct omap_board_mux board_mux[] __initdata = {
+ { .reg_offset = OMAP_MUX_TERMINATOR },
+};
+#endif
+
+static struct of_device_id omap_dt_match_table[] __initdata = {
+ { .compatible = "ti,omap3-l4-core", },
+ {}
+};
+
+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);
+}
+
+static const char *omap3_dt_match[] __initdata = {
+ "ti,omap3",
+ NULL
+};
+
+DT_MACHINE_START(OMAP3_DT, "TI OMAP3 (Flattened Device Tree)")
+ .reserve = omap_reserve,
+ .map_io = omap3_map_io,
+ .init_early = omap3_init_early,
+ .init_irq = omap3_init_irq,
+ .init_machine = omap3_init,
+ .timer = &omap3_timer,
+ .dt_compat = omap3_dt_match,
+MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 268c826..a845e9e 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -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
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 06/13] dt: omap3: add omap-device compatible property
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
` (4 preceding siblings ...)
2011-08-23 5:03 ` [RFC/PATCH v2 05/13] dt: omap3: add generic board file for dt support G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 07/13] dt: omap: create platform bus for omap devices G, Manjunath Kondaiah
` (8 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Add "omap-device" to the i2c controllers compatible property.
Signed-off-by: G, Manjunath Kondaiah <manjugk-l0cyMroinI0@public.gmane.org>
---
arch/arm/boot/dts/omap3.dtsi | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 9ea8257..f64c63d 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -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 >;
};
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 07/13] dt: omap: create platform bus for omap devices
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
` (5 preceding siblings ...)
2011-08-23 5:03 ` [RFC/PATCH v2 06/13] dt: omap3: add omap-device compatible property G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
2011-08-23 9:07 ` Jamie Iles
2011-08-23 5:03 ` [RFC/PATCH v2 08/13] dt: omap: i2c: add dt support for i2c1 controller G, Manjunath Kondaiah
` (7 subsequent siblings)
14 siblings, 1 reply; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel, grant.likely
The omap devices will use HWMOD for fetching device information
hence it needs to be handled seperately during platform bus
creation during dt build.
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
---
drivers/of/platform.c | 41 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index e50ffcb..bd2c089 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -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 */
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 08/13] dt: omap: i2c: add dt support for i2c1 controller
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
` (6 preceding siblings ...)
2011-08-23 5:03 ` [RFC/PATCH v2 07/13] dt: omap: create platform bus for omap devices G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
2011-08-23 15:46 ` G, Manjunath Kondaiah
[not found] ` <4E537F53.4030405@ti.com>
2011-08-23 5:03 ` [RFC/PATCH v2 09/13] dt: omap4: add soc file for handling i2c controllers G, Manjunath Kondaiah
` (6 subsequent siblings)
14 siblings, 2 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel, grant.likely
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.
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
---
arch/arm/mach-omap2/board-omap3-dt.c | 14 +++++++-------
drivers/i2c/busses/i2c-omap.c | 23 ++++++++++++++++++++---
2 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3-dt.c b/arch/arm/mach-omap2/board-omap3-dt.c
index 72c59a4..cd11224 100644
--- a/arch/arm/mach-omap2/board-omap3-dt.c
+++ b/arch/arm/mach-omap2/board-omap3-dt.c
@@ -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 = {
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 2a072ff..9e98014 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -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,
},
};
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 09/13] dt: omap4: add soc file for handling i2c controllers
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
` (7 preceding siblings ...)
2011-08-23 5:03 ` [RFC/PATCH v2 08/13] dt: omap: i2c: add dt support for i2c1 controller G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
2011-08-23 8:23 ` Rajendra Nayak
[not found] ` <4E537FA7.3050609@ti.com>
2011-08-23 5:03 ` [RFC/PATCH v2 10/13] dt: omap4: panda board: set clock freq for i2c devices G, Manjunath Kondaiah
` (5 subsequent siblings)
14 siblings, 2 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel, grant.likely
Add omap4 soc dts file for handling omap4 soc i2c
controllers existing on l4-core bus.
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
---
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
diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
index 58909e9..c28aa95 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -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";
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
new file mode 100644
index 0000000..cb055f5
--- /dev/null
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -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>;
+ 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 >;
+ };
+
+ i2c2: i2c@72000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "ti,omap-i2c", "ti,omap-device";
+ reg = <0x72000 0x100>;
+ interrupts = < 89 >;
+ };
+
+ i2c3: i2c@60000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "ti,omap-i2c", "ti,omap-device";
+ reg = <0x60000 0x100>;
+ interrupts = < 93 >;
+ };
+
+ i2c4: i2c@350000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "ti,omap-i2c", "ti,omap-device";
+ reg = <0x350000 0x100>;
+ interrupts = < 94 >;
+ };
+ };
+};
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 10/13] dt: omap4: panda board: set clock freq for i2c devices
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
` (8 preceding siblings ...)
2011-08-23 5:03 ` [RFC/PATCH v2 09/13] dt: omap4: add soc file for handling i2c controllers G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
[not found] ` <4E537F6B.4060608@ti.com>
2011-08-23 5:03 ` [RFC/PATCH v2 11/13] dt: omap4: add generic board file for dt support G, Manjunath Kondaiah
` (4 subsequent siblings)
14 siblings, 1 reply; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Update omap4 panda dts file with required clock frequencies
for the i2c client devices existing on panda board.
Signed-off-by: G, Manjunath Kondaiah <manjugk-l0cyMroinI0@public.gmane.org>
---
arch/arm/boot/dts/omap4-panda.dts | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
index c28aa95..6b831ca 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -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>;
+ };
};
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 11/13] dt: omap4: add generic board file for dt support
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
` (9 preceding siblings ...)
2011-08-23 5:03 ` [RFC/PATCH v2 10/13] dt: omap4: panda board: set clock freq for i2c devices G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
[not found] ` <4E537F80.1060001@ti.com>
2011-08-23 5:03 ` [RFC/PATCH v2 12/13] dt: omap4: enable dt support for i2c1 controller G, Manjunath Kondaiah
` (3 subsequent siblings)
14 siblings, 1 reply; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel, grant.likely
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.
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
---
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
diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
index 6b831ca..9d1b17c 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -2,7 +2,7 @@
/ {
model = "TI OMAP4 PandaBoard";
- compatible = "ti,omap4-panda", "ti,omap4430";
+ compatible = "ti,omap4-panda", "ti,omap4";
i2c1 {
clock-frequency = <400000>;
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 4fbb54d..853b14c 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -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
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index e702e47..8b8c29c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -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
diff --git a/arch/arm/mach-omap2/board-omap4-dt.c b/arch/arm/mach-omap2/board-omap4-dt.c
new file mode 100644
index 0000000..a4d296c
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap4-dt.c
@@ -0,0 +1,66 @@
+/*
+ * TI OMAP3 device tree board support
+ *
+ * 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>
+#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 = {
+ "ti,omap4",
+ NULL,
+};
+
+DT_MACHINE_START(OMAP4_DT, "TI OMAP4 (Flattened Device Tree)")
+ .boot_params = 0x80000100,
+ .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
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 1c583c7..9aaa960 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -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
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 12/13] dt: omap4: enable dt support for i2c1 controller
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
` (10 preceding siblings ...)
2011-08-23 5:03 ` [RFC/PATCH v2 11/13] dt: omap4: add generic board file for dt support G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 13/13] dt: omap: i2c: dt usage model documentation G, Manjunath Kondaiah
` (2 subsequent siblings)
14 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel, grant.likely
Enable dt support for omap4 i2c1 controller and cleanup
legacy i2c device registration in omap4 generic board file.
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
---
arch/arm/mach-omap2/board-omap4-dt.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap4-dt.c b/arch/arm/mach-omap2/board-omap4-dt.c
index a4d296c..9ade238 100644
--- a/arch/arm/mach-omap2/board-omap4-dt.c
+++ b/arch/arm/mach-omap2/board-omap4-dt.c
@@ -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)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* [RFC/PATCH v2 13/13] dt: omap: i2c: dt usage model documentation
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
` (11 preceding siblings ...)
2011-08-23 5:03 ` [RFC/PATCH v2 12/13] dt: omap4: enable dt support for i2c1 controller G, Manjunath Kondaiah
@ 2011-08-23 5:03 ` G, Manjunath Kondaiah
[not found] ` <4E537ECB.1060704@ti.com>
2011-08-23 15:41 ` G, Manjunath Kondaiah
14 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 5:03 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel, grant.likely
Add documentation for using omap i2c controller with device
tree support enabled.
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
---
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
diff --git a/Documentation/devicetree/bindings/i2c/omap-i2c.txt b/Documentation/devicetree/bindings/i2c/omap-i2c.txt
new file mode 100644
index 0000000..f427445
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/omap-i2c.txt
@@ -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>;
+ };
--
1.7.4.1
^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 09/13] dt: omap4: add soc file for handling i2c controllers
2011-08-23 5:03 ` [RFC/PATCH v2 09/13] dt: omap4: add soc file for handling i2c controllers G, Manjunath Kondaiah
@ 2011-08-23 8:23 ` Rajendra Nayak
2011-08-23 15:11 ` G, Manjunath Kondaiah
[not found] ` <4E537FA7.3050609@ti.com>
1 sibling, 1 reply; 32+ messages in thread
From: Rajendra Nayak @ 2011-08-23 8:23 UTC (permalink / raw)
To: G, Manjunath Kondaiah; +Cc: devicetree-discuss, linux-omap, linux-arm-kernel
On 8/23/2011 10:33 AM, G, Manjunath Kondaiah wrote:
>
> Add omap4 soc dts file for handling omap4 soc i2c
> controllers existing on l4-core bus.
>
> Signed-off-by: G, Manjunath Kondaiah<manjugk@ti.com>
> ---
> 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
>
> diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
> index 58909e9..c28aa95 100644
> --- a/arch/arm/boot/dts/omap4-panda.dts
> +++ b/arch/arm/boot/dts/omap4-panda.dts
> @@ -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";
> diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
> new file mode 100644
> index 0000000..cb055f5
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap4.dtsi
> @@ -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>;
> + ranges =<0 0x48000000 0x1000000>;
> +
> + i2c1: i2c@70000 {
> + #address-cells =<1>;
> + #size-cells =<0>;
Are these really needed, given there are no child nodes defined?
Same with all other instances.
> + compatible = "ti,omap-i2c", "ti,omap-device";
> + reg =<0x70000 0x100>;
> + interrupts =< 88>;
> + };
> +
> + i2c2: i2c@72000 {
> + #address-cells =<1>;
> + #size-cells =<0>;
> + compatible = "ti,omap-i2c", "ti,omap-device";
> + reg =<0x72000 0x100>;
> + interrupts =< 89>;
> + };
> +
> + i2c3: i2c@60000 {
> + #address-cells =<1>;
> + #size-cells =<0>;
> + compatible = "ti,omap-i2c", "ti,omap-device";
> + reg =<0x60000 0x100>;
> + interrupts =< 93>;
> + };
> +
> + i2c4: i2c@350000 {
> + #address-cells =<1>;
> + #size-cells =<0>;
> + compatible = "ti,omap-i2c", "ti,omap-device";
> + reg =<0x350000 0x100>;
> + interrupts =< 94>;
> + };
> + };
> +};
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 07/13] dt: omap: create platform bus for omap devices
2011-08-23 5:03 ` [RFC/PATCH v2 07/13] dt: omap: create platform bus for omap devices G, Manjunath Kondaiah
@ 2011-08-23 9:07 ` Jamie Iles
2011-08-23 15:19 ` G, Manjunath Kondaiah
0 siblings, 1 reply; 32+ messages in thread
From: Jamie Iles @ 2011-08-23 9:07 UTC (permalink / raw)
To: G, Manjunath Kondaiah; +Cc: devicetree-discuss, linux-omap, linux-arm-kernel
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
On Tue, Aug 23, 2011 at 10:03:35AM +0500, G, Manjunath Kondaiah wrote:
>
> The omap devices will use HWMOD for fetching device information
> hence it needs to be handled seperately during platform bus
> creation during dt build.
>
> Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
> ---
> drivers/of/platform.c | 41 ++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 40 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index e50ffcb..bd2c089 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -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;
> }
#ifdef ARCH_OMAP
> +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);
> +}
#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 */
> +
> /**
> * 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 */
> --
> 1.7.4.1
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1
[not found] ` <4E537ECB.1060704@ti.com>
@ 2011-08-23 12:38 ` Cousson, Benoit
0 siblings, 0 replies; 32+ messages in thread
From: Cousson, Benoit @ 2011-08-23 12:38 UTC (permalink / raw)
To: G, Manjunath Kondaiah
Cc: devicetree-discuss@lists.ozlabs.org, Nayak, Rajendra,
linux-arm-kernel@lists.infradead.org, linux-omap
Hi Manju,
Few "minor" comments about your subjects in this series.
> 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@vger.kernel.org/msg53534.html
>
> 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>.
> 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
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
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: Fwd: [RFC/PATCH v2 11/13] dt: omap4: add generic board file for dt support
[not found] ` <4E537F80.1060001-l0cyMroinI0@public.gmane.org>
@ 2011-08-23 13:05 ` Cousson, Benoit
2011-08-23 15:30 ` G, Manjunath Kondaiah
0 siblings, 1 reply; 32+ messages in thread
From: Cousson, Benoit @ 2011-08-23 13:05 UTC (permalink / raw)
To: G, Manjunath Kondaiah
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-omap
From: G, Manjunath Kondaiah<manjugk-l0cyMroinI0@public.gmane.org>
> 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.
>
> Signed-off-by: G, Manjunath Kondaiah<manjugk-l0cyMroinI0@public.gmane.org>
> ---
> 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
>
> diff --git a/arch/arm/boot/dts/omap4-panda.dts
> b/arch/arm/boot/dts/omap4-panda.dts
> index 6b831ca..9d1b17c 100644
> --- a/arch/arm/boot/dts/omap4-panda.dts
> +++ b/arch/arm/boot/dts/omap4-panda.dts
> @@ -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.
>
> i2c1 {
> clock-frequency =<400000>;
> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> index 4fbb54d..853b14c 100644
> --- a/arch/arm/mach-omap2/Kconfig
> +++ b/arch/arm/mach-omap2/Kconfig
> @@ -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.
> + 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:-)
> + More information at Documentation/devicetree
> +
> config OMAP3_EMU
> bool "OMAP3 debugging peripherals"
> depends on ARCH_OMAP3
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index e702e47..8b8c29c 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -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.
> obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
> obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \
> sdram-nokia.o
> diff --git a/arch/arm/mach-omap2/board-omap4-dt.c
> b/arch/arm/mach-omap2/board-omap4-dt.c
> new file mode 100644
> index 0000000..a4d296c
> --- /dev/null
> +++ b/arch/arm/mach-omap2/board-omap4-dt.c
> @@ -0,0 +1,66 @@
> +/*
> + * TI OMAP3 device tree board support
One more C&P.
> + *
> + * 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>.
> +#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 = {
> + "ti,omap4",
> + NULL,
> +};
> +
> +DT_MACHINE_START(OMAP4_DT, "TI OMAP4 (Flattened Device Tree)")
> + .boot_params = 0x80000100,
Not needed anymore with DT.
> + .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
> diff --git a/arch/arm/mach-omap2/board-omap4panda.c
> b/arch/arm/mach-omap2/board-omap4panda.c
> index 1c583c7..9aaa960 100644
> --- a/arch/arm/mach-omap2/board-omap4panda.c
> +++ b/arch/arm/mach-omap2/board-omap4panda.c
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
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: Fwd: [RFC/PATCH v2 09/13] dt: omap4: add soc file for handling i2c controllers
[not found] ` <4E537FA7.3050609@ti.com>
@ 2011-08-23 13:48 ` Cousson, Benoit
2011-08-23 15:18 ` G, Manjunath Kondaiah
0 siblings, 1 reply; 32+ messages in thread
From: Cousson, Benoit @ 2011-08-23 13:48 UTC (permalink / raw)
Cc: G, Manjunath Kondaiah, devicetree-discuss@lists.ozlabs.org,
Nayak, Rajendra, linux-arm-kernel@lists.infradead.org, linux-omap
From: G, Manjunath Kondaiah<manjugk@ti.com>
> To: devicetree-discuss@lists.ozlabs.org
> CC: linux-omap@vger.kernel.org, linux-arm-kernel@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
>
> Signed-off-by: G, Manjunath Kondaiah<manjugk@ti.com>
> ---
> 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
>
> diff --git a/arch/arm/boot/dts/omap4-panda.dts
> b/arch/arm/boot/dts/omap4-panda.dts
> index 58909e9..c28aa95 100644
> --- a/arch/arm/boot/dts/omap4-panda.dts
> +++ b/arch/arm/boot/dts/omap4-panda.dts
> @@ -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";
> diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
> new file mode 100644
> index 0000000..cb055f5
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap4.dtsi
> @@ -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 */
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
> +
> +/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@70000 {
> + #address-cells =<1>;
> + #size-cells =<0>;
> + compatible = "ti,omap-i2c", "ti,omap-device";
> + reg =<0x70000 0x100>;
> + interrupts =< 88>;
> + };
> +
> + i2c2: i2c@72000 {
> + #address-cells =<1>;
> + #size-cells =<0>;
> + compatible = "ti,omap-i2c", "ti,omap-device";
> + reg =<0x72000 0x100>;
> + interrupts =< 89>;
> + };
> +
> + i2c3: i2c@60000 {
> + #address-cells =<1>;
> + #size-cells =<0>;
> + compatible = "ti,omap-i2c", "ti,omap-device";
> + reg =<0x60000 0x100>;
> + interrupts =< 93>;
> + };
> +
> + i2c4: i2c@350000 {
> + #address-cells =<1>;
> + #size-cells =<0>;
> + compatible = "ti,omap-i2c", "ti,omap-device";
> + reg =<0x350000 0x100>;
> + interrupts =< 94>;
> + };
> + };
> +};
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 09/13] dt: omap4: add soc file for handling i2c controllers
2011-08-23 8:23 ` Rajendra Nayak
@ 2011-08-23 15:11 ` G, Manjunath Kondaiah
0 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 15:11 UTC (permalink / raw)
To: Rajendra Nayak; +Cc: devicetree-discuss, linux-omap, linux-arm-kernel
On Tue, Aug 23, 2011 at 01:53:54PM +0530, Rajendra Nayak wrote:
> On 8/23/2011 10:33 AM, G, Manjunath Kondaiah wrote:
> >
> >Add omap4 soc dts file for handling omap4 soc i2c
> >controllers existing on l4-core bus.
> >
> >Signed-off-by: G, Manjunath Kondaiah<manjugk@ti.com>
> >---
> > 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
> >
> >diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
> >index 58909e9..c28aa95 100644
> >--- a/arch/arm/boot/dts/omap4-panda.dts
> >+++ b/arch/arm/boot/dts/omap4-panda.dts
> >@@ -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";
> >diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
> >new file mode 100644
> >index 0000000..cb055f5
> >--- /dev/null
> >+++ b/arch/arm/boot/dts/omap4.dtsi
> >@@ -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>;
> >+ ranges =<0 0x48000000 0x1000000>;
> >+
> >+ i2c1: i2c@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
>
> >+ compatible = "ti,omap-i2c", "ti,omap-device";
> >+ reg =<0x70000 0x100>;
> >+ interrupts =< 88>;
> >+ };
> >+
> >+ i2c2: i2c@72000 {
> >+ #address-cells =<1>;
> >+ #size-cells =<0>;
> >+ compatible = "ti,omap-i2c", "ti,omap-device";
> >+ reg =<0x72000 0x100>;
> >+ interrupts =< 89>;
> >+ };
> >+
> >+ i2c3: i2c@60000 {
> >+ #address-cells =<1>;
> >+ #size-cells =<0>;
> >+ compatible = "ti,omap-i2c", "ti,omap-device";
> >+ reg =<0x60000 0x100>;
> >+ interrupts =< 93>;
> >+ };
> >+
> >+ i2c4: i2c@350000 {
> >+ #address-cells =<1>;
> >+ #size-cells =<0>;
> >+ compatible = "ti,omap-i2c", "ti,omap-device";
> >+ reg =<0x350000 0x100>;
> >+ interrupts =< 94>;
> >+ };
> >+ };
> >+};
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: Fwd: [RFC/PATCH v2 09/13] dt: omap4: add soc file for handling i2c controllers
2011-08-23 13:48 ` Fwd: " Cousson, Benoit
@ 2011-08-23 15:18 ` G, Manjunath Kondaiah
2011-08-23 19:45 ` Cousson, Benoit
0 siblings, 1 reply; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 15:18 UTC (permalink / raw)
To: Cousson, Benoit
Cc: Nayak, Rajendra, devicetree-discuss@lists.ozlabs.org, linux-omap,
linux-arm-kernel@lists.infradead.org
On Tue, Aug 23, 2011 at 03:48:15PM +0200, Cousson, Benoit wrote:
> From: G, Manjunath Kondaiah<manjugk@ti.com>
> >To: devicetree-discuss@lists.ozlabs.org
> >CC: linux-omap@vger.kernel.org, linux-arm-kernel@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.
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.
>
> Benoit
>
>
> >
> >Signed-off-by: G, Manjunath Kondaiah<manjugk@ti.com>
> >---
> > 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
> >
> >diff --git a/arch/arm/boot/dts/omap4-panda.dts
> >b/arch/arm/boot/dts/omap4-panda.dts
> >index 58909e9..c28aa95 100644
> >--- a/arch/arm/boot/dts/omap4-panda.dts
> >+++ b/arch/arm/boot/dts/omap4-panda.dts
> >@@ -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";
> >diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
> >new file mode 100644
> >index 0000000..cb055f5
> >--- /dev/null
> >+++ b/arch/arm/boot/dts/omap4.dtsi
> >@@ -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 */
>
> 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
>
> Benoit
>
> >+
> >+/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@70000 {
> >+ #address-cells =<1>;
> >+ #size-cells =<0>;
> >+ compatible = "ti,omap-i2c", "ti,omap-device";
> >+ reg =<0x70000 0x100>;
> >+ interrupts =< 88>;
> >+ };
> >+
> >+ i2c2: i2c@72000 {
> >+ #address-cells =<1>;
> >+ #size-cells =<0>;
> >+ compatible = "ti,omap-i2c", "ti,omap-device";
> >+ reg =<0x72000 0x100>;
> >+ interrupts =< 89>;
> >+ };
> >+
> >+ i2c3: i2c@60000 {
> >+ #address-cells =<1>;
> >+ #size-cells =<0>;
> >+ compatible = "ti,omap-i2c", "ti,omap-device";
> >+ reg =<0x60000 0x100>;
> >+ interrupts =< 93>;
> >+ };
> >+
> >+ i2c4: i2c@350000 {
> >+ #address-cells =<1>;
> >+ #size-cells =<0>;
> >+ compatible = "ti,omap-i2c", "ti,omap-device";
> >+ reg =<0x350000 0x100>;
> >+ interrupts =< 94>;
> >+ };
> >+ };
> >+};
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 07/13] dt: omap: create platform bus for omap devices
2011-08-23 9:07 ` Jamie Iles
@ 2011-08-23 15:19 ` G, Manjunath Kondaiah
0 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 15:19 UTC (permalink / raw)
To: Jamie Iles; +Cc: devicetree-discuss, linux-omap, linux-arm-kernel
On Tue, Aug 23, 2011 at 10:07:05AM +0100, Jamie Iles wrote:
> 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
>
> Jamie
>
> On Tue, Aug 23, 2011 at 10:03:35AM +0500, G, Manjunath Kondaiah wrote:
> >
> > The omap devices will use HWMOD for fetching device information
> > hence it needs to be handled seperately during platform bus
> > creation during dt build.
> >
> > Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
> > ---
> > drivers/of/platform.c | 41 ++++++++++++++++++++++++++++++++++++++++-
> > 1 files changed, 40 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> > index e50ffcb..bd2c089 100644
> > --- a/drivers/of/platform.c
> > +++ b/drivers/of/platform.c
> > @@ -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;
> > }
>
> #ifdef ARCH_OMAP
>
> > +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);
> > +}
>
> #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 */
>
> > +
> > /**
> > * 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 */
> > --
> > 1.7.4.1
> >
> > _______________________________________________
> > devicetree-discuss mailing list
> > devicetree-discuss@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: Fwd: [RFC/PATCH v2 11/13] dt: omap4: add generic board file for dt support
2011-08-23 13:05 ` Fwd: " Cousson, Benoit
@ 2011-08-23 15:30 ` G, Manjunath Kondaiah
0 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 15:30 UTC (permalink / raw)
To: Cousson, Benoit
Cc: devicetree-discuss@lists.ozlabs.org, Nayak, Rajendra,
linux-arm-kernel@lists.infradead.org, linux-omap
On Tue, Aug 23, 2011 at 03:05:01PM +0200, Cousson, Benoit wrote:
> From: G, Manjunath Kondaiah<manjugk@ti.com>
> >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.
> >
> >Signed-off-by: G, Manjunath Kondaiah<manjugk@ti.com>
> >---
> > 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
> >
> >diff --git a/arch/arm/boot/dts/omap4-panda.dts
> >b/arch/arm/boot/dts/omap4-panda.dts
> >index 6b831ca..9d1b17c 100644
> >--- a/arch/arm/boot/dts/omap4-panda.dts
> >+++ b/arch/arm/boot/dts/omap4-panda.dts
> >@@ -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.
ok.
>
> >
> > i2c1 {
> > clock-frequency =<400000>;
> >diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> >index 4fbb54d..853b14c 100644
> >--- a/arch/arm/mach-omap2/Kconfig
> >+++ b/arch/arm/mach-omap2/Kconfig
> >@@ -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.
>
> >+ 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.
>
> >+ More information at Documentation/devicetree
> >+
> > config OMAP3_EMU
> > bool "OMAP3 debugging peripherals"
> > depends on ARCH_OMAP3
> >diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> >index e702e47..8b8c29c 100644
> >--- a/arch/arm/mach-omap2/Makefile
> >+++ b/arch/arm/mach-omap2/Makefile
> >@@ -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?
>
> > obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
> > obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \
> > sdram-nokia.o
> >diff --git a/arch/arm/mach-omap2/board-omap4-dt.c
> >b/arch/arm/mach-omap2/board-omap4-dt.c
> >new file mode 100644
> >index 0000000..a4d296c
> >--- /dev/null
> >+++ b/arch/arm/mach-omap2/board-omap4-dt.c
> >@@ -0,0 +1,66 @@
> >+/*
> >+ * TI OMAP3 device tree board support
>
> One more C&P.
>
> >+ *
> >+ * 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
>
> >+#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 = {
> >+ "ti,omap4",
> >+ NULL,
> >+};
> >+
> >+DT_MACHINE_START(OMAP4_DT, "TI OMAP4 (Flattened Device Tree)")
> >+ .boot_params = 0x80000100,
>
> Not needed anymore with DT.
yes
>
> >+ .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
> >diff --git a/arch/arm/mach-omap2/board-omap4panda.c
> >b/arch/arm/mach-omap2/board-omap4panda.c
> >index 1c583c7..9aaa960 100644
> >--- a/arch/arm/mach-omap2/board-omap4panda.c
> >+++ b/arch/arm/mach-omap2/board-omap4panda.c
>
> 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
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
` (13 preceding siblings ...)
[not found] ` <4E537ECB.1060704@ti.com>
@ 2011-08-23 15:41 ` G, Manjunath Kondaiah
2011-08-24 9:41 ` Cousson, Benoit
14 siblings, 1 reply; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 15:41 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel
On Tue, Aug 23, 2011 at 10:03:28AM +0500, G, Manjunath Kondaiah wrote:
>
> 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@vger.kernel.org/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
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
>
> 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
>
> --
> 1.7.4.1
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 08/13] dt: omap: i2c: add dt support for i2c1 controller
2011-08-23 5:03 ` [RFC/PATCH v2 08/13] dt: omap: i2c: add dt support for i2c1 controller G, Manjunath Kondaiah
@ 2011-08-23 15:46 ` G, Manjunath Kondaiah
2011-09-01 17:34 ` Cousson, Benoit
[not found] ` <4E537F53.4030405@ti.com>
1 sibling, 1 reply; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 15:46 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linux-omap, linux-arm-kernel
Hi Grant,
On Tue, Aug 23, 2011 at 10:03:36AM +0500, G, Manjunath Kondaiah wrote:
>
> 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.
>
> Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
> ---
> arch/arm/mach-omap2/board-omap3-dt.c | 14 +++++++-------
> drivers/i2c/busses/i2c-omap.c | 23 ++++++++++++++++++++---
> 2 files changed, 27 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-omap3-dt.c b/arch/arm/mach-omap2/board-omap3-dt.c
> index 72c59a4..cd11224 100644
> --- a/arch/arm/mach-omap2/board-omap3-dt.c
> +++ b/arch/arm/mach-omap2/board-omap3-dt.c
> @@ -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 = {
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 2a072ff..9e98014 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -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
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
> }
>
> 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,
> },
> };
>
> --
> 1.7.4.1
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 10/13] dt: omap4: panda board: set clock freq for i2c devices
[not found] ` <4E537F6B.4060608@ti.com>
@ 2011-08-23 19:03 ` Cousson, Benoit
2011-08-23 19:15 ` G, Manjunath Kondaiah
0 siblings, 1 reply; 32+ messages in thread
From: Cousson, Benoit @ 2011-08-23 19:03 UTC (permalink / raw)
To: G, Manjunath Kondaiah, devicetree-discuss@lists.ozlabs.org,
linux-omap, linux-arm-kernel
> From: G, Manjunath Kondaiah<manjugk@ti.com>
> To: devicetree-discuss@lists.ozlabs.org
> CC: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
>
>
> Update omap4 panda dts file with required clock frequencies
> for the i2c client devices existing on panda board.
>
> Signed-off-by: G, Manjunath Kondaiah<manjugk@ti.com>
> ---
> arch/arm/boot/dts/omap4-panda.dts | 16 ++++++++++++++++
> 1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/boot/dts/omap4-panda.dts
> b/arch/arm/boot/dts/omap4-panda.dts
> index c28aa95..6b831ca 100644
> --- a/arch/arm/boot/dts/omap4-panda.dts
> +++ b/arch/arm/boot/dts/omap4-panda.dts
> @@ -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>;
> + };
> };
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
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: Fwd: [RFC/PATCH v2 08/13] dt: omap: i2c: add dt support for i2c1 controller
[not found] ` <4E537F53.4030405@ti.com>
@ 2011-08-23 19:15 ` Cousson, Benoit
0 siblings, 0 replies; 32+ messages in thread
From: Cousson, Benoit @ 2011-08-23 19:15 UTC (permalink / raw)
To: G, Manjunath Kondaiah
Cc: devicetree-discuss@lists.ozlabs.org, linux-omap,
linux-arm-kernel@lists.infradead.org
> 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.
> 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.
> Signed-off-by: G, Manjunath Kondaiah<manjugk@ti.com>
> ---
> arch/arm/mach-omap2/board-omap3-dt.c | 14 +++++++-------
> drivers/i2c/busses/i2c-omap.c | 23 ++++++++++++++++++++---
> 2 files changed, 27 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-omap3-dt.c
> b/arch/arm/mach-omap2/board-omap3-dt.c
> index 72c59a4..cd11224 100644
> --- a/arch/arm/mach-omap2/board-omap3-dt.c
> +++ b/arch/arm/mach-omap2/board-omap3-dt.c
> @@ -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 = {
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 2a072ff..9e98014 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -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;
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
> +#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,
> },
> };
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 10/13] dt: omap4: panda board: set clock freq for i2c devices
2011-08-23 19:03 ` Cousson, Benoit
@ 2011-08-23 19:15 ` G, Manjunath Kondaiah
0 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-08-23 19:15 UTC (permalink / raw)
To: Cousson, Benoit
Cc: devicetree-discuss@lists.ozlabs.org, linux-omap,
linux-arm-kernel@lists.infradead.org
Hi Benoit,
On Wed, Aug 24, 2011 at 12:33 AM, Cousson, Benoit <b-cousson@ti.com> wrote:
>> From: G, Manjunath Kondaiah<manjugk@ti.com>
>> To: devicetree-discuss@lists.ozlabs.org
>> CC: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
>>
>>
>> Update omap4 panda dts file with required clock frequencies
>> for the i2c client devices existing on panda board.
>>
>> Signed-off-by: G, Manjunath Kondaiah<manjugk@ti.com>
>> ---
>> arch/arm/boot/dts/omap4-panda.dts | 16 ++++++++++++++++
>> 1 files changed, 16 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/omap4-panda.dts
>> b/arch/arm/boot/dts/omap4-panda.dts
>> index c28aa95..6b831ca 100644
>> --- a/arch/arm/boot/dts/omap4-panda.dts
>> +++ b/arch/arm/boot/dts/omap4-panda.dts
>> @@ -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>;
>> + };
>> };
>
> 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.
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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: Fwd: [RFC/PATCH v2 09/13] dt: omap4: add soc file for handling i2c controllers
2011-08-23 15:18 ` G, Manjunath Kondaiah
@ 2011-08-23 19:45 ` Cousson, Benoit
0 siblings, 0 replies; 32+ messages in thread
From: Cousson, Benoit @ 2011-08-23 19:45 UTC (permalink / raw)
To: G, Manjunath Kondaiah
Cc: devicetree-discuss@lists.ozlabs.org, Nayak, Rajendra,
linux-arm-kernel@lists.infradead.org, linux-omap
On 8/23/2011 5:18 PM, G, Manjunath Kondaiah wrote:
> On Tue, Aug 23, 2011 at 03:48:15PM +0200, Cousson, Benoit wrote:
>> From: G, Manjunath Kondaiah<manjugk@ti.com>
>>> To: devicetree-discuss@lists.ozlabs.org
>>> CC: linux-omap@vger.kernel.org, linux-arm-kernel@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.
>
> 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
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1
2011-08-23 15:41 ` G, Manjunath Kondaiah
@ 2011-08-24 9:41 ` Cousson, Benoit
0 siblings, 0 replies; 32+ messages in thread
From: Cousson, Benoit @ 2011-08-24 9:41 UTC (permalink / raw)
To: G, Manjunath Kondaiah, Paul Walmsley
Cc: Hilman, Kevin, Menon, Nishanth,
devicetree-discuss@lists.ozlabs.org, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Hi Manju
On 8/23/2011 5:41 PM, G, Manjunath Kondaiah wrote:
> On Tue, Aug 23, 2011 at 10:03:28AM +0500, G, Manjunath Kondaiah wrote:
>>
>> 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@vger.kernel.org/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
>
> 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.
> 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
>
>>
>> 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
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 08/13] dt: omap: i2c: add dt support for i2c1 controller
2011-08-23 15:46 ` G, Manjunath Kondaiah
@ 2011-09-01 17:34 ` Cousson, Benoit
2011-09-02 3:22 ` G, Manjunath Kondaiah
0 siblings, 1 reply; 32+ messages in thread
From: Cousson, Benoit @ 2011-09-01 17:34 UTC (permalink / raw)
To: G, Manjunath Kondaiah
Cc: devicetree-discuss@lists.ozlabs.org, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Hi Manju,
On 8/23/2011 5:46 PM, G, Manjunath Kondaiah wrote:
> Hi Grant,
[...]
> 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
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC/PATCH v2 08/13] dt: omap: i2c: add dt support for i2c1 controller
2011-09-01 17:34 ` Cousson, Benoit
@ 2011-09-02 3:22 ` G, Manjunath Kondaiah
0 siblings, 0 replies; 32+ messages in thread
From: G, Manjunath Kondaiah @ 2011-09-02 3:22 UTC (permalink / raw)
To: Cousson, Benoit, grant.likely
Cc: devicetree-discuss@lists.ozlabs.org, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Hi Benoit,
On Thu, Sep 01, 2011 at 07:34:11PM +0200, Cousson, Benoit wrote:
> Hi Manju,
>
> On 8/23/2011 5:46 PM, G, Manjunath Kondaiah wrote:
> >Hi Grant,
>
> [...]
>
> >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.
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
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2011-09-02 3:22 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-23 5:03 [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 01/13] OMAP: omap_device: Add device tree node pointer G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 02/13] dt: Add pd_size to AUXDATA structure G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 03/13] dt: omap3: add soc file for handling i2c controllers G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 04/13] dt: omap3: beagle board: set clock freq for i2c devices G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 05/13] dt: omap3: add generic board file for dt support G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 06/13] dt: omap3: add omap-device compatible property G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 07/13] dt: omap: create platform bus for omap devices G, Manjunath Kondaiah
2011-08-23 9:07 ` Jamie Iles
2011-08-23 15:19 ` G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 08/13] dt: omap: i2c: add dt support for i2c1 controller G, Manjunath Kondaiah
2011-08-23 15:46 ` G, Manjunath Kondaiah
2011-09-01 17:34 ` Cousson, Benoit
2011-09-02 3:22 ` G, Manjunath Kondaiah
[not found] ` <4E537F53.4030405@ti.com>
2011-08-23 19:15 ` Fwd: " Cousson, Benoit
2011-08-23 5:03 ` [RFC/PATCH v2 09/13] dt: omap4: add soc file for handling i2c controllers G, Manjunath Kondaiah
2011-08-23 8:23 ` Rajendra Nayak
2011-08-23 15:11 ` G, Manjunath Kondaiah
[not found] ` <4E537FA7.3050609@ti.com>
2011-08-23 13:48 ` Fwd: " Cousson, Benoit
2011-08-23 15:18 ` G, Manjunath Kondaiah
2011-08-23 19:45 ` Cousson, Benoit
2011-08-23 5:03 ` [RFC/PATCH v2 10/13] dt: omap4: panda board: set clock freq for i2c devices G, Manjunath Kondaiah
[not found] ` <4E537F6B.4060608@ti.com>
2011-08-23 19:03 ` Cousson, Benoit
2011-08-23 19:15 ` G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 11/13] dt: omap4: add generic board file for dt support G, Manjunath Kondaiah
[not found] ` <4E537F80.1060001@ti.com>
[not found] ` <4E537F80.1060001-l0cyMroinI0@public.gmane.org>
2011-08-23 13:05 ` Fwd: " Cousson, Benoit
2011-08-23 15:30 ` G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 12/13] dt: omap4: enable dt support for i2c1 controller G, Manjunath Kondaiah
2011-08-23 5:03 ` [RFC/PATCH v2 13/13] dt: omap: i2c: dt usage model documentation G, Manjunath Kondaiah
[not found] ` <4E537ECB.1060704@ti.com>
2011-08-23 12:38 ` [RFC/PATCH v2 00/13] dt: omap: dt binding with omap_device and support for i2c1 Cousson, Benoit
2011-08-23 15:41 ` G, Manjunath Kondaiah
2011-08-24 9:41 ` Cousson, Benoit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).