Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: dts: ti: k3-am625-beagleplay: Use mmc-pwrseq for wl18xx enable

BeaglePlay SBC[1] has Texas Instrument's WL18xx WiFi chipset[2].

Currently, WLAN_EN is configured as regulator and regulator-always-on.
However, the timing and wlan_en sequencing is not correctly modelled.

This causes the sdio access to fail during runtime-pm power operations
saving or during system suspend/resume/hibernation/freeze operations.
This is because the WLAN_EN line is not deasserted to low '0' to power
down the WiFi. So during restore, the WiFi driver tries to load the FW
without following correct power sequence. WLAN_EN => '1'/assert (high)
to power-up the chipset.

Use mmc-pwrseq-simple to drive TI's WiFi (WL18xx) chipset enable
'WLAN_EN'. mmc-pwrseq-simple provides power sequence flexibility with
support for post power-on and power-off delays.

Typical log signature that indicates this bug is:
wl1271_sdio mmc2:0001:2: sdio write failed (-110)

Followed by possibly a kernel warning (depending on firmware present):
WARNING: CPU: 1 PID: 45 at drivers/net/wireless/ti/wlcore/sdio.c:123 wl12xx_sdio_raw_write+0xe4/0x168 [wlcore_sdio]

[1] https://www.beagleboard.org/boards/beagleplay
[2] https://www.ti.com/lit/ds/symlink/wl1807mod.pdf

Fixes: f5a731f0787f ("arm64: dts: ti: Add k3-am625-beagleplay")
Suggested-by: Shengyu Qu <wiagn233@outlook.com>
Signed-off-by: Sukrut Bellary <sukrut.bellary@linux.com>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
Link: https://lore.kernel.org/r/20240325143511.2144768-1-nm@ti.com
Signed-off-by: Nishanth Menon <nm@ti.com>

authored by

Sukrut Bellary and committed by
Nishanth Menon
a2a6bbd1 ef00a95d

+12 -15
+12 -15
arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts
··· 82 82 }; 83 83 }; 84 84 85 + sdio_pwrseq: sdio-pwrseq { 86 + compatible = "mmc-pwrseq-simple"; 87 + pinctrl-names = "default"; 88 + pinctrl-0 = <&wifi_en_pins_default>; 89 + /* Internal power on time(Figure 8-3) * 2 */ 90 + post-power-on-delay-ms = <10>; 91 + /* Re-enable time(Figure 8-2) + 20uS */ 92 + power-off-delay-us = <80>; 93 + reset-gpios = <&main_gpio0 38 GPIO_ACTIVE_LOW>; 94 + }; 95 + 85 96 vsys_5v0: regulator-1 { 86 97 bootph-all; 87 98 compatible = "regulator-fixed"; ··· 113 102 vin-supply = <&vsys_5v0>; 114 103 regulator-always-on; 115 104 regulator-boot-on; 116 - }; 117 - 118 - wlan_en: regulator-3 { 119 - /* OUTPUT of SN74AVC2T244DQMR */ 120 - compatible = "regulator-fixed"; 121 - regulator-name = "wlan_en"; 122 - regulator-min-microvolt = <1800000>; 123 - regulator-max-microvolt = <1800000>; 124 - enable-active-high; 125 - regulator-always-on; 126 - vin-supply = <&vdd_3v3>; 127 - gpio = <&main_gpio0 38 GPIO_ACTIVE_HIGH>; 128 - pinctrl-names = "default"; 129 - pinctrl-0 = <&wifi_en_pins_default>; 130 105 }; 131 106 132 107 vdd_3v3_sd: regulator-4 { ··· 836 839 }; 837 840 838 841 &sdhci2 { 839 - vmmc-supply = <&wlan_en>; 840 842 pinctrl-names = "default"; 841 843 pinctrl-0 = <&wifi_pins_default>, <&wifi_32k_clk>; 842 844 non-removable; 843 845 ti,fails-without-test-cd; 844 846 cap-power-off-card; 845 847 keep-power-in-suspend; 848 + mmc-pwrseq = <&sdio_pwrseq>; 846 849 assigned-clocks = <&k3_clks 157 158>; 847 850 assigned-clock-parents = <&k3_clks 157 160>; 848 851 #address-cells = <1>;