Hi,
My customer evaluates eMMC with various speed modes (HS200, DDR52, Legacy 25MHz).
The customer follows the patch provided in the original thread. The patch is disabling HS400 and the customer modified it to disable HS200, etc.
When HS400 is disabled and HS200 is configured, eMMC registers seem to be configured properly.
When HS200 is disabled and High Speed DDR is configured, MMCSD0_SS_PHY_CTRL_4_REG @ 0x0FA1810C value is 0x00106000.
But according to datasheet table 7-66, the value should be 0x00106103.
Similarly, when Legacy SDR is configured, the register value is 0x00000000, but it should be 0x00000110.
Are these settings acceptable? If not, please tell me how to solve them.
Please find below two patches the customer used to disable HS200.
ubootsdk0804disabelsdr104hs200.patch:
diff -ruN a/arch/arm/dts/k3-am64-main.dtsi b/arch/arm/dts/k3-am64-main.dtsi --- a/arch/arm/dts/k3-am64-main.dtsi 2022-09-28 13:25:47.000000000 +0900 +++ b/arch/arm/dts/k3-am64-main.dtsi 2023-04-18 18:18:22.960160749 +0900 @@ -416,13 +416,10 @@ clock-names = "clk_ahb", "clk_xin"; mmc-ddr-1_8v; mmc-hs200-1_8v; - mmc-hs400-1_8v; ti,trm-icp = <0x2>; ti,otap-del-sel-legacy = <0x0>; ti,otap-del-sel-mmc-hs = <0x0>; ti,otap-del-sel-ddr52 = <0x6>; - ti,otap-del-sel-hs200 = <0x7>; - ti,otap-del-sel-hs400 = <0x4>; }; sdhci1: mmc@fa00000 { @@ -438,7 +435,6 @@ ti,otap-del-sel-sdr12 = <0xf>; ti,otap-del-sel-sdr25 = <0xf>; ti,otap-del-sel-sdr50 = <0xc>; - ti,otap-del-sel-sdr104 = <0x6>; ti,otap-del-sel-ddr50 = <0x9>; ti,clkbuf-sel = <0x7>; };
linuxsdk0804disabelsdr104hs200.patch:
diff -ruN a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi --- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi 2022-09-28 13:28:16.000000000 +0900 +++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi 2023-04-18 18:15:08.816168906 +0900 @@ -466,12 +466,10 @@ clocks = <&k3_clks 57 0>, <&k3_clks 57 1>; clock-names = "clk_ahb", "clk_xin"; mmc-ddr-1_8v; - mmc-hs200-1_8v; ti,trm-icp = <0x2>; ti,otap-del-sel-legacy = <0x0>; ti,otap-del-sel-mmc-hs = <0x0>; ti,otap-del-sel-ddr52 = <0x6>; - ti,otap-del-sel-hs200 = <0x7>; }; sdhci1: mmc@fa00000 { @@ -487,7 +485,6 @@ ti,otap-del-sel-sdr12 = <0xf>; ti,otap-del-sel-sdr25 = <0xf>; ti,otap-del-sel-sdr50 = <0xc>; - ti,otap-del-sel-sdr104 = <0x6>; ti,otap-del-sel-ddr50 = <0x9>; ti,clkbuf-sel = <0x7>; };
The customer also applied below two debug patches to display eMMC registers.
MMC0_REG_Debug.patch
diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c index 017ac5f61c0f..11a6f4f0a4e9 100644 --- a/drivers/mmc/host/sdhci_am654.c +++ b/drivers/mmc/host/sdhci_am654.c @@ -299,6 +299,14 @@ static void sdhci_am654_set_clock(struct sdhci_host *host, unsigned int clock) else sdhci_am654_setup_delay_chain(sdhci_am654, timing); + if (sdhci_am654->itap_del_sel[timing]) { + sdhci_am654_write_itapdly(sdhci_am654, + sdhci_am654->itap_del_sel[timing]); + regmap_update_bits(sdhci_am654->base, PHY_CTRL4, ITAPDLYENA_MASK, + 1 << ITAPDLYENA_SHIFT); + } + regmap_update_bits(sdhci_am654->base, PHY_CTRL5, CLKBUFSEL_MASK, sdhci_am654->clkbuf_sel); } -- 2.20.1
MMCSD1_REG_Debug.patch:
--- a/drivers/mmc/core/bus.c 2023-04-04 13:35:14.940994773 +0900 +++ b/drivers/mmc/core/bus.c 2023-04-10 18:18:27.067229299 +0900 @@ -324,6 +324,21 @@ } iounmap(iomem_ptr); + printk(KERN_INFO "SD Debug\n"); + + iomem_ptr = (unsigned int*) ioremap(0x0FA08000, 0x1000); + if (iomem_ptr != NULL) { + printk("[0x0FA08000] = 0x%08x\n", *(unsigned int*)(iomem_ptr)); + /* MMCSD1_SS_PHY_CTRL_4_REG */ + printk("[0x0FA0810C] = 0x%08x\n", *(unsigned int*)(iomem_ptr + 0x10C)); + /* MMCSD1_SS_PHY_CTRL_5_REG */ + printk("[0x0FA08110] = 0x%08x\n", *(unsigned int*)(iomem_ptr + 0x110)); + } else { + printk("ioremap() Failed!\n"); + return 1; + } + iounmap(iomem_ptr); + return 0; }
Here are register log outputs.
HS200 SDR104
[ 2.791660] eMMC Debug [ 2.794116] [0x0FA18000] = 0x68415200 [ 2.797801] [0x0FA1810C] = 0x00107116 [ 2.801462] [0x0FA18110] = 0x00000000 [ 2.805150] SD Debug [ 2.807354] [0x0FA08000] = 0x68403a00 [ 2.811070] [0x0FA0810C] = 0x00106106 [ 2.814741] [0x0FA08110] = 0x00000007
DDR52 DDR50
[ 2.752904] eMMC Debug [ 2.755295] [0x0FA18000] = 0x68415200 [ 2.759002] [0x0FA1810C] = 0x00106000 [ 2.762702] [0x0FA18110] = 0x00000400 [ 2.766386] SD Debug [ 2.768598] [0x0FA08000] = 0x68403a00 [ 2.772257] [0x0FA0810C] = 0x00100000 [ 2.775915] [0x0FA08110] = 0x00000007
Legacy 25MHz
[ 2.767465] eMMC Debug [ 2.769922] [0x0FA18000] = 0x68415200 [ 2.773613] [0x0FA1810C] = 0x00000000 [ 2.777281] [0x0FA18110] = 0x00030000 [ 2.780951] SD Debug [ 2.783276] [0x0FA08000] = 0x68403a00 [ 2.786981] [0x0FA0810C] = 0x00100000 [ 2.790656] [0x0FA08110] = 0x00000007
Thanks and regards,
Koichiro Tashiro