1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  *  (C) Copyright 2010-2012
4  *  NVIDIA Corporation <www.nvidia.com>
5  */
6 
7 #include <common.h>
8 #include <asm/io.h>
9 #include <asm/arch/tegra.h>
10 #include <asm/arch/clock.h>
11 #include <asm/arch/funcmux.h>
12 #include <asm/arch/pinmux.h>
13 #include <asm/gpio.h>
14 #include <i2c.h>
15 
16 void pin_mux_usb(void)
17 {
18 	/*
19 	 * USB1 internal/external mux GPIO, which masquerades as a VBUS GPIO
20 	 * in the current device tree.
21 	 */
22 	pinmux_tristate_disable(PMUX_PINGRP_UAC);
23 }
24 
25 void pin_mux_spi(void)
26 {
27 	funcmux_select(PERIPH_ID_SPI1, FUNCMUX_SPI1_GMC_GMD);
28 }
29 
30 /*
31  * Routine: pin_mux_mmc
32  * Description: setup the pin muxes/tristate values for the SDMMC(s)
33  */
34 void pin_mux_mmc(void)
35 {
36 	funcmux_select(PERIPH_ID_SDMMC1, FUNCMUX_SDMMC1_SDIO1_4BIT);
37 	funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_4_BIT);
38 
39 	/* For CD GPIO PP1 */
40 	pinmux_tristate_disable(PMUX_PINGRP_DAP3);
41 }
42