diff options
author | Dong Aisheng <aisheng.dong@nxp.com> | 2016-02-16 15:45:18 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2016-02-17 18:08:08 +0800 |
commit | 392a2ec58fa88dc36fa582a6ebeaaaaca13ff245 (patch) | |
tree | a10ab83e93e95187a554ef9d920db9ee540879a8 /drivers | |
parent | 6b10227cb72d493f12153bb2dfebae01eeecd4a1 (diff) |
MLK-12404-1 mmc: sdhci-esdhc-imx: fix strobe DLL lock wrong clock issue
When enable DDR, the clock factor definition is changed.
e.g. original 200Mhz will be changed to 100Mhz if set MIX_CTRL_DDREN bit.
So we need to update the clock setting for strobe dll to lock
the correct clock rate.
Additionally we also need disable the clock before locking strobe dll.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(cherry picked from commit 4d8095a6e860f773f5d2e4d5b62a6f4ba1a92431)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index cb59d68d8b6e..9bd2b27b5373 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -875,6 +875,11 @@ static void esdhc_set_strobe_dll(struct sdhci_host *host) u32 v; if (host->mmc->actual_clock > ESDHC_STROBE_DLL_CLK_FREQ) { + /* disable clock before enabling strobe dll */ + writel(readl(host->ioaddr + ESDHC_VENDOR_SPEC) & + (~ESDHC_VENDOR_SPEC_FRC_SDCLK_ON), + host->ioaddr + ESDHC_VENDOR_SPEC); + /* force a reset on strobe dll */ writel(ESDHC_STROBE_DLL_CTRL_RESET, host->ioaddr + ESDHC_STROBE_DLL_CTRL); @@ -937,6 +942,8 @@ static void esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned timing) m |= ESDHC_MIX_CTRL_DDREN | ESDHC_MIX_CTRL_HS400_EN; writel(m, host->ioaddr + ESDHC_MIX_CTRL); imx_data->is_ddr = 1; + /* update clock after enable DDR for strobe DLL lock */ + host->ops->set_clock(host, host->clock); esdhc_set_strobe_dll(host); break; } |