2 * (C) Copyright 2010-2013
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,
25 #include <asm/arch/pinmux.h>
26 #include <asm/arch/gp_padctrl.h>
27 #include "pinmux-config-cardhu.h"
30 #define PMU_I2C_ADDRESS 0x2D
31 #define MAX_I2C_RETRY 3
34 * Routine: pinmux_init
35 * Description: Do individual peripheral pinmux configs
37 void pinmux_init(void)
39 pinmux_config_table(tegra3_pinmux_common,
40 ARRAY_SIZE(tegra3_pinmux_common));
42 pinmux_config_table(unused_pins_lowpower,
43 ARRAY_SIZE(unused_pins_lowpower));
45 /* Initialize any non-default pad configs (APB_MISC_GP regs) */
46 padgrp_config_table(cardhu_padctrl, ARRAY_SIZE(cardhu_padctrl));
49 #if defined(CONFIG_TEGRA_MMC)
51 * Do I2C/PMU writes to bring up SD card bus power
54 void board_sdmmc_voltage_init(void)
56 uchar reg, data_buffer[1];
59 i2c_set_bus_num(0); /* PMU is on bus 0 */
61 /* TPS659110: LDO5_REG = 3.3v, ACTIVE to SDMMC1 */
62 data_buffer[0] = 0x65;
65 for (i = 0; i < MAX_I2C_RETRY; ++i) {
66 if (i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1))
70 /* TPS659110: GPIO7_REG = PDEN, output a 1 to EN_3V3_SYS */
71 data_buffer[0] = 0x09;
74 for (i = 0; i < MAX_I2C_RETRY; ++i) {
75 if (i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1))
81 * Routine: pin_mux_mmc
82 * Description: setup the MMC muxes, power rails, etc.
84 void pin_mux_mmc(void)
87 * NOTE: We don't do mmc-specific pin muxes here.
88 * They were done globally in pinmux_init().
91 /* Bring up the SDIO1 power rail */
92 board_sdmmc_voltage_init();