xref: /rk3399_rockchip-uboot/board/compulab/trimslice/trimslice.c (revision c9aa831ee26f629fbd2df67cab8bb357777e2256)
139e37118SStephen Warren /*
239e37118SStephen Warren  *  (C) Copyright 2010-2012
339e37118SStephen Warren  *  NVIDIA Corporation <www.nvidia.com>
439e37118SStephen Warren  *
539e37118SStephen Warren  * See file CREDITS for list of people who contributed to this
639e37118SStephen Warren  * project.
739e37118SStephen Warren  *
839e37118SStephen Warren  * This program is free software; you can redistribute it and/or
939e37118SStephen Warren  * modify it under the terms of the GNU General Public License as
1039e37118SStephen Warren  * published by the Free Software Foundation; either version 2 of
1139e37118SStephen Warren  * the License, or (at your option) any later version.
1239e37118SStephen Warren  *
1339e37118SStephen Warren  * This program is distributed in the hope that it will be useful,
1439e37118SStephen Warren  * but WITHOUT ANY WARRANTY; without even the implied warranty of
1539e37118SStephen Warren  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1639e37118SStephen Warren  * GNU General Public License for more details.
1739e37118SStephen Warren  *
1839e37118SStephen Warren  * You should have received a copy of the GNU General Public License
1939e37118SStephen Warren  * along with this program; if not, write to the Free Software
2039e37118SStephen Warren  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2139e37118SStephen Warren  * MA 02111-1307 USA
2239e37118SStephen Warren  */
2339e37118SStephen Warren 
2439e37118SStephen Warren #include <common.h>
2539e37118SStephen Warren #include <asm/io.h>
26150c2493STom Warren #include <asm/arch/tegra.h>
2739e37118SStephen Warren #include <asm/arch/clock.h>
2839e37118SStephen Warren #include <asm/arch/funcmux.h>
2939e37118SStephen Warren #include <asm/arch/pinmux.h>
3039e37118SStephen Warren #include <asm/gpio.h>
31150c2493STom Warren #include <i2c.h>
3239e37118SStephen Warren 
337155dc97SStephen Warren void pin_mux_usb(void)
347155dc97SStephen Warren {
357155dc97SStephen Warren 	/*
367155dc97SStephen Warren 	 * USB1 internal/external mux GPIO, which masquerades as a VBUS GPIO
377155dc97SStephen Warren 	 * in the current device tree.
387155dc97SStephen Warren 	 */
397155dc97SStephen Warren 	pinmux_tristate_disable(PINGRP_UAC);
407155dc97SStephen Warren }
4139e37118SStephen Warren 
422db7b952SStephen Warren void pin_mux_spi(void)
432db7b952SStephen Warren {
442db7b952SStephen Warren 	funcmux_select(PERIPH_ID_SPI1, FUNCMUX_SPI1_GMC_GMD);
452db7b952SStephen Warren }
462db7b952SStephen Warren 
4739e37118SStephen Warren /*
4839e37118SStephen Warren  * Routine: pin_mux_mmc
4939e37118SStephen Warren  * Description: setup the pin muxes/tristate values for the SDMMC(s)
5039e37118SStephen Warren  */
51*c9aa831eSTom Warren void pin_mux_mmc(void)
5239e37118SStephen Warren {
5339e37118SStephen Warren 	funcmux_select(PERIPH_ID_SDMMC1, FUNCMUX_SDMMC1_SDIO1_4BIT);
5439e37118SStephen Warren 	funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_4_BIT);
5539e37118SStephen Warren 
5639e37118SStephen Warren 	/* For CD GPIO PP1 */
5739e37118SStephen Warren 	pinmux_tristate_disable(PINGRP_DAP3);
5839e37118SStephen Warren }
59