2012-06-01 03:52:22

by Guoqing Jiang

[permalink] [raw]
Subject: [PATCHv2 0/3] omap3 and omap4: add device tree support for wdt

From: Xiao Jiang <[email protected]>

Changes compared to previous version:
- created document for omap wdt
- some modifications per the comments from Benoit and Jon

This series is based on latest Linus'tree, and also can be applied to dt branch
of linux-omap tree. Tested with omap4430 blaze board and am37xx board.

Xiao Jiang (3):
arm/dts: add wdt node for omap3 and omap4
OMAP: avoid build wdt platform device if with dt support
watchdog: omap_wdt: add device tree support

.../devicetree/bindings/watchdog/omap-wdt.txt | 14 ++++++++++++++
arch/arm/boot/dts/omap3.dtsi | 5 +++++
arch/arm/boot/dts/omap4.dtsi | 5 +++++
arch/arm/mach-omap2/devices.c | 2 +-
drivers/watchdog/omap_wdt.c | 7 +++++++
5 files changed, 32 insertions(+), 1 deletions(-)
create mode 100644 Documentation/devicetree/bindings/watchdog/omap-wdt.txt

--
1.7.3


2012-06-01 03:52:23

by Guoqing Jiang

[permalink] [raw]
Subject: [PATCHv3 2/3] OMAP: avoid build wdt platform device if with dt support

From: Xiao Jiang <[email protected]>

If provided dt support, then skip add wdt platform device as usual.

Signed-off-by: Xiao Jiang <[email protected]>
Reviewed-by: Jon Hunter <[email protected]>
---
arch/arm/mach-omap2/devices.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 7b4b932..527c004 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -772,7 +772,7 @@ static int __init omap_init_wdt(void)
char *oh_name = "wd_timer2";
char *dev_name = "omap_wdt";

- if (!cpu_class_is_omap2())
+ if (!cpu_class_is_omap2() || of_have_populated_dt())
return 0;

oh = omap_hwmod_lookup(oh_name);
--
1.7.3

2012-06-01 03:52:21

by Guoqing Jiang

[permalink] [raw]
Subject: [PATCHv2 1/3] arm/dts: add wdt node for omap3 and omap4

From: Xiao Jiang <[email protected]>

Add wdt node to support dt.

Signed-off-by: Xiao Jiang <[email protected]>
---
.../devicetree/bindings/watchdog/omap-wdt.txt | 14 ++++++++++++++
arch/arm/boot/dts/omap3.dtsi | 5 +++++
arch/arm/boot/dts/omap4.dtsi | 5 +++++
3 files changed, 24 insertions(+), 0 deletions(-)
create mode 100644 Documentation/devicetree/bindings/watchdog/omap-wdt.txt

diff --git a/Documentation/devicetree/bindings/watchdog/omap-wdt.txt b/Documentation/devicetree/bindings/watchdog/omap-wdt.txt
new file mode 100644
index 0000000..c227970
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/omap-wdt.txt
@@ -0,0 +1,14 @@
+TI Watchdog Timer (WDT) Controller for OMAP
+
+Required properties:
+compatible:
+- "ti,omap3-wdt" for OMAP3
+- "ti,omap4-wdt" for OMAP4
+- ti,hwmods: Name of the hwmod associated to the WDT
+
+Examples:
+
+wdt2: wdt@4a314000 {
+ compatible = "ti,omap4-wdt", "ti,omap3-wdt";
+ ti,hwmods = "wd_timer2";
+};
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 99474fa..8109471 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -215,5 +215,10 @@
compatible = "ti,omap3-hsmmc";
ti,hwmods = "mmc3";
};
+
+ wdt2: wdt@48314000 {
+ compatible = "ti,omap3-wdt";
+ ti,hwmods = "wd_timer2";
+ };
};
};
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 359c497..3664641 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -272,5 +272,10 @@
ti,hwmods = "mmc5";
ti,needs-special-reset;
};
+
+ wdt2: wdt@4a314000 {
+ compatible = "ti,omap4-wdt", "ti,omap3-wdt";
+ ti,hwmods = "wd_timer2";
+ };
};
};
--
1.7.3

2012-06-01 03:57:27

by Guoqing Jiang

[permalink] [raw]
Subject: [PATCHv2 3/3] watchdog: omap_wdt: add device tree support

From: Xiao Jiang <[email protected]>

Add device table for omap_wdt to support dt.

Signed-off-by: Xiao Jiang <[email protected]>
---
drivers/watchdog/omap_wdt.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 8285d65..02ebfd5 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -430,6 +430,12 @@ static int omap_wdt_resume(struct platform_device *pdev)
#define omap_wdt_resume NULL
#endif

+static const struct of_device_id omap_wdt_of_match[] = {
+ { .compatible = "ti,omap3-wdt", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, omap_wdt_of_match);
+
static struct platform_driver omap_wdt_driver = {
.probe = omap_wdt_probe,
.remove = __devexit_p(omap_wdt_remove),
@@ -439,6 +445,7 @@ static struct platform_driver omap_wdt_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "omap_wdt",
+ .of_match_table = omap_wdt_of_match,
},
};

--
1.7.3

2012-06-01 13:55:12

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCHv2 0/3] omap3 and omap4: add device tree support for wdt


On 05/31/2012 11:44 PM, [email protected] wrote:
> From: Xiao Jiang <[email protected]>
>
> Changes compared to previous version:
> - created document for omap wdt
> - some modifications per the comments from Benoit and Jon
>
> This series is based on latest Linus'tree, and also can be applied to dt branch
> of linux-omap tree. Tested with omap4430 blaze board and am37xx board.
>
> Xiao Jiang (3):
> arm/dts: add wdt node for omap3 and omap4
> OMAP: avoid build wdt platform device if with dt support
> watchdog: omap_wdt: add device tree support
>
> .../devicetree/bindings/watchdog/omap-wdt.txt | 14 ++++++++++++++
> arch/arm/boot/dts/omap3.dtsi | 5 +++++
> arch/arm/boot/dts/omap4.dtsi | 5 +++++
> arch/arm/mach-omap2/devices.c | 2 +-
> drivers/watchdog/omap_wdt.c | 7 +++++++
> 5 files changed, 32 insertions(+), 1 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/watchdog/omap-wdt.txt

Thanks! Looks good to me.

Reviewed-by: Jon Hunter <[email protected]>

Cheers
Jon