From 0e467759861612ffa9aac21733b39c384761b26d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= Date: Thu, 26 Jun 2014 12:13:20 +0200 Subject: [PATCH] board: tx48: add MMC init code Up to now we relied on cpu_mmc_init() to initialize the MMC unit for us. This had some major drawbacks: - the default implementation doesn't use CD gpios, so that the driver always assumes a card is present. - the default implementation always initializes two MMC interfaces, though the TX48 supports only one. Properly initialize the CD GPIO and implement our own version of cpu_mmc_init(). --- board/karo/tx48/tx48.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/board/karo/tx48/tx48.c b/board/karo/tx48/tx48.c index 7c39056324..48cb0c83da 100644 --- a/board/karo/tx48/tx48.c +++ b/board/karo/tx48/tx48.c @@ -47,6 +47,7 @@ DECLARE_GLOBAL_DATA_PTR; #define TX48_LCD_RST_GPIO AM33XX_GPIO_NR(1, 19) #define TX48_LCD_PWR_GPIO AM33XX_GPIO_NR(1, 22) #define TX48_LCD_BACKLIGHT_GPIO AM33XX_GPIO_NR(3, 14) +#define TX48_MMC_CD_GPIO AM33XX_GPIO_NR(3, 15) #define GMII_SEL (CTRL_BASE + 0x650) @@ -333,10 +334,13 @@ static const struct pin_mux stk5_pads[] = { { OFFSET(gpmc_a6), MODE(7) | PULLUDEN, }, /* LCD Backlight (PWM) */ { OFFSET(mcasp0_aclkx), MODE(7) | PULLUDEN, }, + /* MMC CD */ + { OFFSET(mcasp0_fsx), MODE(7) | PULLUDEN | PULLUP_EN, }, }; static const struct gpio stk5_gpios[] = { - { AM33XX_GPIO_NR(1, 26), GPIOF_OUTPUT_INIT_LOW, "HEARTBEAT LED", }, + { TX48_LED_GPIO, GPIOF_OUTPUT_INIT_LOW, "HEARTBEAT LED", }, + { TX48_MMC_CD_GPIO, GPIOF_INPUT, "HEARTBEAT LED", }, }; static const struct pin_mux stk5_lcd_pads[] = { @@ -1015,6 +1019,13 @@ int board_eth_init(bd_t *bis) } #endif /* CONFIG_DRIVER_TI_CPSW */ +#if defined(CONFIG_OMAP_HSMMC) && !defined(CONFIG_SPL_BUILD) +int cpu_mmc_init(bd_t *bis) +{ + return omap_mmc_init(1, 0, 0, TX48_MMC_CD_GPIO, -1); +} +#endif + void tx48_disable_watchdog(void) { struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE; -- 2.39.2