From 0b320d998d7c1ff43231682f6ab5a97f476249f7 Mon Sep 17 00:00:00 2001 From: Anna Horstmann Date: Wed, 12 Apr 2017 15:17:06 -0700 Subject: [PATCH] IMX7FLY-84 mmc: sdhci-esdhc-imx: add dts property no-mmc-hs400 The phyCORE-i.MX7 SOM (PCM-061-2110111C.A1) with eMMC 5.0 has read errors when operating in the default HS400 mode. Added property "no-mmc-hs400". Signed-off-by: Anna Horstmann diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index a02edfc..6ecf6f8 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -297,6 +297,8 @@ static u32 esdhc_readl_le(struct sdhci_host *host, int reg) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct pltfm_imx_data *imx_data = pltfm_host->priv; + struct esdhc_platform_data *boarddata = &imx_data->boarddata; + u32 val = readl(host->ioaddr + reg); if (unlikely(reg == SDHCI_PRESENT_STATE)) { @@ -338,7 +340,7 @@ static u32 esdhc_readl_le(struct sdhci_host *host, int reg) | SDHCI_USE_SDR50_TUNING | (SDHCI_TUNING_MODE_3 << SDHCI_RETUNING_MODE_SHIFT); - if (imx_data->socdata->flags & ESDHC_FLAG_HS400) + if (imx_data->socdata->flags & ESDHC_FLAG_HS400 && boarddata->support_mmc_hs400) val |= SDHCI_SUPPORT_HS400; } } @@ -1118,6 +1120,13 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, host->quirks2 |= SDHCI_QUIRK2_SDIO_IRQ_THREAD; dev_info(mmc_dev(host->mmc), "assigned as wifi host\n"); } + if (of_find_property(np, "no-mmc-hs400", NULL)) + boarddata->support_mmc_hs400 = false; + else + boarddata->support_mmc_hs400 = true; + + if ((!boarddata->support_mmc_hs400)) + host->quirks2 &= ~SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400; return 0; } diff --git a/include/linux/platform_data/mmc-esdhc-imx.h b/include/linux/platform_data/mmc-esdhc-imx.h index 7daa78a..87f5a44 100644 --- a/include/linux/platform_data/mmc-esdhc-imx.h +++ b/include/linux/platform_data/mmc-esdhc-imx.h @@ -47,5 +47,6 @@ struct esdhc_platform_data { unsigned int delay_line; unsigned int tuning_step; /* The delay cell steps in tuning procedure */ unsigned int tuning_start_tap; /* The start delay cell point in tuning procedure */ + bool support_mmc_hs400; }; #endif /* __ASM_ARCH_IMX_ESDHC_H */ -- 1.9.1