summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2020-09-18 10:42:12 -0400
committerTom Rini <[email protected]>2020-09-18 10:42:12 -0400
commit98f3ee09d096c6c1bc49e08d805f6354dffb0e59 (patch)
treeb02cd94de7fc93381d8ce7d07481ff9952986218 /drivers
parent9de3126e80cdac7ee15b6671065a952184533dda (diff)
parent4516b535bf16db4231ea27bb95197d869f86893b (diff)
Merge tag 'u-boot-imx-20200918' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
---------------------------------------------------------------- Fixes for 2020.10 ----------------- - Toradex boards - mx6qsabrelite: fix env offset - esdhc_imx: waiting for clock instead of sleep - dyn RAM calibration for entry point i.MX6 Travis: https://travis-ci.org/github/sbabic/u-boot-imx/builds/728274602
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/fsl_esdhc_imx.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index 788677984bf..0c866b168f9 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -36,6 +36,7 @@
#include <dt-structs.h>
#include <mapmem.h>
#include <dm/ofnode.h>
+#include <linux/iopoll.h>
#if !CONFIG_IS_ENABLED(BLK)
#include "mmc_private.h"
@@ -631,6 +632,8 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock)
{
struct fsl_esdhc *regs = priv->esdhc_regs;
int div = 1;
+ u32 tmp;
+ int ret;
#ifdef ARCH_MXC
#ifdef CONFIG_MX53
/* For i.MX53 eSDHCv3, SYSCTL.SDCLKFS may not be set to 0. */
@@ -664,7 +667,9 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock)
esdhc_clrsetbits32(&regs->sysctl, SYSCTL_CLOCK_MASK, clk);
- udelay(10000);
+ ret = readx_poll_timeout(esdhc_read32, &regs->prsstat, tmp, tmp & PRSSTAT_SDSTB, 100);
+ if (ret)
+ pr_warn("fsl_esdhc_imx: Internal clock never stabilised.\n");
#ifdef CONFIG_FSL_USDHC
esdhc_setbits32(&regs->vendorspec, VENDORSPEC_PEREN | VENDORSPEC_CKEN);