Skip to contentSkip to conversation

ARM: davinci: da850: add wdt DT node

PATCH In review Kumar, Anil 3 participants 7 messages Jan 24, 2013 – Feb 5, 2013

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

cover ARM: davinci: da850: add wdt DT node

Add wdt DT node and OF_DEV_AUXDATA for wdt driver in da850 board dt file to use wdt clock.

This series applies on top of v3.8-rc4.

This is tested on da850 EVM.

Test Procedure:

$watchdog -F /dev/watchdog (Device should not reboot)
After wdt heartbeat timeout(DEFAULT_HEARTBEAT is 60 sec)
$ctr + c (Device should reboot after heartbeat timeout)

Kumar, Anil (2):
ARM: davinci: da850: add wdt DT node
ARM: davinci: da850: add wdt OF_DEV_AUXDATA entry

 arch/arm/boot/dts/da850-evm.dts  |    3 +++
 arch/arm/boot/dts/da850.dtsi     |    5 +++++
 arch/arm/mach-davinci/da8xx-dt.c |    8 +++++++-
 3 files changed, 15 insertions(+), 1 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/2 ARM: davinci: da850: add wdt DT node

Add da850 wdt DT node.

---
:100644 100644 37dc5a3... 4666ce9... M arch/arm/boot/dts/da850-evm.dts
:100644 100644 640ab75... 08bf974... M arch/arm/boot/dts/da850.dtsi

 arch/arm/boot/dts/da850-evm.dts |    3 +++
 arch/arm/boot/dts/da850.dtsi    |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/boot/dts/da850-evm.dts +3 -0
index 37dc5a3..4666ce9 100644
@@ -24,5 +24,8 @@
 		serial2: serial@1d0d000 {
 			status = "okay";
 		};
+		wdt: wdt@1c21000 {
+			status = "okay";
+		};
 	};
 };
arch/arm/boot/dts/da850.dtsi +5 -0
index 640ab75..08bf974 100644
@@ -56,5 +56,10 @@
 			interrupt-parent = <&intc>;
 			status = "disabled";
 		};
+		wdt: wdt@1c21000 {
+			compatible = "ti,davinci-wdt";
+			reg = <0x21000 0xfff>;
+			status = "disabled";
+		};
 	};
 };
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 2/2 ARM: davinci: da850: add wdt OF_DEV_AUXDATA entry

In reply to Kumar, Anil

Add OF_DEV_AUXDATA for wdt driver in da850 board dt file to use wdt clock.

---
:100644 100644 37c27af... 1b295d2... M arch/arm/mach-davinci/da8xx-dt.c

 arch/arm/mach-davinci/da8xx-dt.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/mach-davinci/da8xx-dt.c +7 -1
index 37c27af..1b295d2 100644
@@ -37,11 +37,17 @@ static void __init da8xx_init_irq(void)
 	of_irq_init(da8xx_irq_match);
 }
 
+struct of_dev_auxdata da850_evm_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("ti,davinci-wdt", 0x1c21000, "watchdog", NULL),
+	{}
+};
+
 #ifdef CONFIG_ARCH_DAVINCI_DA850
 
 static void __init da850_init_machine(void)
 {
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+	of_platform_populate(NULL, of_default_bus_match_table,
+			da850_evm_auxdata_lookup, NULL);
 
 	da8xx_uart_clk_enable();
 }
Signature · 1 line
1.7.4.1
#3 lore raw

Re: [PATCH 2/2] ARM: davinci: da850: add wdt OF_DEV_AUXDATA entry

Hi Anil,

Quoted 14 lines · Anil

Add OF_DEV_AUXDATA for wdt driver in da850 board dt file to use wdt clock.

---
:100644 100644 37c27af... 1b295d2... M arch/arm/mach-davinci/da8xx-dt.c

 arch/arm/mach-davinci/da8xx-dt.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/mach-davinci/da8xx-dt.c +0 -0
index 37c27af..1b295d2 100644

arch/arm/mach-davinci/da8xx-dt.c static void __init da8xx_init_irq(void) · line 40

Quoted 4 lines
arch/arm/mach-davinci/da8xx-dt.c +1 -0
@@ -37,11 +37,17 @@ static void __init da8xx_init_irq(void)
 	of_irq_init(da8xx_irq_match);
 }
 
+struct of_dev_auxdata da850_evm_auxdata_lookup[] __initdata = {

Auxdata is not evm specific. This can instead be called da850_auxdata_lookup[].

Also, I dont think it is necessary to add auxdata in a separate patch from dt nodes. So, I fixed these issues and came up with below patch. I tested basic wdt reboot. reboot command is still broken (with or without this patch). Can you please look at that?

Thanks,
Sekhar

----8<----
From: "Kumar, Anil" <[email protected]>
Date: Thu, 24 Jan 2013 14:08:14 +0530
Subject: [PATCH 1/1] ARM: davinci: da850: add wdt DT node

Add da850 wdt DT node.

---
 arch/arm/boot/dts/da850-evm.dts  |    3 +++
 arch/arm/boot/dts/da850.dtsi     |    5 +++++
 arch/arm/mach-davinci/da8xx-dt.c |    8 +++++++-
 3 files changed, 15 insertions(+), 1 deletion(-)
arch/arm/boot/dts/da850-evm.dts +3 -0
index fa04152..cc777dc 100644
@@ -30,6 +30,9 @@
 		rtc0: rtc at 1c23000 {
 			status = "okay";
 		};
+		wdt: wdt at 1c21000 {
+			status = "okay";
+		};
 	};
 	nand_cs3 at 62000000 {
 		status = "okay";
arch/arm/boot/dts/da850.dtsi +5 -0
index 8dd15c0..2800090 100644
@@ -88,6 +88,11 @@
 				      19>;
 			status = "disabled";
 		};
+		wdt: wdt at 1c21000 {
+			compatible = "ti,davinci-wdt";
+			reg = <0x21000 0xfff>;
+			status = "disabled";
+		};
 	};
 	nand_cs3 at 62000000 {
 		compatible = "ti,davinci-nand";
arch/arm/mach-davinci/da8xx-dt.c +7 -1
index 37c27af..90c3c69 100644
@@ -37,11 +37,17 @@ static void __init da8xx_init_irq(void)
 	of_irq_init(da8xx_irq_match);
 }
 
+struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
+	{}
+};
+
 #ifdef CONFIG_ARCH_DAVINCI_DA850
 
 static void __init da850_init_machine(void)
 {
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+	of_platform_populate(NULL, of_default_bus_match_table,
+			     da850_auxdata_lookup, NULL);
 
 	da8xx_uart_clk_enable();
 }
#4 lore raw

Re: [PATCH 2/2] ARM: davinci: da850: add wdt OF_DEV_AUXDATA entry

Hello.

Quoted 19 lines · Sekhar Nori

Auxdata is not evm specific. This can instead be called da850_auxdata_lookup[].

Also, I dont think it is necessary to add auxdata in a separate patch from dt nodes. So, I fixed these issues and came up with below patch. I tested basic wdt reboot. reboot command is still broken (with or without this patch). Can you please look at that?

Thanks,
Sekhar

----8<----
From: "Kumar, Anil" <[email protected]>
Date: Thu, 24 Jan 2013 14:08:14 +0530
Subject: [PATCH 1/1] ARM: davinci: da850: add wdt DT node

Add da850 wdt DT node.

[...]

arch/arm/boot/dts/da850.dtsi line 93

Quoted 11 lines
arch/arm/boot/dts/da850.dtsi +3 -0
index 8dd15c0..2800090 100644
@@ -88,6 +88,11 @@
  				      19>;
  			status = "disabled";
  		};
+		wdt: wdt at 1c21000 {
+			compatible = "ti,davinci-wdt";
+			reg = <0x21000 0xfff>;
    Not 0x1000? This is region size, not upper limit.

WBR, Sergei

#5 lore raw

RE: [PATCH 2/2] ARM: davinci: da850: add wdt OF_DEV_AUXDATA entry

Hi Serqei,

Quoted 25 lines · Sergei Shtylyov

Hello.

Quoted 19 lines · Sekhar Nori

Auxdata is not evm specific. This can instead be called da850_auxdata_lookup[].

Also, I dont think it is necessary to add auxdata in a separate patch from dt nodes. So, I fixed these issues and came up with below patch. I tested basic wdt reboot. reboot command is still broken (with or without this patch). Can you please look at that?

Thanks,
Sekhar

----8<----
From: "Kumar, Anil" <[email protected]>
Date: Thu, 24 Jan 2013 14:08:14 +0530
Subject: [PATCH 1/1] ARM: davinci: da850: add wdt DT node

Add da850 wdt DT node.

[...]

Quoted 13 lines

arch/arm/boot/dts/da850.dtsi line 93

Quoted 11 lines
arch/arm/boot/dts/da850.dtsi +3 -0
index 8dd15c0..2800090 100644
@@ -88,6 +88,11 @@
  				      19>;
  			status = "disabled";
  		};
+		wdt: wdt at 1c21000 {
+			compatible = "ti,davinci-wdt";
+			reg = <0x21000 0xfff>;
    Not 0x1000? This is region size, not upper limit.

Oh, you are right. It should be 0x1000. Thanks for correcting.

In da850 timer1 is used as wdt and according to da850 data sheet.

Timer1 start address is 0x01C21000
Timer1 end address is 0x01C21FFF

I had wrongly calculated upper limit. I will fix it.

Thanks,
Anil

#6 lore raw

RE: [PATCH 2/2] ARM: davinci: da850: add wdt OF_DEV_AUXDATA entry

In reply to Sekhar Nori
Quoted 20 lines · Sekhar

Hi Anil,

Quoted 17 lines · Anil

Add OF_DEV_AUXDATA for wdt driver in da850 board dt file to use wdt clock.

---
:100644 100644 37c27af... 1b295d2... M arch/arm/mach-davinci/da8xx-dt.c

 arch/arm/mach-davinci/da8xx-dt.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/mach-davinci/da8xx-dt.c +0 -0
index 37c27af..1b295d2 100644
@@ -37,11 +37,17 @@ static void __init da8xx_init_irq(void)
 	of_irq_init(da8xx_irq_match);
 }
 
Quoted 3 lines

arch/arm/mach-davinci/da8xx-dt.c static void __init da8xx_init_irq(void) · line 40

Quoted 1 line
arch/arm/mach-davinci/da8xx-dt.c +1 -0
+struct of_dev_auxdata da850_evm_auxdata_lookup[] __initdata = {

Auxdata is not evm specific. This can instead be called da850_auxdata_lookup[].

ok

Quoted 6 lines

Also, I dont think it is necessary to add auxdata in a separate patch from dt nodes. So, I fixed these issues and came up with below patch. I tested basic wdt reboot. reboot command is still broken (with or without this patch). Can you please look at that?

ok, I will look into reboot command issue.

Quoted 73 lines

Thanks,
Sekhar

----8<----
From: "Kumar, Anil" <[email protected]>
Date: Thu, 24 Jan 2013 14:08:14 +0530
Subject: [PATCH 1/1] ARM: davinci: da850: add wdt DT node

Add da850 wdt DT node.

---
 arch/arm/boot/dts/da850-evm.dts  |    3 +++
 arch/arm/boot/dts/da850.dtsi     |    5 +++++
 arch/arm/mach-davinci/da8xx-dt.c |    8 +++++++-
 3 files changed, 15 insertions(+), 1 deletion(-)
arch/arm/boot/dts/da850-evm.dts +3 -0
index fa04152..cc777dc 100644
@@ -30,6 +30,9 @@
 		rtc0: rtc at 1c23000 {
 			status = "okay";
 		};
+		wdt: wdt at 1c21000 {
+			status = "okay";
+		};
 	};
 	nand_cs3 at 62000000 {
 		status = "okay";
arch/arm/boot/dts/da850.dtsi +5 -0
index 8dd15c0..2800090 100644
@@ -88,6 +88,11 @@
 				      19>;
 			status = "disabled";
 		};
+		wdt: wdt at 1c21000 {
+			compatible = "ti,davinci-wdt";
+			reg = <0x21000 0xfff>;
+			status = "disabled";
+		};
 	};
 	nand_cs3 at 62000000 {
 		compatible = "ti,davinci-nand";
arch/arm/mach-davinci/da8xx-dt.c +7 -1
index 37c27af..90c3c69 100644
@@ -37,11 +37,17 @@ static void __init da8xx_init_irq(void)
 	of_irq_init(da8xx_irq_match);
 }
 
+struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
+	{}
+};
+
 #ifdef CONFIG_ARCH_DAVINCI_DA850
 
 static void __init da850_init_machine(void)
 {
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+	of_platform_populate(NULL, of_default_bus_match_table,
+			     da850_auxdata_lookup, NULL);
 
 	da8xx_uart_clk_enable();
 }