SDIO CLK configured in Auto mode is turning down immediately after the cmd

Hello,

Setup Details:
Platform - VIM3(Fenix 1.6.3 Ubuntu 22.04.3 LTS Linux 5.15.137)

Issue details:
SDIO CLK configured in auto mode is turning down immediately after the cmd.
Is there any configurable parameter which will extended CLK status high even though no activity in bus for Auto ON Mode??

We found in the other platform that CLK Turning OFF is not that immediate.
could be configured for more idle time which will check for the bus inactivity before Turning OFF.
Want to know for VIM3 how to configure for more idle time or etc which will keep the CLK some more time in AUTO MODE and we don’t want to configure for ALWAYS ON mode.

Hi @sidgp

Could you share more details to us? Why you do this and what you want to do ?

Regards,
Nick

I have few use case like
Sending the event(I guess async interrupt support is not there without CLK, event will not reach)
Memory access for which I need CLK to be ON(verified with ALWAYS ON mode)

Nick,

do you have any update on this.

Thanks,
Siddesh.

Hi @sidgp,

Could you provide the steps to reproduce this issue?

Regards,
Nick

Nick,

I tapped the SDIO lines along with CLK.
I observe the CLK status from oscilloscope.
Bring up the WI-FI and then send any CMD and check the CLK status.
CLK is turning OFF quickly.

Thanks,
Siddesh.

Nick,

In VIM3 after the CMD, CLK Turn OFF immediately but in other platform it is staying for some time.
how to configure the VIM3 to same configuration ??

Thanks,
Siddesh.

Nick,

Is there any update on this.

Thanks,
Siddesh.

Nick,

can you please let me know if you have any update on this topic.

Thanks,
Siddesh.

Nick,

looks like the CLK-GATE in the DTS file for the SD node is turning OFF the CLK on inactivity can you help us in how to disable the same ??

I tried to remove from DTS file but Driver load failed.

can you please help me on this ??

Thanks,
Siddesh.

Hi @sidgp,

How you do this ?

Regards,
Nick

Nick,
For the file meson-khadas-vim3.dtsi

I have removed the below line
pinctrl-1 = <&sdio_clk_gate_pins>;
and modified the pinctrl-names to just default
pinctrl-names = “default”;

also did the similar changes to the kvim3.dts from the common driver folder.

Let me know changes required to remove the clk-gate.

Thanks,
Siddesh.

Hi @sidgp,

Are you using the mainline 6.x kernel? Do you have same issue with vendor 5.15 kernel?

Regards,
Nick

No, I am using the Linux Khadas 5.15.137.
Is my procedure to disable the CLK-GATE is correct ???
is there any other way to disable the CLK-GATE ??

Hi @sidgp,

Maybe you can try to disable it in the driver, you need to check the kernel drivers.

Regards,
Nick

Is it not possible by DTS ??
I could not find the way to do in driver ?? can you please help me here ??

Hi @sidgp,

I checked the driver that, the sdio clk is already work on aways on mode by default.

Regards,
Nick

I have captured the trace and found the default it is operating in auto mode, since CLK-GATE is enabled CLK is turning down immediately after the command.
in other platform even though it is auto mode but clk-gate is not enabled it is staying there .

I am measuring some power number hence i want to configure on AUTO MODE with CLK-GATE disabled but not the ALWAYS ON mode.

For this i need your help in disabling the CLK-GATE in AUTO MODE.

Hi @sidgp,

Could you try this patch?

diff --git a/arch/arm64/boot/dts/amlogic/kvim3.dts b/arch/arm64/boot/dts/amlogic/kvim3.dts
index 41714c38e..02b07b7d0 100644
--- a/arch/arm64/boot/dts/amlogic/kvim3.dts
+++ b/arch/arm64/boot/dts/amlogic/kvim3.dts
@@ -1524,8 +1524,8 @@
 &sd_emmc_a {
        status = "okay";
        pinctrl-0 = <&sdio_m_pins>;
-       pinctrl-1 = <&sdio_m_clk_gate_pins>;
-       pinctrl-names = "default", "clk-gate";
+//     pinctrl-1 = <&sdio_m_clk_gate_pins>;
+       pinctrl-names = "default";
        bus-width = <4>;
        cap-sd-highspeed;
        sd-uhs-sdr104;

Regards,
Nick

I am have connected the wi-fi card into SDCARD slot not the SDIO slot using below converter.

Regarding the dts changes..As mentioned in previous comments i have made the similar changes
I have removed the sdcard_clk_gate_pins and kept the sdcard_pins & sd_1bit_pins

with the above changes i see below error while loading the driver

brcmfmac: brcmf_sdiod_ramrw: membytes transfer failed
brcmfmac: brcmf_sdio_verifymemory: error -84 on reading 2048 membytes at 0x00056000
brcmfmac: brcmf_sdio_download_firmware_43022: dongle image file download failed
brcmfmac: brcmf_sdio_remove: Setting IO Card Reset (RES) bit in IOAbort register, after this point no SDIO access is allowed till full SDIO init
brcmfmac: brcmf_sdio_htclk: Failed access turning clock off: -110

Thanks,
Siddesh.