blob: ea95e432867f5837558446d9ab7cd1d5209b3c5a [file] [log] [blame]
Thierry Redingb1c0c732011-11-17 00:10:24 +00001/*
2 * (C) Copyright 2010,2011
3 * NVIDIA Corporation <www.nvidia.com>
Thierry Redinged900c52012-06-04 20:02:24 +00004 * (C) Copyright 2011-2012
Thierry Redingb1c0c732011-11-17 00:10:24 +00005 * Avionic Design GmbH <www.avionic-design.de>
6 *
7 * See file CREDITS for list of people who contributed to this
8 * project.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA
24 */
25
26#include <common.h>
27#include <ns16550.h>
28#include <asm/io.h>
29#include <asm/gpio.h>
Thierry Redingb1c0c732011-11-17 00:10:24 +000030#include <asm/arch/clock.h>
Simon Glassf4483022012-01-11 12:42:26 +000031#include <asm/arch/funcmux.h>
Thierry Redingb1c0c732011-11-17 00:10:24 +000032#include <asm/arch/pinmux.h>
Tom Warren150c2492012-09-19 15:50:56 -070033#include <asm/arch/tegra.h>
34#include <asm/arch-tegra/board.h>
35#include <asm/arch-tegra/clk_rst.h>
Tom Warren150c2492012-09-19 15:50:56 -070036#include <asm/arch-tegra/sys_proto.h>
37#include <asm/arch-tegra/uart.h>
Thierry Redingb1c0c732011-11-17 00:10:24 +000038
Thierry Reding22d58502012-06-04 20:02:28 +000039#ifdef CONFIG_BOARD_EARLY_INIT_F
40void gpio_early_init(void)
41{
42 gpio_request(GPIO_PI4, NULL);
43 gpio_direction_output(GPIO_PI4, 1);
44}
45#endif
46
Tom Warren1e2d7852012-06-01 08:22:14 +000047#ifdef CONFIG_TEGRA_MMC
Thierry Redingb1c0c732011-11-17 00:10:24 +000048/*
49 * Routine: pin_mux_mmc
50 * Description: setup the pin muxes/tristate values for the SDMMC(s)
51 */
Tom Warrenc9aa8312013-02-21 12:31:30 +000052void pin_mux_mmc(void)
Thierry Redingb1c0c732011-11-17 00:10:24 +000053{
Simon Glassf4483022012-01-11 12:42:26 +000054 funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
Thierry Reding79254542012-06-04 20:02:29 +000055 /* for write-protect GPIO PI6 */
56 pinmux_tristate_disable(PINGRP_ATA);
Thierry Redinged900c52012-06-04 20:02:24 +000057 /* for CD GPIO PH2 */
58 pinmux_tristate_disable(PINGRP_ATD);
Thierry Redingb1c0c732011-11-17 00:10:24 +000059}
Thierry Redingb1c0c732011-11-17 00:10:24 +000060#endif