2 * (C) Copyright 2010,2011
3 * NVIDIA Corporation <www.nvidia.com>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <asm/arch/tegra2.h>
27 #include <asm/arch/pinmux.h>
28 #include <asm/arch/mmc.h>
30 #ifdef CONFIG_TEGRA2_MMC
35 * Routine: gpio_config_uart
36 * Description: Does nothing on Harmony - no conflict w/SPI.
38 void gpio_config_uart(void)
42 #ifdef CONFIG_TEGRA2_MMC
44 * Routine: pin_mux_mmc
45 * Description: setup the pin muxes/tristate values for the SDMMC(s)
47 static void pin_mux_mmc(void)
49 /* SDMMC4: config 3, x8 on 2nd set of pins */
50 pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
51 pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
52 pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
54 pinmux_tristate_disable(PINGRP_ATB);
55 pinmux_tristate_disable(PINGRP_GMA);
56 pinmux_tristate_disable(PINGRP_GME);
58 /* For power GPIO PI6 */
59 pinmux_tristate_disable(PINGRP_ATA);
61 pinmux_tristate_disable(PINGRP_ATD);
63 /* SDMMC2: SDIO2_CLK, SDIO2_CMD, SDIO2_DAT[7:0] */
64 pinmux_set_func(PINGRP_DTA, PMUX_FUNC_SDIO2);
65 pinmux_set_func(PINGRP_DTD, PMUX_FUNC_SDIO2);
67 pinmux_tristate_disable(PINGRP_DTA);
68 pinmux_tristate_disable(PINGRP_DTD);
70 /* For power GPIO PT3 */
71 pinmux_tristate_disable(PINGRP_DTB);
73 pinmux_tristate_disable(PINGRP_ATC);
76 /* this is a weak define that we are overriding */
77 int board_mmc_init(bd_t *bd)
79 debug("board_mmc_init called\n");
81 /* Enable muxes, etc. for SDMMC controllers */
84 debug("board_mmc_init: init SD slot J26\n");
85 /* init dev 0, SD slot J26, with 4-bit bus */
86 /* The board has an 8-bit bus, but 8-bit doesn't work yet */
87 tegra2_mmc_init(0, 4, GPIO_PI6, GPIO_PH2);
89 debug("board_mmc_init: init SD slot J5\n");
90 /* init dev 2, SD slot J5, with 4-bit bus */
91 tegra2_mmc_init(2, 4, GPIO_PT3, GPIO_PI5);