blob: a7a1be3c057204a489e126cb257ff7e5b1523c88 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0
Stephen Warrenf5dc27a2012-01-06 12:14:42 +00002/*
3 * Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved.
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
Stephen Warrenf5dc27a2012-01-06 12:14:42 +00007 */
8
9#include <common.h>
10#include <asm/io.h>
Tom Warrenab371962012-09-19 15:50:56 -070011#include <asm/arch/tegra.h>
Stephen Warrenf5dc27a2012-01-06 12:14:42 +000012#include <asm/arch/pinmux.h>
Stephen Warrenf5dc27a2012-01-06 12:14:42 +000013#include <asm/gpio.h>
Stephen Warrenf5dc27a2012-01-06 12:14:42 +000014
Masahiro Yamadab2c88682017-01-10 13:32:07 +090015#ifdef CONFIG_MMC_SDHCI_TEGRA
Stephen Warrenf5dc27a2012-01-06 12:14:42 +000016/*
17 * Routine: pin_mux_mmc
18 * Description: setup the pin muxes/tristate values for the SDMMC(s)
19 */
Tom Warren9745cf82013-02-21 12:31:30 +000020void pin_mux_mmc(void)
Stephen Warrenf5dc27a2012-01-06 12:14:42 +000021{
22 /* SDMMC4: config 3, x8 on 2nd set of pins */
Stephen Warrenf27f4e82014-03-21 12:28:58 -060023 pinmux_set_func(PMUX_PINGRP_ATB, PMUX_FUNC_SDIO4);
24 pinmux_set_func(PMUX_PINGRP_GMA, PMUX_FUNC_SDIO4);
25 pinmux_set_func(PMUX_PINGRP_GME, PMUX_FUNC_SDIO4);
Stephen Warrenf5dc27a2012-01-06 12:14:42 +000026
Stephen Warrenf27f4e82014-03-21 12:28:58 -060027 pinmux_tristate_disable(PMUX_PINGRP_ATB);
28 pinmux_tristate_disable(PMUX_PINGRP_GMA);
29 pinmux_tristate_disable(PMUX_PINGRP_GME);
Stephen Warrenf5dc27a2012-01-06 12:14:42 +000030
Lucas Stach2249fb62012-05-16 08:21:01 +000031 /* SDIO1: SDIO1_CLK, SDIO1_CMD, SDIO1_DAT[3:0] */
Stephen Warrenf27f4e82014-03-21 12:28:58 -060032 pinmux_set_func(PMUX_PINGRP_SDIO1, PMUX_FUNC_SDIO1);
Stephen Warrenf5dc27a2012-01-06 12:14:42 +000033
Stephen Warrenf27f4e82014-03-21 12:28:58 -060034 pinmux_tristate_disable(PMUX_PINGRP_SDIO1);
Stephen Warrenf5dc27a2012-01-06 12:14:42 +000035
36 /* For power GPIO PV1 */
Stephen Warrenf27f4e82014-03-21 12:28:58 -060037 pinmux_tristate_disable(PMUX_PINGRP_UAC);
Stephen Warren07dde1e2012-05-15 11:58:11 +000038 /* For CD GPIO PV5 */
Stephen Warrenf27f4e82014-03-21 12:28:58 -060039 pinmux_tristate_disable(PMUX_PINGRP_GPV);
Stephen Warrenf5dc27a2012-01-06 12:14:42 +000040}
Stephen Warrenf5dc27a2012-01-06 12:14:42 +000041#endif
Marc Dietrichb81dfe12012-11-25 11:26:12 +000042
Simon Glasse865ef32016-01-30 16:37:56 -070043#ifdef CONFIG_DM_VIDEO
Marc Dietrichb81dfe12012-11-25 11:26:12 +000044/* this is a weak define that we are overriding */
45void pin_mux_display(void)
46{
47 debug("init display pinmux\n");
48
49 /* EN_VDD_PANEL GPIO A4 */
Stephen Warrenf27f4e82014-03-21 12:28:58 -060050 pinmux_tristate_disable(PMUX_PINGRP_DAP2);
Marc Dietrichb81dfe12012-11-25 11:26:12 +000051}
52#endif