blob: b74c21934754c3ca0c9bee9fa37c43cf4d6882d7 [file] [log] [blame]
Tom Warrene1495582011-04-14 12:09:41 +00001/*
2 * (C) Copyright 2010,2011
3 * NVIDIA Corporation <www.nvidia.com>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Tom Warrene1495582011-04-14 12:09:41 +00006 */
7
8#include <common.h>
Stephen Warrenf0083342013-06-18 09:46:51 -06009#include <lcd.h>
Tom Warrene1495582011-04-14 12:09:41 +000010#include <asm/io.h>
Simon Glassd677c8e2012-01-11 12:42:27 +000011#include <asm/arch/clock.h>
12#include <asm/arch/funcmux.h>
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000013#include <asm/arch/pinmux.h>
Tom Warrenab371962012-09-19 15:50:56 -070014#include <asm/arch/tegra.h>
Stephen Warrenfba87542011-10-31 06:51:36 +000015#include <asm/gpio.h>
Tom Warren97bf58f2011-09-21 12:40:07 +000016
Tom Warren8c57e962012-05-22 11:44:48 +000017#ifdef CONFIG_TEGRA_MMC
Tom Warren97bf58f2011-09-21 12:40:07 +000018/*
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000019 * Routine: pin_mux_mmc
20 * Description: setup the pin muxes/tristate values for the SDMMC(s)
21 */
Tom Warren9745cf82013-02-21 12:31:30 +000022void pin_mux_mmc(void)
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000023{
Simon Glassd677c8e2012-01-11 12:42:27 +000024 funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
25 funcmux_select(PERIPH_ID_SDMMC2, FUNCMUX_SDMMC2_DTA_DTD_8BIT);
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000026
27 /* For power GPIO PI6 */
28 pinmux_tristate_disable(PINGRP_ATA);
29 /* For CD GPIO PH2 */
30 pinmux_tristate_disable(PINGRP_ATD);
31
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000032 /* For power GPIO PT3 */
33 pinmux_tristate_disable(PINGRP_DTB);
34 /* For CD GPIO PI5 */
35 pinmux_tristate_disable(PINGRP_ATC);
36}
Tom Warren97bf58f2011-09-21 12:40:07 +000037#endif
Stephen Warrenb03192e2012-10-12 09:45:48 +000038
39void pin_mux_usb(void)
40{
41 funcmux_select(PERIPH_ID_USB2, FUNCMUX_USB2_ULPI);
42 pinmux_set_func(PINGRP_CDEV2, PMUX_FUNC_PLLP_OUT4);
43 pinmux_tristate_disable(PINGRP_CDEV2);
44 /* USB2 PHY reset GPIO */
45 pinmux_tristate_disable(PINGRP_UAC);
46}
Stephen Warrenf0083342013-06-18 09:46:51 -060047
48void pin_mux_display(void)
49{
50 pinmux_set_func(PINGRP_SDC, PMUX_FUNC_PWM);
51 pinmux_tristate_disable(PINGRP_SDC);
52}