[U-Boot] [PATCH 05/11] tegra20: switch over harmony board to use tablebased pinmux
Lucas Stach
dev at lynxeye.de
Thu Jan 24 17:48:14 CET 2013
Init pinmux in one shot, in order to avoid any conflicts.
Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
board/nvidia/harmony/harmony.c | 143 ++++++++++++++++++++++++++++++++---------
include/configs/harmony.h | 3 +
2 files changed, 116 insertions(+), 30 deletions(-)
diff --git a/board/nvidia/harmony/harmony.c b/board/nvidia/harmony/harmony.c
index 93430ed..f6dc709 100644
--- a/board/nvidia/harmony/harmony.c
+++ b/board/nvidia/harmony/harmony.c
@@ -1,6 +1,8 @@
/*
* (C) Copyright 2010,2011
* NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2013
+ * Lucas Stach
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -24,7 +26,6 @@
#include <common.h>
#include <asm/io.h>
#include <asm/arch/clock.h>
-#include <asm/arch/funcmux.h>
#include <asm/arch/pinmux.h>
#include <asm/arch/tegra.h>
#include <asm/arch-tegra/mmc.h>
@@ -35,34 +36,11 @@
#ifdef CONFIG_TEGRA_MMC
-/*
- * Routine: pin_mux_mmc
- * Description: setup the pin muxes/tristate values for the SDMMC(s)
- */
-static void pin_mux_mmc(void)
-{
- funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
- funcmux_select(PERIPH_ID_SDMMC2, FUNCMUX_SDMMC2_DTA_DTD_8BIT);
-
- /* For power GPIO PI6 */
- pinmux_tristate_disable(PINGRP_ATA);
- /* For CD GPIO PH2 */
- pinmux_tristate_disable(PINGRP_ATD);
-
- /* For power GPIO PT3 */
- pinmux_tristate_disable(PINGRP_DTB);
- /* For CD GPIO PI5 */
- pinmux_tristate_disable(PINGRP_ATC);
-}
-
/* this is a weak define that we are overriding */
int board_mmc_init(bd_t *bd)
{
debug("board_mmc_init called\n");
- /* Enable muxes, etc. for SDMMC controllers */
- pin_mux_mmc();
-
debug("board_mmc_init: init SD slot J26\n");
/* init dev 0, SD slot J26, with 8-bit bus */
tegra_mmc_init(0, 8, GPIO_PI6, GPIO_PH2);
@@ -75,11 +53,116 @@ int board_mmc_init(bd_t *bd)
}
#endif
-void pin_mux_usb(void)
+static struct pingroup_config harmony_pinmux[] = {
+ PINMUX_ENTRY(ATA, IDE, NORMAL, NORMAL), /* GPIO PI6*/
+ PINMUX_ENTRY(ATB, SDIO4, NORMAL, NORMAL), /* SDMMC4 */
+ PINMUX_ENTRY(ATC, NAND, NORMAL, NORMAL), /* NAND, GPIO PI5 */
+ PINMUX_ENTRY(ATD, GMI, NORMAL, NORMAL), /* GPIO PH2 */
+ PINMUX_ENTRY(ATE, GMI, NORMAL, TRISTATE),
+ PINMUX_ENTRY(CDEV1, PLLA_OUT, NORMAL, TRISTATE),
+ PINMUX_ENTRY(CDEV2, PLLP_OUT4, NORMAL, NORMAL), /* ULPI REFCLK */
+ PINMUX_ENTRY(CRTP, CRT, NORMAL, TRISTATE),
+ PINMUX_ENTRY(CSUS, VI_SENSOR_CLK, NORMAL, TRISTATE),
+ PINMUX_ENTRY(DAP1, DAP1, NORMAL, TRISTATE),
+ PINMUX_ENTRY(DAP2, DAP2, NORMAL, TRISTATE),
+ PINMUX_ENTRY(DAP3, DAP3, NORMAL, TRISTATE),
+ PINMUX_ENTRY(DAP4, DAP4, NORMAL, TRISTATE),
+ PINMUX_ENTRY(DDC, I2C2, NORMAL, TRISTATE),
+ PINMUX_ENTRY(DTA, SDIO2, NORMAL, NORMAL), /* SDMMC2 */
+ PINMUX_ENTRY(DTB, RSVD1, NORMAL, NORMAL), /* GPIO PT3 */
+ PINMUX_ENTRY(DTC, RSVD1, NORMAL, TRISTATE),
+ PINMUX_ENTRY(DTD, SDIO2, NORMAL, NORMAL), /* SDMMC2 */
+ PINMUX_ENTRY(DTE, RSVD1, NORMAL, TRISTATE),
+ PINMUX_ENTRY(DTF, I2C3, NORMAL, TRISTATE),
+ PINMUX_ENTRY(GMA, SDIO4, NORMAL, NORMAL), /* SDMMC4 */
+ PINMUX_ENTRY(GMB, GMI, NORMAL, NORMAL), /* GPIO PC7 */
+ PINMUX_ENTRY(GMC, UARTD, NORMAL, NORMAL), /* UART D */
+ PINMUX_ENTRY(GMD, GMI, NORMAL, TRISTATE),
+ PINMUX_ENTRY(GME, SDIO4, NORMAL, NORMAL), /* SDMMC4 */
+ PINMUX_ENTRY(GPU, GMI, NORMAL, TRISTATE),
+ PINMUX_ENTRY(GPU7, RTCK, NORMAL, TRISTATE),
+ PINMUX_ENTRY(GPV, PCIE, NORMAL, TRISTATE),
+ PINMUX_ENTRY(HDINT, HDMI, NORMAL, TRISTATE),
+ PINMUX_ENTRY(I2CP, I2C, NORMAL, TRISTATE),
+ PINMUX_ENTRY(IRRX, UARTA, NORMAL, NORMAL), /* UART A */
+ PINMUX_ENTRY(IRTX, UARTA, NORMAL, NORMAL), /* UART A */
+ PINMUX_ENTRY(KBCA, KBC, NORMAL, TRISTATE),
+ PINMUX_ENTRY(KBCB, KBC, NORMAL, TRISTATE),
+ PINMUX_ENTRY(KBCC, KBC, NORMAL, TRISTATE),
+ PINMUX_ENTRY(KBCD, KBC, NORMAL, TRISTATE),
+ PINMUX_ENTRY(KBCE, KBC, NORMAL, TRISTATE),
+ PINMUX_ENTRY(KBCF, KBC, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LCSN, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD0, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD1, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD2, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD3, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD4, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD5, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD6, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD7, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD8, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD9, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD10, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD11, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD12, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD13, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD14, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD15, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD16, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LD17, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LDC, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LDI, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LHP0, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LHP1, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LHP2, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LHS, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LM0, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LM1, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LPP, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LPW0, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LPW1, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LPW2, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LSC0, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LSC1, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LSCK, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LSDA, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LSDI, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LSPI, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LVP0, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LVP1, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(LVS, DISPA, NORMAL, TRISTATE),
+ PINMUX_ENTRY(OWC, RSVD2, NORMAL, TRISTATE),
+ PINMUX_ENTRY(PTA, HDMI, NORMAL, TRISTATE),
+ PINMUX_ENTRY(RM, I2C, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SDB, PWM, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SDC, PWM, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SDD, PWM, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SDIO1, SDIO1, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SLXA, PCIE, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SLXC, SPDIF, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SLXD, SPDIF, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SLXK, PCIE, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SPDI, RSVD2, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SPDO, RSVD2, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SPIA, GMI, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SPIB, GMI, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SPIC, GMI, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SPID, SPI1, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SPIE, SPI1, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SPIF, SPI1, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SPIG, SPI2_ALT, NORMAL, TRISTATE),
+ PINMUX_ENTRY(SPIH, SPI2_ALT, NORMAL, TRISTATE),
+ PINMUX_ENTRY(UAA, ULPI, NORMAL, NORMAL), /* ULPI */
+ PINMUX_ENTRY(UAB, ULPI, NORMAL, NORMAL), /* ULPI */
+ PINMUX_ENTRY(UAC, RSVD4, NORMAL, NORMAL), /* GPIO PV1 */
+ PINMUX_ENTRY(UAD, UARTB, NORMAL, TRISTATE),
+ PINMUX_ENTRY(UCA, UARTC, NORMAL, TRISTATE),
+ PINMUX_ENTRY(UCB, UARTC, NORMAL, TRISTATE),
+ PINMUX_ENTRY(UDA, ULPI, NORMAL, NORMAL), /* ULPI */
+};
+
+void pinmux_init(void)
{
- funcmux_select(PERIPH_ID_USB2, FUNCMUX_USB2_ULPI);
- pinmux_set_func(PINGRP_CDEV2, PMUX_FUNC_PLLP_OUT4);
- pinmux_tristate_disable(PINGRP_CDEV2);
- /* USB2 PHY reset GPIO */
- pinmux_tristate_disable(PINGRP_UAC);
+ pinmux_config_table(harmony_pinmux, ARRAY_SIZE(harmony_pinmux));
}
diff --git a/include/configs/harmony.h b/include/configs/harmony.h
index 8d1fd47..d64d501 100644
--- a/include/configs/harmony.h
+++ b/include/configs/harmony.h
@@ -27,6 +27,9 @@
#include <asm/sizes.h>
#include "tegra20-common.h"
+/* Enable tablebased pinmux */
+#define CONFIG_TEGRA_TABLEBASED_PINMUX
+
/* Enable fdt support for Harmony. Flash the image in u-boot-dtb.bin */
#define CONFIG_DEFAULT_DEVICE_TREE tegra20-harmony
#define CONFIG_OF_CONTROL
--
1.8.0.2
More information about the U-Boot
mailing list