blob: 462ab05556c86ae7f7641dcd93399bfcb71279a1 [file] [log] [blame]
Stephen Warren2996e2d2012-01-06 12:14:42 +00001/*
2 * Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved.
3 *
4 * See file CREDITS for list of people who contributed to this
5 * project.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License,
9 * version 2, as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 */
16
17#include <common.h>
18#include <asm/io.h>
Tom Warren150c2492012-09-19 15:50:56 -070019#include <asm/arch/tegra.h>
Stephen Warren2996e2d2012-01-06 12:14:42 +000020#include <asm/arch/pinmux.h>
Stephen Warren2996e2d2012-01-06 12:14:42 +000021#include <asm/gpio.h>
Stephen Warren2996e2d2012-01-06 12:14:42 +000022
Tom Warren1e2d7852012-06-01 08:22:14 +000023#ifdef CONFIG_TEGRA_MMC
Stephen Warren2996e2d2012-01-06 12:14:42 +000024/*
25 * Routine: pin_mux_mmc
26 * Description: setup the pin muxes/tristate values for the SDMMC(s)
27 */
Tom Warrenc9aa8312013-02-21 12:31:30 +000028void pin_mux_mmc(void)
Stephen Warren2996e2d2012-01-06 12:14:42 +000029{
30 /* SDMMC4: config 3, x8 on 2nd set of pins */
Stephen Warren70ad3752014-03-21 12:28:58 -060031 pinmux_set_func(PMUX_PINGRP_ATB, PMUX_FUNC_SDIO4);
32 pinmux_set_func(PMUX_PINGRP_GMA, PMUX_FUNC_SDIO4);
33 pinmux_set_func(PMUX_PINGRP_GME, PMUX_FUNC_SDIO4);
Stephen Warren2996e2d2012-01-06 12:14:42 +000034
Stephen Warren70ad3752014-03-21 12:28:58 -060035 pinmux_tristate_disable(PMUX_PINGRP_ATB);
36 pinmux_tristate_disable(PMUX_PINGRP_GMA);
37 pinmux_tristate_disable(PMUX_PINGRP_GME);
Stephen Warren2996e2d2012-01-06 12:14:42 +000038
Lucas Stachffec1eb2012-05-16 08:21:01 +000039 /* SDIO1: SDIO1_CLK, SDIO1_CMD, SDIO1_DAT[3:0] */
Stephen Warren70ad3752014-03-21 12:28:58 -060040 pinmux_set_func(PMUX_PINGRP_SDIO1, PMUX_FUNC_SDIO1);
Stephen Warren2996e2d2012-01-06 12:14:42 +000041
Stephen Warren70ad3752014-03-21 12:28:58 -060042 pinmux_tristate_disable(PMUX_PINGRP_SDIO1);
Stephen Warren2996e2d2012-01-06 12:14:42 +000043
44 /* For power GPIO PV1 */
Stephen Warren70ad3752014-03-21 12:28:58 -060045 pinmux_tristate_disable(PMUX_PINGRP_UAC);
Stephen Warrenaa53c7f2012-05-15 11:58:11 +000046 /* For CD GPIO PV5 */
Stephen Warren70ad3752014-03-21 12:28:58 -060047 pinmux_tristate_disable(PMUX_PINGRP_GPV);
Stephen Warren2996e2d2012-01-06 12:14:42 +000048}
Stephen Warren2996e2d2012-01-06 12:14:42 +000049#endif
Marc Dietrich25dccd62012-11-25 11:26:12 +000050
51#ifdef CONFIG_LCD
52/* this is a weak define that we are overriding */
53void pin_mux_display(void)
54{
55 debug("init display pinmux\n");
56
57 /* EN_VDD_PANEL GPIO A4 */
Stephen Warren70ad3752014-03-21 12:28:58 -060058 pinmux_tristate_disable(PMUX_PINGRP_DAP2);
Marc Dietrich25dccd62012-11-25 11:26:12 +000059}
60#endif