]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00289406-2 mmc: sdhci-esdhc-imx: add SDHCI_QUIRK2_NOSTD_TIMEOUT_COUNTER
authorDong Aisheng <b29396@freescale.com>
Fri, 22 Nov 2013 12:39:15 +0000 (20:39 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 16 Jun 2014 16:08:39 +0000 (18:08 +0200)
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 <b29396@freescale.com>
drivers/mmc/host/sdhci-esdhc-imx.c

index 4e1970187d075c424ef84bf6d131fdeb3b9d22c0..73c26ecbff5e940a4f057a4b04e0c0c3e8977126 100644 (file)
@@ -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)