blob: 988f057a281cab446f12824a89775ef51878a544 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Thierry Redingb1c0c732011-11-17 00:10:24 +00002/*
3 * (C) Copyright 2010,2011
4 * NVIDIA Corporation <www.nvidia.com>
Thierry Redinged900c52012-06-04 20:02:24 +00005 * (C) Copyright 2011-2012
Thierry Redingb1c0c732011-11-17 00:10:24 +00006 * Avionic Design GmbH <www.avionic-design.de>
Thierry Redingb1c0c732011-11-17 00:10:24 +00007 */
8
9#include <common.h>
10#include <ns16550.h>
11#include <asm/io.h>
12#include <asm/gpio.h>
Thierry Redingb1c0c732011-11-17 00:10:24 +000013#include <asm/arch/clock.h>
Simon Glassf4483022012-01-11 12:42:26 +000014#include <asm/arch/funcmux.h>
Thierry Redingb1c0c732011-11-17 00:10:24 +000015#include <asm/arch/pinmux.h>
Tom Warren150c2492012-09-19 15:50:56 -070016#include <asm/arch/tegra.h>
17#include <asm/arch-tegra/board.h>
18#include <asm/arch-tegra/clk_rst.h>
Tom Warren150c2492012-09-19 15:50:56 -070019#include <asm/arch-tegra/sys_proto.h>
20#include <asm/arch-tegra/uart.h>
Thierry Redingb1c0c732011-11-17 00:10:24 +000021
Thierry Reding22d58502012-06-04 20:02:28 +000022#ifdef CONFIG_BOARD_EARLY_INIT_F
23void gpio_early_init(void)
24{
Stephen Warren01a97a12016-05-12 12:07:39 -060025 gpio_request(TEGRA_GPIO(I, 4), NULL);
26 gpio_direction_output(TEGRA_GPIO(I, 4), 1);
Thierry Reding22d58502012-06-04 20:02:28 +000027}
28#endif
29
Masahiro Yamada1d2c0502017-01-10 13:32:07 +090030#ifdef CONFIG_MMC_SDHCI_TEGRA
Thierry Redingb1c0c732011-11-17 00:10:24 +000031/*
32 * Routine: pin_mux_mmc
33 * Description: setup the pin muxes/tristate values for the SDMMC(s)
34 */
Tom Warrenc9aa8312013-02-21 12:31:30 +000035void pin_mux_mmc(void)
Thierry Redingb1c0c732011-11-17 00:10:24 +000036{
Simon Glassf4483022012-01-11 12:42:26 +000037 funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
Thierry Reding79254542012-06-04 20:02:29 +000038 /* for write-protect GPIO PI6 */
Stephen Warren70ad3752014-03-21 12:28:58 -060039 pinmux_tristate_disable(PMUX_PINGRP_ATA);
Thierry Redinged900c52012-06-04 20:02:24 +000040 /* for CD GPIO PH2 */
Stephen Warren70ad3752014-03-21 12:28:58 -060041 pinmux_tristate_disable(PMUX_PINGRP_ATD);
Thierry Redingb1c0c732011-11-17 00:10:24 +000042}
Thierry Redingb1c0c732011-11-17 00:10:24 +000043#endif