Modify VIM3 Ubuntu - SD card signal voltage as 1.8V

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu

Which version of system do you use? Please provide the version of the system here:

24.04 with Kernel 5.15

Please describe your issue below:

I would like to insert external sdio device into micro SD solt.
But it uses 1.8V as communication (signal voltage) not 3.3V.

I tried to modify kernel DTS as the following sd_emmc_b table to adjust signal voltage from 3.3V to 1.8V in
linux/common_drivers/arch/arm64/boot/dts/amlogic/kvim3.dts.
After built & copyed kvim3.dtd into VIM3, mmc1 still kept 3.3V as signal voltage.
I’m not sure why vmmc-supply & vqmmc-supply is hidden in common driver DTS. (Not work?)

Could anyone let me know how to adjust signal voltage correctly in common driver DTS?
Thanks!!


&sd_emmc_b {
//vmmc-supply = <&vddao3v3_reg>;
//vqmmc-supply = <&vddio_c>;
vmmc-supply = <&vddao3v3_reg>;
vqmmc-supply = <&vddio_ao18_reg>;
sd-uhs-sdr12;
sd-uhs-sdr25;
sd-uhs-sdr50;
sd-uhs-sdr104;

status = “okay”;
pinctrl-0 = <&sdcard_pins>;
pinctrl-1 = <&sdcard_clk_gate_pins>;
pinctrl-2 = <&sd_1bit_pins>;

…

Post a console log of your issue below:

When insert this device into micro SD solt, I guess wrong signal voltage causes communication timeout.

[   38.302238][0 T0     dh] meson-gx-mmc ffe05000.sd: 8 [0x1aa], TIMEOUT[0x2800]
[   38.304853][0 T0     dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   38.311776][0 T0     dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   38.318691][0 T0     dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   38.325598][0 T0     dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   38.332533][0 T0     dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   38.339558][0 T0     dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   38.346579][0 T0     dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   38.353611][0 T0     dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   38.360668][0 T0     dh] meson-gx-mmc ffe05000.sd: 1 [0x0], TIMEOUT[0x2800]
[   39.422079][0 T0     dh] meson-gx-mmc ffe05000.sd: 8 [0x1aa], TIMEOUT[0x2800]
[   39.424629][0 T0     dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   39.431553][0 T0     dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   39.438491][0 T0     dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   39.445418][0 T0     dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   39.452348][0 T0     dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   39.459377][0 T0     dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   39.466424][0 T20    dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   39.473465][0 T0     dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   39.480502][0 T0     dh] meson-gx-mmc ffe05000.sd: 1 [0x0], TIMEOUT[0x2800]
[   40.541811][0 T0     dh] meson-gx-mmc ffe05000.sd: 8 [0x1aa], TIMEOUT[0x2800]
[   40.544384][0 T0     dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   40.551295][0 T0     dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   40.558225][0 T20    dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   40.565193][0 T0     dh] meson-gx-mmc ffe05000.sd: 5 [0x0], TIMEOUT[0x2800]
[   40.572093][0 T0     dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   40.579128][0 T0     dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   40.586138][0 T0     dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   40.593156][0 T0     dh] meson-gx-mmc ffe05000.sd: 55 [0x0], TIMEOUT[0x2800]
[   40.600218][0 T0     dh] meson-gx-mmc ffe05000.sd: 1 [0x0], TIMEOUT[0x2800]

Hi @Mater ,

For VIM3, you can only change the voltage of VDDIO_C

echo 409 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio409/direction
echo 0 > /sys/class/gpio/gpio409/value    # setup to 3.3V
echo 1 > /sys/class/gpio/gpio409/value    # setup to 1.8V

The GPIO to control VDDIO_C is GPIO7 in GPIO expander, so you need to setup correct gpio in your vddio_ao18_reg node.

Regards,
Nick

Dear numbqq,

Thank you for your information.
I’m checking this.

Best regards,
Mater

Dear Nick,

After set value of gpio409, it can switch signal voltage of SD data as 1.8V.

Execus me. I just touch VIM3 board less than one monuth.
Could I ask more about gpio409?

Refer how-to-get-gpio-numbers… as the follow.
I still didn’t get the meaning of gpio409.
Which document or formal website can I study whose definition is gpio409?
Thank you!!

$cat /sys/kernel/debug/pinctrl/pinctrl-devices
name [pinmux] [pinconf]
pinctrl-meson yes yes
pinctrl-meson yes yes
pinctrl-audio-g12a yes no

$ cat /sys/kernel/debug/pinctrl/pinctrl@ff634480-pinctrl-meson/gpio-ranges
GPIO ranges handled:
0: periphs-banks GPIOS [410 - 494] PINS [0 - 84]

$ cat /sys/kernel/debug/pinctrl/pinctrl@ff800014-pinctrl-meson/gpio-ranges
GPIO ranges handled:
0: aobus-banks GPIOS [496 - 511] PINS [0 - 15]

$ cat /sys/kernel/debug/pinctrl/ff642000.audiobus\:pinctrl-pinctrl-audio-g12a/gpio-ranges
GPIO ranges handled:

Hi @Mater,

gpiochip402 is the GPIO expander, you can get the GPIO expander GPIOs from:

# cat /sys/class/gpio/gpiochip402/ngpio
8

Base number:

# cat /sys/class/gpio/gpiochip402/base 
402

So the GPIO number is: 402~409

Regards,
Nick

Hi @numbqq

Thanks for your information.
I got the point.

GPIO 409 is SD_MODE pin from TCA6408 device (start from gpio 402) to adjust VDDIO_C output as 3.3V or 1.8V.
Sorry, I was just little confused about why I did’t find GPIO definition of VDDIO_C or SD_MODE in DTS table. Now, I understand it.

Best regards,
Mater

1 Like