[PATCH] mmc: fsl_esdhc: fix problem when using clk driver

Marek Vasut marex at denx.de
Sat Sep 24 00:29:33 CEST 2022


From: Ye Li <ye.li at nxp.com>

Move init_clk_usdhc to non-clk driver case, since assigned-clocks properties
will initialize the clocks by clk driver.

Signed-off-by: Ye Li <ye.li at nxp.com>
Signed-off-by: Marek Vasut <marex at denx.de>
---
NOTE: Was MLK-21848-5 fsl_esdhc: fix problem when using clk driver
NOTE: Fixes SD SDR104 mode instability on MX8MP
---
Cc: Fabio Estevam <festevam at denx.de>
Cc: Jaehoon Chung <jh80.chung at samsung.com>
Cc: Marcel Ziswiler <marcel.ziswiler at toradex.com>
Cc: Max Krummenacher <max.krummenacher at toradex.com>
Cc: Peng Fan <peng.fan at nxp.com>
Cc: Stefano Babic <sbabic at denx.de>
---
 drivers/mmc/fsl_esdhc_imx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index 9befb190bdf..92b152fc979 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -1519,8 +1519,6 @@ static int fsl_esdhc_probe(struct udevice *dev)
 	 * work as expected.
 	 */
 
-	init_clk_usdhc(dev_seq(dev));
-
 #if CONFIG_IS_ENABLED(CLK)
 	/* Assigned clock already set clock */
 	ret = clk_get_by_name(dev, "per", &priv->per_clk);
@@ -1536,6 +1534,8 @@ static int fsl_esdhc_probe(struct udevice *dev)
 
 	priv->sdhc_clk = clk_get_rate(&priv->per_clk);
 #else
+	init_clk_usdhc(dev_seq(dev));
+
 	priv->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK + dev_seq(dev));
 	if (priv->sdhc_clk <= 0) {
 		dev_err(dev, "Unable to get clk for %s\n", dev->name);
-- 
2.35.1



More information about the U-Boot mailing list