summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2009-12-29 11:18:46 +0800
committerTerry Lv <r65388@freescale.com>2009-12-31 16:12:08 +0800
commitcb4d53ad84e809a9d6d4354db0e140803cff27a2 (patch)
tree60677654a40b50b8ca48acd3a3b88513eb1c6b3b
parenta7b772a9e3f9f565ee8765a07797a3113aef1892 (diff)
downloadu-boot-imx-cb4d53ad84e809a9d6d4354db0e140803cff27a2.zip
u-boot-imx-cb4d53ad84e809a9d6d4354db0e140803cff27a2.tar.gz
u-boot-imx-cb4d53ad84e809a9d6d4354db0e140803cff27a2.tar.bz2
ENGR00119706: Add esdhcv1 support.
Add a new config CONFIG_IMX_ESDHC_V1 for v1 support. Signed-off-by: Terry Lv <r65388@freescale.com>
-rw-r--r--drivers/mmc/Makefile1
-rw-r--r--drivers/mmc/imx_esdhc.c17
-rw-r--r--include/configs/mx25_3stack.h1
3 files changed, 10 insertions, 9 deletions
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 15c07ca..2902ba5 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -32,7 +32,6 @@ COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o
-COBJS-$(CONFIG_FSL_MMC) += fsl_mmc.o
COBJS-$(CONFIG_FSL_MMC) += fsl_esdhc.o
COBJS-$(CONFIG_IMX_MMC) += imx_esdhc.o
diff --git a/drivers/mmc/imx_esdhc.c b/drivers/mmc/imx_esdhc.c
index 025be87..39a0b49 100644
--- a/drivers/mmc/imx_esdhc.c
+++ b/drivers/mmc/imx_esdhc.c
@@ -315,19 +315,17 @@ void set_sysctl(struct mmc *mmc, uint clock)
clk = (pre_div << 8) | (div << 4);
-#ifdef CONFIG_MX25
- tmp = readl(&regs->sysctl) | (SYSCTL_HCKEN | SYSCTL_IPGEN);
-#else
+#ifndef CONFIG_IMX_ESDHC_V1
tmp = readl(&regs->sysctl) & (~SYSCTL_SDCLKEN);
-#endif
writel(tmp, &regs->sysctl);
+#endif
tmp = (readl(&regs->sysctl) & (~SYSCTL_CLOCK_MASK)) | clk;
writel(tmp, &regs->sysctl);
mdelay(100);
-#ifdef CONFIG_MX25
+#ifdef CONFIG_IMX_ESDHC_V1
tmp = readl(&regs->sysctl) | SYSCTL_PEREN;
writel(tmp, &regs->sysctl);
#else
@@ -372,6 +370,11 @@ static int esdhc_init(struct mmc *mmc)
while (readl(&regs->sysctl) & SYSCTL_RSTA)
mdelay(1);
+#ifdef CONFIG_IMX_ESDHC_V1
+ tmp = readl(&regs->sysctl) | (SYSCTL_HCKEN | SYSCTL_IPGEN);
+ writel(tmp, &regs->sysctl);
+#endif
+
/* Set the initial clock speed */
set_sysctl(mmc, 400000);
@@ -389,9 +392,7 @@ static int esdhc_init(struct mmc *mmc)
}
*/
-#ifndef CONFIG_MX25
- set_sysctl(mmc, 400000);
-
+#ifndef CONFIG_IMX_ESDHC_V1
tmp = readl(&regs->sysctl) | SYSCTL_INITA;
writel(tmp, &regs->sysctl);
diff --git a/include/configs/mx25_3stack.h b/include/configs/mx25_3stack.h
index e1a35f6..b0401cd 100644
--- a/include/configs/mx25_3stack.h
+++ b/include/configs/mx25_3stack.h
@@ -110,6 +110,7 @@
#define CONFIG_MMC 1
#define CONFIG_GENERIC_MMC
#define CONFIG_IMX_MMC
+ #define CONFIG_IMX_ESDHC_V1
#define CONFIG_DOS_PARTITION 1
#define CONFIG_CMD_FAT 1
#endif