xref: /rk3399_rockchip-uboot/board/avionic-design/common/tamonten.c (revision ed900c55c35a653a0d2ce5489cdeea9a4dd18b5b)
1b1c0c736SThierry Reding /*
2b1c0c736SThierry Reding  *  (C) Copyright 2010,2011
3b1c0c736SThierry Reding  *  NVIDIA Corporation <www.nvidia.com>
4*ed900c55SThierry 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>
30f46a9456SSimon Glass #include <asm/arch/board.h>
31b1c0c736SThierry Reding #include <asm/arch/tegra2.h>
32b1c0c736SThierry Reding #include <asm/arch/sys_proto.h>
33b1c0c736SThierry Reding #include <asm/arch/clk_rst.h>
34b1c0c736SThierry Reding #include <asm/arch/clock.h>
35f4483021SSimon Glass #include <asm/arch/funcmux.h>
36b1c0c736SThierry Reding #include <asm/arch/pinmux.h>
37b1c0c736SThierry Reding #include <asm/arch/uart.h>
38b1c0c736SThierry Reding #include <asm/arch/mmc.h>
39b1c0c736SThierry Reding 
40b1c0c736SThierry Reding #ifdef CONFIG_TEGRA2_MMC
41b1c0c736SThierry Reding #include <mmc.h>
42b1c0c736SThierry Reding #endif
43b1c0c736SThierry Reding 
44b1c0c736SThierry Reding /*
45*ed900c55SThierry Reding  * Routine: gpio_config_uart
46*ed900c55SThierry Reding  * Description: Does nothing on Tamonten - no conflict w/SPI.
47b1c0c736SThierry Reding  */
48*ed900c55SThierry Reding void gpio_config_uart(void)
49b1c0c736SThierry Reding {
50b1c0c736SThierry Reding }
51b1c0c736SThierry Reding 
52b1c0c736SThierry Reding #ifdef CONFIG_TEGRA2_MMC
53b1c0c736SThierry Reding /*
54b1c0c736SThierry Reding  * Routine: pin_mux_mmc
55b1c0c736SThierry Reding  * Description: setup the pin muxes/tristate values for the SDMMC(s)
56b1c0c736SThierry Reding  */
57b1c0c736SThierry Reding static void pin_mux_mmc(void)
58b1c0c736SThierry Reding {
59f4483021SSimon Glass 	funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
60*ed900c55SThierry Reding 	/* for CD GPIO PH2 */
61*ed900c55SThierry Reding 	pinmux_tristate_disable(PINGRP_ATD);
62b1c0c736SThierry Reding }
63b1c0c736SThierry Reding 
64b1c0c736SThierry Reding /* this is a weak define that we are overriding */
65b1c0c736SThierry Reding int board_mmc_init(bd_t *bd)
66b1c0c736SThierry Reding {
67b1c0c736SThierry Reding 	/* Enable muxes, etc. for SDMMC controllers */
68b1c0c736SThierry Reding 	pin_mux_mmc();
69b1c0c736SThierry Reding 
70*ed900c55SThierry Reding 	/* init dev 0, SD slot, with 4-bit bus */
71b1c0c736SThierry Reding 	tegra2_mmc_init(0, 4, -1, GPIO_PH2);
72b1c0c736SThierry Reding 
73b1c0c736SThierry Reding 	return 0;
74b1c0c736SThierry Reding }
75b1c0c736SThierry Reding #endif
76