[PATCH 3/4] riscv: dts: thead: enable AP6256 Wi-Fi on Milk-V Meles
Han Gao
gaohan at iscas.ac.cn
Tue Sep 29 03:22:47 PDT 2026
Connect AP6256 to SDIO1 with its fixed supplies and PMIC LPO clock.
Use GPIO0_20 for WL_REG_ON and GPIO0_21 for the host-wake interrupt.
Keep GPIO1_24 low to select the external antenna by default.
Use the existing BCM43456 binding and the 198 MHz board limit.
Keep module power during suspend and assign mmc2 to SDIO1.
Signed-off-by: Han Gao <gaohan at iscas.ac.cn>
---
arch/riscv/boot/dts/thead/th1520-milkv-meles.dts | 93 ++++++++++++++++++++++++
1 file changed, 93 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520-milkv-meles.dts b/arch/riscv/boot/dts/thead/th1520-milkv-meles.dts
index 3714047190789bfccd8ff6810342d7ff865e74e4..92b44cb90f57f4830efd29145744c005afa73119 100644
--- a/arch/riscv/boot/dts/thead/th1520-milkv-meles.dts
+++ b/arch/riscv/boot/dts/thead/th1520-milkv-meles.dts
@@ -7,6 +7,7 @@
/dts-v1/;
#include "th1520.dtsi"
+#include <dt-bindings/gpio/gpio.h>
/ {
model = "Milk-V Meles";
@@ -22,6 +23,7 @@ aliases {
gpio5 = &aogpio;
mmc0 = &emmc;
mmc1 = &sdio0;
+ mmc2 = &sdio1;
serial0 = &uart0;
};
@@ -29,6 +31,13 @@ chosen {
stdout-path = "serial0:115200n8";
};
+ wifi_32k: clock-wifi-32k {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <32768>;
+ /* The module LPO input is supplied by PMIC_32K_OUT. */
+ };
+
memory at 0 {
device_type = "memory";
reg = <0x0 0x0 0x2 0x0>;
@@ -42,6 +51,30 @@ fan: pwm-fan {
cooling-levels = <0 64 192 255>;
#cooling-cells = <2>;
};
+
+ wifi_vbat: regulator-wifi-vbat {
+ compatible = "regulator-fixed";
+ regulator-name = "WIFI_3V3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ wifi_vddio: regulator-wifi-vddio {
+ compatible = "regulator-fixed";
+ regulator-name = "WIFI_VDDIO";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+
+ wifi_pwrseq: wifi-pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ pinctrl-names = "default";
+ pinctrl-0 = <&wifi_enable_pins>;
+ reset-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
+ post-power-on-delay-ms = <50>;
+ };
};
/* Names follow the 40-pin header signal labels. */
@@ -77,6 +110,16 @@ &gpio0 {
"", "GPIO0_16", "GPIO0_17";
};
+&gpio1 {
+ /* GPIO1_24 low selects the external antenna through U39. */
+ wifi-antenna-select-hog {
+ gpio-hog;
+ gpios = <24 GPIO_ACTIVE_HIGH>;
+ output-low;
+ line-name = "wifi-external-antenna";
+ };
+};
+
&gpio2 {
gpio-line-names = "GPIO2_0", "GPIO2_1", "", "", "", "", "", "",
"", "", "", "GPIO2_11", "GPIO2_12", "",
@@ -206,6 +249,26 @@ rx-pins {
};
};
+&padctrl1_apsys {
+ wifi_enable_pins: wifi-enable-0 {
+ gpio-pins {
+ pins = "GPIO0_20";
+ bias-disable;
+ drive-strength = <7>;
+ input-disable;
+ };
+ };
+
+ wifi_host_wake_pins: wifi-host-wake-0 {
+ gpio-pins {
+ pins = "GPIO0_21";
+ bias-disable;
+ input-enable;
+ input-schmitt-enable;
+ };
+ };
+};
+
&sdio0 {
pinctrl-names = "default";
pinctrl-0 = <&sdio0_pins>;
@@ -219,6 +282,36 @@ &sdio0 {
status = "okay";
};
+&sdio1 {
+ bus-width = <4>;
+ max-frequency = <198000000>;
+ cap-sd-highspeed;
+ cap-sdio-irq;
+ non-removable;
+ no-sd;
+ no-mmc;
+ keep-power-in-suspend;
+ vmmc-supply = <&wifi_vbat>;
+ vqmmc-supply = <&wifi_vddio>;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ status = "okay";
+
+ wifi at 1 {
+ compatible = "brcm,bcm43456-fmac", "brcm,bcm4329-fmac";
+ reg = <1>;
+ clocks = <&wifi_32k>;
+ clock-names = "lpo";
+ pinctrl-names = "default";
+ pinctrl-0 = <&wifi_host_wake_pins>;
+ interrupt-parent = <&gpio0>;
+ interrupts = <21 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "host-wake";
+ };
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins>;
--
2.47.3
More information about the linux-riscv
mailing list