From: Yangbo Lu Date: Fri, 23 Nov 2018 03:15:36 +0000 (+0800) Subject: mmc: sdhci-of-esdhc: temporary fixup for eMMC HS400 issue X-Git-Tag: Ubuntu-5.2.0-15.16~2881^2~56 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=58d0bf843b49fa99588ac9f85178bd8dfd651b53;p=mirror_ubuntu-eoan-kernel.git mmc: sdhci-of-esdhc: temporary fixup for eMMC HS400 issue Currently only LX2160A eSDHC supports eMMC HS400. According to a large number of tests, eMMC HS400 failed to work at 150MHz, and for a few boards failed to work at 175MHz. But eMMC HS400 worked fine on 200MHz. We hadn't found the root cause but setting eSDHC_DLLCFG0[DLL_FREQ_SEL] = 0 using slow delay chain seemed to resovle this issue. Let's use this as fixup for now. Signed-off-by: Yangbo Lu Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index b73d75251f8a..b93a4556ac8c 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -623,7 +623,9 @@ static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock) esdhc_clock_enable(host, true); temp = sdhci_readl(host, ESDHC_DLLCFG0); - temp |= ESDHC_DLL_ENABLE | ESDHC_DLL_FREQ_SEL; + temp |= ESDHC_DLL_ENABLE; + if (host->mmc->actual_clock == MMC_HS200_MAX_DTR) + temp |= ESDHC_DLL_FREQ_SEL; sdhci_writel(host, temp, ESDHC_DLLCFG0); temp = sdhci_readl(host, ESDHC_TBCTL); sdhci_writel(host, temp | ESDHC_HS400_WNDW_ADJUST, ESDHC_TBCTL);