summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-06-16 13:26:24 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:39:32 -0700
commit6b6da748b9987ee75523f77dbabe124c706d89cc (patch)
tree479cea5ff1ecc5b8e42cc9b88da6da50d62729c5 /board
parentfea2a094904aa9fd76ae423339927dcd2e058049 (diff)
Move GPIO setup to the MMC driver
At present the GPIO setup for MMC is done globally in the board file. This will be kept in the fdt so this commit moves the GPIOs under control of the MMC driver. This means that the initialization will only be done if MMC is enabled, and will pick up the correct board GPIOs when required. Note: I am not sure about this change. It is desirable to have all device-related init in the driver with fdt. But U-Boot tends to split things into board init (which may well init things that are never used) and the drivers (which hope and pray that things are ready). A more invasive change would involve packing the MMC config into a structure in the board file which includes GPIO definitions. That seems like a bridge too far. BUG=chromium-os:11623 TEST=build U-Boot for seaboard, mmc part 0; mmc part 1; see correct output Change-Id: Icdfc07085bfb85be7fabf06dc662c184e77bbed9 Reviewed-on: http://gerrit.chromium.org/gerrit/2778 Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/nvidia/common/board.c4
-rw-r--r--board/nvidia/seaboard/seaboard.c33
2 files changed, 2 insertions, 35 deletions
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 01c89151eba..d39777a1117 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -312,9 +312,9 @@ int arch_cpu_init(void)
int board_mmc_init(bd_t *bd)
{
debug("board_mmc_init called\n");
- /* Enable clocks, muxes, etc. for SDMMC controllers */
+
+ /* Enable muxes, etc. for SDMMC controllers */
pin_mux_mmc();
- gpio_config_mmc();
tegra2_mmc_init(gd->blob);
diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index cfc86913e19..36023ebed55 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -23,36 +23,3 @@
#include <common.h>
#include <asm/arch/gpio.h>
-#ifdef CONFIG_TEGRA2_MMC
-#include <mmc.h>
-#endif
-
-/*
- * 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);
-}
-
-#ifdef CONFIG_TEGRA2_MMC
-/* 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