2011-04-14 12:09:41 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2010,2011
|
|
|
|
* NVIDIA Corporation <www.nvidia.com>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2011-04-14 12:09:41 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/io.h>
|
2012-09-19 22:50:56 +00:00
|
|
|
#include <asm/arch/tegra.h>
|
2014-10-08 20:57:46 +00:00
|
|
|
#include <asm/arch-tegra/board.h>
|
2012-01-11 12:42:28 +00:00
|
|
|
#include <asm/arch/clock.h>
|
|
|
|
#include <asm/arch/funcmux.h>
|
2012-10-22 06:19:36 +00:00
|
|
|
#include <asm/arch/gpio.h>
|
2011-10-31 06:51:35 +00:00
|
|
|
#include <asm/arch/pinmux.h>
|
2011-09-21 12:40:07 +00:00
|
|
|
#include <asm/gpio.h>
|
2011-04-14 12:09:41 +00:00
|
|
|
|
2011-11-05 04:46:51 +00:00
|
|
|
/* TODO: Remove this code when the SPI switch is working */
|
2013-03-16 18:58:02 +00:00
|
|
|
#if (CONFIG_MACH_TYPE != MACH_TYPE_VENTANA)
|
2012-10-22 06:19:36 +00:00
|
|
|
void gpio_early_init_uart(void)
|
2011-04-14 12:09:41 +00:00
|
|
|
{
|
|
|
|
/* Enable UART via GPIO_PI3 (port 8, bit 3) so serial console works */
|
2012-10-22 06:19:36 +00:00
|
|
|
#ifndef CONFIG_SPL_BUILD
|
2011-10-06 12:52:22 +00:00
|
|
|
gpio_request(GPIO_PI3, NULL);
|
2012-10-22 06:19:36 +00:00
|
|
|
#endif
|
2014-09-03 23:37:03 +00:00
|
|
|
tegra_spl_gpio_direction_output(GPIO_PI3, 0);
|
2011-04-14 12:09:41 +00:00
|
|
|
}
|
2011-11-05 04:46:51 +00:00
|
|
|
#endif
|
2011-10-31 06:51:37 +00:00
|
|
|
|
2012-05-22 11:44:48 +00:00
|
|
|
#ifdef CONFIG_TEGRA_MMC
|
2011-10-31 06:51:35 +00:00
|
|
|
/*
|
|
|
|
* Routine: pin_mux_mmc
|
|
|
|
* Description: setup the pin muxes/tristate values for the SDMMC(s)
|
|
|
|
*/
|
2013-02-21 12:31:30 +00:00
|
|
|
void pin_mux_mmc(void)
|
2011-10-31 06:51:35 +00:00
|
|
|
{
|
2012-01-11 12:42:28 +00:00
|
|
|
funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
|
|
|
|
funcmux_select(PERIPH_ID_SDMMC3, FUNCMUX_SDMMC3_SDB_4BIT);
|
2011-10-31 06:51:35 +00:00
|
|
|
|
|
|
|
/* For power GPIO PI6 */
|
2014-03-21 18:28:58 +00:00
|
|
|
pinmux_tristate_disable(PMUX_PINGRP_ATA);
|
2011-10-31 06:51:35 +00:00
|
|
|
/* For CD GPIO PI5 */
|
2014-03-21 18:28:58 +00:00
|
|
|
pinmux_tristate_disable(PMUX_PINGRP_ATC);
|
2011-10-31 06:51:35 +00:00
|
|
|
}
|
2011-09-21 12:40:07 +00:00
|
|
|
#endif
|
2012-02-27 10:52:50 +00:00
|
|
|
|
|
|
|
void pin_mux_usb(void)
|
|
|
|
{
|
|
|
|
/* For USB's GPIO PD0. For now, since we have no pinmux in fdt */
|
2014-03-21 18:28:58 +00:00
|
|
|
pinmux_tristate_disable(PMUX_PINGRP_SLXK);
|
2012-02-27 10:52:50 +00:00
|
|
|
}
|