2 * Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include <asm/arch/pinmux.h>
19 #include <asm/arch/gp_padctrl.h>
20 #include "pinmux-config-dalmore.h"
23 #define BAT_I2C_ADDRESS 0x48 /* TPS65090 charger */
24 #define PMU_I2C_ADDRESS 0x58 /* TPS65913 PMU */
27 * Routine: pinmux_init
28 * Description: Do individual peripheral pinmux configs
30 void pinmux_init(void)
32 pinmux_config_table(tegra114_pinmux_set_nontristate,
33 ARRAY_SIZE(tegra114_pinmux_set_nontristate));
35 pinmux_config_table(tegra114_pinmux_common,
36 ARRAY_SIZE(tegra114_pinmux_common));
38 pinmux_config_table(unused_pins_lowpower,
39 ARRAY_SIZE(unused_pins_lowpower));
41 /* Initialize any non-default pad configs (APB_MISC_GP regs) */
42 padgrp_config_table(dalmore_padctrl, ARRAY_SIZE(dalmore_padctrl));
45 #if defined(CONFIG_TEGRA_MMC)
47 * Do I2C/PMU writes to bring up SD card bus power
50 void board_sdmmc_voltage_init(void)
52 uchar reg, data_buffer[1];
55 ret = i2c_set_bus_num(0);/* PMU is on bus 0 */
57 printf("%s: i2c_set_bus_num returned %d\n", __func__, ret);
59 /* TPS65913: LDO9_VOLTAGE = 3.3V */
60 data_buffer[0] = 0x31;
63 ret = i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1);
65 printf("%s: PMU i2c_write %02X<-%02X returned %d\n",
66 __func__, reg, data_buffer[0], ret);
68 /* TPS65913: LDO9_CTRL = Active */
69 data_buffer[0] = 0x01;
72 ret = i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1);
74 printf("%s: PMU i2c_write %02X<-%02X returned %d\n",
75 __func__, reg, data_buffer[0], ret);
77 /* TPS65090: FET6_CTRL = enable output auto discharge, enable FET6 */
78 data_buffer[0] = 0x03;
81 ret = i2c_write(BAT_I2C_ADDRESS, reg, 1, data_buffer, 1);
83 printf("%s: BAT i2c_write %02X<-%02X returned %d\n",
84 __func__, reg, data_buffer[0], ret);
88 * Routine: pin_mux_mmc
89 * Description: setup the MMC muxes, power rails, etc.
91 void pin_mux_mmc(void)
94 * NOTE: We don't do mmc-specific pin muxes here.
95 * They were done globally in pinmux_init().
98 /* Bring up the SDIO3 power rail */
99 board_sdmmc_voltage_init();