aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChaotian Jing <chaotian.jing@mediatek.com>2016-06-29 22:00:58 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2016-07-25 04:34:31 -0400
commit5462ff39c4538b33e70a3c3fffa980c3acb27642 (patch)
tree31a5a07f5f90c2c8e5cf191673d74f78e23b09bc
parentfaecf41106123ac62c06475ef3a61bc1dabfcad2 (diff)
mmc: mediatek: do not tune data for HS400 mode
for hs400 mode, should only tune DS delay, should not tune PAD_TUNE for data path. if eMMC will run at hs400 mode, do not tune data while call ops->execute_tuning(). Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/mtk-sd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index 5642f71f8bf0..4d7ce6586e57 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -326,6 +326,7 @@ struct msdc_host {
326 unsigned char timing; 326 unsigned char timing;
327 bool vqmmc_enabled; 327 bool vqmmc_enabled;
328 u32 hs400_ds_delay; 328 u32 hs400_ds_delay;
329 bool hs400_mode; /* current eMMC will run at hs400 mode */
329 struct msdc_save_para save_para; /* used when gate HCLK */ 330 struct msdc_save_para save_para; /* used when gate HCLK */
330}; 331};
331 332
@@ -1402,9 +1403,11 @@ static int msdc_execute_tuning(struct mmc_host *mmc, u32 opcode)
1402 dev_err(host->dev, "Tune response fail!\n"); 1403 dev_err(host->dev, "Tune response fail!\n");
1403 return ret; 1404 return ret;
1404 } 1405 }
1405 ret = msdc_tune_data(mmc, opcode); 1406 if (host->hs400_mode == false) {
1406 if (ret == -EIO) 1407 ret = msdc_tune_data(mmc, opcode);
1407 dev_err(host->dev, "Tune data fail!\n"); 1408 if (ret == -EIO)
1409 dev_err(host->dev, "Tune data fail!\n");
1410 }
1408 1411
1409 return ret; 1412 return ret;
1410} 1413}
@@ -1412,6 +1415,7 @@ static int msdc_execute_tuning(struct mmc_host *mmc, u32 opcode)
1412static int msdc_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_ios *ios) 1415static int msdc_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_ios *ios)
1413{ 1416{
1414 struct msdc_host *host = mmc_priv(mmc); 1417 struct msdc_host *host = mmc_priv(mmc);
1418 host->hs400_mode = true;
1415 1419
1416 writel(host->hs400_ds_delay, host->base + PAD_DS_TUNE); 1420 writel(host->hs400_ds_delay, host->base + PAD_DS_TUNE);
1417 return 0; 1421 return 0;