mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 16:44:10 +08:00
mmc: sdhci-esdhc-imx: optimize the strobe dll setting
After set the STROBE SLV delay target value, it need to wait some time to let the usdhc lock the REF and SLV clock. In normal case, 1~2us is enough for imx8/imx6 and imx7d, and 4~5us is enough for imx7ulp, but when do reboot stress test or do the bind/unbind stress test, sometimes need to wait about 10us to get the status lock. This patch optimize delay handle method, only print the warning message if the status is still not lock after 1ms delay. Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/1582100757-20683-3-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
f581e9093a
commit
373e800b53
@ -1019,6 +1019,7 @@ static void esdhc_set_strobe_dll(struct sdhci_host *host)
|
|||||||
struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host);
|
struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host);
|
||||||
u32 strobe_delay;
|
u32 strobe_delay;
|
||||||
u32 v;
|
u32 v;
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* disable clock before enabling strobe dll */
|
/* disable clock before enabling strobe dll */
|
||||||
writel(readl(host->ioaddr + ESDHC_VENDOR_SPEC) &
|
writel(readl(host->ioaddr + ESDHC_VENDOR_SPEC) &
|
||||||
@ -1044,15 +1045,13 @@ static void esdhc_set_strobe_dll(struct sdhci_host *host)
|
|||||||
ESDHC_STROBE_DLL_CTRL_SLV_UPDATE_INT_DEFAULT |
|
ESDHC_STROBE_DLL_CTRL_SLV_UPDATE_INT_DEFAULT |
|
||||||
(strobe_delay << ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_SHIFT);
|
(strobe_delay << ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_SHIFT);
|
||||||
writel(v, host->ioaddr + ESDHC_STROBE_DLL_CTRL);
|
writel(v, host->ioaddr + ESDHC_STROBE_DLL_CTRL);
|
||||||
/* wait 5us to make sure strobe dll status register stable */
|
|
||||||
udelay(5);
|
/* wait max 50us to get the REF/SLV lock */
|
||||||
v = readl(host->ioaddr + ESDHC_STROBE_DLL_STATUS);
|
ret = readl_poll_timeout(host->ioaddr + ESDHC_STROBE_DLL_STATUS, v,
|
||||||
if (!(v & ESDHC_STROBE_DLL_STS_REF_LOCK))
|
((v & ESDHC_STROBE_DLL_STS_REF_LOCK) && (v & ESDHC_STROBE_DLL_STS_SLV_LOCK)), 1, 50);
|
||||||
|
if (ret == -ETIMEDOUT)
|
||||||
dev_warn(mmc_dev(host->mmc),
|
dev_warn(mmc_dev(host->mmc),
|
||||||
"warning! HS400 strobe DLL status REF not lock!\n");
|
"warning! HS400 strobe DLL status REF/SLV not lock in 50us, STROBE DLL status is %x!\n", v);
|
||||||
if (!(v & ESDHC_STROBE_DLL_STS_SLV_LOCK))
|
|
||||||
dev_warn(mmc_dev(host->mmc),
|
|
||||||
"warning! HS400 strobe DLL status SLV not lock!\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void esdhc_reset_tuning(struct sdhci_host *host)
|
static void esdhc_reset_tuning(struct sdhci_host *host)
|
||||||
|
Loading…
Reference in New Issue
Block a user