2 * (C) Copyright 2010-2012
3 * NVIDIA Corporation <www.nvidia.com>
5 * SPDX-License-Identifier: GPL-2.0+
11 #include <asm/arch/tegra.h>
12 #include <asm/arch/clock.h>
13 #include <asm/arch/funcmux.h>
14 #include <asm/arch/pinmux.h>
18 #ifdef CONFIG_TEGRA_MMC
20 * Routine: pin_mux_mmc
21 * Description: setup the pin muxes/tristate values for the SDMMC(s)
23 void pin_mux_mmc(void)
29 /* Turn on MAX8907B LDO12 to 2.8V for J40 power */
30 ret = i2c_get_chip_for_busnum(0, 0x3c, 1, &dev);
32 printf("%s: Cannot find MAX8907B I2C chip\n", __func__);
36 ret = dm_i2c_write(dev, 0x46, &val, 1);
38 printf("i2c_write 0 0x3c 0x46 failed: %d\n", ret);
40 ret = dm_i2c_write(dev, 0x45, &val, 1);
42 printf("i2c_write 0 0x3c 0x45 failed: %d\n", ret);
44 ret = dm_i2c_write(dev, 0x44, &val, 1);
46 printf("i2c_write 0 0x3c 0x44 failed: %d\n", ret);
48 funcmux_select(PERIPH_ID_SDMMC3, FUNCMUX_SDMMC3_SDB_SLXA_8BIT);
49 funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATC_ATD_8BIT);
53 /* this is a weak define that we are overriding */
54 void pin_mux_usb(void)
61 * This is a hack. This should be represented in DT using the
62 * vbus-gpio property. However, U-Boot's DT support doesn't
63 * support any GPIO controller other than the Tegra's yet.
66 /* Turn on TAC6416's GPIO 0+1 for USB1/3's VBUS */
67 ret = i2c_get_chip_for_busnum(0, 0x20, 1, &dev);
69 printf("%s: Cannot find TAC6416 I2C chip\n", __func__);
73 ret = dm_i2c_write(dev, 2, &val, 1);
75 printf("i2c_write 0 0x20 2 failed: %d\n", ret);
77 ret = dm_i2c_write(dev, 6, &val, 1);
79 printf("i2c_write 0 0x20 6 failed: %d\n", ret);