From 1db300830238153e96463abdb61bf2377f1098f0 Mon Sep 17 00:00:00 2001 From: Gunjan Gupta Date: Thu, 14 Dec 2023 01:24:49 +0530 Subject: [PATCH] Add missing dts nodes for wifi support --- ...d-nodes-for-sunxi-info-addr-dump-reg.patch | 30 ++++++++ ...dd-wifi-support-for-orange-pi-zero-2.patch | 69 +++++++++++++++++++ patch/kernel/archive/sunxi-6.1/series.armbian | 1 + patch/kernel/archive/sunxi-6.1/series.conf | 1 + ...d-nodes-for-sunxi-info-addr-dump-reg.patch | 30 ++++++++ ...dd-wifi-support-for-orange-pi-zero-2.patch | 69 +++++++++++++++++++ patch/kernel/archive/sunxi-6.6/series.armbian | 1 + patch/kernel/archive/sunxi-6.6/series.conf | 1 + 8 files changed, 202 insertions(+) create mode 100644 patch/kernel/archive/sunxi-6.1/patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch create mode 100644 patch/kernel/archive/sunxi-6.6/patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch diff --git a/patch/kernel/archive/sunxi-6.1/patches.armbian/add-nodes-for-sunxi-info-addr-dump-reg.patch b/patch/kernel/archive/sunxi-6.1/patches.armbian/add-nodes-for-sunxi-info-addr-dump-reg.patch index 2fc8f7f55a..2444a11e64 100644 --- a/patch/kernel/archive/sunxi-6.1/patches.armbian/add-nodes-for-sunxi-info-addr-dump-reg.patch +++ b/patch/kernel/archive/sunxi-6.1/patches.armbian/add-nodes-for-sunxi-info-addr-dump-reg.patch @@ -36,6 +36,36 @@ index 11e905afa..791c124f4 100644 + }; }; + thermal-zones { +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +index 98735d39e6e8..5ff1b357a25b 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +@@ -1053,6 +1053,25 @@ ths: thermal-sensor@5070400 { + nvmem-cell-names = "calibration"; + #thermal-sensor-cells = <1>; + }; ++ ++ dump_reg: dump_reg@20000 { ++ compatible = "allwinner,sunxi-dump-reg"; ++ reg = <0x0 0x03001000 0x0 0x0f20>; ++ status = "okay"; ++ }; ++ ++ sunxi-info { ++ compatible = "allwinner,sun50i-h616-sys-info"; ++ status = "okay"; ++ }; ++ ++ addr_mgt: addr-mgt { ++ compatible = "allwinner,sunxi-addr_mgt"; ++ type_addr_wifi = <0x2>; ++ type_addr_bt = <0x2>; ++ type_addr_eth = <0x2>; ++ status = "okay"; ++ }; + }; + thermal-zones { -- 2.35.3 diff --git a/patch/kernel/archive/sunxi-6.1/patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch b/patch/kernel/archive/sunxi-6.1/patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch new file mode 100644 index 0000000000..222f608d52 --- /dev/null +++ b/patch/kernel/archive/sunxi-6.1/patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch @@ -0,0 +1,69 @@ +From 8e36084386d07a07f755bda978875b1354162019 Mon Sep 17 00:00:00 2001 +From: Gunjan Gupta +Date: Wed, 13 Dec 2023 19:15:45 +0000 +Subject: [PATCH] arm64: dts: h616: add wifi support for orange pi zero 2 and + zero3 + +--- + .../allwinner/sun50i-h616-orangepi-zero2.dts | 38 +++++++++++++++++++ + 1 file changed, 38 insertions(+) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts +index 19451a0c85ae..400966667d1e 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts +@@ -59,6 +59,34 @@ reg_usb1_vbus: regulator-usb1-vbus { + gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ + status = "okay"; + }; ++ ++ reg_vcc33_wifi: vcc33-wifi { ++ /* Always on 3.3V regulator for WiFi and BT */ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc33-wifi"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ vin-supply = <®_vcc5v>; ++ }; ++ ++ reg_vcc_wifi_io: vcc-wifi-io { ++ /* Always on 1.8V/300mA regulator for WiFi and BT IO */ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-wifi-io"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++ vin-supply = <®_vcc33_wifi>; ++ }; ++ ++ wifi_pwrseq: wifi-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ clocks = <&rtc 1>; ++ clock-names = "osc32k-out"; ++ reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */ ++ post-power-on-delay-ms = <200>; ++ }; + }; + + &ehci1 { +@@ -90,6 +118,16 @@ &mmc0 { + status = "okay"; + }; + ++&mmc1 { ++ vmmc-supply = <®_vcc33_wifi>; ++ vqmmc-supply = <®_vcc_wifi_io>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ mmc-ddr-1_8v; ++ status = "okay"; ++}; ++ + &ohci1 { + status = "okay"; + }; +-- +2.34.1 + diff --git a/patch/kernel/archive/sunxi-6.1/series.armbian b/patch/kernel/archive/sunxi-6.1/series.armbian index e5f3b0c41f..b4cf42806f 100644 --- a/patch/kernel/archive/sunxi-6.1/series.armbian +++ b/patch/kernel/archive/sunxi-6.1/series.armbian @@ -187,3 +187,4 @@ patches.armbian/add-initial-support-for-orangepi3-lts.patch patches.armbian/drivers-input-axp20x-pek-allow-wakeup-after-shutdown.patch patches.armbian/arm64-dts-add-wifi-nodes-for-Inovato-Quadra.patch + patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch diff --git a/patch/kernel/archive/sunxi-6.1/series.conf b/patch/kernel/archive/sunxi-6.1/series.conf index 55f499b9a6..4ff2c0cf3a 100644 --- a/patch/kernel/archive/sunxi-6.1/series.conf +++ b/patch/kernel/archive/sunxi-6.1/series.conf @@ -591,3 +591,4 @@ patches.armbian/add-initial-support-for-orangepi3-lts.patch patches.armbian/drivers-input-axp20x-pek-allow-wakeup-after-shutdown.patch patches.armbian/arm64-dts-add-wifi-nodes-for-Inovato-Quadra.patch + patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch diff --git a/patch/kernel/archive/sunxi-6.6/patches.armbian/add-nodes-for-sunxi-info-addr-dump-reg.patch b/patch/kernel/archive/sunxi-6.6/patches.armbian/add-nodes-for-sunxi-info-addr-dump-reg.patch index a554a460fc..9e518943c3 100644 --- a/patch/kernel/archive/sunxi-6.6/patches.armbian/add-nodes-for-sunxi-info-addr-dump-reg.patch +++ b/patch/kernel/archive/sunxi-6.6/patches.armbian/add-nodes-for-sunxi-info-addr-dump-reg.patch @@ -36,6 +36,36 @@ index 538c90663602..6365cce07304 100644 + }; }; + thermal-zones { +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +index 98735d39e6e8..5ff1b357a25b 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +@@ -1053,6 +1053,25 @@ ths: thermal-sensor@5070400 { + nvmem-cell-names = "calibration"; + #thermal-sensor-cells = <1>; + }; ++ ++ dump_reg: dump_reg@20000 { ++ compatible = "allwinner,sunxi-dump-reg"; ++ reg = <0x0 0x03001000 0x0 0x0f20>; ++ status = "okay"; ++ }; ++ ++ sunxi-info { ++ compatible = "allwinner,sun50i-h616-sys-info"; ++ status = "okay"; ++ }; ++ ++ addr_mgt: addr-mgt { ++ compatible = "allwinner,sunxi-addr_mgt"; ++ type_addr_wifi = <0x2>; ++ type_addr_bt = <0x2>; ++ type_addr_eth = <0x2>; ++ status = "okay"; ++ }; + }; + thermal-zones { -- Armbian diff --git a/patch/kernel/archive/sunxi-6.6/patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch b/patch/kernel/archive/sunxi-6.6/patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch new file mode 100644 index 0000000000..9b3c700439 --- /dev/null +++ b/patch/kernel/archive/sunxi-6.6/patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch @@ -0,0 +1,69 @@ +From 8e36084386d07a07f755bda978875b1354162019 Mon Sep 17 00:00:00 2001 +From: Gunjan Gupta +Date: Wed, 13 Dec 2023 19:15:45 +0000 +Subject: [PATCH] arm64: dts: h616: add wifi support for orange pi zero 2 and + zero3 + +--- + .../allwinner/sun50i-h616-orangepi-zero.dtsi | 38 +++++++++++++++++++ + 1 file changed, 38 insertions(+) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi +index 19451a0c85ae..400966667d1e 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi +@@ -59,6 +59,34 @@ reg_usb1_vbus: regulator-usb1-vbus { + gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ + status = "okay"; + }; ++ ++ reg_vcc33_wifi: vcc33-wifi { ++ /* Always on 3.3V regulator for WiFi and BT */ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc33-wifi"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ vin-supply = <®_vcc5v>; ++ }; ++ ++ reg_vcc_wifi_io: vcc-wifi-io { ++ /* Always on 1.8V/300mA regulator for WiFi and BT IO */ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-wifi-io"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++ vin-supply = <®_vcc33_wifi>; ++ }; ++ ++ wifi_pwrseq: wifi-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ clocks = <&rtc 1>; ++ clock-names = "osc32k-out"; ++ reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */ ++ post-power-on-delay-ms = <200>; ++ }; + }; + + &ehci1 { +@@ -90,6 +118,16 @@ &mmc0 { + status = "okay"; + }; + ++&mmc1 { ++ vmmc-supply = <®_vcc33_wifi>; ++ vqmmc-supply = <®_vcc_wifi_io>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ mmc-ddr-1_8v; ++ status = "okay"; ++}; ++ + &ohci1 { + status = "okay"; + }; +-- +2.34.1 + diff --git a/patch/kernel/archive/sunxi-6.6/series.armbian b/patch/kernel/archive/sunxi-6.6/series.armbian index f2bb412d3f..cc71d02497 100644 --- a/patch/kernel/archive/sunxi-6.6/series.armbian +++ b/patch/kernel/archive/sunxi-6.6/series.armbian @@ -191,3 +191,4 @@ patches.armbian/add-initial-support-for-orangepi3-lts.patch patches.armbian/drivers-input-axp20x-pek-allow-wakeup-after-shutdown.patch patches.armbian/arm64-dts-add-wifi-nodes-for-Inovato-Quadra.patch + patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch diff --git a/patch/kernel/archive/sunxi-6.6/series.conf b/patch/kernel/archive/sunxi-6.6/series.conf index ad2815b0fb..7a9b5998c7 100644 --- a/patch/kernel/archive/sunxi-6.6/series.conf +++ b/patch/kernel/archive/sunxi-6.6/series.conf @@ -460,3 +460,4 @@ patches.armbian/add-initial-support-for-orangepi3-lts.patch patches.armbian/drivers-input-axp20x-pek-allow-wakeup-after-shutdown.patch patches.armbian/arm64-dts-add-wifi-nodes-for-Inovato-Quadra.patch + patches.armbian/arm64-dts-h616-add-wifi-support-for-orange-pi-zero-2.patch