Skip to contentSkip to conversation

arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: enable SDIO interface

PATCH Superseded Nick Xie 3 participants 5 messages Jan 16 – Jan 20

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Nick Xie

author
#0 lore raw

PATCH 1/1 arm64: dts: amlogic: meson-s4-s905y4-khadas-vim1s: enable SDIO interface

Enable the SDIO controller interface connected to the on-board AP6256 WiFi/BT module.

---
 .../amlogic/meson-s4-s905y4-khadas-vim1s.dts  | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)
arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +29 -0
index 4a66c1bec965e..74ef02c713207 100644
@@ -220,6 +220,35 @@ &sd {
 	vqmmc-supply = <&vddio_sd>;
 };
 
+&sdio {
+	status = "okay";
+	pinctrl-0 = <&sdio_pins>;
+	pinctrl-1 = <&sdio_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
+	#address-cells = <1>;
+	#size-cells = <0>;
+	bus-width = <4>;
+	cap-sd-highspeed;
+	sd-uhs-sdr50;
+	sd-uhs-sdr104;
+	max-frequency = <50000000>;
+	non-removable;
+	disable-wp;
+
+	amlogic,dram-access-quirk;
+
+	no-sd;
+	no-mmc;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	vmmc-supply = <&vddao_3v3>;
+	vqmmc-supply = <&vddio_ao1v8>;
+
+	brcmf: wifi@1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+	};
+};
+
 &spicc0 {
 	status = "okay";
 	pinctrl-names = "default";
Signature · 1 line
2.34.1
#1 lore raw

Hi Nick,

thanks for your patches - it's great to see Khadas VIM1S support growing upstream :-)

On Fri, Jan 16, 2026 at 3:39 AM Nick Xie <[email protected]> wrote:
[...]

Quoted 6 lines

+&sdio {

arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +5 -0
+       status = "okay";
+       pinctrl-0 = <&sdio_pins>;
+       pinctrl-1 = <&sdio_clk_gate_pins>;
+       pinctrl-names = "default", "clk-gate";
+       #address-cells = <1>;

arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts &sd { · line 238

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +10 -0
+       #size-cells = <0>;
+       bus-width = <4>;
+       cap-sd-highspeed;
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       max-frequency = <50000000>;
+       non-removable;
+       disable-wp;
+
+       amlogic,dram-access-quirk;

Have you tried without this property? To my knowledge only early G12A and G12B SoCs required this.
The mode enabled by this property limits the SDIO throughput. So it should only be used if the silicon requires this.

arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts &sd { · line 244

Quoted 5 lines
arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +5 -0
+       no-sd;
+       no-mmc;
+       mmc-pwrseq = <&sdio_pwrseq>;
+       vmmc-supply = <&vddao_3v3>;
+       vqmmc-supply = <&vddio_ao1v8>;

I'm missing:
clocks = <&sdio_32k>;
clock-names = "lpo";

arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts &sd { · line 248

Quoted 3 lines
arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +3 -0
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";

Is AP6256 using a bcm43456 chip? If so then this should be (according to Documentation/devicetree/bindings/net/wireless/brcm,bcm4329-fmac.yaml):
compatible = "brcm,bcm43456-fmac", "brcm,bcm4329-fmac";

Best regards,
Martin

#2 lore raw

On Mon, Jan 19, 2026 at 10:39 PM Martin Blumenstingl <[email protected]> wrote:
[...]

Quoted 8 lines

arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts &sd { · line 244

Quoted 5 lines
arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +5 -0
+       no-sd;
+       no-mmc;
+       mmc-pwrseq = <&sdio_pwrseq>;
+       vmmc-supply = <&vddao_3v3>;
+       vqmmc-supply = <&vddio_ao1v8>;

I'm missing:
clocks = <&sdio_32k>;
clock-names = "lpo";

I've been a bit quick here: clocks and clock-names should be part of the wifi@1 sub-node

author
#3 lore raw
In reply to Martin Blumenstingl

[...]

Quoted 16 lines
Quoted 8 lines

+&sdio {
+       status = "okay";
+       pinctrl-0 = <&sdio_pins>;
+       pinctrl-1 = <&sdio_clk_gate_pins>;
+       pinctrl-names = "default", "clk-gate";
+       #address-cells = <1>;
+       #size-cells = <0>;
+       bus-width = <4>;

Quoted 8 lines

+       cap-sd-highspeed;
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       max-frequency = <50000000>;
+       non-removable;
+       disable-wp;
+
+       amlogic,dram-access-quirk;

Quoted 4 lines

Have you tried without this property? To my knowledge only early G12A and G12B SoCs required this.
The mode enabled by this property limits the SDIO throughput. So it should only be used if the silicon requires this.

Without this property it will get an warning:

meson-gx-mmc fe088000.mmc: unaligned sg len 96 blksize 512, disabling descriptor DMA for transfer

Quoted 8 lines
Quoted 5 lines

+       no-sd;
+       no-mmc;
+       mmc-pwrseq = <&sdio_pwrseq>
+       vmmc-supply = <&vddao_3v3>;
+       vqmmc-supply = <&vddio_ao1v8>;

I'm missing:
  clocks = <&sdio_32k>;
  clock-names = "lpo";

Maybe it is not needed? This clock property looks for the bluetooth not for the Wi-Fi ?

Quoted 6 lines
Quoted 3 lines

+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";

Is AP6256 using a bcm43456 chip? If so then this should be (according to Documentation/devicetree/bindings/net/wireless/brcm,bcm4329-fmac.yaml):
   compatible = "brcm,bcm43456-fmac", "brcm,bcm4329-fmac";

OK, I will fix it in next version.

With this SDIO patch, the SDIO card detected well, but when try to connect the wifi, it still failed. So maybe extra patches are needed to make Wi-Fi working.

[    5.909858] meson-gx-mmc fe088000.mmc: allocated mmc-pwrseq
[    6.113160] mmc2: new UHS-I speed SDR104 SDIO card at address 0001
[   19.206019] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43456-sdio for chip BCM4345/9
[   19.208638] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac43456-sdio.khadas,vim1s.bin failed with error -2
[   19.218170] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac43456-sdio.clm_blob failed with error -2
[   19.332091] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[   19.332113] brcmfmac: brcmf_c_process_txcap_blob: no txcap_blob available (err=-2)
[   19.332327] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/9 wl0: Jun 25 2021 17:13:38 version 7.45.96.94 (7bb6b14@SYNA) (r745790) FWID 01-2bdfb64c es7.c5.n4.a3
[   19.332731] brcmfmac: brcmf_sdio_read_control: read 232 control bytes failed: -84
[   19.332988] brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame, send NAK
[   21.939090] brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout
[   35.587422] meson-gx-mmc fe088000.mmc: unaligned sg len 96 blksize 512, disabling descriptor DMA for transfer
[   44.412677] ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)
[   45.696901] ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)
[   47.491768] ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)
[   53.292090] ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)
[   59.866328] ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)

Best regards,
Nick

#4 lore raw
Quoted 49 lines · Nick Xie

[...]

Quoted 16 lines
Quoted 8 lines

+&sdio {
+       status = "okay";
+       pinctrl-0 = <&sdio_pins>;
+       pinctrl-1 = <&sdio_clk_gate_pins>;
+       pinctrl-names = "default", "clk-gate";
+       #address-cells = <1>;
+       #size-cells = <0>;
+       bus-width = <4>;

Quoted 8 lines

+       cap-sd-highspeed;
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       max-frequency = <50000000>;
+       non-removable;
+       disable-wp;
+
+       amlogic,dram-access-quirk;

Quoted 4 lines

Have you tried without this property? To my knowledge only early G12A and G12B SoCs required this.
The mode enabled by this property limits the SDIO throughput. So it should only be used if the silicon requires this.

Without this property it will get an warning:

meson-gx-mmc fe088000.mmc: unaligned sg len 96 blksize 512, disabling descriptor DMA for transfer

Quoted 8 lines
Quoted 5 lines

+       no-sd;
+       no-mmc;
+       mmc-pwrseq = <&sdio_pwrseq>
+       vmmc-supply = <&vddao_3v3>;
+       vqmmc-supply = <&vddio_ao1v8>;

I'm missing:
  clocks = <&sdio_32k>;
  clock-names = "lpo";

Maybe it is not needed? This clock property looks for the bluetooth not for the Wi-Fi ?

Quoted 6 lines
Quoted 3 lines

+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";

Is AP6256 using a bcm43456 chip? If so then this should be (according to Documentation/devicetree/bindings/net/wireless/brcm,bcm4329-fmac.yaml):
   compatible = "brcm,bcm43456-fmac", "brcm,bcm4329-fmac";

OK, I will fix it in next version.

With this SDIO patch, the SDIO card detected well, but when try to connect the wifi, it still failed. So maybe extra patches are needed to make Wi-Fi working.

Quoted 12 lines
[    5.909858] meson-gx-mmc fe088000.mmc: allocated mmc-pwrseq
[    6.113160] mmc2: new UHS-I speed SDR104 SDIO card at address 0001
[   19.206019] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43456-sdio for chip BCM4345/9
[   19.208638] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac43456-sdio.khadas,vim1s.bin failed with error -2
[   19.218170] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac43456-sdio.clm_blob failed with error -2
[   19.332091] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[   19.332113] brcmfmac: brcmf_c_process_txcap_blob: no txcap_blob available (err=-2)
[   19.332327] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/9 wl0: Jun 25 2021 17:13:38 version 7.45.96.94 (7bb6b14@SYNA) (r745790) FWID 01-2bdfb64c es7.c5.n4.a3
[   19.332731] brcmfmac: brcmf_sdio_read_control: read 232 control bytes failed: -84
[   19.332988] brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame, send NAK
[   21.939090] brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout
[   35.587422] meson-gx-mmc fe088000.mmc: unaligned sg len 96 blksize 512, disabling descriptor DMA for transfer

This is an issue with the driver, it's unrelated with the amlogic,dram-access-quirk, which fixes this because we use a bounce buffer.

Quoted 10 lines
[   44.412677] ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)
[   45.696901] ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)
[   47.491768] ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)
[   53.292090] ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)
[   59.866328] ieee80211 phy0: brcmf_cfg80211_connect: BRCMF_C_SET_SSID failed (-52)

Best regards,
Nick