summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorBOUGH CHEN <haibo.chen@nxp.com>2018-12-20 11:57:41 +0000
committerUlf Hansson <ulf.hansson@linaro.org>2019-02-25 08:40:58 +0100
commita98c557e2af3e12e38dee6019a5cf210156d629e (patch)
treece9e2e374baa1473025200ad8669c0d5039c8148 /drivers/mmc
parent4f1000122405afe1de40cd0e789ab1b870868bc2 (diff)
downloadlinux-a98c557e2af3e12e38dee6019a5cf210156d629e.tar.bz2
mmc: sdhci-esdhc-imx: clear ESDHC_STD_TUNING_EN for manual tuning method
The bit ESDHC_STD_TUNING_EN may be configed by bootloader code if it choose to use standard tuning method. So on linux side, if choose to use manual tuning method, need to clear the bit ESDHC_STD_TUNING_EN, remove the impact of bootloader code. Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 71193e291a29..8817b5e7f953 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1120,6 +1120,15 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host)
<< ESDHC_TUNING_STEP_SHIFT;
}
writel(tmp, host->ioaddr + ESDHC_TUNING_CTRL);
+ } else if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) {
+ /*
+ * ESDHC_STD_TUNING_EN may be configed in bootloader
+ * or ROM code, so clear this bit here to make sure
+ * the manual tuning can work.
+ */
+ tmp = readl(host->ioaddr + ESDHC_TUNING_CTRL);
+ tmp &= ~ESDHC_STD_TUNING_EN;
+ writel(tmp, host->ioaddr + ESDHC_TUNING_CTRL);
}
}
}