linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
@ 2011-11-17 15:07 Peter De Schrijver
  2011-11-17 15:44 ` Rob Herring
  2011-11-17 18:51 ` Stephen Warren
  0 siblings, 2 replies; 16+ messages in thread
From: Peter De Schrijver @ 2011-11-17 15:07 UTC (permalink / raw)
  To: Peter De Schrijver
  Cc: Russell King, Colin Cross, Olof Johansson, Stephen Warren,
	Marc Dietrich, Grant Likely, linux-arm-kernel, linux-kernel,
	linux-tegra

Convert tegra20 IRQ intialization to the GIC devicetree binding. Modify the
interrupt definitions in the dts files according to
Documentation/devicetree/bindings/arm/gic.txt

Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
---
 arch/arm/boot/dts/tegra-paz00.dts |    2 +-
 arch/arm/boot/dts/tegra20.dtsi    |   52 ++++++++++++++++++------------------
 arch/arm/mach-tegra/irq.c         |   18 +++++++++++-
 3 files changed, 43 insertions(+), 29 deletions(-)

diff --git a/arch/arm/boot/dts/tegra-paz00.dts b/arch/arm/boot/dts/tegra-paz00.dts
index 15a949f..7ff8f6f 100644
--- a/arch/arm/boot/dts/tegra-paz00.dts
+++ b/arch/arm/boot/dts/tegra-paz00.dts
@@ -32,7 +32,7 @@
 		#size-cells = <0>;
 		compatible = "nvidia,nvec";
 		reg = <0x7000C500 0x100>;
-		interrupts = <124>;
+		interrupts = <0 92 0x04>;
 		clock-frequency = <80000>;
 		request-gpios = <&gpio 170 0>;
 		slave-addr = <138>;
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 795b921..cd01b01 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -5,9 +5,9 @@
 	interrupt-parent = <&intc>;
 
 	intc: interrupt-controller@50041000 {
-		compatible = "nvidia,tegra20-gic";
+		compatible = "arm,cortex-a9-gic";
 		interrupt-controller;
-		#interrupt-cells = <1>;
+		#interrupt-cells = <3>;
 		reg = < 0x50041000 0x1000 >,
 		      < 0x50040100 0x0100 >;
 	};
@@ -17,7 +17,7 @@
 		#size-cells = <0>;
 		compatible = "nvidia,tegra20-i2c";
 		reg = <0x7000C000 0x100>;
-		interrupts = < 70 >;
+		interrupts = < 0 38 0x04 >;
 	};
 
 	i2c@7000c400 {
@@ -25,7 +25,7 @@
 		#size-cells = <0>;
 		compatible = "nvidia,tegra20-i2c";
 		reg = <0x7000C400 0x100>;
-		interrupts = < 116 >;
+		interrupts = < 0 84 0x04 >;
 	};
 
 	i2c@7000c500 {
@@ -33,7 +33,7 @@
 		#size-cells = <0>;
 		compatible = "nvidia,tegra20-i2c";
 		reg = <0x7000C500 0x100>;
-		interrupts = < 124 >;
+		interrupts = < 0 92 0x04 >;
 	};
 
 	i2c@7000d000 {
@@ -41,7 +41,7 @@
 		#size-cells = <0>;
 		compatible = "nvidia,tegra20-i2c";
 		reg = <0x7000D000 0x200>;
-		interrupts = < 85 >;
+		interrupts = < 0 53 0x04 >;
 	};
 
 	i2s@70002800 {
@@ -49,7 +49,7 @@
 		#size-cells = <0>;
 		compatible = "nvidia,tegra20-i2s";
 		reg = <0x70002800 0x200>;
-		interrupts = < 45 >;
+		interrupts = < 0 13 0x04 >;
 		dma-channel = < 2 >;
 	};
 
@@ -58,7 +58,7 @@
 		#size-cells = <0>;
 		compatible = "nvidia,tegra20-i2s";
 		reg = <0x70002a00 0x200>;
-		interrupts = < 35 >;
+		interrupts = < 0 3 0x04 >;
 		dma-channel = < 1 >;
 	};
 
@@ -72,7 +72,7 @@
 	gpio: gpio@6000d000 {
 		compatible = "nvidia,tegra20-gpio";
 		reg = < 0x6000d000 0x1000 >;
-		interrupts = < 64 65 66 67 87 119 121 >;
+		interrupts = < 0 32 0x04 0 33 0x04 0 34 0x04 0 35 0x04 0 55 0x04 0 87 0x04 0 89 0x04 >;
 		#gpio-cells = <2>;
 		gpio-controller;
 	};
@@ -87,81 +87,81 @@
 
 	serial@70006000 {
 		compatible = "nvidia,tegra20-uart";
-		reg = <0x70006000 0x40>;
+		reg = <0x70006000 0x040>;
 		reg-shift = <2>;
-		interrupts = < 68 >;
+		interrupts = < 0 36 0x04 >;
 	};
 
 	serial@70006040 {
 		compatible = "nvidia,tegra20-uart";
-		reg = <0x70006040 0x40>;
+		reg = <0x70006040 0x040>;
 		reg-shift = <2>;
-		interrupts = < 69 >;
+		interrupts = < 0 37 0x04 >;
 	};
 
 	serial@70006200 {
 		compatible = "nvidia,tegra20-uart";
 		reg = <0x70006200 0x100>;
 		reg-shift = <2>;
-		interrupts = < 78 >;
+		interrupts = < 0 46 0x04 >;
 	};
 
 	serial@70006300 {
 		compatible = "nvidia,tegra20-uart";
 		reg = <0x70006300 0x100>;
 		reg-shift = <2>;
-		interrupts = < 122 >;
+		interrupts = < 0 90 0x04 >;
 	};
 
 	serial@70006400 {
 		compatible = "nvidia,tegra20-uart";
 		reg = <0x70006400 0x100>;
 		reg-shift = <2>;
-		interrupts = < 123 >;
+		interrupts = < 0 91 0x04 >;
 	};
 
 	sdhci@c8000000 {
 		compatible = "nvidia,tegra20-sdhci";
 		reg = <0xc8000000 0x200>;
-		interrupts = < 46 >;
+		interrupts = < 0 14 0x04 >;
 	};
 
 	sdhci@c8000200 {
 		compatible = "nvidia,tegra20-sdhci";
 		reg = <0xc8000200 0x200>;
-		interrupts = < 47 >;
+		interrupts = < 0 15 0x04 >;
 	};
 
 	sdhci@c8000400 {
 		compatible = "nvidia,tegra20-sdhci";
 		reg = <0xc8000400 0x200>;
-		interrupts = < 51 >;
+		interrupts = < 0 19 0x04 >;
 	};
 
 	sdhci@c8000600 {
 		compatible = "nvidia,tegra20-sdhci";
 		reg = <0xc8000600 0x200>;
-		interrupts = < 63 >;
+		interrupts = < 0 31 0x04 >;
 	};
 
 	usb@c5000000 {
 		compatible = "nvidia,tegra20-ehci", "usb-ehci";
-		reg = <0xc5000000 0x4000>;
-		interrupts = < 52 >;
+		reg = <0xc5000000 0x04000>;
+		interrupts = < 0 20 0x04 >;
 		phy_type = "utmi";
 	};
 
 	usb@c5004000 {
 		compatible = "nvidia,tegra20-ehci", "usb-ehci";
-		reg = <0xc5004000 0x4000>;
-		interrupts = < 53 >;
+		reg = <0xc5004000 0x04000>;
+		interrupts = < 0 21 0x04 >;
 		phy_type = "ulpi";
 	};
 
 	usb@c5008000 {
 		compatible = "nvidia,tegra20-ehci", "usb-ehci";
-		reg = <0xc5008000 0x4000>;
-		interrupts = < 129 >;
+		reg = <0xc5008000 0x04000>;
+		interrupts = < 0 97 0x04 >;
 		phy_type = "utmi";
 	};
 };
diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
index 8ad82af..c6d02a4 100644
--- a/arch/arm/mach-tegra/irq.c
+++ b/arch/arm/mach-tegra/irq.c
@@ -21,6 +21,7 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/io.h>
+#include <linux/of_irq.h>
 
 #include <asm/hardware/gic.h>
 
@@ -109,6 +110,11 @@ static int tegra_retrigger(struct irq_data *d)
 	return 1;
 }
 
+static const struct of_device_id tegra_irq_match[] __initconst = {
+	{ .compatible = "arm,cortex-a9-gic", .data = gic_of_init },
+	{ /* sentinel */ }
+};
+
 void __init tegra_init_irq(void)
 {
 	int i;
@@ -125,6 +131,14 @@ void __init tegra_init_irq(void)
 	gic_arch_extn.irq_unmask = tegra_unmask;
 	gic_arch_extn.irq_retrigger = tegra_retrigger;
 
-	gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE),
-		 IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100));
+#ifdef CONFIG_OF
+	/* Check if there is a devicetree present as of_irq_init doesn't
+	 * indicate if an interrupt controller node was found.
+	 */
+	if (of_find_node_by_path("/"))
+		of_irq_init(tegra_irq_match);
+	else
+#endif
+		gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE),
+			IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100));
 }
-- 
1.7.7.rc0.72.g4b5ea.dirty


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
  2011-11-17 15:07 [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding Peter De Schrijver
@ 2011-11-17 15:44 ` Rob Herring
  2011-11-17 15:54   ` Peter De Schrijver
  2011-11-17 18:51 ` Stephen Warren
  1 sibling, 1 reply; 16+ messages in thread
From: Rob Herring @ 2011-11-17 15:44 UTC (permalink / raw)
  To: Peter De Schrijver
  Cc: Stephen Warren, linux-kernel, Marc Dietrich, Grant Likely,
	linux-tegra, Colin Cross, Olof Johansson, Russell King,
	linux-arm-kernel

On 11/17/2011 09:07 AM, Peter De Schrijver wrote:
> Convert tegra20 IRQ intialization to the GIC devicetree binding. Modify the
> interrupt definitions in the dts files according to
> Documentation/devicetree/bindings/arm/gic.txt
> 
> Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>

One minor comment below, but otherwise:

Acked-by: Rob Herring <rob.herring@calxeda.com>

> ---
>  arch/arm/boot/dts/tegra-paz00.dts |    2 +-
>  arch/arm/boot/dts/tegra20.dtsi    |   52 ++++++++++++++++++------------------
>  arch/arm/mach-tegra/irq.c         |   18 +++++++++++-
>  3 files changed, 43 insertions(+), 29 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/tegra-paz00.dts b/arch/arm/boot/dts/tegra-paz00.dts
> index 15a949f..7ff8f6f 100644
> --- a/arch/arm/boot/dts/tegra-paz00.dts
> +++ b/arch/arm/boot/dts/tegra-paz00.dts
> @@ -32,7 +32,7 @@
>  		#size-cells = <0>;
>  		compatible = "nvidia,nvec";
>  		reg = <0x7000C500 0x100>;
> -		interrupts = <124>;
> +		interrupts = <0 92 0x04>;
>  		clock-frequency = <80000>;
>  		request-gpios = <&gpio 170 0>;
>  		slave-addr = <138>;
> diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
> index 795b921..cd01b01 100644
> --- a/arch/arm/boot/dts/tegra20.dtsi
> +++ b/arch/arm/boot/dts/tegra20.dtsi
> @@ -5,9 +5,9 @@
>  	interrupt-parent = <&intc>;
>  
>  	intc: interrupt-controller@50041000 {
> -		compatible = "nvidia,tegra20-gic";
> +		compatible = "arm,cortex-a9-gic";
>  		interrupt-controller;

You should add an "interrupt-parent;" here so the gic's parent is null
and not the gic.

Rob
> -		#interrupt-cells = <1>;
> +		#interrupt-cells = <3>;
>  		reg = < 0x50041000 0x1000 >,
>  		      < 0x50040100 0x0100 >;
>  	};

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
  2011-11-17 15:44 ` Rob Herring
@ 2011-11-17 15:54   ` Peter De Schrijver
       [not found]     ` <CACxGe6ub2QBO0ZLwNdSvMxP1U087pqL-qL+dfWAbn-08gBQyvg@mail.gmail.com>
  0 siblings, 1 reply; 16+ messages in thread
From: Peter De Schrijver @ 2011-11-17 15:54 UTC (permalink / raw)
  To: Rob Herring
  Cc: Stephen Warren, linux-kernel, Marc Dietrich, Grant Likely,
	linux-tegra, Colin Cross, Olof Johansson, Russell King,
	linux-arm-kernel

On Thu, Nov 17, 2011 at 04:44:15PM +0100, Rob Herring wrote:
> On 11/17/2011 09:07 AM, Peter De Schrijver wrote:
> > Convert tegra20 IRQ intialization to the GIC devicetree binding. Modify the
> > interrupt definitions in the dts files according to
> > Documentation/devicetree/bindings/arm/gic.txt
> > 
> > Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
> 
> One minor comment below, but otherwise:
> 
> Acked-by: Rob Herring <rob.herring@calxeda.com>
> 
> > ---
> >  arch/arm/boot/dts/tegra-paz00.dts |    2 +-
> >  arch/arm/boot/dts/tegra20.dtsi    |   52 ++++++++++++++++++------------------
> >  arch/arm/mach-tegra/irq.c         |   18 +++++++++++-
> >  3 files changed, 43 insertions(+), 29 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/tegra-paz00.dts b/arch/arm/boot/dts/tegra-paz00.dts
> > index 15a949f..7ff8f6f 100644
> > --- a/arch/arm/boot/dts/tegra-paz00.dts
> > +++ b/arch/arm/boot/dts/tegra-paz00.dts
> > @@ -32,7 +32,7 @@
> >  		#size-cells = <0>;
> >  		compatible = "nvidia,nvec";
> >  		reg = <0x7000C500 0x100>;
> > -		interrupts = <124>;
> > +		interrupts = <0 92 0x04>;
> >  		clock-frequency = <80000>;
> >  		request-gpios = <&gpio 170 0>;
> >  		slave-addr = <138>;
> > diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
> > index 795b921..cd01b01 100644
> > --- a/arch/arm/boot/dts/tegra20.dtsi
> > +++ b/arch/arm/boot/dts/tegra20.dtsi
> > @@ -5,9 +5,9 @@
> >  	interrupt-parent = <&intc>;
> >  
> >  	intc: interrupt-controller@50041000 {
> > -		compatible = "nvidia,tegra20-gic";
> > +		compatible = "arm,cortex-a9-gic";
> >  		interrupt-controller;
> 
> You should add an "interrupt-parent;" here so the gic's parent is null
> and not the gic.

Ok. I will add that in the next version.

Cheers,

Peter.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
       [not found]     ` <CACxGe6ub2QBO0ZLwNdSvMxP1U087pqL-qL+dfWAbn-08gBQyvg@mail.gmail.com>
@ 2011-11-17 17:15       ` Rob Herring
  2011-11-17 20:41         ` Grant Likely
  0 siblings, 1 reply; 16+ messages in thread
From: Rob Herring @ 2011-11-17 17:15 UTC (permalink / raw)
  To: Grant Likely
  Cc: Peter De Schrijver, Marc Dietrich, Olof Johansson, Russell King,
	linux-kernel, Stephen Warren, linux-tegra, linux-arm-kernel,
	Colin Cross

On 11/17/2011 10:53 AM, Grant Likely wrote:
> 
> On Nov 17, 2011 8:54 AM, "Peter De Schrijver" <pdeschrijver@nvidia.com
> <mailto:pdeschrijver@nvidia.com>> wrote:
>>
>> On Thu, Nov 17, 2011 at 04:44:15PM +0100, Rob Herring wrote:
>> > On 11/17/2011 09:07 AM, Peter De Schrijver wrote:
>> > > Convert tegra20 IRQ intialization to the GIC devicetree binding.
> Modify the
>> > > interrupt definitions in the dts files according to
>> > > Documentation/devicetree/bindings/arm/gic.txt
>> > >
>> > > Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com
> <mailto:pdeschrijver@nvidia.com>>
>> >
>> > One minor comment below, but otherwise:
>> >
>> > Acked-by: Rob Herring <rob.herring@calxeda.com
> <mailto:rob.herring@calxeda.com>>
>> >
>> > > ---
>> > >  arch/arm/boot/dts/tegra-paz00.dts |    2 +-
>> > >  arch/arm/boot/dts/tegra20.dtsi    |   52
> ++++++++++++++++++------------------
>> > >  arch/arm/mach-tegra/irq.c         |   18 +++++++++++-
>> > >  3 files changed, 43 insertions(+), 29 deletions(-)
>> > >
>> > > diff --git a/arch/arm/boot/dts/tegra-paz00.dts
> b/arch/arm/boot/dts/tegra-paz00.dts
>> > > index 15a949f..7ff8f6f 100644
>> > > --- a/arch/arm/boot/dts/tegra-paz00.dts
>> > > +++ b/arch/arm/boot/dts/tegra-paz00.dts
>> > > @@ -32,7 +32,7 @@
>> > >             #size-cells = <0>;
>> > >             compatible = "nvidia,nvec";
>> > >             reg = <0x7000C500 0x100>;
>> > > -           interrupts = <124>;
>> > > +           interrupts = <0 92 0x04>;
>> > >             clock-frequency = <80000>;
>> > >             request-gpios = <&gpio 170 0>;
>> > >             slave-addr = <138>;
>> > > diff --git a/arch/arm/boot/dts/tegra20.dtsi
> b/arch/arm/boot/dts/tegra20.dtsi
>> > > index 795b921..cd01b01 100644
>> > > --- a/arch/arm/boot/dts/tegra20.dtsi
>> > > +++ b/arch/arm/boot/dts/tegra20.dtsi
>> > > @@ -5,9 +5,9 @@
>> > >     interrupt-parent = <&intc>;
>> > >
>> > >     intc: interrupt-controller@50041000 {
>> > > -           compatible = "nvidia,tegra20-gic";
>> > > +           compatible = "arm,cortex-a9-gic";
>> > >             interrupt-controller;
>> >
>> > You should add an "interrupt-parent;" here so the gic's parent is null
>> > and not the gic.
>>
>> Ok. I will add that in the next version.
> 
> No, there is no need to do that, nor is it convention. The gic node
> doesn't have an interrupts property, so the interrupt-parent is irrelevant.
> 
Can't resist the inbox? Go back to your sabbatical.. :) We discussed
this before and I though agreed this was the correct approach.

It inherits the interrupt-parent from the parent node. Originally
of_irq_find_parent would return that node, but this was fixed. So it
doesn't really matter from a functional standpoint.

So is no interrupt parent defined as no interrupts property or
interrupt-parent being null phandle?

> Rob, perhaps we should adjust of_init_irq() to only set the parent
> pointer if interrupts is present.
> 

It works correctly already either way.

Rob

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
  2011-11-17 15:07 [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding Peter De Schrijver
  2011-11-17 15:44 ` Rob Herring
@ 2011-11-17 18:51 ` Stephen Warren
  2011-11-18 12:03   ` Peter De Schrijver
  2011-11-18 12:03   ` Peter De Schrijver
  1 sibling, 2 replies; 16+ messages in thread
From: Stephen Warren @ 2011-11-17 18:51 UTC (permalink / raw)
  To: Peter De Schrijver, Peter De Schrijver
  Cc: Russell King, Colin Cross, Olof Johansson, Marc Dietrich,
	Grant Likely, linux-arm-kernel, linux-kernel, linux-tegra

Peter De Schrijver wrote at Thursday, November 17, 2011 8:07 AM:
> Convert tegra20 IRQ intialization to the GIC devicetree binding. Modify the
> interrupt definitions in the dts files according to
> Documentation/devicetree/bindings/arm/gic.txt
> 
> Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>

tegra-harmony.dts contains an interrupts property that wasn't updated,
for the WM8903 codec.

board-dt.c contains logic to search for a node with compatible of
nvidia,tegra20-gic, and then call irq_domain_add_simple. I assume that
logic is replaced by the new common GIC code, and so should be removed
from board-dt.c entirely?

>  	serial@70006000 {
>  		compatible = "nvidia,tegra20-uart";
> -		reg = <0x70006000 0x40>;
> +		reg = <0x70006000 0x040>;

Here and a few other places, why change the reg property?

-- 
nvpublic


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
  2011-11-17 17:15       ` Rob Herring
@ 2011-11-17 20:41         ` Grant Likely
  0 siblings, 0 replies; 16+ messages in thread
From: Grant Likely @ 2011-11-17 20:41 UTC (permalink / raw)
  To: Rob Herring
  Cc: Peter De Schrijver, Marc Dietrich, Olof Johansson, Russell King,
	linux-kernel, Stephen Warren, linux-tegra, linux-arm-kernel,
	Colin Cross

On Thu, Nov 17, 2011 at 10:15 AM, Rob Herring <robherring2@gmail.com> wrote:
> On 11/17/2011 10:53 AM, Grant Likely wrote:
>>
>> On Nov 17, 2011 8:54 AM, "Peter De Schrijver" <pdeschrijver@nvidia.com
>> <mailto:pdeschrijver@nvidia.com>> wrote:
>>>
>>> On Thu, Nov 17, 2011 at 04:44:15PM +0100, Rob Herring wrote:
>>> > On 11/17/2011 09:07 AM, Peter De Schrijver wrote:
>>> > > Convert tegra20 IRQ intialization to the GIC devicetree binding.
>> Modify the
>>> > > interrupt definitions in the dts files according to
>>> > > Documentation/devicetree/bindings/arm/gic.txt
>>> > >
>>> > > Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com
>> <mailto:pdeschrijver@nvidia.com>>
>>> >
>>> > One minor comment below, but otherwise:
>>> >
>>> > Acked-by: Rob Herring <rob.herring@calxeda.com
>> <mailto:rob.herring@calxeda.com>>
>>> >
>>> > > ---
>>> > >  arch/arm/boot/dts/tegra-paz00.dts |    2 +-
>>> > >  arch/arm/boot/dts/tegra20.dtsi    |   52
>> ++++++++++++++++++------------------
>>> > >  arch/arm/mach-tegra/irq.c         |   18 +++++++++++-
>>> > >  3 files changed, 43 insertions(+), 29 deletions(-)
>>> > >
>>> > > diff --git a/arch/arm/boot/dts/tegra-paz00.dts
>> b/arch/arm/boot/dts/tegra-paz00.dts
>>> > > index 15a949f..7ff8f6f 100644
>>> > > --- a/arch/arm/boot/dts/tegra-paz00.dts
>>> > > +++ b/arch/arm/boot/dts/tegra-paz00.dts
>>> > > @@ -32,7 +32,7 @@
>>> > >             #size-cells = <0>;
>>> > >             compatible = "nvidia,nvec";
>>> > >             reg = <0x7000C500 0x100>;
>>> > > -           interrupts = <124>;
>>> > > +           interrupts = <0 92 0x04>;
>>> > >             clock-frequency = <80000>;
>>> > >             request-gpios = <&gpio 170 0>;
>>> > >             slave-addr = <138>;
>>> > > diff --git a/arch/arm/boot/dts/tegra20.dtsi
>> b/arch/arm/boot/dts/tegra20.dtsi
>>> > > index 795b921..cd01b01 100644
>>> > > --- a/arch/arm/boot/dts/tegra20.dtsi
>>> > > +++ b/arch/arm/boot/dts/tegra20.dtsi
>>> > > @@ -5,9 +5,9 @@
>>> > >     interrupt-parent = <&intc>;
>>> > >
>>> > >     intc: interrupt-controller@50041000 {
>>> > > -           compatible = "nvidia,tegra20-gic";
>>> > > +           compatible = "arm,cortex-a9-gic";
>>> > >             interrupt-controller;
>>> >
>>> > You should add an "interrupt-parent;" here so the gic's parent is null
>>> > and not the gic.
>>>
>>> Ok. I will add that in the next version.
>>
>> No, there is no need to do that, nor is it convention. The gic node
>> doesn't have an interrupts property, so the interrupt-parent is irrelevant.
>>
> Can't resist the inbox? Go back to your sabbatical.. :) We discussed
> this before and I though agreed this was the correct approach.

It's a little hard to stop cold turkey.  :-(

Yup, we had discussed it (and your description below jogged my
memory), but I don't remember talking about adding an empty
interrupt-parent property.  I only remember making sure that
of_irq_find_parent() got fixed.

> It inherits the interrupt-parent from the parent node. Originally
> of_irq_find_parent would return that node, but this was fixed. So it
> doesn't really matter from a functional standpoint.
>
> So is no interrupt parent defined as no interrupts property or
> interrupt-parent being null phandle?

There is no precedence for setting a null interrupt-parent and no need
to, so I say just leave it out.

>> Rob, perhaps we should adjust of_init_irq() to only set the parent
>> pointer if interrupts is present.
>>
>
> It works correctly already either way.

Okay, I wasn't sure.  Let's leave it alone.

g.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
  2011-11-17 18:51 ` Stephen Warren
@ 2011-11-18 12:03   ` Peter De Schrijver
  2011-11-18 12:03   ` Peter De Schrijver
  1 sibling, 0 replies; 16+ messages in thread
From: Peter De Schrijver @ 2011-11-18 12:03 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Russell King, Colin Cross, Olof Johansson, Marc Dietrich,
	Grant Likely, linux-arm-kernel, linux-kernel, linux-tegra

On Thu, Nov 17, 2011 at 07:51:35PM +0100, Stephen Warren wrote:
> Peter De Schrijver wrote at Thursday, November 17, 2011 8:07 AM:
> > Convert tegra20 IRQ intialization to the GIC devicetree binding. Modify the
> > interrupt definitions in the dts files according to
> > Documentation/devicetree/bindings/arm/gic.txt
> > 
> > Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
> 
> tegra-harmony.dts contains an interrupts property that wasn't updated,
> for the WM8903 codec.
> 
> board-dt.c contains logic to search for a node with compatible of
> nvidia,tegra20-gic, and then call irq_domain_add_simple. I assume that
> logic is replaced by the new common GIC code, and so should be removed
> from board-dt.c entirely?
> 
> >  	serial@70006000 {
> >  		compatible = "nvidia,tegra20-uart";
> > -		reg = <0x70006000 0x40>;
> > +		reg = <0x70006000 0x040>;
> 
> Here and a few other places, why change the reg property?

Oops. That was probably an overly agressive search and replace :)

Cheers,

Peter.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
  2011-11-17 18:51 ` Stephen Warren
  2011-11-18 12:03   ` Peter De Schrijver
@ 2011-11-18 12:03   ` Peter De Schrijver
  2011-11-18 16:25     ` Stephen Warren
  1 sibling, 1 reply; 16+ messages in thread
From: Peter De Schrijver @ 2011-11-18 12:03 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Russell King, Colin Cross, Olof Johansson, Marc Dietrich,
	Grant Likely, linux-arm-kernel, linux-kernel, linux-tegra

On Thu, Nov 17, 2011 at 07:51:35PM +0100, Stephen Warren wrote:
> Peter De Schrijver wrote at Thursday, November 17, 2011 8:07 AM:
> > Convert tegra20 IRQ intialization to the GIC devicetree binding. Modify the
> > interrupt definitions in the dts files according to
> > Documentation/devicetree/bindings/arm/gic.txt
> > 
> > Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
> 
> tegra-harmony.dts contains an interrupts property that wasn't updated,
> for the WM8903 codec.

But that's a GPIO interrupt no?

> 
> board-dt.c contains logic to search for a node with compatible of
> nvidia,tegra20-gic, and then call irq_domain_add_simple. I assume that
> logic is replaced by the new common GIC code, and so should be removed
> from board-dt.c entirely?
> 

Need to check that...

Cheers,

Peter.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
  2011-11-18 12:03   ` Peter De Schrijver
@ 2011-11-18 16:25     ` Stephen Warren
  2011-11-21 12:22       ` Peter De Schrijver
  0 siblings, 1 reply; 16+ messages in thread
From: Stephen Warren @ 2011-11-18 16:25 UTC (permalink / raw)
  To: Peter De Schrijver
  Cc: Russell King, Colin Cross, Olof Johansson, Marc Dietrich,
	Grant Likely, linux-arm-kernel, linux-kernel, linux-tegra

Peter De Schrijver wrote at Friday, November 18, 2011 5:04 AM:
> On Thu, Nov 17, 2011 at 07:51:35PM +0100, Stephen Warren wrote:
> > Peter De Schrijver wrote at Thursday, November 17, 2011 8:07 AM:
> > > Convert tegra20 IRQ intialization to the GIC devicetree binding. Modify the
> > > interrupt definitions in the dts files according to
> > > Documentation/devicetree/bindings/arm/gic.txt
> > >
> > > Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
> >
> > tegra-harmony.dts contains an interrupts property that wasn't updated,
> > for the WM8903 codec.
> 
> But that's a GPIO interrupt no?

The interrupt line from codec to Tegra is a GPIO, yes.

But the WM8903 still has the same interrupt-parent as everything else,
since it's inherited from /interrupt-parent and doesn't define its own.
Perhaps this is a mistake?

-- 
nvpublic


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
  2011-11-18 16:25     ` Stephen Warren
@ 2011-11-21 12:22       ` Peter De Schrijver
  2011-11-21 15:28         ` Firmware during bootup anish kumar
  2011-11-21 17:20         ` [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding Stephen Warren
  0 siblings, 2 replies; 16+ messages in thread
From: Peter De Schrijver @ 2011-11-21 12:22 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Russell King, Colin Cross, Olof Johansson, Marc Dietrich,
	Grant Likely, linux-arm-kernel, linux-kernel, linux-tegra

On Fri, Nov 18, 2011 at 05:25:33PM +0100, Stephen Warren wrote:
> Peter De Schrijver wrote at Friday, November 18, 2011 5:04 AM:
> > On Thu, Nov 17, 2011 at 07:51:35PM +0100, Stephen Warren wrote:
> > > Peter De Schrijver wrote at Thursday, November 17, 2011 8:07 AM:
> > > > Convert tegra20 IRQ intialization to the GIC devicetree binding. Modify the
> > > > interrupt definitions in the dts files according to
> > > > Documentation/devicetree/bindings/arm/gic.txt
> > > >
> > > > Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
> > >
> > > tegra-harmony.dts contains an interrupts property that wasn't updated,
> > > for the WM8903 codec.
> > 
> > But that's a GPIO interrupt no?
> 
> The interrupt line from codec to Tegra is a GPIO, yes.
> 
> But the WM8903 still has the same interrupt-parent as everything else,
> since it's inherited from /interrupt-parent and doesn't define its own.
> Perhaps this is a mistake?

Yes. I think this is a mistake. If we want the device tree to reflect the
hardware, I think the WM8903 node should specify the GPIO, not the IRQ
number.

Cheers,

Peter.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Firmware during bootup
  2011-11-21 12:22       ` Peter De Schrijver
@ 2011-11-21 15:28         ` anish kumar
  2011-11-21 15:39           ` Borislav Petkov
  2011-11-21 17:20         ` [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding Stephen Warren
  1 sibling, 1 reply; 16+ messages in thread
From: anish kumar @ 2011-11-21 15:28 UTC (permalink / raw)
  To: linux-kernel, alsa-devel

Hello Everyone,

I have a hardware(Noise processing chip) for which I am 
writing the driver.Is it a good idea to download the 
firmware in probe function by spawing kthread?I can't download
the firmware using request_firmware api as this hardware
is required during bootup for boot-up sound and request_firmware
is out of question because of no support in user-space.

Am i missing something?I am bit concerned about boot-up time
as well.

Please help me.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Firmware during bootup
  2011-11-21 15:28         ` Firmware during bootup anish kumar
@ 2011-11-21 15:39           ` Borislav Petkov
  2011-11-21 18:01             ` Denis Kuzmenko
  0 siblings, 1 reply; 16+ messages in thread
From: Borislav Petkov @ 2011-11-21 15:39 UTC (permalink / raw)
  To: anish kumar; +Cc: linux-kernel, alsa-devel

On Tue, Nov 22, 2011 at 12:28:18AM +0900, anish kumar wrote:
> Hello Everyone,
> 
> I have a hardware(Noise processing chip) for which I am 
> writing the driver.Is it a good idea to download the 
> firmware in probe function by spawing kthread?I can't download
> the firmware using request_firmware api as this hardware
> is required during bootup for boot-up sound and request_firmware
> is out of question because of no support in user-space.
> 
> Am i missing something?I am bit concerned about boot-up time
> as well.

You could build it into the kernel, see CONFIG_EXTRA_FIRMWARE Kconfig
help for this.

-- 
Regards/Gruss,
   Boris

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
  2011-11-21 12:22       ` Peter De Schrijver
  2011-11-21 15:28         ` Firmware during bootup anish kumar
@ 2011-11-21 17:20         ` Stephen Warren
  2011-11-23  5:00           ` Peter De Schrijver
  1 sibling, 1 reply; 16+ messages in thread
From: Stephen Warren @ 2011-11-21 17:20 UTC (permalink / raw)
  To: Peter De Schrijver
  Cc: Russell King, Colin Cross, Olof Johansson, Marc Dietrich,
	Grant Likely, linux-arm-kernel, linux-kernel, linux-tegra,
	devicetree-discuss

Peter De Schrijver wrote at Monday, November 21, 2011 5:22 AM:
> On Fri, Nov 18, 2011 at 05:25:33PM +0100, Stephen Warren wrote:
> > Peter De Schrijver wrote at Friday, November 18, 2011 5:04 AM:
> > > On Thu, Nov 17, 2011 at 07:51:35PM +0100, Stephen Warren wrote:
> > > > Peter De Schrijver wrote at Thursday, November 17, 2011 8:07 AM:
> > > > > Convert tegra20 IRQ intialization to the GIC devicetree binding. Modify the
> > > > > interrupt definitions in the dts files according to
> > > > > Documentation/devicetree/bindings/arm/gic.txt
> > > > >
> > > > > Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
> > > >
> > > > tegra-harmony.dts contains an interrupts property that wasn't updated,
> > > > for the WM8903 codec.
> > >
> > > But that's a GPIO interrupt no?
> >
> > The interrupt line from codec to Tegra is a GPIO, yes.
> >
> > But the WM8903 still has the same interrupt-parent as everything else,
> > since it's inherited from /interrupt-parent and doesn't define its own.
> > Perhaps this is a mistake?
> 
> Yes. I think this is a mistake. If we want the device tree to reflect the
> hardware, I think the WM8903 node should specify the GPIO, not the IRQ
> number.

Hmm. This somewhat goes back to the previous irq_to_gpio discussion...

The WM8903 driver only cares about having an interrupt. In this case at
least, the driver never performs any GPIO-like manipulation on this
interrupt line. As such, shouldn't the driver receive the interrupt ID
to use?

The rationale here is that while the WM8903's interrupt output is hooked
to a GPIO input on Tegra systems, there's no reason to believe that it
couldn't be hooked to a dedicated interrupt input pin on some other SoC
(i.e. not a GPIO). In that case, there'd be no GPIO to pass to the driver.

Now perhaps what this means is that we need a DT binding for "the IRQ
generated by this given GPIO pin", rather than encoding that interrupt
number into the WM8903 node directly? That's certainly exactly what we
do when creating the platform data in board files in this case.

-- 
nvpublic


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Firmware during bootup
  2011-11-21 15:39           ` Borislav Petkov
@ 2011-11-21 18:01             ` Denis Kuzmenko
  0 siblings, 0 replies; 16+ messages in thread
From: Denis Kuzmenko @ 2011-11-21 18:01 UTC (permalink / raw)
  To: Borislav Petkov, anish kumar, linux-kernel, alsa-devel

On 11/21/2011 05:39 PM, Borislav Petkov wrote:
> On Tue, Nov 22, 2011 at 12:28:18AM +0900, anish kumar wrote:
>> Hello Everyone,
>>
>> I have a hardware(Noise processing chip) for which I am 
>> writing the driver.Is it a good idea to download the 
>> firmware in probe function by spawing kthread?I can't download
>> the firmware using request_firmware api as this hardware
>> is required during bootup for boot-up sound and request_firmware
>> is out of question because of no support in user-space.
>>
>> Am i missing something?I am bit concerned about boot-up time
>> as well.
> 
> You could build it into the kernel, see CONFIG_EXTRA_FIRMWARE Kconfig
> help for this.
> 

You can also put it into intramfs and use usual request_firmware call.

-- 
Best regards, Denis Kuzmenko.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
  2011-11-21 17:20         ` [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding Stephen Warren
@ 2011-11-23  5:00           ` Peter De Schrijver
  2011-11-23 17:25             ` Stephen Warren
  0 siblings, 1 reply; 16+ messages in thread
From: Peter De Schrijver @ 2011-11-23  5:00 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Russell King, Colin Cross, Olof Johansson, Marc Dietrich,
	Grant Likely, linux-arm-kernel, linux-kernel, linux-tegra,
	devicetree-discuss

> > > But the WM8903 still has the same interrupt-parent as everything else,
> > > since it's inherited from /interrupt-parent and doesn't define its own.
> > > Perhaps this is a mistake?
> > 
> > Yes. I think this is a mistake. If we want the device tree to reflect the
> > hardware, I think the WM8903 node should specify the GPIO, not the IRQ
> > number.
> 
> Hmm. This somewhat goes back to the previous irq_to_gpio discussion...
> 
> The WM8903 driver only cares about having an interrupt. In this case at
> least, the driver never performs any GPIO-like manipulation on this
> interrupt line. As such, shouldn't the driver receive the interrupt ID
> to use?
> 

Maybe it should then. I guess also edge vs level and polarity need to be
specified?

> The rationale here is that while the WM8903's interrupt output is hooked
> to a GPIO input on Tegra systems, there's no reason to believe that it
> couldn't be hooked to a dedicated interrupt input pin on some other SoC
> (i.e. not a GPIO). In that case, there'd be no GPIO to pass to the driver.
> 
> Now perhaps what this means is that we need a DT binding for "the IRQ
> generated by this given GPIO pin", rather than encoding that interrupt
> number into the WM8903 node directly? That's certainly exactly what we
> do when creating the platform data in board files in this case.

I think we need to model the GPIO IRQs as a seperate interrupt controller.
That way the WM8903 node can refer to the GPIO IRQ as an IRQ without
hardcoding the global interrupt number, similar to the way we specify the
SPI number in the device nodes and not the global interrupt number.

Cheers,

Peter.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding
  2011-11-23  5:00           ` Peter De Schrijver
@ 2011-11-23 17:25             ` Stephen Warren
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2011-11-23 17:25 UTC (permalink / raw)
  To: Peter De Schrijver
  Cc: Russell King, Colin Cross, Olof Johansson, Marc Dietrich,
	Grant Likely, linux-arm-kernel, linux-kernel, linux-tegra,
	devicetree-discuss

Peter De Schrijver wrote at Tuesday, November 22, 2011 10:00 PM:
...
> I think we need to model the GPIO IRQs as a seperate interrupt controller.
> That way the WM8903 node can refer to the GPIO IRQ as an IRQ without
> hardcoding the global interrupt number, similar to the way we specify the
> SPI number in the device nodes and not the global interrupt number.

Yes, you're right.

I'd originally thought that the GPIO IRQs fed directly into the GIC, but
now that I read the docs, I see that the GPIO controller really is an
interrupt aggregator/controller.

-- 
nvpublic


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-11-23 17:25 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-17 15:07 [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding Peter De Schrijver
2011-11-17 15:44 ` Rob Herring
2011-11-17 15:54   ` Peter De Schrijver
     [not found]     ` <CACxGe6ub2QBO0ZLwNdSvMxP1U087pqL-qL+dfWAbn-08gBQyvg@mail.gmail.com>
2011-11-17 17:15       ` Rob Herring
2011-11-17 20:41         ` Grant Likely
2011-11-17 18:51 ` Stephen Warren
2011-11-18 12:03   ` Peter De Schrijver
2011-11-18 12:03   ` Peter De Schrijver
2011-11-18 16:25     ` Stephen Warren
2011-11-21 12:22       ` Peter De Schrijver
2011-11-21 15:28         ` Firmware during bootup anish kumar
2011-11-21 15:39           ` Borislav Petkov
2011-11-21 18:01             ` Denis Kuzmenko
2011-11-21 17:20         ` [PATCH] arm/tegra: convert tegra20 to GIC devicetree binding Stephen Warren
2011-11-23  5:00           ` Peter De Schrijver
2011-11-23 17:25             ` Stephen Warren

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