aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAisheng Dong <b29396@freescale.com>2014-08-27 15:26:30 +0800
committerDong Aisheng <aisheng.dong@freescale.com>2015-11-01 01:36:42 +0800
commit7f66735b3e86b82aeb9b9cf4c8d892e4291230bc (patch)
treeedf7dd6c394b05519244f280d19bd7450816e1e3
parent39ef08a182b0020b49988c5566255f1fc4727f0b (diff)
downloadfreescale-7f66735b3e86b82aeb9b9cf4c8d892e4291230bc.tar.gz
mmc: sdhci-esdhc-imx: set the correct max timeout value for uSDHC
The default sdhci driver write 0xE into timeout counter register to set the maximum timeout. The value is not correct for uSDHC since the max counter value for uSDHC is 0xF. Instead of using common timeout code in sdhci, we implement esdhc_set_timeout to handle the difference between eSDHC and uSDHC. Currently we simply set the max timeout value as before. But in the future, we probably may implement IMX specific timeout setting algorithm and use suitable timeout for different CMDs. Reviewed-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Dong Aisheng <b29396@freescale.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> (cherry picked from commit e33eb8e2818c9a7b41bac68a1c83ee4c136af9ba)
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 9138837ebe5..230d356910b 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -998,6 +998,16 @@ static unsigned int esdhc_get_max_timeout_count(struct sdhci_host *host)
return esdhc_is_usdhc(imx_data) ? 1 << 28 : 1 << 27;
}
+static void esdhc_set_timeout(struct sdhci_host *host, struct mmc_command *cmd)
+{
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ struct pltfm_imx_data *imx_data = pltfm_host->priv;
+
+ /* use maximum timeout counter */
+ sdhci_writeb(host, esdhc_is_usdhc(imx_data) ? 0xF : 0xE,
+ SDHCI_TIMEOUT_CONTROL);
+}
+
static struct sdhci_ops sdhci_esdhc_ops = {
.read_l = esdhc_readl_le,
.read_w = esdhc_readw_le,
@@ -1010,6 +1020,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
.get_max_timeout_count = esdhc_get_max_timeout_count,
.get_ro = esdhc_pltfm_get_ro,
.platform_bus_width = esdhc_pltfm_bus_width,
+ .set_timeout = esdhc_set_timeout,
.set_uhs_signaling = esdhc_set_uhs_signaling,
};