From c9646ed758804fa1fa6c1425369a4eee5d618b1d Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Wed, 10 Jun 2009 00:25:30 +0400 Subject: mpc83xx: MPC837XERDB: Add support for FSL eSDHC This patch adds support for eSDHC on MPC837XERDB boards. The WP switch doesn't seem to work on RDB boards though, the WP pin is always asserted (can see the pin state when it's in GPIO mode). FSL DR USB and FSL eSDHC are mutually exclusive because of pins multiplexing, so user should specify 'esdhc' or 'dr_usb' options in the hwconfig environment variable to choose between the devices. p.s. Now we're very close to a monitor len limit (196 bytes left using gcc-4.2.0), so also increase the monitor len by one sector (64 KB). Signed-off-by: Anton Vorontsov Acked-by: Kim Phillips --- board/freescale/mpc837xerdb/mpc837xerdb.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'board/freescale/mpc837xerdb') diff --git a/board/freescale/mpc837xerdb/mpc837xerdb.c b/board/freescale/mpc837xerdb/mpc837xerdb.c index a4a1927..c5c2e40 100644 --- a/board/freescale/mpc837xerdb/mpc837xerdb.c +++ b/board/freescale/mpc837xerdb/mpc837xerdb.c @@ -13,12 +13,14 @@ */ #include +#include #include #include #include #include #include #include +#include #if defined(CONFIG_SYS_DRAM_TEST) int @@ -166,6 +168,21 @@ int board_early_init_f(void) return 0; } +#ifdef CONFIG_FSL_ESDHC +int board_mmc_init(bd_t *bd) +{ + struct immap __iomem *im = (struct immap __iomem *)CONFIG_SYS_IMMR; + + if (!hwconfig("esdhc")) + return 0; + + clrsetbits_be32(&im->sysconf.sicrl, SICRL_USB_B, SICRL_USB_B_SD); + clrsetbits_be32(&im->sysconf.sicrh, SICRH_SPI, SICRH_SPI_SD); + + return fsl_esdhc_mmc_init(bd); +} +#endif + /* * Miscellaneous late-boot configurations * @@ -195,5 +212,6 @@ void ft_board_setup(void *blob, bd_t *bd) #endif ft_cpu_setup(blob, bd); fdt_fixup_dr_usb(blob, bd); + fdt_fixup_esdhc(blob, bd); } #endif /* CONFIG_OF_BOARD_SETUP */ -- cgit v1.1