Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Tom Warren | e149558 | 2011-04-14 12:09:41 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2010,2011 |
| 4 | * NVIDIA Corporation <www.nvidia.com> |
Tom Warren | e149558 | 2011-04-14 12:09:41 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
Tom Warren | e149558 | 2011-04-14 12:09:41 +0000 | [diff] [blame] | 7 | #include <asm/io.h> |
Simon Glass | d677c8e | 2012-01-11 12:42:27 +0000 | [diff] [blame] | 8 | #include <asm/arch/clock.h> |
| 9 | #include <asm/arch/funcmux.h> |
Stephen Warren | f8eac0d | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 10 | #include <asm/arch/pinmux.h> |
Tom Warren | ab37196 | 2012-09-19 15:50:56 -0700 | [diff] [blame] | 11 | #include <asm/arch/tegra.h> |
Stephen Warren | fba8754 | 2011-10-31 06:51:36 +0000 | [diff] [blame] | 12 | #include <asm/gpio.h> |
Tom Warren | 97bf58f | 2011-09-21 12:40:07 +0000 | [diff] [blame] | 13 | |
Masahiro Yamada | b2c8868 | 2017-01-10 13:32:07 +0900 | [diff] [blame] | 14 | #ifdef CONFIG_MMC_SDHCI_TEGRA |
Tom Warren | 97bf58f | 2011-09-21 12:40:07 +0000 | [diff] [blame] | 15 | /* |
Stephen Warren | f8eac0d | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 16 | * Routine: pin_mux_mmc |
| 17 | * Description: setup the pin muxes/tristate values for the SDMMC(s) |
| 18 | */ |
Tom Warren | 9745cf8 | 2013-02-21 12:31:30 +0000 | [diff] [blame] | 19 | void pin_mux_mmc(void) |
Stephen Warren | f8eac0d | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 20 | { |
Simon Glass | d677c8e | 2012-01-11 12:42:27 +0000 | [diff] [blame] | 21 | funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT); |
| 22 | funcmux_select(PERIPH_ID_SDMMC2, FUNCMUX_SDMMC2_DTA_DTD_8BIT); |
Stephen Warren | f8eac0d | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 23 | |
| 24 | /* For power GPIO PI6 */ |
Stephen Warren | f27f4e8 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 25 | pinmux_tristate_disable(PMUX_PINGRP_ATA); |
Stephen Warren | f8eac0d | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 26 | /* For CD GPIO PH2 */ |
Stephen Warren | f27f4e8 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 27 | pinmux_tristate_disable(PMUX_PINGRP_ATD); |
Stephen Warren | f8eac0d | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 28 | |
Stephen Warren | f8eac0d | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 29 | /* For power GPIO PT3 */ |
Stephen Warren | f27f4e8 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 30 | pinmux_tristate_disable(PMUX_PINGRP_DTB); |
Stephen Warren | f8eac0d | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 31 | /* For CD GPIO PI5 */ |
Stephen Warren | f27f4e8 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 32 | pinmux_tristate_disable(PMUX_PINGRP_ATC); |
Stephen Warren | f8eac0d | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 33 | } |
Tom Warren | 97bf58f | 2011-09-21 12:40:07 +0000 | [diff] [blame] | 34 | #endif |
Stephen Warren | b03192e | 2012-10-12 09:45:48 +0000 | [diff] [blame] | 35 | |
| 36 | void pin_mux_usb(void) |
| 37 | { |
| 38 | funcmux_select(PERIPH_ID_USB2, FUNCMUX_USB2_ULPI); |
Stephen Warren | f27f4e8 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 39 | pinmux_set_func(PMUX_PINGRP_CDEV2, PMUX_FUNC_PLLP_OUT4); |
| 40 | pinmux_tristate_disable(PMUX_PINGRP_CDEV2); |
Stephen Warren | b03192e | 2012-10-12 09:45:48 +0000 | [diff] [blame] | 41 | /* USB2 PHY reset GPIO */ |
Stephen Warren | f27f4e8 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 42 | pinmux_tristate_disable(PMUX_PINGRP_UAC); |
Stephen Warren | b03192e | 2012-10-12 09:45:48 +0000 | [diff] [blame] | 43 | } |
Stephen Warren | f008334 | 2013-06-18 09:46:51 -0600 | [diff] [blame] | 44 | |
| 45 | void pin_mux_display(void) |
| 46 | { |
Stephen Warren | f27f4e8 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 47 | pinmux_set_func(PMUX_PINGRP_SDC, PMUX_FUNC_PWM); |
| 48 | pinmux_tristate_disable(PMUX_PINGRP_SDC); |
Stephen Warren | f008334 | 2013-06-18 09:46:51 -0600 | [diff] [blame] | 49 | } |