blob: 64d0860d213944d198220c9ae9c70655d6d8a570 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0
Stephen Warren2996e2d2012-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 Warren2996e2d2012-01-06 12:14:42 +00007 */
8
9#include <common.h>
Simon Glassf7ae49f2020-05-10 11:40:05 -060010#include <log.h>
Stephen Warren2996e2d2012-01-06 12:14:42 +000011#include <asm/io.h>
Tom Warren150c2492012-09-19 15:50:56 -070012#include <asm/arch/tegra.h>
Stephen Warren2996e2d2012-01-06 12:14:42 +000013#include <asm/arch/pinmux.h>
Stephen Warren2996e2d2012-01-06 12:14:42 +000014#include <asm/gpio.h>
Stephen Warren2996e2d2012-01-06 12:14:42 +000015
Masahiro Yamada1d2c0502017-01-10 13:32:07 +090016#ifdef CONFIG_MMC_SDHCI_TEGRA
Stephen Warren2996e2d2012-01-06 12:14:42 +000017/*
18 * Routine: pin_mux_mmc
19 * Description: setup the pin muxes/tristate values for the SDMMC(s)
20 */
Tom Warrenc9aa8312013-02-21 12:31:30 +000021void pin_mux_mmc(void)
Stephen Warren2996e2d2012-01-06 12:14:42 +000022{
23 /* SDMMC4: config 3, x8 on 2nd set of pins */
Stephen Warren70ad3752014-03-21 12:28:58 -060024 pinmux_set_func(PMUX_PINGRP_ATB, PMUX_FUNC_SDIO4);
25 pinmux_set_func(PMUX_PINGRP_GMA, PMUX_FUNC_SDIO4);
26 pinmux_set_func(PMUX_PINGRP_GME, PMUX_FUNC_SDIO4);
Stephen Warren2996e2d2012-01-06 12:14:42 +000027
Stephen Warren70ad3752014-03-21 12:28:58 -060028 pinmux_tristate_disable(PMUX_PINGRP_ATB);
29 pinmux_tristate_disable(PMUX_PINGRP_GMA);
30 pinmux_tristate_disable(PMUX_PINGRP_GME);
Stephen Warren2996e2d2012-01-06 12:14:42 +000031
Lucas Stachffec1eb2012-05-16 08:21:01 +000032 /* SDIO1: SDIO1_CLK, SDIO1_CMD, SDIO1_DAT[3:0] */
Stephen Warren70ad3752014-03-21 12:28:58 -060033 pinmux_set_func(PMUX_PINGRP_SDIO1, PMUX_FUNC_SDIO1);
Stephen Warren2996e2d2012-01-06 12:14:42 +000034
Stephen Warren70ad3752014-03-21 12:28:58 -060035 pinmux_tristate_disable(PMUX_PINGRP_SDIO1);
Stephen Warren2996e2d2012-01-06 12:14:42 +000036
37 /* For power GPIO PV1 */
Stephen Warren70ad3752014-03-21 12:28:58 -060038 pinmux_tristate_disable(PMUX_PINGRP_UAC);
Stephen Warrenaa53c7f2012-05-15 11:58:11 +000039 /* For CD GPIO PV5 */
Stephen Warren70ad3752014-03-21 12:28:58 -060040 pinmux_tristate_disable(PMUX_PINGRP_GPV);
Stephen Warren2996e2d2012-01-06 12:14:42 +000041}
Stephen Warren2996e2d2012-01-06 12:14:42 +000042#endif
Marc Dietrich25dccd62012-11-25 11:26:12 +000043
Simon Glass9e6866d2016-01-30 16:37:56 -070044#ifdef CONFIG_DM_VIDEO
Marc Dietrich25dccd62012-11-25 11:26:12 +000045/* this is a weak define that we are overriding */
46void pin_mux_display(void)
47{
48 debug("init display pinmux\n");
49
50 /* EN_VDD_PANEL GPIO A4 */
Stephen Warren70ad3752014-03-21 12:28:58 -060051 pinmux_tristate_disable(PMUX_PINGRP_DAP2);
Marc Dietrich25dccd62012-11-25 11:26:12 +000052}
53#endif