blob: da14e09c40cc4e0a7932d3fb9f00d9eddc29d5e8 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Tom Warrene1495582011-04-14 12:09:41 +00002/*
3 * (C) Copyright 2010,2011
4 * NVIDIA Corporation <www.nvidia.com>
Tom Warrene1495582011-04-14 12:09:41 +00005 */
6
Tom Warrene1495582011-04-14 12:09:41 +00007#include <asm/io.h>
Simon Glassd677c8e2012-01-11 12:42:27 +00008#include <asm/arch/clock.h>
9#include <asm/arch/funcmux.h>
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000010#include <asm/arch/pinmux.h>
Tom Warrenab371962012-09-19 15:50:56 -070011#include <asm/arch/tegra.h>
Stephen Warrenfba87542011-10-31 06:51:36 +000012#include <asm/gpio.h>
Tom Warren97bf58f2011-09-21 12:40:07 +000013
Masahiro Yamadab2c88682017-01-10 13:32:07 +090014#ifdef CONFIG_MMC_SDHCI_TEGRA
Tom Warren97bf58f2011-09-21 12:40:07 +000015/*
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000016 * Routine: pin_mux_mmc
17 * Description: setup the pin muxes/tristate values for the SDMMC(s)
18 */
Tom Warren9745cf82013-02-21 12:31:30 +000019void pin_mux_mmc(void)
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000020{
Simon Glassd677c8e2012-01-11 12:42:27 +000021 funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
22 funcmux_select(PERIPH_ID_SDMMC2, FUNCMUX_SDMMC2_DTA_DTD_8BIT);
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000023
24 /* For power GPIO PI6 */
Stephen Warrenf27f4e82014-03-21 12:28:58 -060025 pinmux_tristate_disable(PMUX_PINGRP_ATA);
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000026 /* For CD GPIO PH2 */
Stephen Warrenf27f4e82014-03-21 12:28:58 -060027 pinmux_tristate_disable(PMUX_PINGRP_ATD);
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000028
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000029 /* For power GPIO PT3 */
Stephen Warrenf27f4e82014-03-21 12:28:58 -060030 pinmux_tristate_disable(PMUX_PINGRP_DTB);
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000031 /* For CD GPIO PI5 */
Stephen Warrenf27f4e82014-03-21 12:28:58 -060032 pinmux_tristate_disable(PMUX_PINGRP_ATC);
Stephen Warrenf8eac0d2011-10-31 06:51:35 +000033}
Tom Warren97bf58f2011-09-21 12:40:07 +000034#endif
Stephen Warrenb03192e2012-10-12 09:45:48 +000035
36void pin_mux_usb(void)
37{
38 funcmux_select(PERIPH_ID_USB2, FUNCMUX_USB2_ULPI);
Stephen Warrenf27f4e82014-03-21 12:28:58 -060039 pinmux_set_func(PMUX_PINGRP_CDEV2, PMUX_FUNC_PLLP_OUT4);
40 pinmux_tristate_disable(PMUX_PINGRP_CDEV2);
Stephen Warrenb03192e2012-10-12 09:45:48 +000041 /* USB2 PHY reset GPIO */
Stephen Warrenf27f4e82014-03-21 12:28:58 -060042 pinmux_tristate_disable(PMUX_PINGRP_UAC);
Stephen Warrenb03192e2012-10-12 09:45:48 +000043}
Stephen Warrenf0083342013-06-18 09:46:51 -060044
45void pin_mux_display(void)
46{
Stephen Warrenf27f4e82014-03-21 12:28:58 -060047 pinmux_set_func(PMUX_PINGRP_SDC, PMUX_FUNC_PWM);
48 pinmux_tristate_disable(PMUX_PINGRP_SDC);
Stephen Warrenf0083342013-06-18 09:46:51 -060049}