From 750f168825cb80df2c296d69ec671f117d345c02 Mon Sep 17 00:00:00 2001 From: Sammy He Date: Mon, 21 Dec 2009 17:09:24 +0800 Subject: ENGR00119526 MX25: Fix mmc read/write failure on mmc uboot Fix MMC read/write failure due to eSDHC register definition wrong Signed-off-by: Sammy He --- drivers/mmc/imx_esdhc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/mmc') diff --git a/drivers/mmc/imx_esdhc.c b/drivers/mmc/imx_esdhc.c index 5ee0efd..025be87 100644 --- a/drivers/mmc/imx_esdhc.c +++ b/drivers/mmc/imx_esdhc.c @@ -315,7 +315,11 @@ void set_sysctl(struct mmc *mmc, uint clock) clk = (pre_div << 8) | (div << 4); +#ifdef CONFIG_MX25 + tmp = readl(®s->sysctl) | (SYSCTL_HCKEN | SYSCTL_IPGEN); +#else tmp = readl(®s->sysctl) & (~SYSCTL_SDCLKEN); +#endif writel(tmp, ®s->sysctl); tmp = (readl(®s->sysctl) & (~SYSCTL_CLOCK_MASK)) | clk; @@ -323,10 +327,15 @@ void set_sysctl(struct mmc *mmc, uint clock) mdelay(100); +#ifdef CONFIG_MX25 + tmp = readl(®s->sysctl) | SYSCTL_PEREN; + writel(tmp, ®s->sysctl); +#else while (!(readl(®s->prsstat) & PRSSTAT_SDSTB)) ; tmp = readl(®s->sysctl) | (SYSCTL_SDCLKEN); writel(tmp, ®s->sysctl); +#endif } static void esdhc_set_ios(struct mmc *mmc) @@ -380,6 +389,7 @@ static int esdhc_init(struct mmc *mmc) } */ +#ifndef CONFIG_MX25 set_sysctl(mmc, 400000); tmp = readl(®s->sysctl) | SYSCTL_INITA; @@ -387,6 +397,7 @@ static int esdhc_init(struct mmc *mmc) while (readl(®s->sysctl) & SYSCTL_INITA) mdelay(1); +#endif return 0; } -- cgit v1.1