Tom Warren | f4ef666 | 2011-04-14 12:09:41 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2010,2011 |
| 3 | * NVIDIA Corporation <www.nvidia.com> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Tom Warren | f4ef666 | 2011-04-14 12:09:41 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
Stephen Warren | b46694d | 2013-06-18 09:46:51 -0600 | [diff] [blame] | 9 | #include <lcd.h> |
Tom Warren | f4ef666 | 2011-04-14 12:09:41 +0000 | [diff] [blame] | 10 | #include <asm/io.h> |
Simon Glass | e712e54 | 2012-01-11 12:42:27 +0000 | [diff] [blame] | 11 | #include <asm/arch/clock.h> |
| 12 | #include <asm/arch/funcmux.h> |
Stephen Warren | ae03661 | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 13 | #include <asm/arch/pinmux.h> |
Tom Warren | 150c249 | 2012-09-19 15:50:56 -0700 | [diff] [blame] | 14 | #include <asm/arch/tegra.h> |
Stephen Warren | 9877841 | 2011-10-31 06:51:36 +0000 | [diff] [blame] | 15 | #include <asm/gpio.h> |
Tom Warren | ccf7988 | 2011-09-21 12:40:07 +0000 | [diff] [blame] | 16 | |
Tom Warren | 3f82d89 | 2012-05-22 11:44:48 +0000 | [diff] [blame] | 17 | #ifdef CONFIG_TEGRA_MMC |
Tom Warren | ccf7988 | 2011-09-21 12:40:07 +0000 | [diff] [blame] | 18 | /* |
Stephen Warren | ae03661 | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 19 | * Routine: pin_mux_mmc |
| 20 | * Description: setup the pin muxes/tristate values for the SDMMC(s) |
| 21 | */ |
Tom Warren | c9aa831 | 2013-02-21 12:31:30 +0000 | [diff] [blame] | 22 | void pin_mux_mmc(void) |
Stephen Warren | ae03661 | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 23 | { |
Simon Glass | e712e54 | 2012-01-11 12:42:27 +0000 | [diff] [blame] | 24 | funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT); |
| 25 | funcmux_select(PERIPH_ID_SDMMC2, FUNCMUX_SDMMC2_DTA_DTD_8BIT); |
Stephen Warren | ae03661 | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 26 | |
| 27 | /* For power GPIO PI6 */ |
Stephen Warren | 70ad375 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 28 | pinmux_tristate_disable(PMUX_PINGRP_ATA); |
Stephen Warren | ae03661 | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 29 | /* For CD GPIO PH2 */ |
Stephen Warren | 70ad375 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 30 | pinmux_tristate_disable(PMUX_PINGRP_ATD); |
Stephen Warren | ae03661 | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 31 | |
Stephen Warren | ae03661 | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 32 | /* For power GPIO PT3 */ |
Stephen Warren | 70ad375 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 33 | pinmux_tristate_disable(PMUX_PINGRP_DTB); |
Stephen Warren | ae03661 | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 34 | /* For CD GPIO PI5 */ |
Stephen Warren | 70ad375 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 35 | pinmux_tristate_disable(PMUX_PINGRP_ATC); |
Stephen Warren | ae03661 | 2011-10-31 06:51:35 +0000 | [diff] [blame] | 36 | } |
Tom Warren | ccf7988 | 2011-09-21 12:40:07 +0000 | [diff] [blame] | 37 | #endif |
Stephen Warren | 699c40e | 2012-10-12 09:45:48 +0000 | [diff] [blame] | 38 | |
| 39 | void pin_mux_usb(void) |
| 40 | { |
| 41 | funcmux_select(PERIPH_ID_USB2, FUNCMUX_USB2_ULPI); |
Stephen Warren | 70ad375 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 42 | pinmux_set_func(PMUX_PINGRP_CDEV2, PMUX_FUNC_PLLP_OUT4); |
| 43 | pinmux_tristate_disable(PMUX_PINGRP_CDEV2); |
Stephen Warren | 699c40e | 2012-10-12 09:45:48 +0000 | [diff] [blame] | 44 | /* USB2 PHY reset GPIO */ |
Stephen Warren | 70ad375 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 45 | pinmux_tristate_disable(PMUX_PINGRP_UAC); |
Stephen Warren | 699c40e | 2012-10-12 09:45:48 +0000 | [diff] [blame] | 46 | } |
Stephen Warren | b46694d | 2013-06-18 09:46:51 -0600 | [diff] [blame] | 47 | |
| 48 | void pin_mux_display(void) |
| 49 | { |
Stephen Warren | 70ad375 | 2014-03-21 12:28:58 -0600 | [diff] [blame] | 50 | pinmux_set_func(PMUX_PINGRP_SDC, PMUX_FUNC_PWM); |
| 51 | pinmux_tristate_disable(PMUX_PINGRP_SDC); |
Stephen Warren | b46694d | 2013-06-18 09:46:51 -0600 | [diff] [blame] | 52 | } |