From: Dong Aisheng Date: Fri, 22 Nov 2013 12:39:15 +0000 (+0800) Subject: ENGR00289406-2 mmc: sdhci-esdhc-imx: add SDHCI_QUIRK2_NOSTD_TIMEOUT_COUNTER X-Git-Tag: KARO-TX6-2014-07-10~129 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c0402211e34ceed0111dead7ca1c6b0f4296d512;p=karo-tx-linux.git ENGR00289406-2 mmc: sdhci-esdhc-imx: add SDHCI_QUIRK2_NOSTD_TIMEOUT_COUNTER The max timeout counter for uSDHC is SDCLK x (1 << 28), not as standard controller defined as TMCLK x (1 <<27). Add SDHCI_QUIRK2_NOSTD_TIMEOUT_COUNTER quirk to handle it. Signed-off-by: Dong Aisheng --- diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 4e1970187d07..73c26ecbff5e 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -903,6 +903,11 @@ static void esdhc_reset(struct sdhci_host *host, u8 mask) sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); } +static unsigned int esdhc_get_max_timeout_counter(struct sdhci_host *host) +{ + return 1 << 28; +} + static struct sdhci_ops sdhci_esdhc_ops = { .read_l = esdhc_readl_le, .read_w = esdhc_readw_le, @@ -1053,7 +1058,8 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) */ if (esdhc_is_usdhc(imx_data)) { writel(0x08100810, host->ioaddr + ESDHC_WTMK_LVL); - host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN; + host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN | + SDHCI_QUIRK2_NOSTD_TIMEOUT_COUNTER; host->mmc->caps |= MMC_CAP_1_8V_DDR; /* @@ -1061,6 +1067,8 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) * TO1.1, it's harmless for MX6SL */ writel(readl(host->ioaddr + 0x6c) | BIT(7), host->ioaddr + 0x6c); + sdhci_esdhc_ops.get_max_timeout_counter = + esdhc_get_max_timeout_counter; } if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING)