diff mbox

[PATCHv2] ARM: OMAP2+: Use pdata quirks for wl12xx on the AM335x EV-MSK

Message ID 1393837376-25779-1-git-send-email-kaloz@openwrt.org (mailing list archive)
State New, archived
Headers show

Commit Message

Imre Kaloz March 3, 2014, 9:02 a.m. UTC
Enable the WiLink6 connected to mmc2.

Signed-off-by: Imre Kaloz <kaloz@openwrt.org
---
Changes since v1: use the right refclock

 arch/arm/boot/dts/am335x-evmsk.dts |   40 ++++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/pdata-quirks.c |   10 +++++++++
 2 files changed, 50 insertions(+)

Comments

Tony Lindgren March 4, 2014, 6:47 p.m. UTC | #1
* Imre Kaloz <kaloz@openwrt.org> [140303 01:06]:
> Enable the WiLink6 connected to mmc2.
> 
> Signed-off-by: Imre Kaloz <kaloz@openwrt.org
> ---
> Changes since v1: use the right refclock

Thanks applying into omap-for-v3.15/dt.

Regards,

Tony
Yegor Yefremov March 17, 2014, 9:06 a.m. UTC | #2
Hi Imre,

On 03.03.2014 10:02, Imre Kaloz wrote:
> Enable the WiLink6 connected to mmc2.
> 
> Signed-off-by: Imre Kaloz <kaloz@openwrt.org

I have some trouble with WLAN. If I make extensive scanning (just start NetworkManager and wait a minute or so) I get following errors over and over again:

[  717.608550] wlcore: Scan completed due to error.
[  717.613422] ------------[ cut here ]------------
[  717.618405] WARNING: CPU: 0 PID: 940 at drivers/net/wireless/ti/wlcore/main.c:789 wl12xx_queue_recovery_work+0x60/0x6c()
[  717.629832] Modules linked in:
[  717.633055] CPU: 0 PID: 940 Comm: kworker/u2:2 Tainted: G        W    3.14.0-rc4-12737-gefb78a0-dirty #214
[  717.643264] Workqueue: phy0 wl1271_scan_complete_work
[  717.648649] [<c00151e0>] (unwind_backtrace) from [<c0011e38>] (show_stack+0x10/0x14)
[  717.656762] [<c0011e38>] (show_stack) from [<c05a1944>] (dump_stack+0x7c/0x94)
[  717.664372] [<c05a1944>] (dump_stack) from [<c00402bc>] (warn_slowpath_common+0x6c/0x90)
[  717.672876] [<c00402bc>] (warn_slowpath_common) from [<c004037c>] (warn_slowpath_null+0x1c/0x24)
[  717.682110] [<c004037c>] (warn_slowpath_null) from [<c035be0c>] (wl12xx_queue_recovery_work+0x60/0x6c)
[  717.691889] [<c035be0c>] (wl12xx_queue_recovery_work) from [<c036d804>] (wl1271_scan_complete_work+0xf8/0x108)
[  717.702391] [<c036d804>] (wl1271_scan_complete_work) from [<c0058ff4>] (process_one_work+0x1ac/0x4c4)
[  717.712110] [<c0058ff4>] (process_one_work) from [<c0059e88>] (worker_thread+0x114/0x3b4)
[  717.720707] [<c0059e88>] (worker_thread) from [<c005fa44>] (kthread+0xcc/0xe8)
[  717.728306] [<c005fa44>] (kthread) from [<c000e388>] (ret_from_fork+0x14/0x2c)
[  717.735856] ---[ end trace f4d374bb2ca37664 ]---
[  717.743587] wlcore: Hardware recovery in progress. FW ver: Rev 6.3.10.0.133
[  717.752600] wlcore: pc: 0x0, hint_sts: 0x00000020 count: 6
[  717.759609] wlcore: down
[  717.764108] ieee80211 phy0: Hardware restart was requested
[  718.250930] wlcore: firmware booted (Rev 6.3.10.0.133)

Have you experienced such behavior?

Regards,
Yegor
Imre Kaloz March 18, 2014, 7:03 p.m. UTC | #3
Hi Yegor,

On Mon, 17 Mar 2014 10:06:35 +0100, Yegor Yefremov <yegor.yefremov@visionsystems.de> wrote:

> I have some trouble with WLAN. If I make extensive scanning (just start NetworkManager and wait a minute or so) I get following errors over and over again:
>
> [  717.608550] wlcore: Scan completed due to error.
> [  717.613422] ------------[ cut here ]------------
> [  717.618405] WARNING: CPU: 0 PID: 940 at drivers/net/wireless/ti/wlcore/main.c:789 wl12xx_queue_recovery_work+0x60/0x6c()
> [  717.629832] Modules linked in:
> [  717.633055] CPU: 0 PID: 940 Comm: kworker/u2:2 Tainted: G        W    3.14.0-rc4-12737-gefb78a0-dirty #214
> [  717.643264] Workqueue: phy0 wl1271_scan_complete_work
> [  717.648649] [<c00151e0>] (unwind_backtrace) from [<c0011e38>] (show_stack+0x10/0x14)
> [  717.656762] [<c0011e38>] (show_stack) from [<c05a1944>] (dump_stack+0x7c/0x94)
> [  717.664372] [<c05a1944>] (dump_stack) from [<c00402bc>] (warn_slowpath_common+0x6c/0x90)
> [  717.672876] [<c00402bc>] (warn_slowpath_common) from [<c004037c>] (warn_slowpath_null+0x1c/0x24)
> [  717.682110] [<c004037c>] (warn_slowpath_null) from [<c035be0c>] (wl12xx_queue_recovery_work+0x60/0x6c)
> [  717.691889] [<c035be0c>] (wl12xx_queue_recovery_work) from [<c036d804>] (wl1271_scan_complete_work+0xf8/0x108)
> [  717.702391] [<c036d804>] (wl1271_scan_complete_work) from [<c0058ff4>] (process_one_work+0x1ac/0x4c4)
> [  717.712110] [<c0058ff4>] (process_one_work) from [<c0059e88>] (worker_thread+0x114/0x3b4)
> [  717.720707] [<c0059e88>] (worker_thread) from [<c005fa44>] (kthread+0xcc/0xe8)
> [  717.728306] [<c005fa44>] (kthread) from [<c000e388>] (ret_from_fork+0x14/0x2c)
> [  717.735856] ---[ end trace f4d374bb2ca37664 ]---
> [  717.743587] wlcore: Hardware recovery in progress. FW ver: Rev 6.3.10.0.133
> [  717.752600] wlcore: pc: 0x0, hint_sts: 0x00000020 count: 6
> [  717.759609] wlcore: down
> [  717.764108] ieee80211 phy0: Hardware restart was requested
> [  718.250930] wlcore: firmware booted (Rev 6.3.10.0.133)
>
> Have you experienced such behavior?

With older firmwares, quite often. 6.3.10.0.133 sounds amazingly old, the latest is 8.8.0.0.13. What kernel are you on?


Imre
Yegor Yefremov March 19, 2014, 10:39 a.m. UTC | #4
On 18.03.2014 20:03, Imre Kaloz wrote:
> Hi Yegor,
> 
> On Mon, 17 Mar 2014 10:06:35 +0100, Yegor Yefremov <yegor.yefremov@visionsystems.de> wrote:
> 
>> I have some trouble with WLAN. If I make extensive scanning (just start NetworkManager and wait a minute or so) I get following errors over and over again:
>>
>> [  717.608550] wlcore: Scan completed due to error.
>> [  717.613422] ------------[ cut here ]------------
>> [  717.618405] WARNING: CPU: 0 PID: 940 at drivers/net/wireless/ti/wlcore/main.c:789 wl12xx_queue_recovery_work+0x60/0x6c()
>> [  717.629832] Modules linked in:
>> [  717.633055] CPU: 0 PID: 940 Comm: kworker/u2:2 Tainted: G        W    3.14.0-rc4-12737-gefb78a0-dirty #214
>> [  717.643264] Workqueue: phy0 wl1271_scan_complete_work
>> [  717.648649] [<c00151e0>] (unwind_backtrace) from [<c0011e38>] (show_stack+0x10/0x14)
>> [  717.656762] [<c0011e38>] (show_stack) from [<c05a1944>] (dump_stack+0x7c/0x94)
>> [  717.664372] [<c05a1944>] (dump_stack) from [<c00402bc>] (warn_slowpath_common+0x6c/0x90)
>> [  717.672876] [<c00402bc>] (warn_slowpath_common) from [<c004037c>] (warn_slowpath_null+0x1c/0x24)
>> [  717.682110] [<c004037c>] (warn_slowpath_null) from [<c035be0c>] (wl12xx_queue_recovery_work+0x60/0x6c)
>> [  717.691889] [<c035be0c>] (wl12xx_queue_recovery_work) from [<c036d804>] (wl1271_scan_complete_work+0xf8/0x108)
>> [  717.702391] [<c036d804>] (wl1271_scan_complete_work) from [<c0058ff4>] (process_one_work+0x1ac/0x4c4)
>> [  717.712110] [<c0058ff4>] (process_one_work) from [<c0059e88>] (worker_thread+0x114/0x3b4)
>> [  717.720707] [<c0059e88>] (worker_thread) from [<c005fa44>] (kthread+0xcc/0xe8)
>> [  717.728306] [<c005fa44>] (kthread) from [<c000e388>] (ret_from_fork+0x14/0x2c)
>> [  717.735856] ---[ end trace f4d374bb2ca37664 ]---
>> [  717.743587] wlcore: Hardware recovery in progress. FW ver: Rev 6.3.10.0.133
>> [  717.752600] wlcore: pc: 0x0, hint_sts: 0x00000020 count: 6
>> [  717.759609] wlcore: down
>> [  717.764108] ieee80211 phy0: Hardware restart was requested
>> [  718.250930] wlcore: firmware booted (Rev 6.3.10.0.133)
>>
>> Have you experienced such behavior?
> 
> With older firmwares, quite often. 6.3.10.0.133 sounds amazingly old, the latest is 8.8.0.0.13. What kernel are you on?

I'm using Jorjin WG7311-2A on my custom board and I also have EVMSK with LBEE5ZSTNC-523(WL1271L). My kernel version is 3.14.0-rc4-12737-gefb78a0-dirty. Where do I get 8.8.0.0.13? AFAIK I'm using the latest firmware from here: https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/ti-connectivity

This is either wl127x-fw-5-sr.bin or wl127x-fw-5-mr.bin

Yegor
diff mbox

Patch

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index 4718ec4..a544fc4 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -45,6 +45,18 @@ 
 		regulator-boot-on;
 	};
 
+	wl12xx_vmmc: fixedregulator@2 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl12xx_gpio>;
+		compatible = "regulator-fixed";
+		regulator-name = "vwl1271";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&gpio1 29 0>;
+		startup-delay-us = <70000>;
+		enable-active-high;
+	};
+
 	leds {
 		pinctrl-names = "default";
 		pinctrl-0 = <&user_leds_s0>;
@@ -264,6 +276,24 @@ 
 			0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */
 		>;
 	};
+
+	mmc2_pins: pinmux_mmc2_pins {
+		pinctrl-single,pins = <
+			0x74 (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_wpn.gpio0_31 */
+			0x80 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
+			0x84 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
+			0x00 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
+			0x04 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
+			0x08 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
+			0x0c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
+		>;
+	};
+
+	wl12xx_gpio: pinmux_wl12xx_gpio {
+		pinctrl-single,pins = <
+			0x7c (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_csn0.gpio1_29 */
+		>;
+	};
 };
 
 &uart0 {
@@ -470,6 +500,16 @@ 
 	ti,no-reset-on-init;
 };
 
+&mmc2 {
+	status = "okay";
+	vmmc-supply = <&wl12xx_vmmc>;
+	ti,non-removable;
+	bus-width = <4>;
+	cap-power-off-card;
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_pins>;
+};
+
 &mcasp1 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&mcasp1_pins>;
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 3d5b24d..a92acdb 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -187,6 +187,13 @@  static void __init omap4_panda_legacy_init(void)
 }
 #endif
 
+#ifdef CONFIG_SOC_AM33XX
+static void __init am335x_evmsk_legacy_init(void)
+{
+	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 31);
+}
+#endif
+
 #ifdef CONFIG_SOC_OMAP5
 static void __init omap5_uevm_legacy_init(void)
 {
@@ -271,6 +278,9 @@  static struct pdata_init pdata_quirks[] __initdata = {
 	{ "ti,omap4-sdp", omap4_sdp_legacy_init, },
 	{ "ti,omap4-panda", omap4_panda_legacy_init, },
 #endif
+#ifdef CONFIG_SOC_AM33XX
+	{ "ti,am335x-evmsk", am335x_evmsk_legacy_init, },
+#endif
 #ifdef CONFIG_SOC_OMAP5
 	{ "ti,omap5-uevm", omap5_uevm_legacy_init, },
 #endif