From ccf7988b9ace671085a7ae6e7317c6a378c4a309 Mon Sep 17 00:00:00 2001 From: Tom Warren Date: Wed, 21 Sep 2011 12:40:07 +0000 Subject: tegra2: Enable MMC for Seaboard This adds the required GPIO and pinmux configuration to make eMMC / SD work on Seaboard. Signed-off-by: Simon Glass Tested-by: Tom Warren --- board/nvidia/seaboard/seaboard.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'board/nvidia/seaboard') diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c index 4b9a8f33e8..bc67d0f94c 100644 --- a/board/nvidia/seaboard/seaboard.c +++ b/board/nvidia/seaboard/seaboard.c @@ -24,7 +24,10 @@ #include #include #include -#include +#include +#ifdef CONFIG_TEGRA2_MMC +#include +#endif /* * Routine: gpio_config_uart @@ -50,3 +53,33 @@ void gpio_config_uart(void) val |= 1 << GPIO_BIT(gp); writel(val, &bank->gpio_dir_out[GPIO_PORT(gp)]); } + +#ifdef CONFIG_TEGRA2_MMC +/* + * Routine: gpio_config_mmc + * Description: Set GPIOs for SDMMC3 SDIO slot. + */ +void gpio_config_mmc(void) +{ + /* Set EN_VDDIO_SD (GPIO I6) */ + gpio_direction_output(GPIO_PI6, 1); + + /* Config pin as GPI for Card Detect (GPIO I5) */ + gpio_direction_input(GPIO_PI5); +} + +/* this is a weak define that we are overriding */ +int board_mmc_getcd(u8 *cd, struct mmc *mmc) +{ + debug("board_mmc_getcd called\n"); + *cd = 1; /* Assume card is inserted, or eMMC */ + + if (IS_SD(mmc)) { + /* Seaboard SDMMC3 = SDIO3_CD = GPIO_PI5 */ + if (gpio_get_value(GPIO_PI5)) + *cd = 0; + } + + return 0; +} +#endif -- cgit v1.2.1