tm2: emmc run hs400 200M [1/1]
authorruixuan.li <ruixuan.li@amlogic.com>
Tue, 2 Apr 2019 12:37:38 +0000 (20:37 +0800)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 06:37:25 +0000 (14:37 +0800)
PD#SWPL-5658

Problem:
emmc run hs200 200M now

Solution:
set emmc busmode to hs400 200M

Verify:
passed on t962e2 ab311

Change-Id: If5fef5c3b55cc95152b0d5d19bb5a56b293aafcf
Signed-off-by: ruixuan.li <ruixuan.li@amlogic.com>
Signed-off-by: Ruixuan Li <ruixuan.li@amlogic.com>
Signed-off-by: Luan Yuan <luan.yuan@amlogic.com>
arch/arm/boot/dts/amlogic/sm1_s905x3_ac213.dts
arch/arm64/boot/dts/amlogic/sm1_s905x3_ac213.dts
drivers/amlogic/mmc/aml_sd_emmc_v3.c

index cf7af78..22b894f 100644 (file)
                         "MMC_CAP_HW_RESET",
                         "MMC_CAP_ERASE",
                         "MMC_CAP_CMD23";
-               caps2 = "MMC_CAP2_HS200";
-               /* "MMC_CAP2_HS400";*/
+               caps2 = "MMC_CAP2_HS200", "MMC_CAP2_HS400";
                f_min = <400000>;
                f_max = <200000000>;
        };
index 5ab7981..179696a 100644 (file)
                         "MMC_CAP_HW_RESET",
                         "MMC_CAP_ERASE",
                         "MMC_CAP_CMD23";
-               caps2 = "MMC_CAP2_HS200";
-               /* "MMC_CAP2_HS400";*/
+               caps2 = "MMC_CAP2_HS200", "MMC_CAP2_HS400";
                f_min = <400000>;
                f_max = <200000000>;
        };
index 297e784..4efea4b 100644 (file)
@@ -1614,6 +1614,7 @@ int aml_emmc_hs200_tl1(struct mmc_host *mmc)
        writel(vclkc, host->base + SD_EMMC_CLOCK_V3);
        pr_info("[%s][%d] clk config:0x%x\n",
                __func__, __LINE__, readl(host->base + SD_EMMC_CLOCK_V3));
+
        for (i = 0; i < 63; i++) {
                retry_times = 0;
                delay2 += (1 << 24);
@@ -1622,6 +1623,7 @@ retry:
                err = emmc_eyetest_log(mmc, 9);
                if (err)
                        continue;
+
                count = fbinary(pdata->align[9]);
                if (((count >= 14) && (count <= 20))
                        || ((count >= 48) && (count <= 54))) {
@@ -1939,11 +1941,10 @@ int aml_post_hs400_timming(struct mmc_host *mmc)
        struct amlsd_platform *pdata = mmc_priv(mmc);
        struct amlsd_host *host = pdata->host;
        aml_sd_emmc_clktest(mmc);
-       if ((host->data->chip_type == MMC_CHIP_TL1)
-               || (host->data->chip_type == MMC_CHIP_SM1))
-               aml_emmc_hs400_tl1(mmc);
-       else if (host->data->chip_type == MMC_CHIP_G12B)
+       if (host->data->chip_type == MMC_CHIP_G12B)
                aml_emmc_hs400_Revb(mmc);
+       else if (host->data->chip_type >= MMC_CHIP_TL1)
+               aml_emmc_hs400_tl1(mmc);
        else
                aml_emmc_hs400_general(mmc);
        return 0;