SD card SDR104 mode support


#1

I have a Samsung U3 micro SD card which support SDR104 mode.

The kernel in ubuntu server image disabled sd-uhs-sdr104.
&sdmmc {
clock-frequency = <100000000>;
clock-freq-min-max = <100000 100000000>;
supports-sd;
bus-width = <4>;
cap-mmc-highspeed;
cap-sd-highspeed;
disable-wp;
num-slots = <1>;
//sd-uhs-sdr104;
vqmmc-supply = <&vcc_sd>;
pinctrl-names = “default”;
pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
};

sdmmc bus works at 50Mhz
[ 3.261940] sdhci-pltfm: SDHCI platform and OF driver helper
[ 3.292155] mmc0: new high speed SDXC card at address 0001
[ 3.301876] mmc1: SDHCI controller on fe330000.sdhci [fe330000.sdhci] using ADMA
[ 4.438973] mmc2: new ultra high speed SDR104 SDIO card at address 0001
[ 7.229720] ======== Card detection to detect SDIO card! ========
Actuall read/write speed is around 15-18MB/s

To get better performance, I enabled sd-uhs-sdr104 by changes:
&sdmmc {
max-frequency = <150000000>;
supports-sd;
bus-width = <4>;
cap-mmc-highspeed;
cap-sd-highspeed;
disable-wp;
num-slots = <1>;
sd-uhs-sdr104;
vqmmc-supply = <&vcc_sd>;
pinctrl-names = “default”;
pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
};
sdmmc bus works at 150Mhz,
[ 3.261891] sdhci-pltfm: SDHCI platform and OF driver helper
[ 3.301731] mmc1: SDHCI controller on fe330000.sdhci [fe330000.sdhci] using ADMA
[ 3.716656] mmc0: new ultra high speed SDR104 SDXC card at address 0001
[ 4.387245] mmc2: new ultra high speed SDR104 SDIO card at address 0001
actuall read/write speed is around 50MB/s

The SD card get a big performance benefit from this patch. But when reboot the system,
uboot fails to read sdcard unless I re-plug power cable. The issue is reported here
Here is another ubuntu server stuck when reboot, Ubuntu server stuck on reboot
No sure if it is the same issue with mine.

The kernel of Armbian also enabled ‘sd-uhs-sdr104’ support, and it doesn’t get suck when reboot.
I looked into their uboot source code, And got a working patch.
&sdmmc {
+       max-frequency = <20000000>;
&sdmmc_bus4>;

};

 
&sdhci {
+       max-frequency = <25000000>;
       bus-width = <8>;
       mmc-hs400-1_8v;

There are max-frequency limiation of sdmmc and sdhci in there uboot.
Pathed radxa u-boot, ubunt server does not get stuck any more when reboot system.
But SD card can not trun on SDR104 mode after reboot.
It back to 50Mhz SDXC mode.
[ 3.261940] sdhci-pltfm: SDHCI platform and OF driver helper
[ 3.292155] mmc0: new high speed SDXC card at address 0001
[ 3.301876] mmc1: SDHCI controller on fe330000.sdhci [fe330000.sdhci] using ADMA
Have to re-plug power cable to enable SDR104 mode.

During my test, sd-uhs-sdr104 mode does make huge performance improvement and works stable.
Can your engineer look into this issue to make sure SDR104 mode can always been turned on for U3 class SD card .