diff options
author | Tom Rini <trini@konsulko.com> | 2019-11-06 07:10:16 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-11-06 07:10:16 -0500 |
commit | e64ebde12dc82e80f81a74d66b48da2fe598041f (patch) | |
tree | 7509b0d26b594f9d0fa5547ba28b31edc607f707 /drivers/mmc/fsl_esdhc_imx.c | |
parent | 14d39c9e1dc9397febd58399a70f32e7481bbc27 (diff) | |
parent | f65d08411d76f01ddfb5d44909c667b91b847ddf (diff) |
Merge tag 'mmc-2019-11-5' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
- fsl_esdhc driver cleanup
- fsl_esdhc_imx driver improvement and compatible string update
Diffstat (limited to 'drivers/mmc/fsl_esdhc_imx.c')
-rw-r--r-- | drivers/mmc/fsl_esdhc_imx.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c index 43106dec756..40993863130 100644 --- a/drivers/mmc/fsl_esdhc_imx.c +++ b/drivers/mmc/fsl_esdhc_imx.c @@ -627,9 +627,6 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock) int sdhc_clk = priv->sdhc_clk; uint clk; - if (clock < mmc->cfg->f_min) - clock = mmc->cfg->f_min; - while (sdhc_clk / (16 * pre_div * ddr_pre_div) > clock && pre_div < 256) pre_div *= 2; @@ -958,6 +955,7 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc) { struct fsl_esdhc *regs = priv->esdhc_regs; int ret __maybe_unused; + u32 clock; #ifdef CONFIG_FSL_ESDHC_USE_PERIPHERAL_CLK /* Select to use peripheral clock */ @@ -966,8 +964,12 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc) esdhc_clock_control(priv, true); #endif /* Set the clock speed */ - if (priv->clock != mmc->clock) - set_sysctl(priv, mmc, mmc->clock); + clock = mmc->clock; + if (clock < mmc->cfg->f_min) + clock = mmc->cfg->f_min; + + if (priv->clock != clock) + set_sysctl(priv, mmc, clock); #ifdef MMC_SUPPORTS_TUNING if (mmc->clk_disable) { @@ -1645,6 +1647,9 @@ static const struct udevice_id fsl_esdhc_ids[] = { { .compatible = "fsl,imx7d-usdhc", .data = (ulong)&usdhc_imx7d_data,}, { .compatible = "fsl,imx7ulp-usdhc", }, { .compatible = "fsl,imx8qm-usdhc", .data = (ulong)&usdhc_imx8qm_data,}, + { .compatible = "fsl,imx8mm-usdhc", .data = (ulong)&usdhc_imx8qm_data,}, + { .compatible = "fsl,imx8mn-usdhc", .data = (ulong)&usdhc_imx8qm_data,}, + { .compatible = "fsl,imx8mq-usdhc", .data = (ulong)&usdhc_imx8qm_data,}, { .compatible = "fsl,esdhc", }, { /* sentinel */ } }; |