From bb9915407bdf24fd45daa49b32715fe3e8e00be0 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 root@OpenWrt:/# iw list Wiphy phy0 wiphy index: 0 max # scan SSIDs: 9 max scan IEs length: 2304 bytes max # sched scan SSIDs: 0 max # match sets: 0 Retry short limit: 7 Retry long limit: 4 Coverage class: 0 (up to 0m) Available Antennas: TX 0 RX 0 Supported interface modes: * IBSS * managed * AP * monitor Band 1: Frequencies: * 2412 MHz [1] (20.0 dBm) * 2417 MHz [2] (20.0 dBm) * 2422 MHz [3] (20.0 dBm) * 2427 MHz [4] (20.0 dBm) * 2432 MHz [5] (20.0 dBm) * 2437 MHz [6] (20.0 dBm) * 2442 MHz [7] (20.0 dBm) * 2447 MHz [8] (20.0 dBm) * 2452 MHz [9] (20.0 dBm) * 2457 MHz [10] (20.0 dBm) * 2462 MHz [11] (20.0 dBm) * 2467 MHz [12] (20.0 dBm) (no IR) * 2472 MHz [13] (20.0 dBm) (no IR) * 2484 MHz [14] (20.0 dBm) (no IR) 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 117d25ea90..fe561d0923 100644 --- a/target/linux/sunxi/image/cortexa53.mk +++ b/target/linux/sunxi/image/cortexa53.mk @@ -66,6 +66,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 @@ -73,6 +74,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"; + }; -- 2.30.2