Skip to contentSkip to conversation

omap3 and omap4: add device tree support for wdt

PATCH In review [email protected] 4 participants 8 messages Jun 1, 2012 – Jul 9, 2012

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

PATCH v2 1/3 arm/dts: add wdt node for omap3 and omap4

In reply to [email protected]

From: Xiao Jiang <[email protected]>

Add wdt node to support dt.

---
 .../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
Documentation/devicetree/bindings/watchdog/omap-wdt.txt new file +14 -0
new file mode 100644
index 0000000..c227970
@@ -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";
+};
arch/arm/boot/dts/omap3.dtsi +5 -0
index 99474fa..8109471 100644
@@ -215,5 +215,10 @@
 			compatible = "ti,omap3-hsmmc";
 			ti,hwmods = "mmc3";
 		};
+
+		wdt2: wdt@48314000 {
+			compatible = "ti,omap3-wdt";
+			ti,hwmods = "wd_timer2";
+		};
 	};
 };
arch/arm/boot/dts/omap4.dtsi +5 -0
index 359c497..3664641 100644
@@ -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";
+		};
 	};
 };
Signature · 1 line
1.7.3
#0 lore raw

v2 cover 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
Signature · 1 line
1.7.3
#2 lore raw

PATCH v3 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.

---
 arch/arm/mach-omap2/devices.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/devices.c +1 -1
index 7b4b932..527c004 100644
@@ -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);
Signature · 1 line
1.7.3
#3 lore raw

PATCH v2 3/3 watchdog: omap_wdt: add device tree support

In reply to [email protected]

From: Xiao Jiang <[email protected]>

Add device table for omap_wdt to support dt.

---
 drivers/watchdog/omap_wdt.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/watchdog/omap_wdt.c +7 -0
index 8285d65..02ebfd5 100644
@@ -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,
 	},
 };
 
Signature · 1 line
1.7.3
Reviewed-by on the v2 series
#7 lore raw
In reply to [email protected]
Quoted 14 lines · On 05/31/2012 11:44 PM, jgq516 at gmail.com 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

Quoted 7 lines
 .../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.

Cheers
Jon

maintainer
#4 lore raw

Re: [PATCHv2 3/3] watchdog: omap_wdt: add device tree support

In reply to [email protected]

Hi Wim,

Quoted 3 lines · * jgq516 at gmail.com <[email protected]> [120531 20:56]:

From: Xiao Jiang <[email protected]>

Add device table for omap_wdt to support dt.

Care to ack this patch in the series?

Regards,

Tony

Quoted 34 lines
---
 drivers/watchdog/omap_wdt.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/watchdog/omap_wdt.c +7 -0
index 8285d65..02ebfd5 100644
@@ -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,
 	},
 };
 
Signature · 1 line
1.7.3
maintainer
#6 lore raw

Re: [PATCHv2 3/3] watchdog: omap_wdt: add device tree support

Quoted 5 lines · Wim Van Sebroeck

Hi Tony,

Quoted 3 lines

Hi Wim,

* jgq516 at gmail.com <[email protected]> [120531 20:56]:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

From: Xiao Jiang <[email protected]>

Add device table for omap_wdt to support dt.

Care to ack this patch in the series?

Yep.

Thanks, I'll apply all three into omap devel-dt branch.

Regards,

Tony