2 * (C) Copyright 2010-2012
3 * NVIDIA Corporation <www.nvidia.com>
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/arch/tegra.h>
11 #include <asm/arch/clock.h>
12 #include <asm/arch/funcmux.h>
13 #include <asm/arch/pinmux.h>
17 #ifdef CONFIG_TEGRA_MMC
19 * Routine: pin_mux_mmc
20 * Description: setup the pin muxes/tristate values for the SDMMC(s)
22 void pin_mux_mmc(void)
27 /* Turn on MAX8907B LDO12 to 2.8V for J40 power */
28 ret = i2c_set_bus_num(0);
30 printf("i2c_set_bus_num failed: %d\n", ret);
32 ret = i2c_write(0x3c, 0x46, 1, &val, 1);
34 printf("i2c_write 0 0x3c 0x46 failed: %d\n", ret);
36 ret = i2c_write(0x3c, 0x45, 1, &val, 1);
38 printf("i2c_write 0 0x3c 0x45 failed: %d\n", ret);
40 ret = i2c_write(0x3c, 0x44, 1, &val, 1);
42 printf("i2c_write 0 0x3c 0x44 failed: %d\n", ret);
44 funcmux_select(PERIPH_ID_SDMMC3, FUNCMUX_SDMMC3_SDB_SLXA_8BIT);
45 funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATC_ATD_8BIT);
49 /* this is a weak define that we are overriding */
50 void pin_mux_usb(void)
56 * This is a hack. This should be represented in DT using the
57 * vbus-gpio property. However, U-Boot's DT support doesn't
58 * support any GPIO controller other than the Tegra's yet.
61 /* Turn on TAC6416's GPIO 0+1 for USB1/3's VBUS */
62 ret = i2c_set_bus_num(0);
64 printf("i2c_set_bus_num failed: %d\n", ret);
66 ret = i2c_write(0x20, 2, 1, &val, 1);
68 printf("i2c_write 0 0x20 2 failed: %d\n", ret);
70 ret = i2c_write(0x20, 6, 1, &val, 1);
72 printf("i2c_write 0 0x20 6 failed: %d\n", ret);