[U-Boot] [PATCH v1 2/5] mmc: fsl_esdhc: ppc: set sdhc clock

Yinbo Zhu yinbo.zhu at nxp.com
Mon Mar 25 10:48:53 UTC 2019


From: Yinbo Zhu <yinbo.zhu at nxp.com>

This patch is to set sdhc clock for ppc

Signed-off-by: Yinbo Zhu <yinbo.zhu at nxp.com>
---
 drivers/mmc/fsl_esdhc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 9e34557d16..a65e5c19db 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -1428,7 +1428,9 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)
 #endif
 
 #if CONFIG_IS_ENABLED(DM_MMC)
+#ifndef CONFIG_PPC
 #include <asm/arch/clock.h>
+#endif
 __weak void init_clk_usdhc(u32 index)
 {
 }
@@ -1454,7 +1456,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
 	if (addr == FDT_ADDR_T_NONE)
 		return -EINVAL;
 
-	priv->esdhc_regs = (struct fsl_esdhc *)addr;
+	priv->esdhc_regs = (struct fsl_esdhc *)(addr);
 	priv->dev = dev;
 	priv->mode = -1;
 	if (data) {
@@ -1560,7 +1562,11 @@ static int fsl_esdhc_probe(struct udevice *dev)
 
 		priv->sdhc_clk = clk_get_rate(&priv->per_clk);
 	} else {
+#ifndef CONFIG_PPC
 		priv->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK + dev->seq);
+#else
+		priv->sdhc_clk = gd->arch.sdhc_clk;
+#endif
 		if (priv->sdhc_clk <= 0) {
 			dev_err(dev, "Unable to get clk for %s\n", dev->name);
 			return -EINVAL;
-- 
2.17.1



More information about the U-Boot mailing list