diff mbox

[1/2] ARM: dts: Fix muxing and regulator for wl12xx on the SDIO bus for pandaboard

Message ID 20130913190953.24617.46506.stgit@localhost (mailing list archive)
State New, archived
Headers show

Commit Message

Tony Lindgren Sept. 13, 2013, 7:09 p.m. UTC
Commit b42b9181 (ARM: OMAP2+: Remove board-omap4panda.c)
removed legacy booting in favor of device tree based booting
for pandaboard. That caused the WLAN to stop working as the
related .dts entries fell through the cracks.

The legacy muxing was setting pulls for GPIO 48 and 49, so let's
keep that behaviour for now to avoid further regressions for
BT and FM. Also input logic was enabled for MMC CLK line, but
I've verified that the input logic we don't need enabled for
CLK line as it's not bidirectional.

Also, we want to use non-removable instead of ti,non-removable
as the ti,non-removable also sets no_regulator_off_init which
is really not what we want as then wl12xx won't get powered
up and down which is needed for resetting it.

Note that looks like the WLAN interface fails to come up after
a warm reset, but that most likely was also happening with
the legacy booting and needs a separate fix.

Cc: Paolo Pisati <p.pisati@gmail.com>
Cc: Benoit Cousson <bcousson@baylibre.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Luciano Coelho <luca@coelho.fi>
Cc: devicetree-discuss@lists.ozlabs.org
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/boot/dts/omap4-panda-common.dtsi |   46 ++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)

Comments

Luca Coelho Sept. 17, 2013, 6:26 a.m. UTC | #1
Hi Tony,

Both patches look good to me, though I didn't have the time to retest
them.

--
Cheers,
Luca.

On Fri, 2013-09-13 at 12:09 -0700, Tony Lindgren wrote:
> Commit b42b9181 (ARM: OMAP2+: Remove board-omap4panda.c)
> removed legacy booting in favor of device tree based booting
> for pandaboard. That caused the WLAN to stop working as the
> related .dts entries fell through the cracks.
> 
> The legacy muxing was setting pulls for GPIO 48 and 49, so let's
> keep that behaviour for now to avoid further regressions for
> BT and FM. Also input logic was enabled for MMC CLK line, but
> I've verified that the input logic we don't need enabled for
> CLK line as it's not bidirectional.
> 
> Also, we want to use non-removable instead of ti,non-removable
> as the ti,non-removable also sets no_regulator_off_init which
> is really not what we want as then wl12xx won't get powered
> up and down which is needed for resetting it.
> 
> Note that looks like the WLAN interface fails to come up after
> a warm reset, but that most likely was also happening with
> the legacy booting and needs a separate fix.
> 
> Cc: Paolo Pisati <p.pisati@gmail.com>
> Cc: Benoit Cousson <bcousson@baylibre.com>
> Cc: Rajendra Nayak <rnayak@ti.com>
> Cc: Luciano Coelho <luca@coelho.fi>
> Cc: devicetree-discuss@lists.ozlabs.org
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/boot/dts/omap4-panda-common.dtsi |   46 ++++++++++++++++++++++++++++-
>  1 file changed, 45 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
> index faa95b5..814ab67 100644
> --- a/arch/arm/boot/dts/omap4-panda-common.dtsi
> +++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
> @@ -107,6 +107,19 @@
>  	 */
>  		clock-frequency = <19200000>;
>  	};
> +
> +	/* regulator for wl12xx on sdio5 */
> +	wl12xx_vmmc: wl12xx_vmmc {
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&wl12xx_gpio>;
> +		compatible = "regulator-fixed";
> +		regulator-name = "vwl1271";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		gpio = <&gpio2 11 0>;
> +		startup-delay-us = <70000>;
> +		enable-active-high;
> +	};
>  };
>  
>  &omap4_pmx_wkup {
> @@ -235,6 +248,33 @@
>  			0x1c (PIN_OUTPUT | MUX_MODE3)	/* gpio_wk8 */
>  		>;
>  	};
> +
> +	/*
> +	 * wl12xx GPIO outputs for WLAN_EN, BT_EN, FM_EN, BT_WAKEUP
> +	 * REVISIT: Are the pull-ups needed for GPIO 48 and 49?
> +	 */
> +	wl12xx_gpio: pinmux_wl12xx_gpio {
> +		pinctrl-single,pins = <
> +			0x26 (PIN_OUTPUT | MUX_MODE3)		/* gpmc_a19.gpio_43 */
> +			0x2c (PIN_OUTPUT | MUX_MODE3)		/* gpmc_a22.gpio_46 */
> +			0x30 (PIN_OUTPUT_PULLUP | MUX_MODE3)	/* gpmc_a24.gpio_48 */
> +			0x32 (PIN_OUTPUT_PULLUP | MUX_MODE3)	/* gpmc_a25.gpio_49 */
> +		>;
> +	};
> +
> +	/* wl12xx GPIO inputs and SDIO pins */
> +	wl12xx_pins: pinmux_wl12xx_pins {
> +		pinctrl-single,pins = <
> +			0x38 (PIN_INPUT | MUX_MODE3)		/* gpmc_ncs2.gpio_52 */
> +			0x3a (PIN_INPUT | MUX_MODE3)		/* gpmc_ncs3.gpio_53 */
> +			0x108 (PIN_OUTPUT | MUX_MODE0)		/* sdmmc5_clk.sdmmc5_clk */
> +			0x10a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc5_cmd.sdmmc5_cmd */
> +			0x10c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc5_dat0.sdmmc5_dat0 */
> +			0x10e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc5_dat1.sdmmc5_dat1 */
> +			0x110 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc5_dat2.sdmmc5_dat2 */
> +			0x112 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc5_dat3.sdmmc5_dat3 */
> +		>;
> +	};
>  };
>  
>  &i2c1 {
> @@ -314,8 +354,12 @@
>  };
>  
>  &mmc5 {
> -	ti,non-removable;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&wl12xx_pins>;
> +	vmmc-supply = <&wl12xx_vmmc>;
> +	non-removable;
>  	bus-width = <4>;
> +	cap-power-off-card;
>  };
>  
>  &emif1 {
>
Luca Coelho Sept. 17, 2013, 6:28 a.m. UTC | #2
On Tue, 2013-09-17 at 09:26 +0300, Luca Coelho wrote:
> Both patches look good to me, though I didn't have the time to retest
> them.

Actually I don't even have a Blaze device anymore, so I can't really
test the second patch. :(

--
Luca.
Tony Lindgren Sept. 18, 2013, 12:02 a.m. UTC | #3
* Luca Coelho <luca@coelho.fi> [130916 23:35]:
> On Tue, 2013-09-17 at 09:26 +0300, Luca Coelho wrote:
> > Both patches look good to me, though I didn't have the time to retest
> > them.
> 
> Actually I don't even have a Blaze device anymore, so I can't really
> test the second patch. :(

OK no problem, I've tested it on panda es.

Regards,

Tony
Benoit Cousson Sept. 18, 2013, 9:04 a.m. UTC | #4
Hi Tony,

On 18/09/2013 02:02, Tony Lindgren wrote:
> * Luca Coelho <luca@coelho.fi> [130916 23:35]:
>> On Tue, 2013-09-17 at 09:26 +0300, Luca Coelho wrote:
>>> Both patches look good to me, though I didn't have the time to retest
>>> them.
>>
>> Actually I don't even have a Blaze device anymore, so I can't really
>> test the second patch. :(
>
> OK no problem, I've tested it on panda es.

Do we have someone out-there that still own a Blaze?

Anyway, I'm about to send a DTS fix branch for -rc2, so I'll include 
these two patches.

Thanks,
Benoit
Tony Lindgren Sept. 18, 2013, 5:51 p.m. UTC | #5
* Benoit Cousson <bcousson@baylibre.com> [130918 02:12]:
> Hi Tony,
> 
> On 18/09/2013 02:02, Tony Lindgren wrote:
> >* Luca Coelho <luca@coelho.fi> [130916 23:35]:
> >>On Tue, 2013-09-17 at 09:26 +0300, Luca Coelho wrote:
> >>>Both patches look good to me, though I didn't have the time to retest
> >>>them.
> >>
> >>Actually I don't even have a Blaze device anymore, so I can't really
> >>test the second patch. :(
> >
> >OK no problem, I've tested it on panda es.
> 
> Do we have someone out-there that still own a Blaze?
> 
> Anyway, I'm about to send a DTS fix branch for -rc2, so I'll include
> these two patches.

OK yes good please do pick them up, I'll drop them from my
not-yet-pushed-out omap-for-v3.12/fixes.

Regards,

Tony
Tony Lindgren Sept. 18, 2013, 11:47 p.m. UTC | #6
* Tony Lindgren <tony@atomide.com> [130918 11:00]:
> * Benoit Cousson <bcousson@baylibre.com> [130918 02:12]:
> > Hi Tony,
> > 
> > On 18/09/2013 02:02, Tony Lindgren wrote:
> > >* Luca Coelho <luca@coelho.fi> [130916 23:35]:
> > >>On Tue, 2013-09-17 at 09:26 +0300, Luca Coelho wrote:
> > >>>Both patches look good to me, though I didn't have the time to retest
> > >>>them.
> > >>
> > >>Actually I don't even have a Blaze device anymore, so I can't really
> > >>test the second patch. :(
> > >
> > >OK no problem, I've tested it on panda es.
> > 
> > Do we have someone out-there that still own a Blaze?
> > 
> > Anyway, I'm about to send a DTS fix branch for -rc2, so I'll include
> > these two patches.
> 
> OK yes good please do pick them up, I'll drop them from my
> not-yet-pushed-out omap-for-v3.12/fixes.

Hmm looks like there's also some new regression in the
wl12xx driver:

# iwconfig wlan0
wlan0     no wireless extensions.

My test script was just doing:

# iw dev wlan0 scan

And that works fine. Luca, any ideas?

Regards,

Tony
Olof Johansson Sept. 18, 2013, 11:57 p.m. UTC | #7
On Wed, Sep 18, 2013 at 2:04 AM, Benoit Cousson <bcousson@baylibre.com> wrote:
> Hi Tony,
>
>
> On 18/09/2013 02:02, Tony Lindgren wrote:
>>
>> * Luca Coelho <luca@coelho.fi> [130916 23:35]:
>>>
>>> On Tue, 2013-09-17 at 09:26 +0300, Luca Coelho wrote:
>>>>
>>>> Both patches look good to me, though I didn't have the time to retest
>>>> them.
>>>
>>>
>>> Actually I don't even have a Blaze device anymore, so I can't really
>>> test the second patch. :(
>>
>>
>> OK no problem, I've tested it on panda es.
>
>
> Do we have someone out-there that still own a Blaze?

I think I might have one in a box somewhere. I'll take a look.


-Olof
Luca Coelho Sept. 19, 2013, 5:43 a.m. UTC | #8
On Wed, 2013-09-18 at 16:47 -0700, Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [130918 11:00]:
> > * Benoit Cousson <bcousson@baylibre.com> [130918 02:12]:
> > > Hi Tony,
> > > 
> > > On 18/09/2013 02:02, Tony Lindgren wrote:
> > > >* Luca Coelho <luca@coelho.fi> [130916 23:35]:
> > > >>On Tue, 2013-09-17 at 09:26 +0300, Luca Coelho wrote:
> > > >>>Both patches look good to me, though I didn't have the time to retest
> > > >>>them.
> > > >>
> > > >>Actually I don't even have a Blaze device anymore, so I can't really
> > > >>test the second patch. :(
> > > >
> > > >OK no problem, I've tested it on panda es.
> > > 
> > > Do we have someone out-there that still own a Blaze?
> > > 
> > > Anyway, I'm about to send a DTS fix branch for -rc2, so I'll include
> > > these two patches.
> > 
> > OK yes good please do pick them up, I'll drop them from my
> > not-yet-pushed-out omap-for-v3.12/fixes.
> 
> Hmm looks like there's also some new regression in the
> wl12xx driver:
> 
> # iwconfig wlan0
> wlan0     no wireless extensions.
> 
> My test script was just doing:
> 
> # iw dev wlan0 scan
> 
> And that works fine. Luca, any ideas?

Have you compiled WEXT support in your kernel? iwconfig uses the
(deprecated) Wireless Extensions API.  iw uses the current nl80211 API.

If you want to use iwconfig and friends you need to enable
CONFIG_CFG80211_WEXT.

--
Cheers,
Luca.
Tony Lindgren Sept. 19, 2013, 2:53 p.m. UTC | #9
* Luca Coelho <luca@coelho.fi> [130918 22:50]:
> On Wed, 2013-09-18 at 16:47 -0700, Tony Lindgren wrote:
> > * Tony Lindgren <tony@atomide.com> [130918 11:00]:
> > > * Benoit Cousson <bcousson@baylibre.com> [130918 02:12]:
> > > > Hi Tony,
> > > > 
> > > > On 18/09/2013 02:02, Tony Lindgren wrote:
> > > > >* Luca Coelho <luca@coelho.fi> [130916 23:35]:
> > > > >>On Tue, 2013-09-17 at 09:26 +0300, Luca Coelho wrote:
> > > > >>>Both patches look good to me, though I didn't have the time to retest
> > > > >>>them.
> > > > >>
> > > > >>Actually I don't even have a Blaze device anymore, so I can't really
> > > > >>test the second patch. :(
> > > > >
> > > > >OK no problem, I've tested it on panda es.
> > > > 
> > > > Do we have someone out-there that still own a Blaze?
> > > > 
> > > > Anyway, I'm about to send a DTS fix branch for -rc2, so I'll include
> > > > these two patches.
> > > 
> > > OK yes good please do pick them up, I'll drop them from my
> > > not-yet-pushed-out omap-for-v3.12/fixes.
> > 
> > Hmm looks like there's also some new regression in the
> > wl12xx driver:
> > 
> > # iwconfig wlan0
> > wlan0     no wireless extensions.
> > 
> > My test script was just doing:
> > 
> > # iw dev wlan0 scan
> > 
> > And that works fine. Luca, any ideas?
> 
> Have you compiled WEXT support in your kernel? iwconfig uses the
> (deprecated) Wireless Extensions API.  iw uses the current nl80211 API.
> 
> If you want to use iwconfig and friends you need to enable
> CONFIG_CFG80211_WEXT.

OK thanks, I don't need to use iwconfig. Looks like the default
changed in commit 10bab00af (cfg80211: deprecate CFG80211_WEXT).

Regards,

Tony
Luca Coelho Sept. 19, 2013, 5:21 p.m. UTC | #10
On Thu, 2013-09-19 at 07:53 -0700, Tony Lindgren wrote:
> * Luca Coelho <luca@coelho.fi> [130918 22:50]:
> > On Wed, 2013-09-18 at 16:47 -0700, Tony Lindgren wrote:
> > > * Tony Lindgren <tony@atomide.com> [130918 11:00]:
> > > > * Benoit Cousson <bcousson@baylibre.com> [130918 02:12]:
> > > > > Hi Tony,
> > > > > 
> > > > > On 18/09/2013 02:02, Tony Lindgren wrote:
> > > > > >* Luca Coelho <luca@coelho.fi> [130916 23:35]:
> > > > > >>On Tue, 2013-09-17 at 09:26 +0300, Luca Coelho wrote:
> > > > > >>>Both patches look good to me, though I didn't have the time to retest
> > > > > >>>them.
> > > > > >>
> > > > > >>Actually I don't even have a Blaze device anymore, so I can't really
> > > > > >>test the second patch. :(
> > > > > >
> > > > > >OK no problem, I've tested it on panda es.
> > > > > 
> > > > > Do we have someone out-there that still own a Blaze?
> > > > > 
> > > > > Anyway, I'm about to send a DTS fix branch for -rc2, so I'll include
> > > > > these two patches.
> > > > 
> > > > OK yes good please do pick them up, I'll drop them from my
> > > > not-yet-pushed-out omap-for-v3.12/fixes.
> > > 
> > > Hmm looks like there's also some new regression in the
> > > wl12xx driver:
> > > 
> > > # iwconfig wlan0
> > > wlan0     no wireless extensions.
> > > 
> > > My test script was just doing:
> > > 
> > > # iw dev wlan0 scan
> > > 
> > > And that works fine. Luca, any ideas?
> > 
> > Have you compiled WEXT support in your kernel? iwconfig uses the
> > (deprecated) Wireless Extensions API.  iw uses the current nl80211 API.
> > 
> > If you want to use iwconfig and friends you need to enable
> > CONFIG_CFG80211_WEXT.
> 
> OK thanks, I don't need to use iwconfig. Looks like the default
> changed in commit 10bab00af (cfg80211: deprecate CFG80211_WEXT).

Yeah, it's not enabled by default anymore.  And it was more than about
time! ;)

--
Luca.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index faa95b5..814ab67 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -107,6 +107,19 @@ 
 	 */
 		clock-frequency = <19200000>;
 	};
+
+	/* regulator for wl12xx on sdio5 */
+	wl12xx_vmmc: wl12xx_vmmc {
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl12xx_gpio>;
+		compatible = "regulator-fixed";
+		regulator-name = "vwl1271";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&gpio2 11 0>;
+		startup-delay-us = <70000>;
+		enable-active-high;
+	};
 };
 
 &omap4_pmx_wkup {
@@ -235,6 +248,33 @@ 
 			0x1c (PIN_OUTPUT | MUX_MODE3)	/* gpio_wk8 */
 		>;
 	};
+
+	/*
+	 * wl12xx GPIO outputs for WLAN_EN, BT_EN, FM_EN, BT_WAKEUP
+	 * REVISIT: Are the pull-ups needed for GPIO 48 and 49?
+	 */
+	wl12xx_gpio: pinmux_wl12xx_gpio {
+		pinctrl-single,pins = <
+			0x26 (PIN_OUTPUT | MUX_MODE3)		/* gpmc_a19.gpio_43 */
+			0x2c (PIN_OUTPUT | MUX_MODE3)		/* gpmc_a22.gpio_46 */
+			0x30 (PIN_OUTPUT_PULLUP | MUX_MODE3)	/* gpmc_a24.gpio_48 */
+			0x32 (PIN_OUTPUT_PULLUP | MUX_MODE3)	/* gpmc_a25.gpio_49 */
+		>;
+	};
+
+	/* wl12xx GPIO inputs and SDIO pins */
+	wl12xx_pins: pinmux_wl12xx_pins {
+		pinctrl-single,pins = <
+			0x38 (PIN_INPUT | MUX_MODE3)		/* gpmc_ncs2.gpio_52 */
+			0x3a (PIN_INPUT | MUX_MODE3)		/* gpmc_ncs3.gpio_53 */
+			0x108 (PIN_OUTPUT | MUX_MODE0)		/* sdmmc5_clk.sdmmc5_clk */
+			0x10a (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc5_cmd.sdmmc5_cmd */
+			0x10c (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc5_dat0.sdmmc5_dat0 */
+			0x10e (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc5_dat1.sdmmc5_dat1 */
+			0x110 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc5_dat2.sdmmc5_dat2 */
+			0x112 (PIN_INPUT_PULLUP | MUX_MODE0)	/* sdmmc5_dat3.sdmmc5_dat3 */
+		>;
+	};
 };
 
 &i2c1 {
@@ -314,8 +354,12 @@ 
 };
 
 &mmc5 {
-	ti,non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&wl12xx_pins>;
+	vmmc-supply = <&wl12xx_vmmc>;
+	non-removable;
 	bus-width = <4>;
+	cap-power-off-card;
 };
 
 &emif1 {