diff mbox

[3/4] ARM: Dove: Convert to DT GPIO and pinctrl

Message ID 1353317996-20841-4-git-send-email-sebastian.hesselbarth@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sebastian Hesselbarth Nov. 19, 2012, 9:39 a.m. UTC
Following the ongoing conversion of Orion SoCs to DT, make use of
gpio and pinctrl drivers through DT. The main dtsi for Dove is prepared
to allow board specific descriptors to make use of pinctrl muxing.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: Axel Lin <axel.lin@ingics.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/Kconfig            |    2 ++
 arch/arm/boot/dts/dove.dtsi |   20 +++++++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

Comments

Jason Cooper Nov. 24, 2012, 2:39 a.m. UTC | #1
On Mon, Nov 19, 2012 at 10:39:55AM +0100, Sebastian Hesselbarth wrote:
> Following the ongoing conversion of Orion SoCs to DT, make use of
> gpio and pinctrl drivers through DT. The main dtsi for Dove is prepared
> to allow board specific descriptors to make use of pinctrl muxing.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
> Cc: Axel Lin <axel.lin@ingics.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/Kconfig            |    2 ++
>  arch/arm/boot/dts/dove.dtsi |   20 +++++++++++++++++---
>  2 files changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index d5a28da..bb9a85d 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -539,6 +539,8 @@ config ARCH_DOVE
>  	select CPU_V7
>  	select GENERIC_CLOCKEVENTS
>  	select MIGHT_HAVE_PCI
> +	select PINCTRL
> +	select PINCTRL_DOVE
>  	select PLAT_ORION_LEGACY
>  	select USB_ARCH_HAS_EHCI
>  	help
> diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
> index 8c8ab62..c457480 100644
> --- a/arch/arm/boot/dts/dove.dtsi
> +++ b/arch/arm/boot/dts/dove.dtsi
> @@ -4,6 +4,12 @@
>  	compatible = "marvell,dove";
>  	model = "Marvell Armada 88AP510 SoC";
>  
> +	aliases {
> +		gpio0 = &gpio0;
> +		gpio1 = &gpio1;
> +		gpio2 = &gpio2;
> +	};
> +
>  	soc@f1000000 {
>  		compatible = "simple-bus";
>  		#address-cells = <1>;
> @@ -85,7 +91,8 @@
>  			#gpio-cells = <2>;
>  			gpio-controller;
>  			reg = <0xd0400 0x20>;
> -			ngpio = <32>;
> +			ngpios = <32>;
> +			interrupt-controller;
>  			interrupts = <12>, <13>, <14>, <60>;
>  		};
>  
> @@ -94,7 +101,8 @@
>  			#gpio-cells = <2>;
>  			gpio-controller;
>  			reg = <0xd0420 0x20>;
> -			ngpio = <32>;
> +			ngpios = <32>;
> +			interrupt-controller;
>  			interrupts = <61>;
>  		};
>  
> @@ -103,7 +111,13 @@
>  			#gpio-cells = <2>;
>  			gpio-controller;
>  			reg = <0xe8400 0x0c>;
> -			ngpio = <8>;
> +			ngpios = <8>;
> +		};
> +
> +		pinctrl: pinctrl@d0200 {
> +			compatible = "marvell,dove-pinctrl";
> +			reg = <0xd0200 0x10>;
> +			clocks = <&gate_clk 22>;

The above line broke the dtbs build target for dove_defconfig.  I have
removed it.  Please let me know if that is not the correct answer.  This
was the only occurence of 'clk' in arch/arm/boot/dts/dove* .

thx,

Jason.

>  		};
>  
>  		spi0: spi@10600 {
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thomas Petazzoni Nov. 24, 2012, 7:02 a.m. UTC | #2
Dear Jason Cooper,

On Fri, 23 Nov 2012 21:39:42 -0500, Jason Cooper wrote:
> > +		pinctrl: pinctrl@d0200 {
> > +			compatible = "marvell,dove-pinctrl";
> > +			reg = <0xd0200 0x10>;
> > +			clocks = <&gate_clk 22>;
> 
> The above line broke the dtbs build target for dove_defconfig.  I have
> removed it.  Please let me know if that is not the correct answer.  This
> was the only occurence of 'clk' in arch/arm/boot/dts/dove* .

Are you sure you merged

 [PATCH 7/8] ARM: dove: switch to DT clock providers ?

This one clearly adds gate_clk in dove.dtsi. This patch was part of the
pull request:

Subject: [GIT PULL v3] core, cpu and gated clocks for mvebu
Date: Tue, 20 Nov 2012 15:31:08 +0100

Best regards,

Thomas
Jason Cooper Nov. 24, 2012, 3 p.m. UTC | #3
On Sat, Nov 24, 2012 at 08:02:40AM +0100, Thomas Petazzoni wrote:
> Dear Jason Cooper,
> 
> On Fri, 23 Nov 2012 21:39:42 -0500, Jason Cooper wrote:
> > > +		pinctrl: pinctrl@d0200 {
> > > +			compatible = "marvell,dove-pinctrl";
> > > +			reg = <0xd0200 0x10>;
> > > +			clocks = <&gate_clk 22>;
> > 
> > The above line broke the dtbs build target for dove_defconfig.  I have
> > removed it.  Please let me know if that is not the correct answer.  This
> > was the only occurence of 'clk' in arch/arm/boot/dts/dove* .
> 
> Are you sure you merged
> 
>  [PATCH 7/8] ARM: dove: switch to DT clock providers ?
> 
> This one clearly adds gate_clk in dove.dtsi. This patch was part of the
> pull request:
> 
> Subject: [GIT PULL v3] core, cpu and gated clocks for mvebu
> Date: Tue, 20 Nov 2012 15:31:08 +0100

Yes, so that's what I thought happened.  This would have made orion/dt
depend upon mvebu/everything.  It already had two other dependencies.
Not ideal.

The good thing is, the build is not broken.  Once v3.8-rc1 drops with
all of our stuff merged, I'll post a fixup patch adding this back in.

thx,

Jason.
Thomas Petazzoni Nov. 24, 2012, 6:10 p.m. UTC | #4
Dear Jason Cooper,

On Sat, 24 Nov 2012 10:00:04 -0500, Jason Cooper wrote:

> Yes, so that's what I thought happened.  This would have made orion/dt
> depend upon mvebu/everything.  It already had two other dependencies.
> Not ideal.
> 
> The good thing is, the build is not broken.  Once v3.8-rc1 drops with
> all of our stuff merged, I'll post a fixup patch adding this back in.

It unfortunately means that Dove will be basically unbootable in
3.8-rc1, as the driver will not be clk_get()ing its gatable clock, and
the clock driver will disable it. Maybe we can just live with it, I
don't know.

Thomas
Jason Cooper Nov. 24, 2012, 6:59 p.m. UTC | #5
On Sat, Nov 24, 2012 at 07:10:24PM +0100, Thomas Petazzoni wrote:
> Dear Jason Cooper,
> 
> On Sat, 24 Nov 2012 10:00:04 -0500, Jason Cooper wrote:
> 
> > Yes, so that's what I thought happened.  This would have made orion/dt
> > depend upon mvebu/everything.  It already had two other dependencies.
> > Not ideal.
> > 
> > The good thing is, the build is not broken.  Once v3.8-rc1 drops with
> > all of our stuff merged, I'll post a fixup patch adding this back in.
> 
> It unfortunately means that Dove will be basically unbootable in
> 3.8-rc1, as the driver will not be clk_get()ing its gatable clock, and
> the clock driver will disable it. Maybe we can just live with it, I
> don't know.

Yes, I thought as much after I sent this reply.  Definitely a choice of
the lesser of two evils.  As long as we don't break the build or have
horrendous merge conflicts, I think it's tolerable.

Any one who is booting -rc1's is typically bug hunting.  This means
Sebastian, who has been CC'd on all of this.  I don't want to rely on
this in the future, but doing it once due to the circumstances is
something I'm comfortable answering to.

thx,

Jason.
Sebastian Hesselbarth Nov. 25, 2012, 10:51 a.m. UTC | #6
On 11/24/2012 07:59 PM, Jason Cooper wrote:
> On Sat, Nov 24, 2012 at 07:10:24PM +0100, Thomas Petazzoni wrote:
>> On Sat, 24 Nov 2012 10:00:04 -0500, Jason Cooper wrote:
>>> Yes, so that's what I thought happened.  This would have made orion/dt
>>> depend upon mvebu/everything.  It already had two other dependencies.
>>> Not ideal.
>>>
>>> The good thing is, the build is not broken.  Once v3.8-rc1 drops with
>>> all of our stuff merged, I'll post a fixup patch adding this back in.
>>
>> It unfortunately means that Dove will be basically unbootable in
>> 3.8-rc1, as the driver will not be clk_get()ing its gatable clock, and
>> the clock driver will disable it. Maybe we can just live with it, I
>> don't know.
>
> Yes, I thought as much after I sent this reply.  Definitely a choice of
> the lesser of two evils.  As long as we don't break the build or have
> horrendous merge conflicts, I think it's tolerable.
>
> Any one who is booting -rc1's is typically bug hunting.  This means
> Sebastian, who has been CC'd on all of this.  I don't want to rely on
> this in the future, but doing it once due to the circumstances is
> something I'm comfortable answering to.

Jason,

sorry for the late answer. I merged all pull reqs in the order posted
on top of latest linux/master. Thomas is right, removing the clk_gate
from pinctrl potentially could have broken boot on dove. I tried it and
it _does_ boot, because the clk used by pinctrl is optional in pinctrl-dove
and there is no pinhog/device touching the register clocked by the clock.

As soon as I 'cat pinconf-groups' in debugfs, the register is read and
my cubox hangs as expected.

So, finally a fixup patch for 3.8-rc1 is ok for me.

Thanks for merging all the patches!

Sebastian
Jason Cooper Nov. 25, 2012, 3:28 p.m. UTC | #7
On Sun, Nov 25, 2012 at 11:51:46AM +0100, Sebastian Hesselbarth wrote:
> On 11/24/2012 07:59 PM, Jason Cooper wrote:
> >On Sat, Nov 24, 2012 at 07:10:24PM +0100, Thomas Petazzoni wrote:
> >>On Sat, 24 Nov 2012 10:00:04 -0500, Jason Cooper wrote:
> >>>Yes, so that's what I thought happened.  This would have made orion/dt
> >>>depend upon mvebu/everything.  It already had two other dependencies.
> >>>Not ideal.
> >>>
> >>>The good thing is, the build is not broken.  Once v3.8-rc1 drops with
> >>>all of our stuff merged, I'll post a fixup patch adding this back in.
> >>
> >>It unfortunately means that Dove will be basically unbootable in
> >>3.8-rc1, as the driver will not be clk_get()ing its gatable clock, and
> >>the clock driver will disable it. Maybe we can just live with it, I
> >>don't know.
> >
> >Yes, I thought as much after I sent this reply.  Definitely a choice of
> >the lesser of two evils.  As long as we don't break the build or have
> >horrendous merge conflicts, I think it's tolerable.
> >
> >Any one who is booting -rc1's is typically bug hunting.  This means
> >Sebastian, who has been CC'd on all of this.  I don't want to rely on
> >this in the future, but doing it once due to the circumstances is
> >something I'm comfortable answering to.
> 
> sorry for the late answer. I merged all pull reqs in the order posted
> on top of latest linux/master. Thomas is right, removing the clk_gate
> from pinctrl potentially could have broken boot on dove. I tried it and
> it _does_ boot, because the clk used by pinctrl is optional in pinctrl-dove
> and there is no pinhog/device touching the register clocked by the clock.
> 
> As soon as I 'cat pinconf-groups' in debugfs, the register is read and
> my cubox hangs as expected.
> 
> So, finally a fixup patch for 3.8-rc1 is ok for me.

Great!  I'm glad to hear it's not as bad as I feared.

thx,

Jason.
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d5a28da..bb9a85d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -539,6 +539,8 @@  config ARCH_DOVE
 	select CPU_V7
 	select GENERIC_CLOCKEVENTS
 	select MIGHT_HAVE_PCI
+	select PINCTRL
+	select PINCTRL_DOVE
 	select PLAT_ORION_LEGACY
 	select USB_ARCH_HAS_EHCI
 	help
diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
index 8c8ab62..c457480 100644
--- a/arch/arm/boot/dts/dove.dtsi
+++ b/arch/arm/boot/dts/dove.dtsi
@@ -4,6 +4,12 @@ 
 	compatible = "marvell,dove";
 	model = "Marvell Armada 88AP510 SoC";
 
+	aliases {
+		gpio0 = &gpio0;
+		gpio1 = &gpio1;
+		gpio2 = &gpio2;
+	};
+
 	soc@f1000000 {
 		compatible = "simple-bus";
 		#address-cells = <1>;
@@ -85,7 +91,8 @@ 
 			#gpio-cells = <2>;
 			gpio-controller;
 			reg = <0xd0400 0x20>;
-			ngpio = <32>;
+			ngpios = <32>;
+			interrupt-controller;
 			interrupts = <12>, <13>, <14>, <60>;
 		};
 
@@ -94,7 +101,8 @@ 
 			#gpio-cells = <2>;
 			gpio-controller;
 			reg = <0xd0420 0x20>;
-			ngpio = <32>;
+			ngpios = <32>;
+			interrupt-controller;
 			interrupts = <61>;
 		};
 
@@ -103,7 +111,13 @@ 
 			#gpio-cells = <2>;
 			gpio-controller;
 			reg = <0xe8400 0x0c>;
-			ngpio = <8>;
+			ngpios = <8>;
+		};
+
+		pinctrl: pinctrl@d0200 {
+			compatible = "marvell,dove-pinctrl";
+			reg = <0xd0200 0x10>;
+			clocks = <&gate_clk 22>;
 		};
 
 		spi0: spi@10600 {