i tried to set uhs-mode by changing the vqmmc-supply and seems to be right, but real speed is still bad
--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
@@ -232,10 +232,12 @@ &mmc1 {
bus-width = <4>;
max-frequency = <50000000>;
cap-sd-highspeed;
+ mmc-hs200-1_8v;
r_smpl = <1>;
cd-gpios = <&pio 81 GPIO_ACTIVE_LOW>;
vmmc-supply = <®_3p3v>;
- vqmmc-supply = <®_3p3v>;
+ vqmmc-supply = <®_1p8v>;
+ //vqmmc-supply = <®_3p3v>;
assigned-clocks = <&topckgen CLK_TOP_MSDC30_1_SEL>;
assigned-clock-parents = <&topckgen CLK_TOP_UNIV48M>;
};
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -1459,9 +1459,13 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
/* Apply different pinctrl settings for different signal voltage */
if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180)
+ {
pinctrl_select_state(host->pinctrl, host->pins_uhs);
- else
+ dev_err(host->dev, "using uhs pins (%d)!\n",ios->signal_voltage);
+ } else {
pinctrl_select_state(host->pinctrl, host->pins_default);
+ dev_err(host->dev, "using default pins (%d)!\n",ios->signal_voltage);
+ }
}
return 0;
}
root@bpi-r64:~# dmesg | grep pins
[ 1.233061] mtk-msdc 11230000.mmc: using uhs pins (1)!
[ 1.243422] mtk-msdc 11240000.mmc: using uhs pins (1)!
[ 1.377499] mtk-msdc 11230000.mmc: using uhs pins (1)!
currently only writing 50MB, but this takes already 10 minutes
for emmc i see a message like this, but not for sdcard (maybe it’s related to dma):
[ 1.374748] mtk-msdc 11230000.mmc: phase: [map:fffffff] [maxlen:28] [final:9]
i think i’ve fixed it by adding reset to sdcard-controller like emmc (new bootchain/ATF+FIT of 5.11-rc1)
https://elixir.bootlin.com/linux/v5.10-rc1/source/arch/arm64/boot/dts/mediatek/mt7622.dtsi#L689
But with other const
https://elixir.bootlin.com/linux/v5.10-rc1/source/include/dt-bindings/reset/mt7622-reset.h#L40
root@bpi-r64:~# dd status=progress if=/dev/urandom of=/tmp/test.dat bs=1M count=200 && time sync
200+0 records in
200+0 records out
209715200 bytes (210 MB, 200 MiB) copied, 4.33725 s, 48.4 MB/s
real 0m4.348s
user 0m0.000s
sys 0m4.301s
real 0m15.774s
user 0m0.000s
sys 0m0.027s
root@bpi-r64:~#
so additional to patch above (change to uhs by set vqmmc-supply)
--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi
@@ -698,6 +698,8 @@ mmc1: mmc@11240000 {
clocks = <&pericfg CLK_PERI_MSDC30_1_PD>,
<&topckgen CLK_TOP_AXI_SEL>;
clock-names = "source", "hclk";
+ resets = <&pericfg MT7622_PERI_MSDC1_SW_RST>;
+ reset-names = "hrst";
status = "disabled";
};
@skype @onlyfly34 can you confirm this? I guess uboot sets any wrong mode not compatible to linux initialization like for emmc
Posted patch without debug in driver to mailinglist