blob: dd56a39cafbda0513c0078a4f692cbe59b805c4f [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Tom Warrenf4ef6662011-04-14 12:09:41 +00002/*
3 * (C) Copyright 2010,2011
4 * NVIDIA Corporation <www.nvidia.com>
Tom Warrenf4ef6662011-04-14 12:09:41 +00005 */
6
7#include <common.h>
Stephen Warrenb46694d2013-06-18 09:46:51 -06008#include <lcd.h>
Tom Warrenf4ef6662011-04-14 12:09:41 +00009#include <asm/io.h>
Simon Glasse712e542012-01-11 12:42:27 +000010#include <asm/arch/clock.h>
11#include <asm/arch/funcmux.h>
Stephen Warrenae036612011-10-31 06:51:35 +000012#include <asm/arch/pinmux.h>
Tom Warren150c2492012-09-19 15:50:56 -070013#include <asm/arch/tegra.h>
Stephen Warren98778412011-10-31 06:51:36 +000014#include <asm/gpio.h>
Tom Warrenccf79882011-09-21 12:40:07 +000015
Masahiro Yamada1d2c0502017-01-10 13:32:07 +090016#ifdef CONFIG_MMC_SDHCI_TEGRA
Tom Warrenccf79882011-09-21 12:40:07 +000017/*
Stephen Warrenae036612011-10-31 06:51:35 +000018 * 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 Warrenae036612011-10-31 06:51:35 +000022{
Simon Glasse712e542012-01-11 12:42:27 +000023 funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
24 funcmux_select(PERIPH_ID_SDMMC2, FUNCMUX_SDMMC2_DTA_DTD_8BIT);
Stephen Warrenae036612011-10-31 06:51:35 +000025
26 /* For power GPIO PI6 */
Stephen Warren70ad3752014-03-21 12:28:58 -060027 pinmux_tristate_disable(PMUX_PINGRP_ATA);
Stephen Warrenae036612011-10-31 06:51:35 +000028 /* For CD GPIO PH2 */
Stephen Warren70ad3752014-03-21 12:28:58 -060029 pinmux_tristate_disable(PMUX_PINGRP_ATD);
Stephen Warrenae036612011-10-31 06:51:35 +000030
Stephen Warrenae036612011-10-31 06:51:35 +000031 /* For power GPIO PT3 */
Stephen Warren70ad3752014-03-21 12:28:58 -060032 pinmux_tristate_disable(PMUX_PINGRP_DTB);
Stephen Warrenae036612011-10-31 06:51:35 +000033 /* For CD GPIO PI5 */
Stephen Warren70ad3752014-03-21 12:28:58 -060034 pinmux_tristate_disable(PMUX_PINGRP_ATC);
Stephen Warrenae036612011-10-31 06:51:35 +000035}
Tom Warrenccf79882011-09-21 12:40:07 +000036#endif
Stephen Warren699c40e2012-10-12 09:45:48 +000037
38void pin_mux_usb(void)
39{
40 funcmux_select(PERIPH_ID_USB2, FUNCMUX_USB2_ULPI);
Stephen Warren70ad3752014-03-21 12:28:58 -060041 pinmux_set_func(PMUX_PINGRP_CDEV2, PMUX_FUNC_PLLP_OUT4);
42 pinmux_tristate_disable(PMUX_PINGRP_CDEV2);
Stephen Warren699c40e2012-10-12 09:45:48 +000043 /* USB2 PHY reset GPIO */
Stephen Warren70ad3752014-03-21 12:28:58 -060044 pinmux_tristate_disable(PMUX_PINGRP_UAC);
Stephen Warren699c40e2012-10-12 09:45:48 +000045}
Stephen Warrenb46694d2013-06-18 09:46:51 -060046
47void pin_mux_display(void)
48{
Stephen Warren70ad3752014-03-21 12:28:58 -060049 pinmux_set_func(PMUX_PINGRP_SDC, PMUX_FUNC_PWM);
50 pinmux_tristate_disable(PMUX_PINGRP_SDC);
Stephen Warrenb46694d2013-06-18 09:46:51 -060051}