2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2011-04-14 12:09:41 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2010,2011
|
|
|
|
* NVIDIA Corporation <www.nvidia.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/io.h>
|
2017-06-01 01:47:48 +00:00
|
|
|
#include <asm/mach-types.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 */
|
2016-05-12 18:07:39 +00:00
|
|
|
gpio_request(TEGRA_GPIO(I, 3), "uart_en");
|
|
|
|
gpio_direction_output(TEGRA_GPIO(I, 3), 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
|
|
|
|
2017-01-10 04:32:07 +00:00
|
|
|
#ifdef CONFIG_MMC_SDHCI_TEGRA
|
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)
|
|
|
|
{
|
ARM: tegra: fix ULPI PHY on Ventana and Seaboard
Commit ce02a71c2374 "tegra: dts: Sync tegra20 device tree files with
Linux" enabled the ULPI USB port on Ventana, but made no attempt to ensure
that U-Boot code could handle this. In practice, various code is missing,
and various configuration options are not enabled, which causes U-Boot to
hang when attempting to initialize this USB port. This patch enables ULPI
PHY support on Ventana, and adds the required pinmux setup for the port to
operate. Note that Ventana is so similar to Seaboard that this change is
made in the Seaboard board file, which is shared with Ventana.
Seaboard also has the ULPI USB port wired up in hardware, although to an
internal port that often doesn't have anything attached to it. However,
the DT nodes for the USB controller and PHY had different status property
values, so the port was not initialized by U-Boot. Fix this inconsistency,
and enable the ULPI port, just like in the Linux kernel DT. This likewise
requires enabling ULPI support in the Seaboard defconfig.
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-09-15 18:19:39 +00:00
|
|
|
/* For USB0'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);
|
ARM: tegra: fix ULPI PHY on Ventana and Seaboard
Commit ce02a71c2374 "tegra: dts: Sync tegra20 device tree files with
Linux" enabled the ULPI USB port on Ventana, but made no attempt to ensure
that U-Boot code could handle this. In practice, various code is missing,
and various configuration options are not enabled, which causes U-Boot to
hang when attempting to initialize this USB port. This patch enables ULPI
PHY support on Ventana, and adds the required pinmux setup for the port to
operate. Note that Ventana is so similar to Seaboard that this change is
made in the Seaboard board file, which is shared with Ventana.
Seaboard also has the ULPI USB port wired up in hardware, although to an
internal port that often doesn't have anything attached to it. However,
the DT nodes for the USB controller and PHY had different status property
values, so the port was not initialized by U-Boot. Fix this inconsistency,
and enable the ULPI port, just like in the Linux kernel DT. This likewise
requires enabling ULPI support in the Seaboard defconfig.
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2016-09-15 18:19:39 +00:00
|
|
|
/* For USB1's ULPI signals */
|
|
|
|
funcmux_select(PERIPH_ID_USB2, FUNCMUX_USB2_ULPI);
|
|
|
|
pinmux_set_func(PMUX_PINGRP_CDEV2, PMUX_FUNC_PLLP_OUT4);
|
|
|
|
pinmux_tristate_disable(PMUX_PINGRP_CDEV2);
|
|
|
|
/* USB1 PHY reset GPIO */
|
|
|
|
pinmux_tristate_disable(PMUX_PINGRP_UAC);
|
2012-02-27 10:52:50 +00:00
|
|
|
}
|