1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  *  (C) Copyright 2010,2011
4  *  NVIDIA Corporation <www.nvidia.com>
5  *  (C) Copyright 2011-2012
6  *  Avionic Design GmbH <www.avionic-design.de>
7  */
8 
9 #include <common.h>
10 #include <ns16550.h>
11 #include <asm/io.h>
12 #include <asm/gpio.h>
13 #include <asm/arch/clock.h>
14 #include <asm/arch/funcmux.h>
15 #include <asm/arch/pinmux.h>
16 #include <asm/arch/tegra.h>
17 #include <asm/arch-tegra/board.h>
18 #include <asm/arch-tegra/clk_rst.h>
19 #include <asm/arch-tegra/sys_proto.h>
20 #include <asm/arch-tegra/uart.h>
21 
22 #ifdef CONFIG_BOARD_EARLY_INIT_F
23 void gpio_early_init(void)
24 {
25 	gpio_request(TEGRA_GPIO(I, 4), NULL);
26 	gpio_direction_output(TEGRA_GPIO(I, 4), 1);
27 }
28 #endif
29 
30 #ifdef CONFIG_MMC_SDHCI_TEGRA
31 /*
32  * Routine: pin_mux_mmc
33  * Description: setup the pin muxes/tristate values for the SDMMC(s)
34  */
35 void pin_mux_mmc(void)
36 {
37 	funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
38 	/* for write-protect GPIO PI6 */
39 	pinmux_tristate_disable(PMUX_PINGRP_ATA);
40 	/* for CD GPIO PH2 */
41 	pinmux_tristate_disable(PMUX_PINGRP_ATD);
42 }
43 #endif
44