Skip to contentSkip to conversation

ARM: dts: sun9i: Enable SDIO-based WiFi

PATCH Applied Chen-Yu Tsai 2 participants 5 messages Oct 28, 2016 – Nov 2, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index 3c5214cbe4e6..ab6a221027ef 100644
@@ -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
#2 lore raw

PATCH 2/3 ARM: dts: sun9i: a80-optimus: Enable AP6330 WiFi

In reply to Chen-Yu Tsai

The 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
index ceb6ef15d669..7e036b2be762 100644
@@ -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 = <&reg_dldo1>;
+	vqmmc-supply = <&reg_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
#3 lore raw

PATCH 3/3 ARM: dts: sun9i: cubieboard4: Enable AP6330 WiFi

In reply to Chen-Yu Tsai

The 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
index 439847acd41e..67b02fe7f11c 100644
@@ -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 = <&reg_dldo1>;
+	vqmmc-supply = <&reg_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
#4 lore raw
In reply to Chen-Yu Tsai
Quoted 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>