xref: /rk3399_rockchip-uboot/board/avionic-design/common/tamonten.c (revision c9aa831ee26f629fbd2df67cab8bb357777e2256)
1b1c0c736SThierry Reding /*
2b1c0c736SThierry Reding  *  (C) Copyright 2010,2011
3b1c0c736SThierry Reding  *  NVIDIA Corporation <www.nvidia.com>
4ed900c55SThierry Reding  *  (C) Copyright 2011-2012
5b1c0c736SThierry Reding  *  Avionic Design GmbH <www.avionic-design.de>
6b1c0c736SThierry Reding  *
7b1c0c736SThierry Reding  * See file CREDITS for list of people who contributed to this
8b1c0c736SThierry Reding  * project.
9b1c0c736SThierry Reding  *
10b1c0c736SThierry Reding  * This program is free software; you can redistribute it and/or
11b1c0c736SThierry Reding  * modify it under the terms of the GNU General Public License as
12b1c0c736SThierry Reding  * published by the Free Software Foundation; either version 2 of
13b1c0c736SThierry Reding  * the License, or (at your option) any later version.
14b1c0c736SThierry Reding  *
15b1c0c736SThierry Reding  * This program is distributed in the hope that it will be useful,
16b1c0c736SThierry Reding  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17b1c0c736SThierry Reding  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18b1c0c736SThierry Reding  * GNU General Public License for more details.
19b1c0c736SThierry Reding  *
20b1c0c736SThierry Reding  * You should have received a copy of the GNU General Public License
21b1c0c736SThierry Reding  * along with this program; if not, write to the Free Software
22b1c0c736SThierry Reding  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23b1c0c736SThierry Reding  * MA 02111-1307 USA
24b1c0c736SThierry Reding  */
25b1c0c736SThierry Reding 
26b1c0c736SThierry Reding #include <common.h>
27b1c0c736SThierry Reding #include <ns16550.h>
28b1c0c736SThierry Reding #include <asm/io.h>
29b1c0c736SThierry Reding #include <asm/gpio.h>
30b1c0c736SThierry Reding #include <asm/arch/clock.h>
31f4483021SSimon Glass #include <asm/arch/funcmux.h>
32b1c0c736SThierry Reding #include <asm/arch/pinmux.h>
33150c2493STom Warren #include <asm/arch/tegra.h>
34150c2493STom Warren #include <asm/arch-tegra/board.h>
35150c2493STom Warren #include <asm/arch-tegra/clk_rst.h>
36150c2493STom Warren #include <asm/arch-tegra/sys_proto.h>
37150c2493STom Warren #include <asm/arch-tegra/uart.h>
38b1c0c736SThierry Reding 
3922d58506SThierry Reding #ifdef CONFIG_BOARD_EARLY_INIT_F
4022d58506SThierry Reding void gpio_early_init(void)
4122d58506SThierry Reding {
4222d58506SThierry Reding 	gpio_request(GPIO_PI4, NULL);
4322d58506SThierry Reding 	gpio_direction_output(GPIO_PI4, 1);
4422d58506SThierry Reding }
4522d58506SThierry Reding #endif
4622d58506SThierry Reding 
471e2d7859STom Warren #ifdef CONFIG_TEGRA_MMC
48b1c0c736SThierry Reding /*
49b1c0c736SThierry Reding  * Routine: pin_mux_mmc
50b1c0c736SThierry Reding  * Description: setup the pin muxes/tristate values for the SDMMC(s)
51b1c0c736SThierry Reding  */
52*c9aa831eSTom Warren void pin_mux_mmc(void)
53b1c0c736SThierry Reding {
54f4483021SSimon Glass 	funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
5579254543SThierry Reding 	/* for write-protect GPIO PI6 */
5679254543SThierry Reding 	pinmux_tristate_disable(PINGRP_ATA);
57ed900c55SThierry Reding 	/* for CD GPIO PH2 */
58ed900c55SThierry Reding 	pinmux_tristate_disable(PINGRP_ATD);
59b1c0c736SThierry Reding }
60b1c0c736SThierry Reding #endif
61