diff mbox series

[3/3] mmc: fsl_esdhc_imx: add ColdFire support

Message ID 20230224005210.664664-3-angelo.dureghello@timesys.com
State Superseded
Delegated to: Tom Rini
Headers show
Series [1/3] m68k: add mmc device for mcf5441x | expand

Commit Message

Angelo Dureghello Feb. 24, 2023, 12:52 a.m. UTC
From: Angelo Durgehello <angelo@kernel-space.org>

ColdFire mcf5441x includes the same imx esdhc controller module,
so adding minimal code to support it.

Signed-off-by: Angelo Durgehello <angelo@kernel-space.org>
---
 drivers/mmc/fsl_esdhc_imx.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index 66caf683f7..4e15738782 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -1381,7 +1381,9 @@  void fdt_fixup_esdhc(void *blob, struct bd_info *bd)
 #endif
 
 #if CONFIG_IS_ENABLED(DM_MMC)
+#if !CONFIG_IS_ENABLED(MCF5441x)
 #include <asm/arch/clock.h>
+#endif
 __weak void init_clk_usdhc(u32 index)
 {
 }
@@ -1536,7 +1538,12 @@  static int fsl_esdhc_probe(struct udevice *dev)
 #else
 	init_clk_usdhc(dev_seq(dev));
 
+#if IS_ENABLED(CONFIG_MCF5441x)
+	priv->sdhc_clk = gd->arch.sdhc_clk;
+#else
 	priv->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK + dev_seq(dev));
+#endif
+
 	if (priv->sdhc_clk <= 0) {
 		dev_err(dev, "Unable to get clk for %s\n", dev->name);
 		return -EINVAL;