diff mbox

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

Message ID 510FA09F.7030604@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sekhar Nori Feb. 4, 2013, 11:50 a.m. UTC
Hi Anil,

On 1/24/2013 2:08 PM, Kumar, Anil wrote:
> Add OF_DEV_AUXDATA for wdt driver in da850 board dt
> file to use wdt clock.
> 
> Signed-off-by: Kumar, Anil <anilkumar.v@ti.com>
> ---
> :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(-)
> 
> diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
> index 37c27af..1b295d2 100644
> --- a/arch/arm/mach-davinci/da8xx-dt.c
> +++ b/arch/arm/mach-davinci/da8xx-dt.c
> @@ -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" <anilkumar.v@ti.com>
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.

Signed-off-by: Kumar, Anil <anilkumar.v@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 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(-)

Comments

Sergei Shtylyov Feb. 4, 2013, noon UTC | #1
Hello.

On 04-02-2013 15:50, Sekhar Nori wrote:

> 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" <anilkumar.v@ti.com>
> 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.

> Signed-off-by: Kumar, Anil <anilkumar.v@ti.com>
> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
[...]

> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
> index 8dd15c0..2800090 100644
> --- a/arch/arm/boot/dts/da850.dtsi
> +++ b/arch/arm/boot/dts/da850.dtsi
> @@ -88,6 +88,11 @@
>   				      19>;
>   			status = "disabled";
>   		};
> +		wdt: wdt@1c21000 {
> +			compatible = "ti,davinci-wdt";
> +			reg = <0x21000 0xfff>;

    Not 0x1000? This is region size, not upper limit.

WBR, Sergei
Kumar, Anil Feb. 5, 2013, 1:51 a.m. UTC | #2
On Mon, Feb 04, 2013 at 17:20:55, Nori, Sekhar wrote:
> Hi Anil,
> 
> On 1/24/2013 2:08 PM, Kumar, Anil wrote:
> > Add OF_DEV_AUXDATA for wdt driver in da850 board dt
> > file to use wdt clock.
> > 
> > Signed-off-by: Kumar, Anil <anilkumar.v@ti.com>
> > ---
> > :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(-)
> > 
> > diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
> > index 37c27af..1b295d2 100644
> > --- a/arch/arm/mach-davinci/da8xx-dt.c
> > +++ b/arch/arm/mach-davinci/da8xx-dt.c
> > @@ -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[].

ok

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

> Thanks,
> Sekhar
> 
> ----8<----
> From: "Kumar, Anil" <anilkumar.v@ti.com>
> 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.
> 
> Signed-off-by: Kumar, Anil <anilkumar.v@ti.com>
> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
> ---
>  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(-)
> 
> diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
> index fa04152..cc777dc 100644
> --- a/arch/arm/boot/dts/da850-evm.dts
> +++ b/arch/arm/boot/dts/da850-evm.dts
> @@ -30,6 +30,9 @@
>  		rtc0: rtc@1c23000 {
>  			status = "okay";
>  		};
> +		wdt: wdt@1c21000 {
> +			status = "okay";
> +		};
>  	};
>  	nand_cs3@62000000 {
>  		status = "okay";
> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
> index 8dd15c0..2800090 100644
> --- a/arch/arm/boot/dts/da850.dtsi
> +++ b/arch/arm/boot/dts/da850.dtsi
> @@ -88,6 +88,11 @@
>  				      19>;
>  			status = "disabled";
>  		};
> +		wdt: wdt@1c21000 {
> +			compatible = "ti,davinci-wdt";
> +			reg = <0x21000 0xfff>;
> +			status = "disabled";
> +		};
>  	};
>  	nand_cs3@62000000 {
>  		compatible = "ti,davinci-nand";
> diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
> index 37c27af..90c3c69 100644
> --- a/arch/arm/mach-davinci/da8xx-dt.c
> +++ b/arch/arm/mach-davinci/da8xx-dt.c
> @@ -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();
>  }
> 
>
Kumar, Anil Feb. 5, 2013, 6:39 a.m. UTC | #3
Hi Serqei,

On Mon, Feb 04, 2013 at 17:30:20, Sergei Shtylyov wrote:
> Hello.
> 
> On 04-02-2013 15:50, Sekhar Nori wrote:
> 
> > 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" <anilkumar.v@ti.com>
> > 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.
> 
> > Signed-off-by: Kumar, Anil <anilkumar.v@ti.com>
> > Signed-off-by: Sekhar Nori <nsekhar@ti.com>
> [...]
> 
> > diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
> > index 8dd15c0..2800090 100644
> > --- a/arch/arm/boot/dts/da850.dtsi
> > +++ b/arch/arm/boot/dts/da850.dtsi
> > @@ -88,6 +88,11 @@
> >   				      19>;
> >   			status = "disabled";
> >   		};
> > +		wdt: wdt@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
diff mbox

Patch

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index fa04152..cc777dc 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -30,6 +30,9 @@ 
 		rtc0: rtc@1c23000 {
 			status = "okay";
 		};
+		wdt: wdt@1c21000 {
+			status = "okay";
+		};
 	};
 	nand_cs3@62000000 {
 		status = "okay";
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 8dd15c0..2800090 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -88,6 +88,11 @@ 
 				      19>;
 			status = "disabled";
 		};
+		wdt: wdt@1c21000 {
+			compatible = "ti,davinci-wdt";
+			reg = <0x21000 0xfff>;
+			status = "disabled";
+		};
 	};
 	nand_cs3@62000000 {
 		compatible = "ti,davinci-nand";
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index 37c27af..90c3c69 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -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();
 }