2 * (C) Copyright 2010-2013
3 * NVIDIA Corporation <www.nvidia.com>
5 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/arch/pinmux.h>
10 #include <asm/arch/gp_padctrl.h>
11 #include "pinmux-config-cardhu.h"
14 #define PMU_I2C_ADDRESS 0x2D
15 #define MAX_I2C_RETRY 3
18 * Routine: pinmux_init
19 * Description: Do individual peripheral pinmux configs
21 void pinmux_init(void)
23 pinmux_config_table(tegra3_pinmux_common,
24 ARRAY_SIZE(tegra3_pinmux_common));
26 pinmux_config_table(unused_pins_lowpower,
27 ARRAY_SIZE(unused_pins_lowpower));
29 /* Initialize any non-default pad configs (APB_MISC_GP regs) */
30 padgrp_config_table(cardhu_padctrl, ARRAY_SIZE(cardhu_padctrl));
33 #if defined(CONFIG_TEGRA_MMC)
35 * Do I2C/PMU writes to bring up SD card bus power
38 void board_sdmmc_voltage_init(void)
40 uchar reg, data_buffer[1];
43 i2c_set_bus_num(0); /* PMU is on bus 0 */
45 /* TPS659110: LDO5_REG = 3.3v, ACTIVE to SDMMC1 */
46 data_buffer[0] = 0x65;
49 for (i = 0; i < MAX_I2C_RETRY; ++i) {
50 if (i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1))
54 /* TPS659110: GPIO7_REG = PDEN, output a 1 to EN_3V3_SYS */
55 data_buffer[0] = 0x09;
58 for (i = 0; i < MAX_I2C_RETRY; ++i) {
59 if (i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1))
65 * Routine: pin_mux_mmc
66 * Description: setup the MMC muxes, power rails, etc.
68 void pin_mux_mmc(void)
71 * NOTE: We don't do mmc-specific pin muxes here.
72 * They were done globally in pinmux_init().
75 /* Bring up the SDIO1 power rail */
76 board_sdmmc_voltage_init();