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/>.
19 #include <asm/arch/pinmux.h>
20 #include <asm/arch/gp_padctrl.h>
21 #include "pinmux-config-dalmore.h"
24 #define BAT_I2C_ADDRESS 0x48 /* TPS65090 charger */
25 #define PMU_I2C_ADDRESS 0x58 /* TPS65913 PMU */
28 * Routine: pinmux_init
29 * Description: Do individual peripheral pinmux configs
31 void pinmux_init(void)
33 pinmux_config_pingrp_table(tegra114_pinmux_set_nontristate,
34 ARRAY_SIZE(tegra114_pinmux_set_nontristate));
36 pinmux_config_pingrp_table(tegra114_pinmux_common,
37 ARRAY_SIZE(tegra114_pinmux_common));
39 pinmux_config_pingrp_table(unused_pins_lowpower,
40 ARRAY_SIZE(unused_pins_lowpower));
42 /* Initialize any non-default pad configs (APB_MISC_GP regs) */
43 pinmux_config_drvgrp_table(dalmore_padctrl,
44 ARRAY_SIZE(dalmore_padctrl));
47 #if defined(CONFIG_TEGRA_MMC)
49 * Do I2C/PMU writes to bring up SD card bus power
52 void board_sdmmc_voltage_init(void)
55 uchar reg, data_buffer[1];
58 ret = i2c_get_chip_for_busnum(0, PMU_I2C_ADDRESS, &dev);
60 debug("%s: Cannot find PMIC I2C chip\n", __func__);
64 /* TPS65913: LDO9_VOLTAGE = 3.3V */
65 data_buffer[0] = 0x31;
68 ret = i2c_write(dev, reg, data_buffer, 1);
70 printf("%s: PMU i2c_write %02X<-%02X returned %d\n",
71 __func__, reg, data_buffer[0], ret);
73 /* TPS65913: LDO9_CTRL = Active */
74 data_buffer[0] = 0x01;
77 ret = i2c_write(dev, reg, data_buffer, 1);
79 printf("%s: PMU i2c_write %02X<-%02X returned %d\n",
80 __func__, reg, data_buffer[0], ret);
82 /* TPS65090: FET6_CTRL = enable output auto discharge, enable FET6 */
83 data_buffer[0] = 0x03;
86 ret = i2c_get_chip_for_busnum(0, BAT_I2C_ADDRESS, &dev);
88 debug("%s: Cannot find charger I2C chip\n", __func__);
91 ret = i2c_write(dev, reg, data_buffer, 1);
93 printf("%s: BAT i2c_write %02X<-%02X returned %d\n",
94 __func__, reg, data_buffer[0], ret);
98 * Routine: pin_mux_mmc
99 * Description: setup the MMC muxes, power rails, etc.
101 void pin_mux_mmc(void)
104 * NOTE: We don't do mmc-specific pin muxes here.
105 * They were done globally in pinmux_init().
108 /* Bring up the SDIO3 power rail */
109 board_sdmmc_voltage_init();