From 6ec43e63720762ee01be224601f69b99d49fca5d Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Sun, 28 Feb 2021 16:42:05 +0100 Subject: [PATCH] sunxi: enable wifi module on Pine64 boards The Pine64(+) and the SoPine64 baseboard has an optional BT+WiFi module, carrying an RTL8723BS. The wifi part is connected via SDIO, the BT part is connected via UART. The BT part requires additional code changes in the drivers so we'll skip that until 5.10. Aside from a DTS patch to enable the wifi module, add the required packages into the device definitions. [ 8.996970] RTL8723BS: module init start [ 9.000922] RTL8723BS: rtl8723bs v4.3.5.5_12290.20140916_BTCOEX20140507-4E40 [ 9.007965] RTL8723BS: rtl8723bs BT-Coex version = BTCOEX20140507-4E40 [ 9.014785] pnetdev = 000000009bdd5000 [ 9.047780] RTL8723BS: rtw_ndev_init(wlan0) [ 9.053349] RTL8723BS: module init ret =0 Signed-off-by: Zoltan HERPAI --- target/linux/sunxi/image/cortexa53.mk | 2 + ...m64-dts-enable-wifi-on-pine64-boards.patch | 72 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 target/linux/sunxi/patches-5.4/450-arm64-dts-enable-wifi-on-pine64-boards.patch diff --git a/target/linux/sunxi/image/cortexa53.mk b/target/linux/sunxi/image/cortexa53.mk index bd7f48ba72..2918427912 100644 --- a/target/linux/sunxi/image/cortexa53.mk +++ b/target/linux/sunxi/image/cortexa53.mk @@ -76,6 +76,7 @@ TARGET_DEVICES += olimex_a64-olinuxino-emmc define Device/pine64_pine64-plus DEVICE_VENDOR := Pine64 DEVICE_MODEL := Pine64+ + DEVICE_PACKAGES := kmod-rtl8723bs rtl8723bs-firmware $(Device/sun50i-a64) endef TARGET_DEVICES += pine64_pine64-plus @@ -83,6 +84,7 @@ TARGET_DEVICES += pine64_pine64-plus define Device/pine64_sopine-baseboard DEVICE_VENDOR := Pine64 DEVICE_MODEL := SoPine + DEVICE_PACKAGES := kmod-rtl8723bs rtl8723bs-firmware $(Device/sun50i-a64) endef TARGET_DEVICES += pine64_sopine-baseboard diff --git a/target/linux/sunxi/patches-5.4/450-arm64-dts-enable-wifi-on-pine64-boards.patch b/target/linux/sunxi/patches-5.4/450-arm64-dts-enable-wifi-on-pine64-boards.patch new file mode 100644 index 0000000000..8117338029 --- /dev/null +++ b/target/linux/sunxi/patches-5.4/450-arm64-dts-enable-wifi-on-pine64-boards.patch @@ -0,0 +1,72 @@ +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts +@@ -78,6 +78,11 @@ + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ ++ }; + }; + + &ac_power_supply { +@@ -138,6 +143,21 @@ + reg = <1>; + }; + }; ++ ++&mmc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc1_pins>; ++ vmmc-supply = <®_dldo4>; ++ vqmmc-supply = <®_eldo1>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ rtl8723cs: wifi@1 { ++ reg = <1>; ++ }; ++}; + + &mmc2 { + pinctrl-names = "default"; +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts +@@ -73,6 +73,11 @@ + }; + }; + }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ ++ }; + }; + + &codec { +@@ -146,6 +151,21 @@ + status = "okay"; + }; + ++&mmc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc1_pins>; ++ vmmc-supply = <®_dldo4>; ++ vqmmc-supply = <®_eldo1>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ rtl8723cs: wifi@1 { ++ reg = <1>; ++ }; ++}; ++ + &ohci0 { + status = "okay"; + };