tm2: emmc run hs400 200M [1/1]
authorruixuan.li <ruixuan.li@amlogic.com>
Tue, 2 Apr 2019 12:37:38 +0000 (20:37 +0800)
committerRuixuan Li <ruixuan.li@amlogic.com>
Wed, 22 May 2019 03:15:06 +0000 (20:15 -0700)
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>
arch/arm/boot/dts/amlogic/mesontm2.dtsi
arch/arm/boot/dts/amlogic/sm1_s905x3_ac213.dts
arch/arm/boot/dts/amlogic/tm2_t962e2_ab311.dts
arch/arm/boot/dts/amlogic/tm2_t962e2_ab319.dts
arch/arm/boot/dts/amlogic/tm2_t962x3_ab301.dts
arch/arm64/boot/dts/amlogic/mesontm2.dtsi
arch/arm64/boot/dts/amlogic/sm1_s905x3_ac213.dts
arch/arm64/boot/dts/amlogic/tm2_t962e2_ab311.dts
arch/arm64/boot/dts/amlogic/tm2_t962e2_ab319.dts
arch/arm64/boot/dts/amlogic/tm2_t962x3_ab301.dts
drivers/amlogic/mmc/aml_sd_emmc_v3.c

index 60d7ff9..5798e1a 100644 (file)
                        tx_delay = <0>;
                        max_req_size = <0x20000>; /**128KB*/
                        gpio_dat3 = <&gpio BOOT_3 GPIO_ACTIVE_HIGH>;
-                       hw_reset = <&gpio BOOT_12 GPIO_ACTIVE_HIGH>;
+                       hw_reset = <&gpio BOOT_9 GPIO_ACTIVE_HIGH>;
                        card_type = <1>;
                        /* 1:mmc card(include eMMC),
                         * 2:sd card(include tSD)
index afbfaa9..b3de0ff 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 8d055f7..46b666d 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 db2014e..d135ebe 100644 (file)
                         "MMC_CAP_ERASE",
                         "MMC_CAP_CMD23";
                caps2 = "MMC_CAP2_HS200";
-               /* "MMC_CAP2_HS400";*/
+                       /*"MMC_CAP2_HS400";*/
                f_min = <400000>;
                f_max = <200000000>;
        };
index c84e551..5a284e5 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 bef2ee5..4051135 100644 (file)
                        tx_delay = <0>;
                        max_req_size = <0x20000>; /**128KB*/
                        gpio_dat3 = <&gpio BOOT_3 GPIO_ACTIVE_HIGH>;
-                       hw_reset = <&gpio BOOT_12 GPIO_ACTIVE_HIGH>;
+                       hw_reset = <&gpio BOOT_9 GPIO_ACTIVE_HIGH>;
                        card_type = <1>;
                        /* 1:mmc card(include eMMC),
                         * 2:sd card(include tSD)
index bbb65ec..849ed43 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 fdf9cc5..067af6a 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 78fce0a..744e190 100644 (file)
                         "MMC_CAP_ERASE",
                         "MMC_CAP_CMD23";
                caps2 = "MMC_CAP2_HS200";
-               /* "MMC_CAP2_HS400";*/
+                       /*"MMC_CAP2_HS400";*/
                f_min = <400000>;
                f_max = <200000000>;
        };
index 7e38b56..44d9923 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 e9c25c1..aabfd06 100644 (file)
@@ -1619,6 +1619,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);
@@ -1627,6 +1628,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))) {
@@ -1944,11 +1946,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;