2 * (C) Copyright 2010-2013
3 * NVIDIA Corporation <www.nvidia.com>
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/arch/pinmux.h>
11 #include <asm/arch/gp_padctrl.h>
12 #include "pinmux-config-cardhu.h"
15 #define PMU_I2C_ADDRESS 0x2D
16 #define MAX_I2C_RETRY 3
19 * Routine: pinmux_init
20 * Description: Do individual peripheral pinmux configs
22 void pinmux_init(void)
24 pinmux_config_pingrp_table(tegra3_pinmux_common,
25 ARRAY_SIZE(tegra3_pinmux_common));
27 pinmux_config_pingrp_table(unused_pins_lowpower,
28 ARRAY_SIZE(unused_pins_lowpower));
30 /* Initialize any non-default pad configs (APB_MISC_GP regs) */
31 pinmux_config_drvgrp_table(cardhu_padctrl, ARRAY_SIZE(cardhu_padctrl));
34 #if defined(CONFIG_TEGRA_MMC)
36 * Do I2C/PMU writes to bring up SD card bus power
39 void board_sdmmc_voltage_init(void)
42 uchar reg, data_buffer[1];
46 ret = i2c_get_chip_for_busnum(0, PMU_I2C_ADDRESS, &dev);
48 debug("%s: Cannot find PMIC I2C chip\n", __func__);
52 /* TPS659110: LDO5_REG = 3.3v, ACTIVE to SDMMC1 */
53 data_buffer[0] = 0x65;
56 for (i = 0; i < MAX_I2C_RETRY; ++i) {
57 if (i2c_write(dev, reg, data_buffer, 1))
61 /* TPS659110: GPIO7_REG = PDEN, output a 1 to EN_3V3_SYS */
62 data_buffer[0] = 0x09;
65 for (i = 0; i < MAX_I2C_RETRY; ++i) {
66 if (i2c_write(dev, reg, data_buffer, 1))
72 * Routine: pin_mux_mmc
73 * Description: setup the MMC muxes, power rails, etc.
75 void pin_mux_mmc(void)
78 * NOTE: We don't do mmc-specific pin muxes here.
79 * They were done globally in pinmux_init().
82 /* Bring up the SDIO1 power rail */
83 board_sdmmc_voltage_init();