tablebased pinmux for Tegra20
Subsystems (7)
cover tablebased pinmux for Tegra20
This series introduces tablebased pinmux to all Tegra20 boards and removes the old way of doing pinmux to avoid any possible conflicts in pin setup.
Patch 1 introduces a temporary CONFIG option for the new pinmux style to avoid breaking bisectability in the middle of the series. This option gets removed again in patch 10.
I have verified that all commits build without errors and tested the new pinmux on my Colibri T20 platform.
For all other boards I took the pinmux configuration from the Linux kernel, but only un-tristated the pads that are used by U-Boot. I can't test the other boards myself, so please everyone with the hardware give this a run and provide a tested-by or a bug report. The series is based denx.de/u-boot-tegra/next.
Patch 11 is more of a RFC and removes the old funcmux as after the switchover nothing uses it anymore. We are not doing real muxing in U-Boot, so there is no need to keep it. But I want to hear from other people if they see any reason to keep this.
Lucas Stach (11):
tegra: introduce config option to do table based pinmux
tegra20: add entry point and helper for tablebased pinmux
tegra20: switch over colibri_t20 board to use tablebased pinmux
tegra20: switch over tamonten platform to use tablebased pinmux
tegra20: switch over harmony board to use tablebased pinmux
tegra20: switch over seaboard and ventana to use tablebased pinmux
tegra20: switch over whistler board to use tablebased pinmux
tegra20: switch over paz00 board to use tablebased pinmux
tegra20: switch over trimslice board to use tablebased pinmux
tegra20: remove old pinmux setup
tegra20: remove funcmux
arch/arm/cpu/tegra-common/board.c | 26 -- arch/arm/cpu/tegra20-common/Makefile | 2 +- arch/arm/cpu/tegra20-common/funcmux.c | 310 --------------------- arch/arm/include/asm/arch-tegra/board.h | 12 - arch/arm/include/asm/arch-tegra20/funcmux.h | 67 ----- arch/arm/include/asm/arch-tegra20/pinmux.h | 12 + board/avionic-design/common/tamonten.c | 133 +++++++-- board/compal/paz00/paz00.c | 149 +++++++--- board/compulab/trimslice/trimslice.c | 146 +++++++--- board/nvidia/common/board.c | 36 +-- board/nvidia/harmony/harmony.c | 143 ++++++++-- board/nvidia/seaboard/seaboard.c | 133 +++++++-- board/nvidia/whistler/whistler.c | 131 ++++++++- .../colibri_t20-common/colibri_t20-common.c | 132 +++++++-- board/toradex/colibri_t20_iris/colibri_t20_iris.c | 16 +- drivers/i2c/tegra_i2c.c | 9 - drivers/input/tegra-kbc.c | 4 +- drivers/mtd/nand/tegra_nand.c | 1 - drivers/video/tegra.c | 3 - include/configs/colibri_t20_iris.h | 1 - include/configs/trimslice.h | 1 - include/configs/whistler.h | 1 - 22 files changed, 814 insertions(+), 654 deletions(-) delete mode 100644 arch/arm/cpu/tegra20-common/funcmux.c delete mode 100644 arch/arm/include/asm/arch-tegra20/funcmux.h
Signature · 1 line
1.8.0.2
PATCH 1/11 tegra: introduce config option to do table based pinmux
This disables all pinmux entry points and instead calls pinmux_init() in early board init, allowing boards to set up the pinmux in one shot, like it's done with Tegra30.
This option is temporary and can go away once we switched over all boards to the new pinmux style.
--- board/nvidia/common/board.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
board/nvidia/common/board.c +8 -2
@@ -132,7 +132,9 @@ int board_init(void)gpio_config_uart ();#endif #ifdef CONFIG_TEGRA_SPI +#ifndef CONFIG_TEGRA_TABLEBASED_PINMUX pin_mux_spi (); +#endif spi_init ();#endif #ifdef CONFIG_PWM_TEGRA
@@ -140,7 +142,9 @@ int board_init(void)debug ("%s: Failed to init pwm\n" , __func__);#endif #ifdef CONFIG_LCD +#ifndef CONFIG_TEGRA_TABLEBASED_PINMUX pin_mux_display (); +#endif tegra_lcd_check_next_stage (gd->fdt_blob,0 );#endif /* boot param addr */
@@ -165,14 +169,16 @@ int board_init(void)#endif /* CONFIG_TEGRA_I2C */ #ifdef CONFIG_USB_EHCI_TEGRA +#ifndef CONFIG_TEGRA_TABLEBASED_PINMUX pin_mux_usb (); +#endif board_usb_init (gd->fdt_blob);#endif #ifdef CONFIG_LCD tegra_lcd_check_next_stage (gd->fdt_blob,0 );#endif -#ifdef CONFIG_TEGRA_NAND +#if defined(CONFIG_TEGRA_NAND ) && !defined(CONFIG_TEGRA_TABLEBASED_PINMUX )pin_mux_nand ();#endif
@@ -196,7 +202,7 @@ void gpio_early_init(void) __attribute__((weak, alias("__gpio_early_init")));int board_early_init_f (void ) { -#if defined(CONFIG_TEGRA30 ) +#if defined(CONFIG_TEGRA30 ) || defined(CONFIG_TEGRA_TABLEBASED_PINMUX )pinmux_init ();#endif board_init_uart_f ();
Signature · 1 line
1.8.0.2
PATCH 2/11 tegra20: add entry point and helper for tablebased pinmux
In reply to Lucas Stach--- arch/arm/include/asm/arch-tegra20/pinmux.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm/include/asm/arch-tegra20/pinmux.h +12 -0
@@ -350,4 +350,16 @@ void pinmux_set_tristate(enum pmux_pingrp pin, int enable);*/ void pinmux_config_table (const struct pingroup_config *config,int len); +/* Set a group of pins from a table */ +void pinmux_init (void ); + +/* helper to fill pinmux table */ +#define PINMUX_ENTRY (_pingroup, _mux, _pull, _tri) \ + { \ + .pingroup = PINGRP_##_pingroup, \ + .func = PMUX_FUNC_##_mux, \ + .pull = PMUX_PULL_##_pull, \ + .tristate = PMUX_TRI_##_tri, \ + } +#endif /* PINMUX_H */
Signature · 1 line
1.8.0.2
PATCH 3/11 tegra20: switch over colibri_t20 board to use tablebased pinmux
In reply to Lucas StachInit Colibri T20 pinmux in one shot, in order to avoid any conflicts.
--- .../colibri_t20-common/colibri_t20-common.c | 132 +++++++++++++++++---- board/toradex/colibri_t20_iris/colibri_t20_iris.c | 16 +-- include/configs/colibri_t20_iris.h | 3 + 3 files changed, 115 insertions(+), 36 deletions(-)
board/toradex/colibri_t20-common/colibri_t20-common.c +111 -21
@@ -1,5 +1,5 @@/* -* Copyright (C) 2012 Lucas Stach +* Copyright (C) 2012-2013 Lucas Stach * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as
@@ -14,31 +14,121 @@*/ #include <common.h> -#include <asm/arch/clock.h> -#include <asm/arch/funcmux.h> #include <asm/arch/pinmux.h> #include <asm/arch-tegra/board.h> #include "colibri_t20-common.h" -#ifdef CONFIG_USB_EHCI_TEGRA -void colibri_t20_common_pin_mux_usb (void ) -{ -/* module internal USB bus to connect ethernet chipset */ -funcmux_select (PERIPH_ID_USB2 ,FUNCMUX_USB2_ULPI ); -/* ULPI reference clock output */ -pinmux_set_func (PINGRP_CDEV2 ,PMUX_FUNC_PLLP_OUT4 ); -pinmux_tristate_disable (PINGRP_CDEV2 ); -/* PHY reset GPIO */ -pinmux_tristate_disable (PINGRP_UAC ); -/* VBus GPIO */ -pinmux_tristate_disable (PINGRP_DTE ); -} -#endif +static struct pingroup_config colibri_t20_pinmux[] = { +PINMUX_ENTRY (ATA ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (ATB ,SDIO4 ,NORMAL ,NORMAL ),/* MMC */ +PINMUX_ENTRY (ATC ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (ATD ,GMI ,NORMAL ,TRISTATE ), +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 ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DAP2 ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DAP3 ,DAP3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DAP4 ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DDC ,I2C2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTA ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTB ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTC ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTD ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTE ,RSVD1 ,NORMAL ,NORMAL ),/* GPIO */ +PINMUX_ENTRY (DTF ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMA ,SDIO4 ,NORMAL ,NORMAL ),/* MMC */ +PINMUX_ENTRY (GMB ,IDE ,NORMAL ,NORMAL ),/* GPIO */ +PINMUX_ENTRY (GMC ,UARTD ,NORMAL ,NORMAL ),/* UART D */ +PINMUX_ENTRY (GMD ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GME ,SDIO4 ,NORMAL ,NORMAL ),/* MMC 8bit */ +PINMUX_ENTRY (GPU ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GPU7 ,RTCK ,NORMAL ,NORMAL ),/* JTAG RTCK */ +PINMUX_ENTRY (GPV ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (HDINT ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (I2CP ,I2C ,NORMAL ,NORMAL ), +PINMUX_ENTRY (IRRX ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (IRTX ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (KBCA ,NAND ,NORMAL ,NORMAL ),/* NAND */ +PINMUX_ENTRY (KBCB ,NAND ,NORMAL ,NORMAL ),/* NAND */ +PINMUX_ENTRY (KBCC ,NAND ,NORMAL ,NORMAL ),/* NAND */ +PINMUX_ENTRY (KBCD ,NAND ,NORMAL ,NORMAL ),/* NAND */ +PINMUX_ENTRY (KBCE ,NAND ,NORMAL ,NORMAL ),/* NAND */ +PINMUX_ENTRY (KBCF ,NAND ,NORMAL ,NORMAL ),/* NAND */ +PINMUX_ENTRY (LCSN ,RSVD4 ,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 ,RSVD4 ,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 ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LM1 ,RSVD3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LPP ,DISPA ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LPW0 ,DISPB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LPW1 ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LPW2 ,DISPB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSC0 ,DISPA ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSC1 ,DISPB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSCK ,DISPB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSDA ,DISPB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSDI ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSPI ,DISPA ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LVP0 ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LVP1 ,DISPA ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LVS ,DISPA ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (OWC ,OWR ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (PTA ,RSVD4 ,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 ,UARTA ,NORMAL ,NORMAL ),/* UART A */ +PINMUX_ENTRY (SLXA ,SPI4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXC ,SPI4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXD ,SPI4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXK ,SPI4 ,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 ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIG ,SPI2_ALT ,NORMAL ,NORMAL ),/* GPIO */ +PINMUX_ENTRY (SPIH ,SPI2_ALT ,NORMAL ,NORMAL ),/* GPIO */ +PINMUX_ENTRY (UAA ,ULPI ,NORMAL ,NORMAL ),/* ULPI */ +PINMUX_ENTRY (UAB ,ULPI ,NORMAL ,NORMAL ),/* ULPI */ +PINMUX_ENTRY (UAC ,RSVD4 ,NORMAL ,NORMAL ),/* GPIO */ +PINMUX_ENTRY (UAD ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCA ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCB ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UDA ,ULPI ,NORMAL ,NORMAL ),/* ULPI */ +}; -#ifdef CONFIG_TEGRA_NAND -void pin_mux_nand (void ) +void pinmux_init (void ) { -funcmux_select (PERIPH_ID_NDFLASH ,FUNCMUX_NDFLASH_KBC_8_BIT ); +pinmux_config_table (colibri_t20_pinmux,ARRAY_SIZE (colibri_t20_pinmux)); } -#endif
board/toradex/colibri_t20_iris/colibri_t20_iris.c +1 -15
@@ -1,5 +1,5 @@/* -* Copyright (C) 2012 Lucas Stach +* Copyright (C) 2012-2013 Lucas Stach * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as
@@ -16,29 +16,15 @@#include <common.h> #include <asm/gpio.h> #include <asm/arch/clock.h> -#include <asm/arch/funcmux.h> #include <asm/arch/pinmux.h> #include <asm/arch-tegra/board.h> #include <asm/arch-tegra/mmc.h> #include "../colibri_t20-common/colibri_t20-common.h" -#ifdef CONFIG_USB_EHCI_TEGRA -void pin_mux_usb (void ) -{ -colibri_t20_common_pin_mux_usb (); - -/* USB 1 aka Tegra USB port 3 VBus*/ -pinmux_tristate_disable (PINGRP_SPIG ); -} -#endif -#ifdef CONFIG_TEGRA_MMC int board_mmc_init (bd_t *bd) { -funcmux_select (PERIPH_ID_SDMMC4 ,FUNCMUX_SDMMC4_ATB_GMA_4_BIT ); -pinmux_tristate_disable (PINGRP_GMB ); -tegra_mmc_init (0 ,4 ,-1 ,GPIO_PC7 );return 0 ;
include/configs/colibri_t20_iris.h +3 -0
@@ -18,6 +18,9 @@#include "tegra20-common.h" +/* Enable tablebased pinmux */ +#define CONFIG_TEGRA_TABLEBASED_PINMUX +/* Enable FDT support */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-colibri_t20_iris#define CONFIG_OF_CONTROL
Signature · 1 line
1.8.0.2
PATCH 4/11 tegra20: switch over tamonten platform to use tablebased pinmux
In reply to Lucas StachInit pinmux in one shot, in order to avoid any conflicts.
--- board/avionic-design/common/tamonten.c | 133 ++++++++++++++++++++++++++++----- include/configs/medcom-wide.h | 3 + include/configs/plutux.h | 3 + include/configs/tec.h | 3 + 4 files changed, 125 insertions(+), 17 deletions(-)
board/avionic-design/common/tamonten.c +116 -17
@@ -3,6 +3,8 @@* NVIDIA Corporation <www.nvidia.com> * (C) Copyright 2011-2012 * Avionic Design GmbH <www.avionic-design.de> +* (C) Copyright 2013 +* Lucas Stach * * See file CREDITS for list of people who contributed to this * project.
@@ -28,7 +30,6 @@#include <asm/io.h> #include <asm/gpio.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/board.h>
@@ -50,28 +51,126 @@ void gpio_early_init(void)#endif #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 ); -/* for write-protect GPIO PI6 */ -pinmux_tristate_disable (PINGRP_ATA ); -/* for CD GPIO PH2 */ -pinmux_tristate_disable (PINGRP_ATD ); -} -/* this is a weak define that we are overriding */ int board_mmc_init (bd_t *bd) { -/* Enable muxes, etc. for SDMMC controllers */ -pin_mux_mmc (); -/* init dev 0, SD slot, with 4-bit bus */ tegra_mmc_init (0 ,4 ,GPIO_PI6 ,GPIO_PH2 );return 0 ; }#endif + +static struct pingroup_config tamonten_pinmux[] = { +PINMUX_ENTRY (ATA ,IDE ,NORMAL ,NORMAL ),/* GPIO */ +PINMUX_ENTRY (ATB ,SDIO4 ,NORMAL ,NORMAL ),/* MMC */ +PINMUX_ENTRY (ATC ,NAND ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (ATD ,GMI ,NORMAL ,NORMAL ),/* GPIO */ +PINMUX_ENTRY (ATE ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV1 ,PLLA_OUT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV2 ,PLLP_OUT4 ,NORMAL ,TRISTATE ), +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 ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTA ,SDIO2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTB ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTC ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTD ,SDIO2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTE ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTF ,I2C3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMA ,SDIO4 ,NORMAL ,NORMAL ),/* MMC */ +PINMUX_ENTRY (GMB ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMC ,UARTD ,NORMAL ,NORMAL ),/* UART D */ +PINMUX_ENTRY (GMD ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GME ,SDIO4 ,NORMAL ,NORMAL ),/* MMC */ +PINMUX_ENTRY (GPU ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GPU7 ,RTCK ,NORMAL ,NORMAL ),/* JTAG RTCK */ +PINMUX_ENTRY (GPV ,PCIE ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (HDINT ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (I2CP ,I2C ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (IRRX ,UARTA ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (IRTX ,UARTA ,NORMAL ,TRISTATE ), +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 ,RSVD4 ,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 ,TRISTATE ), +PINMUX_ENTRY (UAB ,ULPI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAC ,RSVD2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAD ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCA ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCB ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UDA ,ULPI ,NORMAL ,TRISTATE ), +}; + +void pinmux_init (void ) +{ +pinmux_config_table (tamonten_pinmux,ARRAY_SIZE (tamonten_pinmux)); +}
include/configs/medcom-wide.h +3 -0
@@ -28,6 +28,9 @@#include "tegra20-common.h" +/* Enable tablebased pinmux */ +#define CONFIG_TEGRA_TABLEBASED_PINMUX +/* Enable fdt support for Medcom-Wide. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-medcom-wide#define CONFIG_OF_CONTROL
include/configs/plutux.h +3 -0
@@ -28,6 +28,9 @@#include "tegra20-common.h" +/* Enable tablebased pinmux */ +#define CONFIG_TEGRA_TABLEBASED_PINMUX +/* Enable fdt support for Plutux. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-plutux#define CONFIG_OF_CONTROL
include/configs/tec.h +3 -0
@@ -28,6 +28,9 @@#include "tegra20-common.h" +/* Enable tablebased pinmux */ +#define CONFIG_TEGRA_TABLEBASED_PINMUX +/* Enable fdt support for TEC. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-tec#define CONFIG_OF_CONTROL
Signature · 1 line
1.8.0.2
PATCH 4/11 tegra20: switch over tamonten platform to use tablebased pinmux
board/avionic-design/common/tamonten.c void gpio_early_init(void) · line 66
Quoted 7 lines · Lucas Stach
Init pinmux in one shot, in order to avoid any conflicts.
board/avionic-design/common/tamonten.c +3
-0+static struct pingroup_config tamonten_pinmux[] = { +PINMUX_ENTRY (ATA ,IDE ,NORMAL ,NORMAL ),/* GPIO */ +PINMUX_ENTRY (ATB ,SDIO4 ,NORMAL ,NORMAL ),/* MMC */
...
I believe this initializes every single pingroup on the SoC to something. In order to prevent any behavior changes, wouldn't it be better to first fill in this table only with entries that achieve the same pinmux programming that used to be performed by the C code you're removing? Then, a separate later patch could fill in missing items in the pinmux table. I think that'd end up being much safer and easier to validate.
PATCH 4/11 tegra20: switch over tamonten platform to use tablebased pinmux
Am Freitag, den 25.01.2013, 14:04 -0800 schrieb Stephen Warren:
Quoted 10 lines · Lucas Stach
Quoted 7 lines
Init pinmux in one shot, in order to avoid any conflicts.
board/avionic-design/common/tamonten.c +3
-0+static struct pingroup_config tamonten_pinmux[] = { +PINMUX_ENTRY (ATA ,IDE ,NORMAL ,NORMAL ),/* GPIO */ +PINMUX_ENTRY (ATB ,SDIO4 ,NORMAL ,NORMAL ),/* MMC */ ...
Quoted 8 lines
I believe this initializes every single pingroup on the SoC to something. In order to prevent any behavior changes, wouldn't it be better to first fill in this table only with entries that achieve the same pinmux programming that used to be performed by the C code you're removing? Then, a separate later patch could fill in missing items in the pinmux table. I think that'd end up being much safer and easier to validate.
As I wrote in the cover letter this initializes the pinmux to the same values the Linux kernel uses. I don't consider it a safer approach to pull out the old pinmux from the C Code and then later building a conflict free full muxtable out of this.
However I made sure to go through the C Code to see which pads need to be un-tristated. At that time I cross-checked the table with the functions used by the C Code. But as a human I'm not safe from mistakes.
Regards,
Lucas
PATCH 5/11 tegra20: switch over harmony board to use tablebased pinmux
In reply to Lucas StachInit pinmux in one shot, in order to avoid any conflicts.
--- board/nvidia/harmony/harmony.c | 143 ++++++++++++++++++++++++++++++++--------- include/configs/harmony.h | 3 + 2 files changed, 116 insertions(+), 30 deletions(-)
board/nvidia/harmony/harmony.c +113 -30
@@ -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)); }
include/configs/harmony.h +3 -0
@@ -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
Signature · 1 line
1.8.0.2
PATCH 6/11 tegra20: switch over seaboard and ventana to use tablebased pinmux
In reply to Lucas StachInit pinmux in one shot, in order to avoid any conflicts.
--- board/nvidia/seaboard/seaboard.c | 133 +++++++++++++++++++++++++++++++++------ include/configs/seaboard.h | 3 + include/configs/ventana.h | 3 + 3 files changed, 121 insertions(+), 18 deletions(-)
board/nvidia/seaboard/seaboard.c +115 -18
@@ -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.
@@ -25,7 +27,6 @@#include <asm/io.h> #include <asm/arch/tegra.h> #include <asm/arch/clock.h> -#include <asm/arch/funcmux.h> #include <asm/arch/gpio.h> #include <asm/arch/pinmux.h> #include <asm/arch-tegra/mmc.h>
@@ -47,29 +48,12 @@ void gpio_early_init_uart(void)#endif #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_SDMMC3 ,FUNCMUX_SDMMC3_SDB_4BIT ); - -/* For power GPIO PI6 */ -pinmux_tristate_disable (PINGRP_ATA ); -/* 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 eMMC\n" );/* init dev 0, eMMC chip, with 8-bit bus */ tegra_mmc_init (0 ,8 ,-1 ,-1 );
@@ -87,3 +71,116 @@ void pin_mux_usb(void)/* For USB's GPIO PD0. For now, since we have no pinmux in fdt */ pinmux_tristate_disable (PINGRP_SLXK ); } +static struct pingroup_config seaboard_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 ),/* NAND, GPIO PH1,PH3 */ +PINMUX_ENTRY (ATE ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV1 ,PLLA_OUT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV2 ,PLLP_OUT4 ,NORMAL ,TRISTATE ), +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 ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTB ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTC ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTD ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTE ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTF ,I2C3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMA ,SDIO4 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (GMB ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMC ,UARTD ,NORMAL ,NORMAL ),/* UART D */ +PINMUX_ENTRY (GMD ,SFLASH ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GME ,SDIO4 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (GPU ,PWM ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GPU7 ,RTCK ,NORMAL ,NORMAL ),/* JTAG RTCK */ +PINMUX_ENTRY (GPV ,PCIE ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (HDINT ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (I2CP ,I2C ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (IRRX ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (IRTX ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (KBCA ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (KBCB ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (KBCC ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (KBCD ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (KBCE ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (KBCF ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (LCSN ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LD0 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD1 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD2 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD3 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD4 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD5 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD6 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD7 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD8 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD9 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD10 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD11 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD12 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD13 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD14 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD15 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD16 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD17 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LDC ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LDI ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LHP0 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LHP1 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LHP2 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LHS ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LM0 ,RSVD4 ,NORMAL ,NORMAL ),/* GPIO PW0 */ +PINMUX_ENTRY (LM1 ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LPP ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LPW0 ,HDMI ,NORMAL ,NORMAL ),/* GPIO PB2 */ +PINMUX_ENTRY (LPW1 ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LPW2 ,HDMI ,NORMAL ,NORMAL ),/* GPIO PC6 */ +PINMUX_ENTRY (LSC0 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LSC1 ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSCK ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSDA ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSDI ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSPI ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LVP0 ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LVP1 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LVS ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (OWC ,RSVD2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (PTA ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (RM ,I2C ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SDB ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC3 */ +PINMUX_ENTRY (SDC ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC3 */ +PINMUX_ENTRY (SDD ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC3 */ +PINMUX_ENTRY (SDIO1 ,SDIO1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXA ,PCIE ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXC ,SPDIF ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXD ,SPDIF ,NORMAL ,NORMAL ),/* GPIO PD4 */ +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 ,TRISTATE ), +PINMUX_ENTRY (UAB ,ULPI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAC ,RSVD2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAD ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCA ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCB ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UDA ,ULPI ,NORMAL ,TRISTATE ), +}; + +void pinmux_init (void ) +{ +pinmux_config_table (seaboard_pinmux,ARRAY_SIZE (seaboard_pinmux)); +}
include/configs/seaboard.h +3 -0
@@ -35,6 +35,9 @@#include "tegra20-common.h" +/* Enable tablebased pinmux */ +#define CONFIG_TEGRA_TABLEBASED_PINMUX +/* Enable fdt support for Seaboard. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-seaboard#define CONFIG_OF_CONTROL
include/configs/ventana.h +3 -0
@@ -27,6 +27,9 @@#include <asm/sizes.h> #include "tegra20-common.h" +/* Enable tablebased pinmux */ +#define CONFIG_TEGRA_TABLEBASED_PINMUX +/* Enable fdt support for Ventana. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-ventana#define CONFIG_OF_CONTROL
Signature · 1 line
1.8.0.2
PATCH 6/11 tegra20: switch over seaboard and ventana to use tablebased pinmux
Hi Lucas,
Quoted 8 lines · Lucas Stach
Init pinmux in one shot, in order to avoid any conflicts.
Signed-off-by Lucas Stach <[email protected]>--- board/nvidia/seaboard/seaboard.c | 133 +++++++++++++++++++++++++++++++++------ include/configs/seaboard.h | 3 + include/configs/ventana.h | 3 + 3 files changed, 121 insertions(+), 18 deletions(-)
This seems like a lot of code and presumably quite a bit of duplication between boards. What sort of conflicts does this avoid, and is it the only way of avoiding them?
Also, how does this deal with drivers that want to support different configurations, such as 4/8 bit MMC, UART flow control, etc.? How does this fit with what the device tree pinmux specifies in the kernel, and why would we not move to using that?
Regards,
Simon
Quoted 200 lines
board/nvidia/seaboard/seaboard.c +115
-18@@ -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. @@ -25,7 +27,6 @@#include <asm/io.h> #include <asm/arch/tegra.h> #include <asm/arch/clock.h> -#include <asm/arch/funcmux.h> #include <asm/arch/gpio.h> #include <asm/arch/pinmux.h> #include <asm/arch-tegra/mmc.h> @@ -47,29 +48,12 @@ void gpio_early_init_uart(void)#endif #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_SDMMC3 ,FUNCMUX_SDMMC3_SDB_4BIT ); - -/* For power GPIO PI6 */ -pinmux_tristate_disable (PINGRP_ATA ); -/* 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 eMMC\n" );/* init dev 0, eMMC chip, with 8-bit bus */ tegra_mmc_init (0 ,8 ,-1 ,-1 );@@ -87,3 +71,116 @@ void pin_mux_usb(void)/* For USB's GPIO PD0. For now, since we have no pinmux in fdt */ pinmux_tristate_disable (PINGRP_SLXK ); } +static struct pingroup_config seaboard_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 ),/* NAND, GPIO PH1,PH3 */ +PINMUX_ENTRY (ATE ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV1 ,PLLA_OUT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV2 ,PLLP_OUT4 ,NORMAL ,TRISTATE ), +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 ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTB ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTC ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTD ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTE ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTF ,I2C3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMA ,SDIO4 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (GMB ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMC ,UARTD ,NORMAL ,NORMAL ),/* UART D */ +PINMUX_ENTRY (GMD ,SFLASH ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GME ,SDIO4 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (GPU ,PWM ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GPU7 ,RTCK ,NORMAL ,NORMAL ),/* JTAG RTCK */ +PINMUX_ENTRY (GPV ,PCIE ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (HDINT ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (I2CP ,I2C ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (IRRX ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (IRTX ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (KBCA ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (KBCB ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (KBCC ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (KBCD ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (KBCE ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (KBCF ,KBC ,UP ,NORMAL ),/* KBC */ +PINMUX_ENTRY (LCSN ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LD0 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD1 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD2 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD3 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD4 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD5 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD6 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD7 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD8 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD9 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD10 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD11 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD12 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD13 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD14 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD15 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD16 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD17 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LDC ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LDI ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LHP0 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LHP1 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LHP2 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LHS ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LM0 ,RSVD4 ,NORMAL ,NORMAL ),/* GPIO PW0 */ +PINMUX_ENTRY (LM1 ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LPP ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LPW0 ,HDMI ,NORMAL ,NORMAL ),/* GPIO PB2 */ +PINMUX_ENTRY (LPW1 ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LPW2 ,HDMI ,NORMAL ,NORMAL ),/* GPIO PC6 */ +PINMUX_ENTRY (LSC0 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LSC1 ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSCK ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSDA ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSDI ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSPI ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LVP0 ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LVP1 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LVS ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (OWC ,RSVD2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (PTA ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (RM ,I2C ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SDB ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC3 */ +PINMUX_ENTRY (SDC ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC3 */ +PINMUX_ENTRY (SDD ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC3 */ +PINMUX_ENTRY (SDIO1 ,SDIO1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXA ,PCIE ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXC ,SPDIF ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXD ,SPDIF ,NORMAL ,NORMAL ),/* GPIO PD4 */ +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 ,TRISTATE ), +PINMUX_ENTRY (UAB ,ULPI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAC ,RSVD2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAD ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCA ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCB ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UDA ,ULPI ,NORMAL ,TRISTATE ), +}; + +void pinmux_init (void ) +{ +pinmux_config_table (seaboard_pinmux,ARRAY_SIZE (seaboard_pinmux)); +}include/configs/seaboard.h +3
-0@@ -35,6 +35,9 @@#include "tegra20-common.h" +/* Enable tablebased pinmux */ +#define CONFIG_TEGRA_TABLEBASED_PINMUX +/* Enable fdt support for Seaboard. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-seaboard#define CONFIG_OF_CONTROL include/configs/ventana.h +3
-1@@ -27,6 +27,9 @@#include <asm/sizes.h> #include "tegra20-common.h" +/* Enable tablebased pinmux */ +#define CONFIG_TEGRA_TABLEBASED_PINMUX +/* Enable fdt support for Ventana. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-ventana#define CONFIG_OF_CONTROL --1.8.0.2
PATCH 6/11 tegra20: switch over seaboard and ventana to use tablebased pinmux
Am Freitag, den 25.01.2013, 06:54 +1300 schrieb Simon Glass:
Quoted 12 lines
Hi Lucas,
Quoted 8 lines · Lucas Stach
Init pinmux in one shot, in order to avoid any conflicts.
Signed-off-by Lucas Stach <[email protected]>--- board/nvidia/seaboard/seaboard.c | 133 +++++++++++++++++++++++++++++++++------ include/configs/seaboard.h | 3 + include/configs/ventana.h | 3 + 3 files changed, 121 insertions(+), 18 deletions(-)
Quoted 4 lines
This seems like a lot of code and presumably quite a bit of duplication between boards. What sort of conflicts does this avoid, and is it the only way of avoiding them?
I don't see it as duplication, but as explicitly spelling out how the pinmux configuration should be set up on a certain board.
Before this change we would leave some pads uninitialised in their (random) reset configuration. For example on the Colibri this leads to NAND not working as it's wired up to the KBC pads. If we only configure those, ATC will remain in it's reset state and would be also configured to the NAND function, which leads to fail. Having an explicit, known to be conflict free configuration for all pads avoids all those unpleasant surprises.
Quoted 4 lines
Also, how does this deal with drivers that want to support different configurations, such as 4/8 bit MMC, UART flow control, etc.? How does this fit with what the device tree pinmux specifies in the kernel, and why would we not move to using that?
This is just the pinmux. You have to make sure to match the pinmux with your driver configuration. This tablebased approach is the same thing as what is done with Tegra30 in U-Boot.
It's not as runtime flexible as the pinmux used in the Linux kernel, but also quite a fair bit simpler. I don't see any platform that would need anything other than the default configuration in U-Boot, so we don't need the muxing stuff provided by the pinmux framework in the kernel.
While running U-Boot we want to keep most of the pads in tristate and just enable the ones used by U-Boot itself (boot devices, GPIOs, LCD pins, etc.), so using the plain kernel pinmux config isn't going to work. So I think the table based approach is a good compromise between the need of having an comprehensively defined pinmux, simplicity and effort needed to define the pinmux.
Regards,
Lucas
PATCH 6/11 tegra20: switch over seaboard and ventana to use tablebased pinmux
Hi Lucas,
Quoted 13 lines · Lucas Stach
Am Freitag, den 25.01.2013, 06:54 +1300 schrieb Simon Glass:
Quoted 12 lines
Hi Lucas,
Quoted 8 lines · Lucas Stach
Init pinmux in one shot, in order to avoid any conflicts.
Signed-off-by Lucas Stach <[email protected]>--- board/nvidia/seaboard/seaboard.c | 133 +++++++++++++++++++++++++++++++++------ include/configs/seaboard.h | 3 + include/configs/ventana.h | 3 + 3 files changed, 121 insertions(+), 18 deletions(-)
Quoted 6 lines
Quoted 4 lines
This seems like a lot of code and presumably quite a bit of duplication between boards. What sort of conflicts does this avoid, and is it the only way of avoiding them?
I don't see it as duplication, but as explicitly spelling out how the pinmux configuration should be set up on a certain board.
I mean that the table is very similar for different boards, so looks like duplicated coded (133 very similar lines for each board).
Also, this seems to break FDT use. At present it is possible (I think) to boot the same U-Boot on any board, with the device tree specifying the config. With your change that is no longer possible, I think?
Looking ahead to T114 I see a similar problem. The funcmux approach was a compromise in that we could just select appropriate values for each function - there was no agreement on how to put this in the FDT though (my intention was that it would depend on the kernel binding, but that is now defined, so what excuse do we have for not implementing it in U-Boot?).
Quoted 8 lines
Before this change we would leave some pads uninitialised in their (random) reset configuration. For example on the Colibri this leads to NAND not working as it's wired up to the KBC pads. If we only configure those, ATC will remain in it's reset state and would be also configured to the NAND function, which leads to fail. Having an explicit, known to be conflict free configuration for all pads avoids all those unpleasant surprises.
Well yes, but we seem to be right back to where we started, with the FDT unable to describe a key feature of the boards (pinmux).
Quoted 6 lines
Quoted 5 lines
Also, how does this deal with drivers that want to support different configurations, such as 4/8 bit MMC, UART flow control, etc.? How does this fit with what the device tree pinmux specifies in the kernel, and why would we not move to using that?
Quoted 8 lines
This is just the pinmux. You have to make sure to match the pinmux with your driver configuration. This tablebased approach is the same thing as what is done with Tegra30 in U-Boot.
It's not as runtime flexible as the pinmux used in the Linux kernel, but also quite a fair bit simpler. I don't see any platform that would need anything other than the default configuration in U-Boot, so we don't need the muxing stuff provided by the pinmux framework in the kernel.
Fair enough, simple is good, but I'm not sure it will do the job. If we create different variants of a board, how exactly will we describe the differences other than by creating a new config, separate U-Boot build, etc.?
Quoted 7 lines
While running U-Boot we want to keep most of the pads in tristate and just enable the ones used by U-Boot itself (boot devices, GPIOs, LCD pins, etc.), so using the plain kernel pinmux config isn't going to work. So I think the table based approach is a good compromise between the need of having an comprehensively defined pinmux, simplicity and effort needed to define the pinmux.
OK. Can you think of a way to implement this so that we have:
board/nvidia/common/tegra20_dt.c
and the resulting image can run on all T20 boards (given an appropriate DT)?
Regards,
Simon
Quoted 5 lines
Regards,
Lucas
PATCH 6/11 tegra20: switch over seaboard and ventana to use tablebased pinmux
Hello Simon,
Am Samstag, den 26.01.2013, 10:20 +1300 schrieb Simon Glass:
Quoted 30 lines
Hi Lucas,
Quoted 13 lines · Lucas Stach
Am Freitag, den 25.01.2013, 06:54 +1300 schrieb Simon Glass:
Quoted 12 lines
Hi Lucas,
Quoted 8 lines · Lucas Stach
Init pinmux in one shot, in order to avoid any conflicts.
Signed-off-by Lucas Stach <[email protected]>--- board/nvidia/seaboard/seaboard.c | 133 +++++++++++++++++++++++++++++++++------ include/configs/seaboard.h | 3 + include/configs/ventana.h | 3 + 3 files changed, 121 insertions(+), 18 deletions(-)Quoted 6 lines
Quoted 4 lines
This seems like a lot of code and presumably quite a bit of duplication between boards. What sort of conflicts does this avoid, and is it the only way of avoiding them?
I don't see it as duplication, but as explicitly spelling out how the pinmux configuration should be set up on a certain board.
I mean that the table is very similar for different boards, so looks like duplicated coded (133 very similar lines for each board).
Also, this seems to break FDT use. At present it is possible (I think) to boot the same U-Boot on any board, with the device tree specifying the config. With your change that is no longer possible, I think?
Quoted 7 lines
Looking ahead to T114 I see a similar problem. The funcmux approach was a compromise in that we could just select appropriate values for each function - there was no agreement on how to put this in the FDT though (my intention was that it would depend on the kernel binding, but that is now defined, so what excuse do we have for not implementing it in U-Boot?).
That Tegra30 doesn't do so either. ;) But I agree, that's no valid excuse and we should resolve this before Tegra114 introduces more of this stuff. See below.
Quoted 9 lines
Quoted 8 lines
Before this change we would leave some pads uninitialised in their (random) reset configuration. For example on the Colibri this leads to NAND not working as it's wired up to the KBC pads. If we only configure those, ATC will remain in it's reset state and would be also configured to the NAND function, which leads to fail. Having an explicit, known to be conflict free configuration for all pads avoids all those unpleasant surprises.
Quoted 3 lines
Well yes, but we seem to be right back to where we started, with the FDT unable to describe a key feature of the boards (pinmux).
I see your point now. The obvious answer for now is: it's not regressing functionality, as we were never able to boot the same U-Boot image by just changing the DT.
But yes in the end we want to pack this information into the DT files. But even then it would be nice if people would test this pachset, as I imagine DT based pinmux is the same as tablebased pinmux, just in a slightly different flavour. ;) So if people test the tablebased config now, we can do the conversion to DT based with a lot more confidence.
I'll look into using the kernel pinmux binding minus the MUX stuff, as I think there's no real reason to have this in U-Boot.
Regards,
Lucas
PATCH 6/11 tegra20: switch over seaboard and ventana to use tablebased pinmux
Hi Lucas,
Quoted 52 lines · Lucas Stach
Hello Simon,
Am Samstag, den 26.01.2013, 10:20 +1300 schrieb Simon Glass:
Quoted 30 lines
Hi Lucas,
Quoted 13 lines · Lucas Stach
Am Freitag, den 25.01.2013, 06:54 +1300 schrieb Simon Glass:
Quoted 12 lines
Hi Lucas,
Quoted 8 lines · Lucas Stach
Init pinmux in one shot, in order to avoid any conflicts.
Signed-off-by Lucas Stach <[email protected]>--- board/nvidia/seaboard/seaboard.c | 133 +++++++++++++++++++++++++++++++++------ include/configs/seaboard.h | 3 + include/configs/ventana.h | 3 + 3 files changed, 121 insertions(+), 18 deletions(-)Quoted 6 lines
Quoted 4 lines
This seems like a lot of code and presumably quite a bit of duplication between boards. What sort of conflicts does this avoid, and is it the only way of avoiding them?
I don't see it as duplication, but as explicitly spelling out how the pinmux configuration should be set up on a certain board.
I mean that the table is very similar for different boards, so looks like duplicated coded (133 very similar lines for each board).
Also, this seems to break FDT use. At present it is possible (I think) to boot the same U-Boot on any board, with the device tree specifying the config. With your change that is no longer possible, I think?
Quoted 7 lines
Looking ahead to T114 I see a similar problem. The funcmux approach was a compromise in that we could just select appropriate values for each function - there was no agreement on how to put this in the FDT though (my intention was that it would depend on the kernel binding, but that is now defined, so what excuse do we have for not implementing it in U-Boot?).
That Tegra30 doesn't do so either. ;) But I agree, that's no valid excuse and we should resolve this before Tegra114 introduces more of this stuff. See below.
Quoted 9 lines
Quoted 8 lines
Before this change we would leave some pads uninitialised in their (random) reset configuration. For example on the Colibri this leads to NAND not working as it's wired up to the KBC pads. If we only configure those, ATC will remain in it's reset state and would be also configured to the NAND function, which leads to fail. Having an explicit, known to be conflict free configuration for all pads avoids all those unpleasant surprises.
Quoted 6 lines
Quoted 3 lines
Well yes, but we seem to be right back to where we started, with the FDT unable to describe a key feature of the boards (pinmux).
I see your point now. The obvious answer for now is: it's not regressing functionality, as we were never able to boot the same U-Boot image by just changing the DT.
Well, kind of. In fact we were able to boot at 3 different T20 boards just by adding a 'funcmux' property to the device's node to select the required mux option for that driver. This code is no use on T30/T114, and was only a stop-gap anyway.
Quoted 9 lines
But yes in the end we want to pack this information into the DT files. But even then it would be nice if people would test this pachset, as I imagine DT based pinmux is the same as tablebased pinmux, just in a slightly different flavour. ;) So if people test the tablebased config now, we can do the conversion to DT based with a lot more confidence.
I'll look into using the kernel pinmux binding minus the MUX stuff, as I think there's no real reason to have this in U-Boot.
Well I would rather than we get that running than switch to table-driven mux, assuming it is not too big a job?
I imagine perhaps naively that a function could be written which parses the pinmux and sets it up in U-Boot - effectively using the FDT as the pinmux table.
Regards,
Simon
Quoted 4 lines
Regards,
Lucas
PATCH 6/11 tegra20: switch over seaboard and ventana to use tablebased pinmux
Am Samstag, den 26.01.2013, 10:49 +1300 schrieb Simon Glass:
[...]
Quoted 9 lines
Quoted 8 lines
But yes in the end we want to pack this information into the DT files. But even then it would be nice if people would test this pachset, as I imagine DT based pinmux is the same as tablebased pinmux, just in a slightly different flavour. ;) So if people test the tablebased config now, we can do the conversion to DT based with a lot more confidence.
I'll look into using the kernel pinmux binding minus the MUX stuff, as I think there's no real reason to have this in U-Boot.
Quoted 6 lines
Well I would rather than we get that running than switch to table-driven mux, assuming it is not too big a job?
I imagine perhaps naively that a function could be written which parses the pinmux and sets it up in U-Boot - effectively using the FDT as the pinmux table.
That's my plan. But still even if we keep the binding the same, the actual pinmux config would differ between the kernel and U-Boot (a lot more pads kept in tristate in U-Boot). So as the FDT would effectively resemble the same tables I included in this patchset, some testing coverage of that would smoothen the transition.
Regards,
Lucas
PATCH 6/11 tegra20: switch over seaboard and ventana to use tablebased pinmux
Quoted 18 lines · Lucas Stach
Am Samstag, den 26.01.2013, 10:49 +1300 schrieb Simon Glass:
[...]Quoted 9 lines
Quoted 8 lines
But yes in the end we want to pack this information into the DT files. But even then it would be nice if people would test this pachset, as I imagine DT based pinmux is the same as tablebased pinmux, just in a slightly different flavour. ;) So if people test the tablebased config now, we can do the conversion to DT based with a lot more confidence.
I'll look into using the kernel pinmux binding minus the MUX stuff, as I think there's no real reason to have this in U-Boot.
Quoted 6 lines
Well I would rather than we get that running than switch to table-driven mux, assuming it is not too big a job?
I imagine perhaps naively that a function could be written which parses the pinmux and sets it up in U-Boot - effectively using the FDT as the pinmux table.
Quoted 5 lines
That's my plan. But still even if we keep the binding the same, the actual pinmux config would differ between the kernel and U-Boot (a lot more pads kept in tristate in U-Boot). So as the FDT would effectively resemble the same tables I included in this patchset, some testing coverage of that would smoothen the transition.
Why wouldn't the pinmux tables in the FDT passed to U-Boot either be identical to (a) the kernel, or (b) the small subset of the pinmux options that U-Boot used to program via code? I don't see any reason for U-Boot to program all the pingroups to TRISTATE etc.; if it's programming those pingroups at all, it may as well just program the correct final value.
PATCH 6/11 tegra20: switch over seaboard and ventana to use tablebased pinmux
In reply to Simon GlassQuoted 58 lines · Simon Glass
Hi Lucas,
Quoted 55 lines · Lucas Stach
Hello Simon,
Am Samstag, den 26.01.2013, 10:20 +1300 schrieb Simon Glass:
Quoted 30 lines
Hi Lucas,
Quoted 13 lines · Lucas Stach
Am Freitag, den 25.01.2013, 06:54 +1300 schrieb Simon Glass:
Quoted 12 lines
Hi Lucas,
Quoted 8 lines · Lucas Stach
Init pinmux in one shot, in order to avoid any conflicts.
Signed-off-by Lucas Stach <[email protected]>--- board/nvidia/seaboard/seaboard.c | 133 +++++++++++++++++++++++++++++++++------ include/configs/seaboard.h | 3 + include/configs/ventana.h | 3 + 3 files changed, 121 insertions(+), 18 deletions(-)Quoted 6 lines
Quoted 4 lines
This seems like a lot of code and presumably quite a bit of duplication between boards. What sort of conflicts does this avoid, and is it the only way of avoiding them?
I don't see it as duplication, but as explicitly spelling out how the pinmux configuration should be set up on a certain board.
I mean that the table is very similar for different boards, so looks like duplicated coded (133 very similar lines for each board).
Also, this seems to break FDT use. At present it is possible (I think) to boot the same U-Boot on any board, with the device tree specifying the config. With your change that is no longer possible, I think?
Quoted 7 lines
Looking ahead to T114 I see a similar problem. The funcmux approach was a compromise in that we could just select appropriate values for each function - there was no agreement on how to put this in the FDT though (my intention was that it would depend on the kernel binding, but that is now defined, so what excuse do we have for not implementing it in U-Boot?).
That Tegra30 doesn't do so either. ;) But I agree, that's no valid excuse and we should resolve this before Tegra114 introduces more of this stuff. See below.
Quoted 12 lines
Quoted 8 lines
Before this change we would leave some pads uninitialised in their (random) reset configuration. For example on the Colibri this leads to NAND not working as it's wired up to the KBC pads. If we only configure those, ATC will remain in it's reset state and would be also configured to the NAND function, which leads to fail. Having an explicit, known to be conflict free configuration for all pads avoids all those unpleasant surprises.
Well yes, but we seem to be right back to where we started, with the FDT unable to describe a key feature of the boards (pinmux).
Quoted 8 lines
Quoted 3 lines
I see your point now. The obvious answer for now is: it's not regressing functionality, as we were never able to boot the same U-Boot image by just changing the DT.
Well, kind of. In fact we were able to boot at 3 different T20 boards just by adding a 'funcmux' property to the device's node to select the required mux option for that driver. This code is no use on T30/T114, and was only a stop-gap anyway.
??? I don't believe U-Boot supports any "funcmux" property in the device tree. Are you referring to some downstream U-Boot? Such a branch wouldn't be relevant to a patch for upstream U-Boot.
PATCH 6/11 tegra20: switch over seaboard and ventana to use tablebased pinmux
Hi Stephen,
Quoted 63 lines · Stephen Warren
Quoted 62 lines · Simon Glass
Hi Lucas,
Quoted 58 lines · Lucas Stach
Hello Simon,
Am Samstag, den 26.01.2013, 10:20 +1300 schrieb Simon Glass:
Quoted 30 lines
Hi Lucas,
Quoted 13 lines · Lucas Stach
Am Freitag, den 25.01.2013, 06:54 +1300 schrieb Simon Glass:
Quoted 12 lines
Hi Lucas,
Quoted 8 lines · Lucas Stach
Init pinmux in one shot, in order to avoid any conflicts.
Signed-off-by Lucas Stach <[email protected]>--- board/nvidia/seaboard/seaboard.c | 133 +++++++++++++++++++++++++++++++++------ include/configs/seaboard.h | 3 + include/configs/ventana.h | 3 + 3 files changed, 121 insertions(+), 18 deletions(-)Quoted 6 lines
Quoted 4 lines
This seems like a lot of code and presumably quite a bit of duplication between boards. What sort of conflicts does this avoid, and is it the only way of avoiding them?
I don't see it as duplication, but as explicitly spelling out how the pinmux configuration should be set up on a certain board.
I mean that the table is very similar for different boards, so looks like duplicated coded (133 very similar lines for each board).
Also, this seems to break FDT use. At present it is possible (I think) to boot the same U-Boot on any board, with the device tree specifying the config. With your change that is no longer possible, I think?
Quoted 7 lines
Looking ahead to T114 I see a similar problem. The funcmux approach was a compromise in that we could just select appropriate values for each function - there was no agreement on how to put this in the FDT though (my intention was that it would depend on the kernel binding, but that is now defined, so what excuse do we have for not implementing it in U-Boot?).
That Tegra30 doesn't do so either. ;) But I agree, that's no valid excuse and we should resolve this before Tegra114 introduces more of this stuff. See below.
Quoted 9 lines
Quoted 8 lines
Before this change we would leave some pads uninitialised in their (random) reset configuration. For example on the Colibri this leads to NAND not working as it's wired up to the KBC pads. If we only configure those, ATC will remain in it's reset state and would be also configured to the NAND function, which leads to fail. Having an explicit, known to be conflict free configuration for all pads avoids all those unpleasant surprises.
Quoted 3 lines
Well yes, but we seem to be right back to where we started, with the FDT unable to describe a key feature of the boards (pinmux).
I see your point now. The obvious answer for now is: it's not regressing functionality, as we were never able to boot the same U-Boot image by just changing the DT.
Quoted 9 lines
Quoted 4 lines
Well, kind of. In fact we were able to boot at 3 different T20 boards just by adding a 'funcmux' property to the device's node to select the required mux option for that driver. This code is no use on T30/T114, and was only a stop-gap anyway.
??? I don't believe U-Boot supports any "funcmux" property in the device tree. Are you referring to some downstream U-Boot? Such a branch wouldn't be relevant to a patch for upstream U-Boot.
Yes, downstream. In fact from memory only the UARTs and one i2c port actually cared on T20 - the rest just used default funcmux. But we did agree at the time to omit this 'funcmux' FDT binding from mainline since there was an expectation that the kernel would soon have FDT pinmux and we would use that in U-Boot. Now that it is available I think we should use the kernel's FDT binding instead of static table-based pinmux.
Regards,
Simon
PATCH 6/11 tegra20: switch over seaboard and ventana to use tablebased pinmux
In reply to Lucas StachQuoted 17 lines · Lucas Stach
Am Freitag, den 25.01.2013, 06:54 +1300 schrieb Simon Glass:
Quoted 12 lines
Hi Lucas,
Quoted 8 lines · Lucas Stach
Init pinmux in one shot, in order to avoid any conflicts.
Signed-off-by Lucas Stach <[email protected]>--- board/nvidia/seaboard/seaboard.c | 133 +++++++++++++++++++++++++++++++++------ include/configs/seaboard.h | 3 + include/configs/ventana.h | 3 + 3 files changed, 121 insertions(+), 18 deletions(-)Quoted 4 lines
This seems like a lot of code and presumably quite a bit of duplication between boards. What sort of conflicts does this avoid, and is it the only way of avoiding them?
Quoted 5 lines
I don't see it as duplication, but as explicitly spelling out how the pinmux configuration should be set up on a certain board.
Before this change we would leave some pads uninitialised in their (random) reset configuration.
Just being pedantic here, but I don't think the power-on-reset configuration is random; it's well defined but perhaps just not documented, and not always what is correct/best for any particular board design.
PATCH 7/11 tegra20: switch over whistler board to use tablebased pinmux
In reply to Lucas StachInit pinmux in one shot, in order to avoid any conflicts.
--- board/nvidia/whistler/whistler.c | 131 ++++++++++++++++++++++++++++++++++----- include/configs/whistler.h | 3 + 2 files changed, 119 insertions(+), 15 deletions(-)
board/nvidia/whistler/whistler.c +116 -15
@@ -1,6 +1,8 @@/* * (C) Copyright 2010-2012 * NVIDIA Corporation <www.nvidia.com> +* (C) Copyright 2013 +* Lucas Stach * * See file CREDITS for list of people who contributed to this * project.
@@ -25,7 +27,6 @@#include <asm/io.h> #include <asm/arch/tegra.h> #include <asm/arch/clock.h> -#include <asm/arch/funcmux.h> #include <asm/arch/pinmux.h> #include <asm/arch-tegra/mmc.h> #include <asm/gpio.h>
@@ -34,17 +35,6 @@#include <mmc.h> #endif - -/* -* 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_SDMMC3 ,FUNCMUX_SDMMC3_SDB_SLXA_8BIT ); -funcmux_select (PERIPH_ID_SDMMC4 ,FUNCMUX_SDMMC4_ATC_ATD_8BIT ); -} -/* this is a weak define that we are overriding */ int board_mmc_init (bd_t *bd) {
@@ -70,9 +60,6 @@ int board_mmc_init(bd_t *bd)if (ret)printf ("i2c_write 0 0x3c 0x44 failed: %d\n" , ret); -/* Enable muxes, etc. for SDMMC controllers */ -pin_mux_mmc (); -/* init dev 0 (SDMMC4), (J29 "HSMMC") with 8-bit bus */ tegra_mmc_init (0 ,8 ,-1 ,-1 );
@@ -107,3 +94,117 @@ void pin_mux_usb(void)if (ret)printf ("i2c_write 0 0x20 6 failed: %d\n" , ret); } + +static struct pingroup_config whistler_pinmux[] = { +PINMUX_ENTRY (ATA ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (ATB ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (ATC ,SDIO4 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (ATD ,SDIO4 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (ATE ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV1 ,PLLA_OUT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV2 ,OSC ,NORMAL ,TRISTATE ), +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 ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTB ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTC ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTD ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTE ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTF ,I2C3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMA ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMB ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMC ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMD ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GME ,DAP5 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GPU ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GPU7 ,RTCK ,NORMAL ,NORMAL ),/* JTAG RTCK */ +PINMUX_ENTRY (GPV ,PCIE ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (HDINT ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (I2CP ,I2C ,NORMAL ,NORMAL ),/* DVC */ +PINMUX_ENTRY (IRRX ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (IRTX ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (KBCA ,KBC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (KBCB ,SDIO2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (KBCC ,KBC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (KBCD ,SDIO2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (KBCE ,KBC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (KBCF ,KBC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LCSN ,SPI3 ,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 ,SPI3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSDA ,SPI3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LSDI ,SPI3 ,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 ,OWR ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (PTA ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (RM ,I2C ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SDB ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC3 */ +PINMUX_ENTRY (SDC ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (SDD ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (SDIO1 ,SDIO1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXA ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (SLXC ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (SLXD ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (SLXK ,SDIO3 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (SPDI ,RSVD2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPDO ,RSVD2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIA ,SPI3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIB ,SPI3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIC ,SPI3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPID ,SPI2_ALT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIE ,SPI2_ALT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIF ,SPI2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIG ,SPI2_ALT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIH ,SPI2_ALT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAA ,UARTA ,NORMAL ,NORMAL ),/* UART A */ +PINMUX_ENTRY (UAB ,UARTA ,NORMAL ,NORMAL ),/* UART A */ +PINMUX_ENTRY (UAC ,OWR ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAD ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCA ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCB ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UDA ,SPI1 ,NORMAL ,TRISTATE ), +}; + +void pinmux_init (void ) +{ +pinmux_config_table (whistler_pinmux,ARRAY_SIZE (whistler_pinmux)); +}
include/configs/whistler.h +3 -0
@@ -27,6 +27,9 @@#include <asm/sizes.h> #include "tegra20-common.h" +/* Enable tablebased pinmux */ +#define CONFIG_TEGRA_TABLEBASED_PINMUX +/* Enable fdt support for Whistler. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-whistler#define CONFIG_OF_CONTROL
Signature · 1 line
1.8.0.2
PATCH 8/11 tegra20: switch over paz00 board to use tablebased pinmux
In reply to Lucas StachInit pinmux in one shot, in order to avoid any conflicts.
--- board/compal/paz00/paz00.c | 149 ++++++++++++++++++++++++++++++++++----------- include/configs/paz00.h | 3 + 2 files changed, 115 insertions(+), 37 deletions(-)
board/compal/paz00/paz00.c +112 -37
@@ -1,5 +1,6 @@/* * Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved. +* Copyright (c) 2013 Lucas Stach * * See file CREDITS for list of people who contributed to this * project.
@@ -26,40 +27,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 ) -{ -/* SDMMC4: config 3, x8 on 2nd set of pins */ -pinmux_set_func (PINGRP_ATB ,PMUX_FUNC_SDIO4 ); -pinmux_set_func (PINGRP_GMA ,PMUX_FUNC_SDIO4 ); -pinmux_set_func (PINGRP_GME ,PMUX_FUNC_SDIO4 ); - -pinmux_tristate_disable (PINGRP_ATB ); -pinmux_tristate_disable (PINGRP_GMA ); -pinmux_tristate_disable (PINGRP_GME ); - -/* SDIO1: SDIO1_CLK, SDIO1_CMD, SDIO1_DAT[3:0] */ -pinmux_set_func (PINGRP_SDIO1 ,PMUX_FUNC_SDIO1 ); - -pinmux_tristate_disable (PINGRP_SDIO1 ); - -/* For power GPIO PV1 */ -pinmux_tristate_disable (PINGRP_UAC ); -/* For CD GPIO PV5 */ -pinmux_tristate_disable (PINGRP_GPV ); -} -/* 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 eMMC\n" );/* init dev 0, eMMC chip, with 8-bit bus */ tegra_mmc_init (0 ,8 ,-1 ,-1 );
@@ -72,13 +44,116 @@ int board_mmc_init(bd_t *bd) }#endif -#ifdef CONFIG_LCD -/* this is a weak define that we are overriding */ -void pin_mux_display (void ) -{ -debug ("init display pinmux\n" ); +static struct pingroup_config paz00_pinmux[] = { +PINMUX_ENTRY (ATA ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (ATB ,SDIO4 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (ATC ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (ATD ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (ATE ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV1 ,PLLA_OUT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV2 ,PLLP_OUT4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CRTP ,CRT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CSUS ,PLLC_OUT1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DAP1 ,DAP1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DAP2 ,GMI ,NORMAL ,NORMAL ),/* GPIO PA4 */ +PINMUX_ENTRY (DAP3 ,DAP3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DAP4 ,DAP4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DDC ,I2C2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTA ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTB ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTC ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTD ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTE ,RSVD1 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTF ,I2C3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMA ,SDIO4 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (GMB ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMC ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMD ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GME ,SDIO4 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (GPU ,PWM ,NORMAL ,NORMAL ),/* GPIO PU4 */ +PINMUX_ENTRY (GPU7 ,RTCK ,NORMAL ,NORMAL ),/* JTAG RTCK */ +PINMUX_ENTRY (GPV ,PCIE ,NORMAL ,NORMAL ),/* GPIO PV5 */ +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 ,SDIO2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (KBCC ,KBC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (KBCD ,SDIO2 ,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 ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD1 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD2 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD3 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD4 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD5 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD6 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD7 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD8 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD9 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD10 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD11 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD12 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD13 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD14 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD15 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD16 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LD17 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LDC ,DISPA ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LDI ,DISPA ,NORMAL ,NORMAL ),/* GPIO PM6 */ +PINMUX_ENTRY (LHP0 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LHP1 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LHP2 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LHS ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LM0 ,RSVD4 ,NORMAL ,NORMAL ),/* GPIO PW0 */ +PINMUX_ENTRY (LM1 ,DISPA ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LPP ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LPW0 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LPW1 ,DISPA ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LPW2 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LSC0 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +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 ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LVP0 ,DISPA ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (LVP1 ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (LVS ,DISPA ,NORMAL ,NORMAL ),/* LCD */ +PINMUX_ENTRY (OWC ,OWR ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (PTA ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (RM ,I2C ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SDB ,PWM ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SDC ,TWC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SDD ,PWM ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SDIO1 ,SDIO1 ,NORMAL ,NORMAL ),/* SDIO1 */ +PINMUX_ENTRY (SLXA ,PCIE ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXC ,SPI4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXD ,SPI4 ,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 ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIE ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIF ,RSVD4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIG ,SPI2_ALT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIH ,SPI2_ALT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAA ,ULPI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAB ,ULPI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAC ,RSVD4 ,NORMAL ,NORMAL ),/* GPIO PV1 */ +PINMUX_ENTRY (UAD ,SPDIF ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCA ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCB ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UDA ,ULPI ,NORMAL ,TRISTATE ), +}; -/* EN_VDD_PANEL GPIO A4 */ -pinmux_tristate_disable (PINGRP_DAP2 ); +void pinmux_init (void ) +{ +pinmux_config_table (paz00_pinmux,ARRAY_SIZE (paz00_pinmux)); } -#endif
include/configs/paz00.h +3 -0
@@ -20,6 +20,9 @@#include <asm/sizes.h> #include "tegra20-common.h" +/* Enable tablebased pinmux */ +#define CONFIG_TEGRA_TABLEBASED_PINMUX +/* Enable fdt support for Paz00. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-paz00#define CONFIG_OF_CONTROL
Signature · 1 line
1.8.0.2
PATCH 9/11 tegra20: switch over trimslice board to use tablebased pinmux
In reply to Lucas StachInit pinmux in one shot, in order to avoid any conflicts.
--- board/compulab/trimslice/trimslice.c | 146 +++++++++++++++++++++++++++-------- include/configs/trimslice.h | 3 + 2 files changed, 118 insertions(+), 31 deletions(-)
board/compulab/trimslice/trimslice.c +115 -31
@@ -1,6 +1,8 @@/* * (C) Copyright 2010-2012 * NVIDIA Corporation <www.nvidia.com> +* (C) Copyright 2013 +* Lucas Stach * * See file CREDITS for list of people who contributed to this * project.
@@ -25,7 +27,6 @@#include <asm/io.h> #include <asm/arch/tegra.h> #include <asm/arch/clock.h> -#include <asm/arch/funcmux.h> #include <asm/arch/pinmux.h> #include <asm/arch-tegra/mmc.h> #include <asm/gpio.h>
@@ -34,41 +35,11 @@#include <mmc.h> #endif -void pin_mux_usb (void ) -{ -/* -* USB1 internal/external mux GPIO, which masquerades as a VBUS GPIO -* in the current device tree. -*/ -pinmux_tristate_disable (PINGRP_UAC ); -} - -void pin_mux_spi (void ) -{ -funcmux_select (PERIPH_ID_SPI1 ,FUNCMUX_SPI1_GMC_GMD ); -} - -/* -* 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_SDMMC1 ,FUNCMUX_SDMMC1_SDIO1_4BIT ); -funcmux_select (PERIPH_ID_SDMMC4 ,FUNCMUX_SDMMC4_ATB_GMA_4_BIT ); - -/* For CD GPIO PP1 */ -pinmux_tristate_disable (PINGRP_DAP3 ); -} -/* 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 (); -/* init dev 0 (SDMMC4), (micro-SD slot) with 4-bit bus */ tegra_mmc_init (0 ,4 ,-1 ,GPIO_PP1 );
@@ -77,3 +48,116 @@ int board_mmc_init(bd_t *bd)return 0 ; } +static struct pingroup_config trimslice_pinmux[] = { +PINMUX_ENTRY (ATA ,IDE ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (ATB ,SDIO4 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (ATC ,NAND ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (ATD ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (ATE ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV1 ,PLLA_OUT ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (CDEV2 ,PLLP_OUT4 ,NORMAL ,TRISTATE ), +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 ,NORMAL ),/* GPIO PP1 */ +PINMUX_ENTRY (DAP4 ,DAP4 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DDC ,I2C2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTA ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTB ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTC ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTD ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTE ,VI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (DTF ,I2C3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMA ,SDIO4 ,NORMAL ,NORMAL ),/* SDMMC4 */ +PINMUX_ENTRY (GMB ,NAND ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GMC ,SFLASH ,NORMAL ,NORMAL ),/* SPI1 */ +PINMUX_ENTRY (GMD ,SFLASH ,NORMAL ,NORMAL ),/* SPI1 */ +PINMUX_ENTRY (GME ,GMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (GPU ,UARTA ,NORMAL ,NORMAL ),/* UART A */ +PINMUX_ENTRY (GPU7 ,RTCK ,NORMAL ,NORMAL ),/* JTAG RTCK */ +PINMUX_ENTRY (GPV ,PCIE ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (HDINT ,HDMI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (I2CP ,I2C ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (IRRX ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (IRTX ,UARTB ,NORMAL ,TRISTATE ), +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 ,GMI ,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 ,NORMAL ),/* SDMMC1 */ +PINMUX_ENTRY (SLXA ,PCIE ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXC ,SDIO3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXD ,SDIO3 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SLXK ,PCIE ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPDI ,SPDIF ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPDO ,SPDIF ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIA ,SPI2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIB ,SPI2 ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (SPIC ,SPI2 ,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 ,TRISTATE ), +PINMUX_ENTRY (UAB ,ULPI ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UAC ,RSVD2 ,NORMAL ,NORMAL ),/* GPIO PV2 */ +PINMUX_ENTRY (UAD ,UARTB ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCA ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UCB ,UARTC ,NORMAL ,TRISTATE ), +PINMUX_ENTRY (UDA ,ULPI ,NORMAL ,TRISTATE ), +}; + +void pinmux_init (void ) +{ +pinmux_config_table (trimslice_pinmux,ARRAY_SIZE (trimslice_pinmux)); +}
include/configs/trimslice.h +3 -0
@@ -27,6 +27,9 @@#include <asm/sizes.h> #include "tegra20-common.h" +/* Enable tablebased pinmux */ +#define CONFIG_TEGRA_TABLEBASED_PINMUX +/* Enable fdt support for TrimSlice. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-trimslice#define CONFIG_OF_CONTROL
Signature · 1 line
1.8.0.2
PATCH 10/11 tegra20: remove old pinmux setup
In reply to Lucas StachAll boards are converted to the new tablebased pinmux setup. Get rid of the old method.
--- arch/arm/cpu/tegra-common/board.c | 25 -------------------- arch/arm/include/asm/arch-tegra/board.h | 12 ---------- board/nvidia/common/board.c | 41 +-------------------------------- drivers/i2c/tegra_i2c.c | 9 -------- drivers/input/tegra-kbc.c | 4 +--- drivers/video/tegra.c | 3 --- include/configs/colibri_t20_iris.h | 4 ---- include/configs/harmony.h | 3 --- include/configs/medcom-wide.h | 3 --- include/configs/paz00.h | 3 --- include/configs/plutux.h | 3 --- include/configs/seaboard.h | 3 --- include/configs/tec.h | 3 --- include/configs/trimslice.h | 4 ---- include/configs/ventana.h | 3 --- include/configs/whistler.h | 4 ---- 16 files changed, 2 insertions(+), 125 deletions(-)
arch/arm/cpu/tegra-common/board.c +0 -25
@@ -102,30 +102,6 @@ int checkboard(void) }#endif /* CONFIG_DISPLAY_BOARDINFO */ -static int uart_configs[] = { -#if defined(CONFIG_TEGRA20) - #if defined(CONFIG_TEGRA_UARTA_UAA_UAB) - FUNCMUX_UART1_UAA_UAB, - #elif defined(CONFIG_TEGRA_UARTA_GPU) - FUNCMUX_UART1_GPU, - #elif defined(CONFIG_TEGRA_UARTA_SDIO1) - FUNCMUX_UART1_SDIO1, - #else - FUNCMUX_UART1_IRRX_IRTX, - #endif - FUNCMUX_UART2_UARTB, - -1, - FUNCMUX_UART4_GMC, - -1, -#else /* Tegra30 */ - FUNCMUX_UART1_ULPI, /* UARTA */ - -1, - -1, - -1, - -1, -#endif -}; -/** * Set up the specified uarts *
@@ -145,7 +121,6 @@ static void setup_uarts(int uart_ids)if (uart_ids & (1 << i)) {enum periph_id id = id_for_uart[i]; -funcmux_select (id, uart_configs[i]);clock_ll_start_uart (id); } }
arch/arm/include/asm/arch-tegra/board.h +0 -12
@@ -34,16 +34,4 @@ void board_init_uart_f(void);/* Set up any early GPIOs the board might need for proper operation */ void gpio_early_init (void );/* overrideable GPIO config */ -/* -* Hooks to allow boards to set up the pinmux for a specific function. -* Has to be implemented in the board files as we don't yet support pinmux -* setup from FTD. If a board file does not implement one of those functions -* an empty stub function will be called. -*/ - -void pin_mux_usb (void );/* overrideable USB pinmux setup */ -void pin_mux_spi (void );/* overrideable SPI pinmux setup */ -void pin_mux_nand (void );/* overrideable NAND pinmux setup */ -void pin_mux_display (void );/* overrideable DISPLAY pinmux setup */ -#endif
board/nvidia/common/board.c +1 -40
84 lines not on this page · raw message
drivers/i2c/tegra_i2c.c +0 -9
@@ -27,7 +27,6 @@#include <i2c.h> #include <asm/io.h> #include <asm/arch/clock.h> -#include <asm/arch/funcmux.h> #include <asm/arch/gpio.h> #include <asm/arch/pinmux.h> #include <asm/arch-tegra/clk_rst.h>
@@ -42,7 +41,6 @@ struct i2c_bus {int id;enum periph_id periph_id;int speed; -int pinmux_config;struct i2c_control *control;struct i2c_ctlr *regs;int is_dvc;/* DVC type, rather than I2C */
@@ -99,8 +97,6 @@ static void i2c_init_controller(struct i2c_bus *i2c_bus)setbits_le32 (&dvc->ctrl3,DVC_CTRL_REG3_I2C_HW_SW_PROG_MASK ); } - -funcmux_select (i2c_bus->periph_id, i2c_bus->pinmux_config); } static void send_packet_headers(
@@ -322,11 +318,6 @@ static int i2c_get_config(const void *blob, int node, struct i2c_bus *i2c_bus) { i2c_bus->regs = (struct i2c_ctlr *)fdtdec_get_addr (blob, node,"reg" ); -/* -* We don't have a binding for pinmux yet. Leave it out for now. So -* far no one needs anything other than the default. -*/ - i2c_bus->pinmux_config =FUNCMUX_DEFAULT ; i2c_bus->speed =fdtdec_get_int (blob, node,"clock-frequency" ,0 ); i2c_bus->periph_id =clock_decode_periph_id (blob, node);
drivers/input/tegra-kbc.c +1 -3
@@ -29,7 +29,6 @@#include <tegra-kbc.h> #include <asm/io.h> #include <asm/arch/clock.h> -#include <asm/arch/funcmux.h> #include <asm/arch-tegra/timer.h> #include <linux/input.h>
@@ -348,8 +347,7 @@ static int init_tegra_keyboard(void)#error "Tegra keyboard driver requires FDT definitions"#endif -/* Set up pin mux and enable the clock */ -funcmux_select (PERIPH_ID_KBC ,FUNCMUX_DEFAULT ); +/* enable the clock */ clock_enable (PERIPH_ID_KBC );config_kbc_gpio (config.kbc);
drivers/video/tegra.c +0 -3
@@ -27,7 +27,6 @@#include <asm/gpio.h> #include <asm/arch/clock.h> -#include <asm/arch/funcmux.h> #include <asm/arch/pinmux.h> #include <asm/arch/pwm.h> #include <asm/arch/display.h>
@@ -275,8 +274,6 @@ static int handle_stage(const void *blob)* variable. */ -funcmux_select (PERIPH_ID_DISP1 ,FUNCMUX_DEFAULT ); -fdtdec_setup_gpio (&config.panel_vdd);fdtdec_setup_gpio (&config.lvds_shutdown);fdtdec_setup_gpio (&config.backlight_vdd);
include/configs/colibri_t20_iris.h +0 -4
@@ -18,9 +18,6 @@#include "tegra20-common.h" -/* Enable tablebased pinmux */ -#define CONFIG_TEGRA_TABLEBASED_PINMUX -/* Enable FDT support */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-colibri_t20_iris#define CONFIG_OF_CONTROL
@@ -32,7 +29,6 @@/* Board-specific serial config */ #define CONFIG_TEGRA_ENABLE_UARTA -#define CONFIG_TEGRA_UARTA_SDIO1 #define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTA_BASE#define CONFIG_BOARD_EARLY_INIT_F
include/configs/harmony.h +0 -3
@@ -27,9 +27,6 @@#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
include/configs/medcom-wide.h +0 -3
@@ -28,9 +28,6 @@#include "tegra20-common.h" -/* Enable tablebased pinmux */ -#define CONFIG_TEGRA_TABLEBASED_PINMUX -/* Enable fdt support for Medcom-Wide. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-medcom-wide#define CONFIG_OF_CONTROL
include/configs/paz00.h +0 -3
@@ -20,9 +20,6 @@#include <asm/sizes.h> #include "tegra20-common.h" -/* Enable tablebased pinmux */ -#define CONFIG_TEGRA_TABLEBASED_PINMUX -/* Enable fdt support for Paz00. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-paz00#define CONFIG_OF_CONTROL
include/configs/plutux.h +0 -3
@@ -28,9 +28,6 @@#include "tegra20-common.h" -/* Enable tablebased pinmux */ -#define CONFIG_TEGRA_TABLEBASED_PINMUX -/* Enable fdt support for Plutux. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-plutux#define CONFIG_OF_CONTROL
include/configs/seaboard.h +0 -3
@@ -35,9 +35,6 @@#include "tegra20-common.h" -/* Enable tablebased pinmux */ -#define CONFIG_TEGRA_TABLEBASED_PINMUX -/* Enable fdt support for Seaboard. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-seaboard#define CONFIG_OF_CONTROL
include/configs/tec.h +0 -3
@@ -28,9 +28,6 @@#include "tegra20-common.h" -/* Enable tablebased pinmux */ -#define CONFIG_TEGRA_TABLEBASED_PINMUX -/* Enable fdt support for TEC. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-tec#define CONFIG_OF_CONTROL
include/configs/trimslice.h +0 -4
@@ -27,9 +27,6 @@#include <asm/sizes.h> #include "tegra20-common.h" -/* Enable tablebased pinmux */ -#define CONFIG_TEGRA_TABLEBASED_PINMUX -/* Enable fdt support for TrimSlice. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-trimslice#define CONFIG_OF_CONTROL
@@ -41,7 +38,6 @@/* Board-specific serial config */ #define CONFIG_TEGRA_ENABLE_UARTA -#define CONFIG_TEGRA_UARTA_GPU #define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTA_BASE#define CONFIG_MACH_TYPE MACH_TYPE_TRIMSLICE
include/configs/ventana.h +0 -3
@@ -27,9 +27,6 @@#include <asm/sizes.h> #include "tegra20-common.h" -/* Enable tablebased pinmux */ -#define CONFIG_TEGRA_TABLEBASED_PINMUX -/* Enable fdt support for Ventana. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-ventana#define CONFIG_OF_CONTROL
include/configs/whistler.h +0 -4
@@ -27,9 +27,6 @@#include <asm/sizes.h> #include "tegra20-common.h" -/* Enable tablebased pinmux */ -#define CONFIG_TEGRA_TABLEBASED_PINMUX -/* Enable fdt support for Whistler. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra20-whistler#define CONFIG_OF_CONTROL
@@ -41,7 +38,6 @@/* Board-specific serial config */ #define CONFIG_TEGRA_ENABLE_UARTA -#define CONFIG_TEGRA_UARTA_UAA_UAB #define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTA_BASE#define CONFIG_MACH_TYPE MACH_TYPE_WHISTLER
Signature · 1 line
1.8.0.2
PATCH 10/11 tegra20: remove old pinmux setup
arch/arm/cpu/tegra-common/board.c static void setup_uarts(int uart_ids) · line 126
Quoted 13 lines · Lucas Stach
All boards are converted to the new tablebased pinmux setup. Get rid of the old method.
arch/arm/cpu/tegra-common/board.c +0
-1@@ -145,7 +121,6 @@ static void setup_uarts(int uart_ids)if (uart_ids & (1 << i)) {enum periph_id id = id_for_uart[i]; -funcmux_select (id, uart_configs[i]);clock_ll_start_uart (id); } }
Doesn't the debug UART get set up very early, in the SPL, before any table-based pinmux could be activated?
If so, I think we need to leave this one funcmux API call in place, so that the debug UART always works nice and early.
If not, how much does this series increase the binary of the SPL?
PATCH 10/11 tegra20: remove old pinmux setup
Am Freitag, den 25.01.2013, 14:12 -0800 schrieb Stephen Warren:
Quoted 18 lines · Lucas Stach
arch/arm/cpu/tegra-common/board.c static void setup_uarts(int uart_ids) · line 126
Quoted 13 lines
All boards are converted to the new tablebased pinmux setup. Get rid of the old method.
arch/arm/cpu/tegra-common/board.c +0
-1@@ -145,7 +121,6 @@ static void setup_uarts(int uart_ids)if (uart_ids & (1 << i)) {enum periph_id id = id_for_uart[i]; -funcmux_select (id, uart_configs[i]);clock_ll_start_uart (id); } }Doesn't the debug UART get set up very early, in the SPL, before any table-based pinmux could be activated?
Quoted 5 lines
If so, I think we need to leave this one funcmux API call in place, so that the debug UART always works nice and early.
If not, how much does this series increase the binary of the SPL?
Ah right, I forgot about SPL debug. If we go for FDT based pinmux, we have to init UART in some explicit way, as DT and SPL don't mix.
But even then I would like to get rid of the funcmux style and rather let the boards provide a minimal UART pinmux init table, as funcmux doesn't map too well onto the plethora of config options Tegra30 provides for the pinmux.
Regards,
Lucas
PATCH 10/11 tegra20: remove old pinmux setup
Quoted 24 lines · Lucas Stach
Am Freitag, den 25.01.2013, 14:12 -0800 schrieb Stephen Warren:
Quoted 18 lines · Lucas Stach
arch/arm/cpu/tegra-common/board.c static void setup_uarts(int uart_ids) · line 126
Quoted 13 lines
All boards are converted to the new tablebased pinmux setup. Get rid of the old method.
arch/arm/cpu/tegra-common/board.c +0
-1@@ -145,7 +121,6 @@ static void setup_uarts(int uart_ids)if (uart_ids & (1 << i)) {enum periph_id id = id_for_uart[i]; -funcmux_select (id, uart_configs[i]);clock_ll_start_uart (id); } }Doesn't the debug UART get set up very early, in the SPL, before any table-based pinmux could be activated?
Quoted 5 lines
If so, I think we need to leave this one funcmux API call in place, so that the debug UART always works nice and early.
If not, how much does this series increase the binary of the SPL?
Quoted 7 lines
Ah right, I forgot about SPL debug. If we go for FDT based pinmux, we have to init UART in some explicit way, as DT and SPL don't mix.
But even then I would like to get rid of the funcmux style and rather let the boards provide a minimal UART pinmux init table, as funcmux doesn't map too well onto the plethora of config options Tegra30 provides for the pinmux.
Yes, that's perhaps true.
For reference, I recently worked out all the possible locations of each logical signal (well, only RX/TX/RTS/CTS for Tegra30) for each UART. I put the table below for reference in case it's interesting.
Tegra20:
(sets of pingroups that create a complete UART)
Quoted 20 lines
+ * UART A:
+ * 0: unspecified
+ * 1: irrx, irtx
+ * 2: gpu
+ * 3: sdb, sdd
+ * 4: sdio1
+ * 5: uaa
+ * 6: irrx, irtx, uad
+ * 7: irrx, irtx, uad, uab
+ * 8: sdb, sdd, uad
+ * 9: sdb, sdd, uad, uab
+ * 10: uaa, uab
+ * UART B:
+ * 0: unspecified
+ * 1: uad
+ * 2: uad, irrx, irtx
+ * UART C:
+ * 0: unspecified
+ * 1: uca
+ * 2: uca, ucb
Quoted 8 lines
+ * UART D:
+ * 0: unspecified
+ * 1: gmc
+ * 2: uda
+ * UART E:
+ * 0: unspecified
+ * 1: gma
+ * 2: sdio1
Tegra30:
(possible locations for each signal on each UART)
Quoted 82 lines
+ * UART CTS pin
+ * UART A:
+ * 0: unspecified
+ * 1:uart2_rxd
+ * 2:ulpi_data2
+ * 3:gpio_pu2
+ * UART B:
+ * 0: unspecified
+ * 1:uart2_cts_n
+ * UART C:
+ * 0: unspecified
+ * 1:uart3_cts_n
+ * UART D:
+ * 0: unspecified
+ * 1:gmi_a18
+ * 2:ulpi_nxt
+ * UART E:
+ * 0: unspecified
+ * 1:sdmmc1_dat1
+ * 2:sdmmc4_dat2
+ * UART RTS pin
+ * UART A:
+ * 0: unspecified
+ * 1:uart2_txd
+ * 2:ulpi_data3
+ * 3:gpio_pu3
+ * UART B:
+ * 0: unspecified
+ * 1:uart2_rts_n
+ * UART C:
+ * 0: unspecified
+ * 1:uart3_rts_n
+ * UART D:
+ * 0: unspecified
+ * 1:gmi_a19
+ * 2:ulpi_stp
+ * UART E:
+ * 0: unspecified
+ * 1:sdmmc1_dat0
+ * 2:sdmmc4_dat3
+ * UART TXD pin
+ * UART A:
+ * 0: unspecified
+ * 1:sdmmc3_clk
+ * 2:uart2_rts_n
+ * 3:ulpi_data0
+ * 4:gpio_pu0
+ * UART B:
+ * 0: unspecified
+ * 1:uart2_txd
+ * UART C:
+ * 0: unspecified
+ * 1:uart3_txd
+ * UART D:
+ * 0: unspecified
+ * 1:gmi_a16
+ * 2:ulpi_clk
+ * UART E:
+ * 0: unspecified
+ * 1:sdmmc1_dat3
+ * 2:sdmmc4_dat0
+ * UART RXD pin
+ * UART A:
+ * 0: unspecified
+ * 1:sdmmc3_cmd
+ * 2:uart2_cts_n
+ * 3:ulpi_data1
+ * 4:gpio_pu1
+ * UART B:
+ * 0: unspecified
+ * 1:uart2_rxd
+ * UART C:
+ * 0: unspecified
+ * 1:uart3_rxd
+ * UART D:
+ * 0: unspecified
+ * 1:gmi_a17
+ * 2:ulpi_dir
+ * UART E:
+ * 0: unspecified
+ * 1:sdmmc1_dat2
+ * 2:sdmmc4_dat1
PATCH 11/11 tegra20: remove funcmux
In reply to Lucas StachIt's not used by anything anymore, now that all boards are using tablebased pinmux.
--- arch/arm/cpu/tegra-common/board.c | 1 - arch/arm/cpu/tegra20-common/Makefile | 2 +- arch/arm/cpu/tegra20-common/funcmux.c | 310 ---------------------------- arch/arm/include/asm/arch-tegra20/funcmux.h | 67 ------ board/nvidia/common/board.c | 1 - drivers/mtd/nand/tegra_nand.c | 1 - 6 files changed, 1 insertion(+), 381 deletions(-) delete mode 100644 arch/arm/cpu/tegra20-common/funcmux.c delete mode 100644 arch/arm/include/asm/arch-tegra20/funcmux.h
arch/arm/cpu/tegra-common/board.c +0 -1
@@ -24,7 +24,6 @@#include <common.h> #include <asm/io.h> #include <asm/arch/clock.h> -#include <asm/arch/funcmux.h> #include <asm/arch/tegra.h> #include <asm/arch-tegra/board.h> #include <asm/arch-tegra/pmc.h>
arch/arm/cpu/tegra20-common/Makefile +1 -1
@@ -31,7 +31,7 @@ CFLAGS_arch/arm/cpu/tegra20-common/warmboot_avp.o += -march=armv4t LIB = $(obj)lib$(SOC)-common.o -COBJS-y += clock.o funcmux.o pinmux.o +COBJS-y += clock.o pinmux.o COBJS-$(CONFIG_TEGRA_LP0) += warmboot.o crypto.o warmboot_avp.o COBJS-$(CONFIG_TEGRA_CLOCK_SCALING) += emc.o COBJS-$(CONFIG_TEGRA_PMU) += pmu.o
arch/arm/cpu/tegra20-common/funcmux.c deleted +0 -310
310 lines not on this page · raw message
arch/arm/include/asm/arch-tegra20/funcmux.h deleted +0 -67
67 lines not on this page · raw message
board/nvidia/common/board.c +0 -1
@@ -29,7 +29,6 @@#ifdef CONFIG_LCD #include <asm/arch/display.h> #endif -#include <asm/arch/funcmux.h> #include <asm/arch/pinmux.h> #include <asm/arch/pmu.h> #ifdef CONFIG_PWM_TEGRA
drivers/mtd/nand/tegra_nand.c +0 -1
@@ -27,7 +27,6 @@#include <asm/io.h> #include <nand.h> #include <asm/arch/clock.h> -#include <asm/arch/funcmux.h> #include <asm/arch-tegra/clk_rst.h> #include <asm/errno.h> #include <asm/gpio.h>
Signature · 1 line
1.8.0.2