ARM: dts: sun9i: Enable SDIO-based WiFi
Subsystems (2)
cover ARM: dts: sun9i: Enable SDIO-based WiFi
Hi Maxime,
Now that we have support for both PMICs, we can turn on the regulators needed for the onboard WiFi chips.
This is a fairly simple series. The WiFi chips themselves are supported by the brcmfmac driver, but the user needs to get an nvram.txt file and put it in their firmware directory, in addition to the firmware file in linux-firmware. Otherwise we just need to enable the mmc controller and supply the vmmc and vqmmc regulators.
Regards
ChenYu
Chen-Yu Tsai (3):
ARM: dts: sun9i: Add mmc1 pinmux setting
ARM: dts: sun9i: a80-optimus: Enable AP6330 WiFi
ARM: dts: sun9i: cubieboard4: Enable AP6330 WiFi
arch/arm/boot/dts/sun9i-a80-cubieboard4.dts | 32 +++++++++++++++++++++++++++++ arch/arm/boot/dts/sun9i-a80-optimus.dts | 30 +++++++++++++++++++++++++++ arch/arm/boot/dts/sun9i-a80.dtsi | 8 ++++++++ 3 files changed, 70 insertions(+)
Signature · 1 line
2.9.3
PATCH 1/3 ARM: dts: sun9i: Add mmc1 pinmux setting
On the A80, mmc1 is available on pingroup G. Designs mostly use this to connect to an SDIO WiFi chip.
--- arch/arm/boot/dts/sun9i-a80.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/boot/dts/sun9i-a80.dtsi +8 -0
@@ -700,6 +700,14 @@ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; }; + mmc1_pins: mmc1 { + allwinner,pins = "PG0", "PG1" ,"PG2", "PG3", + "PG4", "PG5"; + allwinner,function = "mmc1"; + allwinner,drive = <SUN4I_PINCTRL_30_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + mmc2_8bit_pins: mmc2_8bit { allwinner,pins = "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12",
Signature · 1 line
2.9.3
PATCH 2/3 ARM: dts: sun9i: a80-optimus: Enable AP6330 WiFi
In reply to Chen-Yu TsaiThe board has a Ampak AP6330 WiFi/BT/FM module. Inside it is a Broadcom BCM4330 WiFi/BT/FM combo IC. The WiFi portion is connected to mmc1, with the enabling pin connected to PL2. The AC100 RTC provides a low power clock signal.
--- arch/arm/boot/dts/sun9i-a80-optimus.dts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm/boot/dts/sun9i-a80-optimus.dts +30 -0
@@ -105,6 +105,14 @@ enable-active-high; gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&ac100_rtc 1>; + clock-names = "ext_clock"; + /* enables internal regulator and de-asserts reset */ + reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */ + }; }; &ehci0 {
@@ -130,6 +138,21 @@ status = "okay"; }; +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>, <&wifi_en_pin_optimus>; + vmmc-supply = <®_dldo1>; + vqmmc-supply = <®_cldo3>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; +}; + +&mmc1_pins { + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>; +}; + &mmc2 { pinctrl-names = "default"; pinctrl-0 = <&mmc2_8bit_pins>;
@@ -199,6 +222,13 @@ allwinner,drive = <SUN4I_PINCTRL_10_MA>; allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; }; + + wifi_en_pin_optimus: wifi_en_pin at 0 { + allwinner,pins = "PL2"; + allwinner,function = "gpio_out"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; }; &r_rsb {
Signature · 1 line
2.9.3
PATCH 3/3 ARM: dts: sun9i: cubieboard4: Enable AP6330 WiFi
In reply to Chen-Yu TsaiThe board has a Ampak AP6330 WiFi/BT/FM module. Inside it is a Broadcom BCM4330 WiFi/BT/FM combo IC. The WiFi portion is connected to mmc1, with the enabling pin connected to PL2. The AC100 RTC provides a low power clock signal.
--- arch/arm/boot/dts/sun9i-a80-cubieboard4.dts | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
arch/arm/boot/dts/sun9i-a80-cubieboard4.dts +32 -0
@@ -76,6 +76,14 @@ gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ }; }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&ac100_rtc 1>; + clock-names = "ext_clock"; + /* enables internal regulator and de-asserts reset */ + reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */ + }; }; &mmc0 {
@@ -88,6 +96,21 @@ status = "okay"; }; +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>, <&wifi_en_pin_cubieboard4>; + vmmc-supply = <®_dldo1>; + vqmmc-supply = <®_cldo3>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; +}; + +&mmc1_pins { + allwinner,pull = <SUN4I_PINCTRL_PULL_UP>; +}; + &mmc2 { pinctrl-names = "default"; pinctrl-0 = <&mmc2_8bit_pins>;
@@ -128,6 +151,15 @@ status = "okay"; }; +&r_pio { + wifi_en_pin_cubieboard4: wifi_en_pin at 0 { + allwinner,pins = "PL2"; + allwinner,function = "gpio_out"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; +}; + &r_rsb { status = "okay";
Signature · 1 line
2.9.3
Maxime Ripard
AppliedQuoted 11 lines · Chen-Yu Tsai
Hi Maxime,
Now that we have support for both PMICs, we can turn on the regulators needed for the onboard WiFi chips.
This is a fairly simple series. The WiFi chips themselves are supported by the brcmfmac driver, but the user needs to get an nvram.txt file and put it in their firmware directory, in addition to the firmware file in linux-firmware. Otherwise we just need to enable the mmc controller and supply the vmmc and vqmmc regulators.
Applied all three, thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161102/f6a550a6/attachment.sig>