summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>2012-09-27 10:26:02 +0000
committerStefano Babic <sbabic@denx.de>2012-10-16 12:35:10 +0200
commit6e3dc127545247f123de063a6a101960e3eb2ccd (patch)
tree20b0f4c067c91cef79e7cd5dea3259e1b4a9de42
parent151d63cb9145b5eeb4585cb1b5a9c95f985a0e12 (diff)
downloadu-boot-imx-6e3dc127545247f123de063a6a101960e3eb2ccd.zip
u-boot-imx-6e3dc127545247f123de063a6a101960e3eb2ccd.tar.gz
u-boot-imx-6e3dc127545247f123de063a6a101960e3eb2ccd.tar.bz2
mx35: Fix eSDHC clocks
Each eSDHC instance has a dedicated clock. gd->sdhc_clk must also be set accordingly. This is good for the case only a single SDHC instance is used (initialization made with fsl_esdhc_mmc_init()). A future patch will fix the multi-instance use case (initialization made directly with fsl_esdhc_initialize()). Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Eric Bénard <eric@eukrea.com> Cc: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r--arch/arm/cpu/arm1136/mx35/generic.c14
-rw-r--r--arch/arm/include/asm/arch-mx35/clock.h4
2 files changed, 15 insertions, 3 deletions
diff --git a/arch/arm/cpu/arm1136/mx35/generic.c b/arch/arm/cpu/arm1136/mx35/generic.c
index 7dc1a8e..41e9639 100644
--- a/arch/arm/cpu/arm1136/mx35/generic.c
+++ b/arch/arm/cpu/arm1136/mx35/generic.c
@@ -361,8 +361,12 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
return get_ipg_per_clk();
case MXC_UART_CLK:
return imx_get_uartclk();
- case MXC_ESDHC_CLK:
+ case MXC_ESDHC1_CLK:
return mxc_get_peri_clock(ESDHC1_CLK);
+ case MXC_ESDHC2_CLK:
+ return mxc_get_peri_clock(ESDHC2_CLK);
+ case MXC_ESDHC3_CLK:
+ return mxc_get_peri_clock(ESDHC3_CLK);
case MXC_USB_CLK:
return mxc_get_main_clock(USB_CLK);
case MXC_FEC_CLK:
@@ -472,7 +476,13 @@ int cpu_mmc_init(bd_t *bis)
int get_clocks(void)
{
#ifdef CONFIG_FSL_ESDHC
- gd->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
+#if CONFIG_SYS_FSL_ESDHC_ADDR == MMC_SDHC2_BASE_ADDR
+ gd->sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
+#elif CONFIG_SYS_FSL_ESDHC_ADDR == MMC_SDHC3_BASE_ADDR
+ gd->sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
+#else
+ gd->sdhc_clk = mxc_get_clock(MXC_ESDHC1_CLK);
+#endif
#endif
return 0;
}
diff --git a/arch/arm/include/asm/arch-mx35/clock.h b/arch/arm/include/asm/arch-mx35/clock.h
index 2eff08d..00679ef 100644
--- a/arch/arm/include/asm/arch-mx35/clock.h
+++ b/arch/arm/include/asm/arch-mx35/clock.h
@@ -44,7 +44,9 @@ enum mxc_clock {
MXC_IPG_CLK,
MXC_IPG_PERCLK,
MXC_UART_CLK,
- MXC_ESDHC_CLK,
+ MXC_ESDHC1_CLK,
+ MXC_ESDHC2_CLK,
+ MXC_ESDHC3_CLK,
MXC_USB_CLK,
MXC_CSPI_CLK,
MXC_FEC_CLK,