pinctrl: add a driver for NVIDIA Tegra
PATCH v2 1/4 pinctrl: add a driver for NVIDIA Tegra
This adds a driver for the Tegra pinmux, and required parameterization data for Tegra20 and Tegra30.
The driver is initially added with driver name and device tree compatible value that won't cause this driver to be used. A later change will switch the pinctrl driver to use the correct values, switch the old pinmux driver to be disabled, and update all code that uses the old pinmux APIs to use the new pinctrl APIs.
--
v2: Add kerneldoc to pinctrl-tegra.h, use bit fields throughout struct tegra_pingroup to reduce the static data size for each pin group.
--- arch/arm/mach-tegra/include/mach/pinconf-tegra.h | 63 + drivers/pinctrl/Kconfig | 15 + drivers/pinctrl/Makefile | 3 + drivers/pinctrl/pinctrl-tegra.c | 559 ++++ drivers/pinctrl/pinctrl-tegra.h | 163 + drivers/pinctrl/pinctrl-tegra20.c | 2860 +++++++++++++++++ drivers/pinctrl/pinctrl-tegra30.c | 3726 ++++++++++++++++++++++ 7 files changed, 7389 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-tegra/include/mach/pinconf-tegra.h create mode 100644 drivers/pinctrl/pinctrl-tegra.c create mode 100644 drivers/pinctrl/pinctrl-tegra.h create mode 100644 drivers/pinctrl/pinctrl-tegra20.c create mode 100644 drivers/pinctrl/pinctrl-tegra30.c
arch/arm/mach-tegra/include/mach/pinconf-tegra.h new file +63 -0
@@ -0,0 +1,63 @@ +/* +* pinctrl configuration definitions for the NVIDIA Tegra pinmux +* +* Copyright (c) 2011, NVIDIA CORPORATION. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms and conditions of the GNU General Public License, +* version 2, as published by the Free Software Foundation. +* +* This program is distributed in the hope it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +*/ + +#ifndef __PINCONF_TEGRA_H__ +#define __PINCONF_TEGRA_H__ + +enum tegra_pinconf_param { +/* argument: tegra_pinconf_pull */ +TEGRA_PINCONF_PARAM_PULL , +/* argument: tegra_pinconf_tristate */ +TEGRA_PINCONF_PARAM_TRISTATE , +/* argument: Boolean */ +TEGRA_PINCONF_PARAM_ENABLE_INPUT , +/* argument: Boolean */ +TEGRA_PINCONF_PARAM_OPEN_DRAIN , +/* argument: Boolean */ +TEGRA_PINCONF_PARAM_LOCK , +/* argument: Boolean */ +TEGRA_PINCONF_PARAM_IORESET , +/* argument: Boolean */ +TEGRA_PINCONF_PARAM_HIGH_SPEED_MODE , +/* argument: Boolean */ +TEGRA_PINCONF_PARAM_SCHMITT , +/* argument: Boolean */ +TEGRA_PINCONF_PARAM_LOW_POWER_MODE , +/* argument: Integer, range is HW-dependant */ +TEGRA_PINCONF_PARAM_DRIVE_DOWN_STRENGTH , +/* argument: Integer, range is HW-dependant */ +TEGRA_PINCONF_PARAM_DRIVE_UP_STRENGTH , +/* argument: Integer, range is HW-dependant */ +TEGRA_PINCONF_PARAM_SLEW_RATE_FALLING , +/* argument: Integer, range is HW-dependant */ +TEGRA_PINCONF_PARAM_SLEW_RATE_RISING , +}; + +enum tegra_pinconf_pull { +TEGRA_PINCONFIG_PULL_NONE , +TEGRA_PINCONFIG_PULL_DOWN , +TEGRA_PINCONFIG_PULL_UP , +}; + +enum tegra_pinconf_tristate { +TEGRA_PINCONFIG_DRIVEN , +TEGRA_PINCONFIG_TRISTATE , +}; + +#define TEGRA_PINCONF_PACK (_param_, _arg_) ((_param_) << 16 | (_arg_)) +#define TEGRA_PINCONF_UNPACK_PARAM (_conf_) ((_conf_) >> 16) +#define TEGRA_PINCONF_UNPACK_ARG (_conf_) ((_conf_) & 0xffff) + +#endif
drivers/pinctrl/Kconfig +15 -0
@@ -50,6 +50,21 @@ config PINCTRL_SIRF depends on ARCH_PRIMA2 select PINMUX +config PINCTRL_TEGRA + bool + +config PINCTRL_TEGRA20 + bool + select PINMUX + select PINCONF + select PINCTRL_TEGRA + +config PINCTRL_TEGRA30 + bool + select PINMUX + select PINCONF + select PINCTRL_TEGRA + config PINCTRL_U300 bool "U300 pin controller driver" depends on ARCH_U300
drivers/pinctrl/Makefile +3 -0
@@ -10,5 +10,8 @@ obj-$(CONFIG_PINCTRL_MMP2) += pinctrl-mmp2.o obj-$(CONFIG_PINCTRL_PXA168) += pinctrl-pxa168.o obj-$(CONFIG_PINCTRL_PXA910) += pinctrl-pxa910.o obj-$(CONFIG_PINCTRL_SIRF) += pinctrl-sirf.o +obj-$(CONFIG_PINCTRL_TEGRA) += pinctrl-tegra.o +obj-$(CONFIG_PINCTRL_TEGRA20) += pinctrl-tegra20.o +obj-$(CONFIG_PINCTRL_TEGRA30) += pinctrl-tegra30.o obj-$(CONFIG_PINCTRL_U300) += pinctrl-u300.o obj-$(CONFIG_PINCTRL_COH901) += pinctrl-coh901.o
drivers/pinctrl/pinctrl-tegra.c new file +559 -0
559 lines not on this page · raw message
drivers/pinctrl/pinctrl-tegra.h new file +163 -0
163 lines not on this page · raw message
drivers/pinctrl/pinctrl-tegra20.c new file +2860 -0
2,186 lines not on this page · raw message
drivers/pinctrl/pinctrl-tegra30.c new file +3726 -0
3,726 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.0.4
Part of the diff is not shown here. View the raw message.
PATCH v2 2/4 ARM: tegra: Select PINCTRL Kconfig variables
This causes the Tegra pinctrl driver to be built whenever core Tegra support is enabled.
--- arch/arm/mach-tegra/Kconfig | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/Kconfig +4 -0
@@ -7,6 +7,8 @@ config ARCH_TEGRA_2x_SOC select CPU_V7 select ARM_GIC select ARCH_REQUIRE_GPIOLIB + select PINCTRL + select PINCTRL_TEGRA20 select USB_ARCH_HAS_EHCI if USB_SUPPORT select USB_ULPI if USB_SUPPORT select USB_ULPI_VIEWPORT if USB_SUPPORT
@@ -19,6 +21,8 @@ config ARCH_TEGRA_3x_SOC select CPU_V7 select ARM_GIC select ARCH_REQUIRE_GPIOLIB + select PINCTRL + select PINCTRL_TEGRA30 select USB_ARCH_HAS_EHCI if USB_SUPPORT select USB_ULPI if USB_SUPPORT select USB_ULPI_VIEWPORT if USB_SUPPORT
Signature · 1 line
1.7.0.4
PATCH v2 3/4 ARM: tegra: Switch to new pinctrl driver
In reply to Stephen Warren* Rename old pinmux and new pinctrl platform driver and DT match table entries, so the new driver gets instantiated.
* Re-write board-pinmux.c, so that it uses pinctrl APIs to configura the pinmux.
* Re-write board-*-pinmux.c so that the pinmux configuration tables are in pinctrl format.
Ventana's pin mux table needed some edits on top of the basic format conversion, since some mux options that were previously marked as reserved are now valid in the new pinctrl driver. Attempting to use the old reserved names will result in a failure. Specifically, groups lpw0, lpw2, lsc1, lsck, and lsda were changed from function rsvd4 to displaya, and group pta was changed from function rsvd2 to hdmi.
All boards' pin mux tables needed some edits on top of the based format conversion, since function i2c was split into i2c1 (first general I2C controller) and i2cp (power I2C controller) to better align function definitions with HW blocks.
Due to the split of mux tables into pure mux and pull/tristate tables, many entries in the separate Seaboard/Ventana tables could be merged into the common table, since the entries differed only in the portion in one of the tables, not both.
Most pin groups allow configuration of mux, tri-state, and pull. However, some don't allow pull configuration, which is instead configured by new groups that only allow pull configuration. This is a reflection of the true HW capabilities, which weren't fully represented by the old pinmux driver. This required adding new pull table entries for those new groups, and setting many other entries' pull configuration to TEGRA_PINCONFIG_DONT_SET.
--- arch/arm/mach-tegra/board-harmony-pinmux.c | 362 ++++++++++++++------- arch/arm/mach-tegra/board-paz00-pinmux.c | 362 ++++++++++++++------- arch/arm/mach-tegra/board-pinmux.c | 62 ++++- arch/arm/mach-tegra/board-pinmux.h | 39 ++- arch/arm/mach-tegra/board-seaboard-pinmux.c | 442 ++++++++++++++++--------- arch/arm/mach-tegra/board-trimslice-pinmux.c | 366 ++++++++++++++-------- arch/arm/mach-tegra/pinmux.c | 6 +- drivers/pinctrl/pinctrl-tegra.c | 6 +- 8 files changed, 1095 insertions(+), 550 deletions(-)
arch/arm/mach-tegra/board-harmony-pinmux.c +238 -124
@@ -2,6 +2,7 @@* arch/arm/mach-tegra/board-harmony-pinmux.c * * Copyright (C) 2010 Google, Inc. +* Copyright (c) 2011, NVIDIA CORPORATION. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and
@@ -15,133 +16,244 @@*/ #include <linux/kernel.h> -#include <linux/gpio.h> -#include <linux/of.h> - -#include <mach/pinmux.h> -#include <mach/pinmux-tegra20.h> #include "gpio-names.h" #include "board-harmony.h" #include "board-pinmux.h" -static struct tegra_pingroup_config harmony_pinmux[] = { - {TEGRA_PINGROUP_ATA ,TEGRA_MUX_IDE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_ATB ,TEGRA_MUX_SDIO4 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_ATC ,TEGRA_MUX_NAND ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_ATD ,TEGRA_MUX_GMI ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_ATE ,TEGRA_MUX_GMI ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_CDEV1 ,TEGRA_MUX_PLLA_OUT ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_CDEV2 ,TEGRA_MUX_PLLP_OUT4 ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_CRTP ,TEGRA_MUX_CRT ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_CSUS ,TEGRA_MUX_VI_SENSOR_CLK ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_DAP1 ,TEGRA_MUX_DAP1 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_DAP2 ,TEGRA_MUX_DAP2 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_DAP3 ,TEGRA_MUX_DAP3 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_DAP4 ,TEGRA_MUX_DAP4 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_DDC ,TEGRA_MUX_I2C2 ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_DTA ,TEGRA_MUX_SDIO2 ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_DTB ,TEGRA_MUX_RSVD1 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_DTC ,TEGRA_MUX_RSVD1 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_DTD ,TEGRA_MUX_SDIO2 ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_DTE ,TEGRA_MUX_RSVD1 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_DTF ,TEGRA_MUX_I2C3 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_GMA ,TEGRA_MUX_SDIO4 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_GMB ,TEGRA_MUX_GMI ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_GMC ,TEGRA_MUX_UARTD ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_GMD ,TEGRA_MUX_GMI ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_GME ,TEGRA_MUX_SDIO4 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_GPU ,TEGRA_MUX_GMI ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_GPU7 ,TEGRA_MUX_RTCK ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_GPV ,TEGRA_MUX_PCIE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_HDINT ,TEGRA_MUX_HDMI ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_I2CP ,TEGRA_MUX_I2C ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_IRRX ,TEGRA_MUX_UARTA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_IRTX ,TEGRA_MUX_UARTA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_KBCA ,TEGRA_MUX_KBC ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_KBCB ,TEGRA_MUX_KBC ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_KBCC ,TEGRA_MUX_KBC ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_KBCD ,TEGRA_MUX_KBC ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_KBCE ,TEGRA_MUX_KBC ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_KBCF ,TEGRA_MUX_KBC ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LCSN ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_LD0 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD1 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD10 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD11 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD12 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD13 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD14 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD15 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD16 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD17 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD2 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD3 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD4 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD5 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD6 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD7 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD8 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LD9 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LDC ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_LDI ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LHP0 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LHP1 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LHP2 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LHS ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LM0 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LM1 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_LPP ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LPW0 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LPW1 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_LPW2 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LSC0 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LSC1 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_LSCK ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_LSDA ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_LSDI ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_LSPI ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LVP0 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_LVP1 ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_LVS ,TEGRA_MUX_DISPLAYA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_OWC ,TEGRA_MUX_RSVD2 ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_PMC ,TEGRA_MUX_PWR_ON ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_PTA ,TEGRA_MUX_HDMI ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_RM ,TEGRA_MUX_I2C ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_SDB ,TEGRA_MUX_PWM ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SDC ,TEGRA_MUX_PWM ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_SDD ,TEGRA_MUX_PWM ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SDIO1 ,TEGRA_MUX_SDIO1 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SLXA ,TEGRA_MUX_PCIE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SLXC ,TEGRA_MUX_SPDIF ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SLXD ,TEGRA_MUX_SPDIF ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SLXK ,TEGRA_MUX_PCIE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SPDI ,TEGRA_MUX_RSVD2 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SPDO ,TEGRA_MUX_RSVD2 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SPIA ,TEGRA_MUX_GMI ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_SPIB ,TEGRA_MUX_GMI ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_SPIC ,TEGRA_MUX_GMI ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SPID ,TEGRA_MUX_SPI1 ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SPIE ,TEGRA_MUX_SPI1 ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SPIF ,TEGRA_MUX_SPI1 ,TEGRA_PUPD_PULL_DOWN ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SPIG ,TEGRA_MUX_SPI2_ALT ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_SPIH ,TEGRA_MUX_SPI2_ALT ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_UAA ,TEGRA_MUX_ULPI ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_UAB ,TEGRA_MUX_ULPI ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_UAC ,TEGRA_MUX_RSVD2 ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_UAD ,TEGRA_MUX_IRDA ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_UCA ,TEGRA_MUX_UARTC ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_UCB ,TEGRA_MUX_UARTC ,TEGRA_PUPD_PULL_UP ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_UDA ,TEGRA_MUX_ULPI ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_TRISTATE }, - {TEGRA_PINGROUP_CK32 ,TEGRA_MUX_NONE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_DDRC ,TEGRA_MUX_NONE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_PMCA ,TEGRA_MUX_NONE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_PMCB ,TEGRA_MUX_NONE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_PMCC ,TEGRA_MUX_NONE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_PMCD ,TEGRA_MUX_NONE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_PMCE ,TEGRA_MUX_NONE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_XM2C ,TEGRA_MUX_NONE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, - {TEGRA_PINGROUP_XM2D ,TEGRA_MUX_NONE ,TEGRA_PUPD_NORMAL ,TEGRA_TRI_NORMAL }, +static struct pinmux_map harmony_map[] = { +TEGRA_PINMUX_MAP ("ata" ,"ide" ), +TEGRA_PINMUX_MAP ("atb" ,"sdio4" ), +TEGRA_PINMUX_MAP ("atc" ,"nand" ), +TEGRA_PINMUX_MAP ("atd" ,"gmi" ), +TEGRA_PINMUX_MAP ("ate" ,"gmi" ), +TEGRA_PINMUX_MAP ("cdev1" ,"plla_out" ), +TEGRA_PINMUX_MAP ("cdev2" ,"pllp_out4" ), +TEGRA_PINMUX_MAP ("crtp" ,"crt" ), +TEGRA_PINMUX_MAP ("csus" ,"vi_sensor_clk" ), +TEGRA_PINMUX_MAP ("dap1" ,"dap1" ), +TEGRA_PINMUX_MAP ("dap2" ,"dap2" ), +TEGRA_PINMUX_MAP ("dap3" ,"dap3" ), +TEGRA_PINMUX_MAP ("dap4" ,"dap4" ), +TEGRA_PINMUX_MAP ("ddc" ,"i2c2" ), +TEGRA_PINMUX_MAP ("dta" ,"sdio2" ), +TEGRA_PINMUX_MAP ("dtb" ,"rsvd1" ), +TEGRA_PINMUX_MAP ("dtc" ,"rsvd1" ), +TEGRA_PINMUX_MAP ("dtd" ,"sdio2" ), +TEGRA_PINMUX_MAP ("dte" ,"rsvd1" ), +TEGRA_PINMUX_MAP ("dtf" ,"i2c3" ), +TEGRA_PINMUX_MAP ("gma" ,"sdio4" ), +TEGRA_PINMUX_MAP ("gmb" ,"gmi" ), +TEGRA_PINMUX_MAP ("gmc" ,"uartd" ), +TEGRA_PINMUX_MAP ("gmd" ,"gmi" ), +TEGRA_PINMUX_MAP ("gme" ,"sdio4" ), +TEGRA_PINMUX_MAP ("gpu" ,"gmi" ), +TEGRA_PINMUX_MAP ("gpu7" ,"rtck" ), +TEGRA_PINMUX_MAP ("gpv" ,"pcie" ), +TEGRA_PINMUX_MAP ("hdint" ,"hdmi" ), +TEGRA_PINMUX_MAP ("i2cp" ,"i2cp" ), +TEGRA_PINMUX_MAP ("irrx" ,"uarta" ), +TEGRA_PINMUX_MAP ("irtx" ,"uarta" ), +TEGRA_PINMUX_MAP ("kbca" ,"kbc" ), +TEGRA_PINMUX_MAP ("kbcb" ,"kbc" ), +TEGRA_PINMUX_MAP ("kbcc" ,"kbc" ), +TEGRA_PINMUX_MAP ("kbcd" ,"kbc" ), +TEGRA_PINMUX_MAP ("kbce" ,"kbc" ), +TEGRA_PINMUX_MAP ("kbcf" ,"kbc" ), +TEGRA_PINMUX_MAP ("lcsn" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld0" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld1" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld2" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld3" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld4" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld5" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld6" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld7" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld8" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld9" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld10" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld11" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld12" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld13" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld14" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld15" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld16" ,"displaya" ), +TEGRA_PINMUX_MAP ("ld17" ,"displaya" ), +TEGRA_PINMUX_MAP ("ldc" ,"displaya" ), +TEGRA_PINMUX_MAP ("ldi" ,"displaya" ), +TEGRA_PINMUX_MAP ("lhp0" ,"displaya" ), +TEGRA_PINMUX_MAP ("lhp1" ,"displaya" ), +TEGRA_PINMUX_MAP ("lhp2" ,"displaya" ), +TEGRA_PINMUX_MAP ("lhs" ,"displaya" ), +TEGRA_PINMUX_MAP ("lm0" ,"displaya" ), +TEGRA_PINMUX_MAP ("lm1" ,"displaya" ), +TEGRA_PINMUX_MAP ("lpp" ,"displaya" ), +TEGRA_PINMUX_MAP ("lpw0" ,"displaya" ), +TEGRA_PINMUX_MAP ("lpw1" ,"displaya" ), +TEGRA_PINMUX_MAP ("lpw2" ,"displaya" ), +TEGRA_PINMUX_MAP ("lsc0" ,"displaya" ), +TEGRA_PINMUX_MAP ("lsc1" ,"displaya" ), +TEGRA_PINMUX_MAP ("lsck" ,"displaya" ), +TEGRA_PINMUX_MAP ("lsda" ,"displaya" ), +TEGRA_PINMUX_MAP ("lsdi" ,"displaya" ), +TEGRA_PINMUX_MAP ("lspi" ,"displaya" ), +TEGRA_PINMUX_MAP ("lvp0" ,"displaya" ), +TEGRA_PINMUX_MAP ("lvp1" ,"displaya" ), +TEGRA_PINMUX_MAP ("lvs" ,"displaya" ), +TEGRA_PINMUX_MAP ("owc" ,"rsvd2" ), +TEGRA_PINMUX_MAP ("pmc" ,"pwr_on" ), +TEGRA_PINMUX_MAP ("pta" ,"hdmi" ), +TEGRA_PINMUX_MAP ("rm" ,"i2c1" ), +TEGRA_PINMUX_MAP ("sdb" ,"pwm" ), +TEGRA_PINMUX_MAP ("sdc" ,"pwm" ), +TEGRA_PINMUX_MAP ("sdd" ,"pwm" ), +TEGRA_PINMUX_MAP ("sdio1" ,"sdio1" ), +TEGRA_PINMUX_MAP ("slxa" ,"pcie" ), +TEGRA_PINMUX_MAP ("slxc" ,"spdif" ), +TEGRA_PINMUX_MAP ("slxd" ,"spdif" ), +TEGRA_PINMUX_MAP ("slxk" ,"pcie" ), +TEGRA_PINMUX_MAP ("spdi" ,"rsvd2" ), +TEGRA_PINMUX_MAP ("spdo" ,"rsvd2" ), +TEGRA_PINMUX_MAP ("spia" ,"gmi" ), +TEGRA_PINMUX_MAP ("spib" ,"gmi" ), +TEGRA_PINMUX_MAP ("spic" ,"gmi" ), +TEGRA_PINMUX_MAP ("spid" ,"spi1" ), +TEGRA_PINMUX_MAP ("spie" ,"spi1" ), +TEGRA_PINMUX_MAP ("spif" ,"spi1" ), +TEGRA_PINMUX_MAP ("spig" ,"spi2_alt" ), +TEGRA_PINMUX_MAP ("spih" ,"spi2_alt" ), +TEGRA_PINMUX_MAP ("uaa" ,"ulpi" ), +TEGRA_PINMUX_MAP ("uab" ,"ulpi" ), +TEGRA_PINMUX_MAP ("uac" ,"rsvd2" ), +TEGRA_PINMUX_MAP ("uad" ,"irda" ), +TEGRA_PINMUX_MAP ("uca" ,"uartc" ), +TEGRA_PINMUX_MAP ("ucb" ,"uartc" ), +TEGRA_PINMUX_MAP ("uda" ,"ulpi" ), +}; + +struct tegra_board_pinmux_pg_conf harmony_pg[] = { + {"ata" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"atb" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"atc" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"atd" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"ate" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"cdev1" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"cdev2" ,TEGRA_PINCONFIG_PULL_DOWN ,TEGRA_PINCONFIG_TRISTATE }, + {"crtp" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"csus" ,TEGRA_PINCONFIG_PULL_DOWN ,TEGRA_PINCONFIG_TRISTATE }, + {"dap1" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"dap2" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"dap3" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"dap4" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"ddc" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DRIVEN }, + {"dta" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DRIVEN }, + {"dtb" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"dtc" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"dtd" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DRIVEN }, + {"dte" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"dtf" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"gma" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"gmb" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"gmc" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"gmd" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"gme" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"gpu" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"gpu7" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"gpv" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"hdint" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"i2cp" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"irrx" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_TRISTATE }, + {"irtx" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_TRISTATE }, + {"kbca" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DRIVEN }, + {"kbcb" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DRIVEN }, + {"kbcc" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DRIVEN }, + {"kbcd" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DRIVEN }, + {"kbce" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DRIVEN }, + {"kbcf" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DRIVEN }, + {"lcsn" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"ld0" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld1" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld2" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld3" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld4" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld5" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld6" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld7" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld8" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld9" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld10" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld11" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld12" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld13" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld14" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld15" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld16" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ld17" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"ldc" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"ldi" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lhp0" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lhp1" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lhp2" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lhs" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lm0" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lm1" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"lpp" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lpw0" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lpw1" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"lpw2" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lsc0" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lsc1" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"lsck" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"lsda" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"lsdi" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"lspi" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lvp0" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"lvp1" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"lvs" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"owc" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"pmc" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_DRIVEN }, + {"pta" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"rm" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"sdb" ,TEGRA_PINCONFIG_DONT_SET ,TEGRA_PINCONFIG_TRISTATE }, + {"sdc" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DRIVEN }, + {"sdd" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_TRISTATE }, + {"sdio1" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"slxa" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"slxc" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"slxd" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"slxk" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"spdi" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"spdo" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"spia" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"spib" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DRIVEN }, + {"spic" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_TRISTATE }, + {"spid" ,TEGRA_PINCONFIG_PULL_DOWN ,TEGRA_PINCONFIG_TRISTATE }, + {"spie" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_TRISTATE }, + {"spif" ,TEGRA_PINCONFIG_PULL_DOWN ,TEGRA_PINCONFIG_TRISTATE }, + {"spig" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"spih" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_TRISTATE }, + {"uaa" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_TRISTATE }, + {"uab" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_TRISTATE }, + {"uac" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"uad" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_TRISTATE }, + {"uca" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_TRISTATE }, + {"ucb" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_TRISTATE }, + {"uda" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_TRISTATE }, + {"ck32" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DONT_SET }, + {"ddrc" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DONT_SET }, + {"pmca" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DONT_SET }, + {"pmcb" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DONT_SET }, + {"pmcc" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DONT_SET }, + {"pmcd" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DONT_SET }, + {"pmce" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DONT_SET }, + {"xm2c" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DONT_SET }, + {"xm2d" ,TEGRA_PINCONFIG_PULL_NONE ,TEGRA_PINCONFIG_DONT_SET }, + {"ls" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DONT_SET }, + {"lc" ,TEGRA_PINCONFIG_PULL_UP ,TEGRA_PINCONFIG_DONT_SET }, + {"ld17_0" ,TEGRA_PINCONFIG_PULL_DOWN ,TEGRA_PINCONFIG_DONT_SET }, + {"ld19_18" ,TEGRA_PINCONFIG_PULL_DOWN ,TEGRA_PINCONFIG_DONT_SET }, + {"ld21_20" ,TEGRA_PINCONFIG_PULL_DOWN ,TEGRA_PINCONFIG_DONT_SET }, + {"ld23_22" ,TEGRA_PINCONFIG_PULL_DOWN ,TEGRA_PINCONFIG_DONT_SET }, };static struct tegra_gpio_table gpio_table[] = {
@@ -158,8 +270,10 @@ static struct tegra_gpio_table gpio_table[] = { };static struct tegra_board_pinmux_conf conf = { - .pgs = harmony_pinmux, - .pg_count =ARRAY_SIZE (harmony_pinmux), + .maps = harmony_map, + .map_count =ARRAY_SIZE (harmony_map), + .pgs = harmony_pg, + .pg_count =ARRAY_SIZE (harmony_pg), .gpios = gpio_table, .gpio_count =ARRAY_SIZE (gpio_table), };
arch/arm/mach-tegra/board-paz00-pinmux.c +238 -124
385 lines not on this page · raw message
arch/arm/mach-tegra/board-pinmux.c +55 -7
93 lines not on this page · raw message
arch/arm/mach-tegra/board-pinmux.h +35 -4
@@ -15,17 +15,48 @@ #ifndef __MACH_TEGRA_BOARD_PINMUX_H #define __MACH_TEGRA_BOARD_PINMUX_H +#include <linux/pinctrl/machine.h> + +#include <mach/pinconf-tegra.h> + #define GPIO_DEV "tegra-gpio" #define PINMUX_DEV "tegra-pinmux" -struct tegra_pingroup_config; -struct tegra_gpio_table; +#define TEGRA_PINMUX_MAP(_group_, _function_) { \ + .name = _group_, \ + .ctrl_dev_name = PINMUX_DEV, \ + .group = _group_, \ + .function = _function_, \ + .hog_on_boot = true, \ +} + +#define TEGRA_PINCONFIG_DONT_SET 0xffff + +struct tegra_board_pinmux_pg_conf { + const char *group; + u16 pull; + u16 tristate; +}; + +struct tegra_board_pinmux_drive_conf { + const char *group; + u16 high_speed_mode; + u16 schmitt; + u16 low_power_mode; + u16 drive_down_strength; + u16 drive_up_strength; + u16 slew_falling; + u16 slew_rising; +}; struct tegra_board_pinmux_conf { - struct tegra_pingroup_config *pgs; + struct pinmux_map *maps; + int map_count; + + struct tegra_board_pinmux_pg_conf *pgs; int pg_count; - struct tegra_drive_pingroup_config *drives; + struct tegra_board_pinmux_drive_conf *drives; int drive_count; struct tegra_gpio_table *gpios;
arch/arm/mach-tegra/board-seaboard-pinmux.c +283 -159
476 lines not on this page · raw message
arch/arm/mach-tegra/board-trimslice-pinmux.c +240 -126
389 lines not on this page · raw message
arch/arm/mach-tegra/pinmux.c +3 -3
@@ -711,10 +711,10 @@ void tegra_pinmux_config_pullupdown_table(const struct tegra_pingroup_config *costatic struct of_device_id tegra_pinmux_of_match[]__devinitdata = { #ifdef CONFIG_ARCH_TEGRA_2x_SOC - { .compatible ="nvidia,tegra20-pinmux" , tegra20_pinmux_init }, + { .compatible ="nvidia,tegra20-pinmux-disabled" , tegra20_pinmux_init }, #endif #ifdef CONFIG_ARCH_TEGRA_3x_SOC - { .compatible ="nvidia,tegra30-pinmux" , tegra30_pinmux_init }, + { .compatible ="nvidia,tegra30-pinmux-disabled" , tegra30_pinmux_init }, #endif { }, };
@@ -809,7 +809,7 @@ static int __devinit tegra_pinmux_probe(struct platform_device *pdev)static struct platform_driver tegra_pinmux_driver = { .driver = { - .name ="tegra-pinmux" , + .name ="tegra-pinmux-disabled" , .owner =THIS_MODULE , .of_match_table = tegra_pinmux_of_match, },
drivers/pinctrl/pinctrl-tegra.c +3 -3
@@ -31,7 +31,7 @@#include "pinctrl-tegra.h" -#define DRIVER_NAME "tegra-pinmux-disabled" +#define DRIVER_NAME "tegra-pinmux"struct tegra_pmx {struct device *dev;
@@ -422,13 +422,13 @@ static struct pinctrl_desc tegra_pinctrl_desc = {static struct of_device_id tegra_pinctrl_of_match[]__devinitdata = { #ifdef CONFIG_PINCTRL_TEGRA20 { - .compatible ="nvidia,tegra20-pinmux-disabled" , + .compatible ="nvidia,tegra20-pinmux" , .data = tegra20_pinctrl_init, }, #endif #ifdef CONFIG_PINCTRL_TEGRA30 { - .compatible ="nvidia,tegra30-pinmux-disabled" , + .compatible ="nvidia,tegra30-pinmux" , .data = tegra30_pinctrl_init, }, #endif
Signature · 1 line
1.7.0.4
PATCH v2 4/4 ARM: tegra: Remove pre-pinctrl pinmux driver
In reply to Stephen WarrenThe pinctrl driver is now active and used by all boards. Remove the old pinmux driver.
--- arch/arm/mach-tegra/Makefile | 3 - arch/arm/mach-tegra/include/mach/pinmux-tegra20.h | 184 ---- arch/arm/mach-tegra/include/mach/pinmux-tegra30.h | 320 ------- arch/arm/mach-tegra/include/mach/pinmux.h | 302 ------- arch/arm/mach-tegra/pinmux-tegra20-tables.c | 244 ----- arch/arm/mach-tegra/pinmux-tegra30-tables.c | 376 -------- arch/arm/mach-tegra/pinmux.c | 987 --------------------- 7 files changed, 0 insertions(+), 2416 deletions(-) delete mode 100644 arch/arm/mach-tegra/include/mach/pinmux-tegra20.h delete mode 100644 arch/arm/mach-tegra/include/mach/pinmux-tegra30.h delete mode 100644 arch/arm/mach-tegra/include/mach/pinmux.h delete mode 100644 arch/arm/mach-tegra/pinmux-tegra20-tables.c delete mode 100644 arch/arm/mach-tegra/pinmux-tegra30-tables.c delete mode 100644 arch/arm/mach-tegra/pinmux.c
arch/arm/mach-tegra/Makefile +0 -3
@@ -5,13 +5,10 @@ obj-y += io.o obj-y += irq.o obj-y += clock.o obj-y += timer.o -obj-y += pinmux.o obj-y += fuse.o obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += powergate.o obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_clocks.o obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o -obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += pinmux-tegra20-tables.o -obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += pinmux-tegra30-tables.o obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks.o obj-$(CONFIG_SMP) += platsmp.o localtimer.o headsmp.o
arch/arm/mach-tegra/include/mach/pinmux-tegra20.h deleted +0 -184
184 lines not on this page · raw message
arch/arm/mach-tegra/include/mach/pinmux-tegra30.h deleted +0 -320
320 lines not on this page · raw message
arch/arm/mach-tegra/include/mach/pinmux.h deleted +0 -302
302 lines not on this page · raw message
arch/arm/mach-tegra/pinmux-tegra20-tables.c deleted +0 -244
244 lines not on this page · raw message
arch/arm/mach-tegra/pinmux-tegra30-tables.c deleted +0 -376
376 lines not on this page · raw message
arch/arm/mach-tegra/pinmux.c deleted +0 -987
987 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Quoted 2 lines · Stephen Warren
This adds a driver for the Tegra pinmux, and required parameterization data for Tegra20 and Tegra30.
OK so I've applied this monster patch and the three others,
the diffstat looks like so:
git diff --stat v3.3-rc2..HEAD
arch/arm/mach-tegra/Kconfig | 4 + arch/arm/mach-tegra/Makefile | 3 - arch/arm/mach-tegra/board-harmony-pinmux.c | 362 ++- arch/arm/mach-tegra/board-paz00-pinmux.c | 362 ++- arch/arm/mach-tegra/board-pinmux.c | 62 +- arch/arm/mach-tegra/board-pinmux.h | 39 +- arch/arm/mach-tegra/board-seaboard-pinmux.c | 442 ++- arch/arm/mach-tegra/board-trimslice-pinmux.c | 366 ++- arch/arm/mach-tegra/include/mach/pinconf-tegra.h | 63 + arch/arm/mach-tegra/include/mach/pinmux-tegra20.h | 184 - arch/arm/mach-tegra/include/mach/pinmux-tegra30.h | 320 -- arch/arm/mach-tegra/include/mach/pinmux.h | 302 -- arch/arm/mach-tegra/pinmux-tegra20-tables.c | 244 -- arch/arm/mach-tegra/pinmux-tegra30-tables.c | 376 --- arch/arm/mach-tegra/pinmux.c | 987 ------ drivers/pinctrl/Kconfig | 15 + drivers/pinctrl/Makefile | 3 + drivers/pinctrl/pinctrl-tegra.c | 559 +++ drivers/pinctrl/pinctrl-tegra.h | 163 + drivers/pinctrl/pinctrl-tegra20.c | 2860 ++++++++++++++++ drivers/pinctrl/pinctrl-tegra30.c | 3726 +++++++++++++++++++++ 21 files changed, 8482 insertions(+), 2960 deletions(-)
It's still pretty big, adding some 6000 lines in sum total, but you've made your case for having all information about the hardware in the driver quite clear so I've not got much more to say. Short story: the driver knows all about what the hardware can do, and the platform data or device tree will decide how these capabilities are employed on a certain system.
What is nice is to have this out of the ARM tree and under pinctrl subsystem control.
Olof, Arnd: please verify that this is a direction you accept for the Tegra. (Olof has already ACK:ed it, mainly thinking about Arnd.)
I've created a separate branch named pinctrl-tegra-for-next for this series and merged it into my devel and for-next branches and pushed. As suggested by Olof devel and for-next may be rebased but the tegra branch will stay intact (fixes on top is OK).
Olof: I've published the pinctrl-tegra-for-next branch based on v3.3-rc2 here:git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git
pinctrl-tegra-for-next
Yours,
Linus Walleij
Quoted 40 lines · Linus Walleij
Quoted 2 lines · Stephen Warren
This adds a driver for the Tegra pinmux, and required parameterization data for Tegra20 and Tegra30.
OK so I've applied this monster patch and the three others,
the diffstat looks like so:
git diff --stat v3.3-rc2..HEAD
arch/arm/mach-tegra/Kconfig | 4 + arch/arm/mach-tegra/Makefile | 3 - arch/arm/mach-tegra/board-harmony-pinmux.c | 362 ++- arch/arm/mach-tegra/board-paz00-pinmux.c | 362 ++- arch/arm/mach-tegra/board-pinmux.c | 62 +- arch/arm/mach-tegra/board-pinmux.h | 39 +- arch/arm/mach-tegra/board-seaboard-pinmux.c | 442 ++- arch/arm/mach-tegra/board-trimslice-pinmux.c | 366 ++- arch/arm/mach-tegra/include/mach/pinconf-tegra.h | 63 + arch/arm/mach-tegra/include/mach/pinmux-tegra20.h | 184 - arch/arm/mach-tegra/include/mach/pinmux-tegra30.h | 320 -- arch/arm/mach-tegra/include/mach/pinmux.h | 302 -- arch/arm/mach-tegra/pinmux-tegra20-tables.c | 244 -- arch/arm/mach-tegra/pinmux-tegra30-tables.c | 376 --- arch/arm/mach-tegra/pinmux.c | 987 ------ drivers/pinctrl/Kconfig | 15 + drivers/pinctrl/Makefile | 3 + drivers/pinctrl/pinctrl-tegra.c | 559 +++ drivers/pinctrl/pinctrl-tegra.h | 163 + drivers/pinctrl/pinctrl-tegra20.c | 2860 ++++++++++++++++ drivers/pinctrl/pinctrl-tegra30.c | 3726 +++++++++++++++++++++ 21 files changed, 8482 insertions(+), 2960 deletions(-)It's still pretty big, adding some 6000 lines in sum total, but you've made your case for having all information about the hardware in the driver quite clear so I've not got much more to say. Short story: the driver knows all about what the hardware can do, and the platform data or device tree will decide how these capabilities are employed on a certain system.
Quoted 3 lines
What is nice is to have this out of the ARM tree and under pinctrl subsystem control.
Heh, omap and imx have a much big SoC family than tegra. Imaging what if omap and imx do the same thing here, probably will move Linus' attention from arch/arm/ to drivers/pinctrl :)
Fortunately, it seems omap and imx will try to get those huge data out of the driver/kernel.
Signature · 2 lines
Regards, Shawn
Quoted 40 lines · Linus Walleij
Quoted 2 lines · Stephen Warren
This adds a driver for the Tegra pinmux, and required parameterization data for Tegra20 and Tegra30.
OK so I've applied this monster patch and the three others,
the diffstat looks like so:
git diff --stat v3.3-rc2..HEAD
arch/arm/mach-tegra/Kconfig | 4 + arch/arm/mach-tegra/Makefile | 3 - arch/arm/mach-tegra/board-harmony-pinmux.c | 362 ++- arch/arm/mach-tegra/board-paz00-pinmux.c | 362 ++- arch/arm/mach-tegra/board-pinmux.c | 62 +- arch/arm/mach-tegra/board-pinmux.h | 39 +- arch/arm/mach-tegra/board-seaboard-pinmux.c | 442 ++- arch/arm/mach-tegra/board-trimslice-pinmux.c | 366 ++- arch/arm/mach-tegra/include/mach/pinconf-tegra.h | 63 + arch/arm/mach-tegra/include/mach/pinmux-tegra20.h | 184 - arch/arm/mach-tegra/include/mach/pinmux-tegra30.h | 320 -- arch/arm/mach-tegra/include/mach/pinmux.h | 302 -- arch/arm/mach-tegra/pinmux-tegra20-tables.c | 244 -- arch/arm/mach-tegra/pinmux-tegra30-tables.c | 376 --- arch/arm/mach-tegra/pinmux.c | 987 ------ drivers/pinctrl/Kconfig | 15 + drivers/pinctrl/Makefile | 3 + drivers/pinctrl/pinctrl-tegra.c | 559 +++ drivers/pinctrl/pinctrl-tegra.h | 163 + drivers/pinctrl/pinctrl-tegra20.c | 2860 ++++++++++++++++ drivers/pinctrl/pinctrl-tegra30.c | 3726 +++++++++++++++++++++ 21 files changed, 8482 insertions(+), 2960 deletions(-)It's still pretty big, adding some 6000 lines in sum total, but you've made your case for having all information about the hardware in the driver quite clear so I've not got much more to say. Short story: the driver knows all about what the hardware can do, and the platform data or device tree will decide how these capabilities are employed on a certain system.
Quoted 5 lines
What is nice is to have this out of the ARM tree and under pinctrl subsystem control.
Olof, Arnd: please verify that this is a direction you accept for the Tegra. (Olof has already ACK:ed it, mainly thinking about Arnd.)
I would have liked to see a smaller pinctrl driver and one with fewer macros, but I'm not going to complain about it -- drivers/pinctrl is definitely your turf not mine and I assume that Olof's Ack was meant in his position as Tegra maintainer instead of his position as arm-soc maintainer.
It's unfortunate that the number of lines in the board specific pinmux files is actually growing, even though the contents seem to be smaller and it seems to be done in a way that all the data will move into the device tree eventually. What is holding up that move right now? I guess if we could move the per-board pinmux data into dts files, that would mean we could actually get rid of the per-board source files in tegra, right?
One thing that worries me a bit is the object size of the tegra pinctrl driver: There are now about 70kb pinmux driver binary in each kernel that wants to run on tegra (about the same as the remaining tegra platform code), which can become a bottleneck in future multi-platform kernels that also want to run on a lot of other things.
Will it be possible to eventually put the pinmux driver into a loadable module?
Arnd
Quoted 8 lines · Arnd Bergmann
[Me]
Quoted 2 lines
Olof, Arnd: please verify that this is a direction you accept for the Tegra. (Olof has already ACK:ed it, mainly thinking about Arnd.)
I would have liked to see a smaller pinctrl driver and one with fewer macros, but I'm not going to complain about it --
drivers/pinctrlis definitely your turf not mine and I assume that Olof's Ack was meant in his position as Tegra maintainer instead of his position as arm-soc maintainer.
Which means I have no ACK from any of the ARM SoC maintainers on this which is touching the ARM tree substantially and affecting more or less all recent ARM SoCs,
Which is actually bad enough for me to have second thoughts on this.
So I'm taking this branch off from -next until we resolve this.
Quoted 4 lines
It's unfortunate that the number of lines in the board specific pinmux files is actually growing, even though the contents seem to be smaller and it seems to be done in a way that all the data will move into the device tree eventually. What is holding up that move right now?
This is being held up by the discussion in the thread:
"Pinmux bindings proposal V2" and its precursor.
Evidently it is hard to reach consensus on DT bindings, my analysis is that this is because these tend to turn into full-blown hardware-description committe work rather than Linux kernel issues. (This is both good and bad.)
There will be no pinmux DT bindings until there is a patch for it that gets an ACK from the majority of interested parties, preferably all.
Myself I stay out of that discussion in order not to rock the boat.
Quoted 3 lines
I guess if we could move the per-board pinmux data into dts files, that would mean we could actually get rid of the per-board source files in tegra, right?
If you mean these:
arch/arm/mach-tegra/board-harmony-pinmux.c | 362 ++- arch/arm/mach-tegra/board-paz00-pinmux.c | 362 ++- arch/arm/mach-tegra/board-pinmux.c | 62 +- arch/arm/mach-tegra/board-pinmux.h | 39 +- arch/arm/mach-tegra/board-seaboard-pinmux.c | 442 ++- arch/arm/mach-tegra/board-trimslice-pinmux.c | 366 ++-
Then the answer is yes.
But not if you mean these:
drivers/pinctrl/pinctrl-tegra20.c | 2860 ++++++++++++++++ drivers/pinctrl/pinctrl-tegra30.c | 3726 +++++++++++++++++++++
Because the large number of lines come from SoC
properties rather than board properties.
The big issue here is whether SoC hardware block properties (such as the pins and their names, and their groups) should be:
(A) open-coded in the driver or
(B) provided as data in the device tree
nVidia Tegra have opted for the former, Texas OMAP for the latter. The in-kernel drivers also do like Tegra. However they are smaller due to less combinatorics.
This means that the Tegra driver gets (quite a bit) bigger and the OMAP driver (quite a bit) smaller.
Then we've had some arguments about this, you can make a lot of points for and against one or the other, but we have no consensus on the individual rank of these arguments.
I have resorted to the solution found in Documentation/ManagementStyle, chapter 1, which helpfully talks about handling situations of the type
(A) vs (B) ... which means no decision on my part until we sort it out! People will have to discuss it and start ACKing each others patches after finding some rough consensus.
Quoted 6 lines
One thing that worries me a bit is the object size of the tegra pinctrl driver: There are now about 70kb pinmux driver binary in each kernel that wants to run on tegra (about the same as the remaining tegra platform code), which can become a bottleneck in future multi-platform kernels that also want to run on a lot of other things.
This sounds like a correct observation and I think I have said the same previously.
Quoted 2 lines
Will it be possible to eventually put the pinmux driver into a loadable module?
Tony had made it possible to have pinctrl drivers as modules, but some systems may need their pin control up before they even bring up the filesystem :-(
Booting from initramfs and switchroot can solve the above but will slow down boot I believe, and ARM systems usually don't like that.
Yours,
Linus Walleij
Linus Walleij wrote at Friday, February 03, 2012 7:57 AM:
Quoted 10 lines · Arnd Bergmann
Quoted 8 lines
[Me]
Quoted 2 lines
Olof, Arnd: please verify that this is a direction you accept for the Tegra. (Olof has already ACK:ed it, mainly thinking about Arnd.)
I would have liked to see a smaller pinctrl driver and one with fewer macros, but I'm not going to complain about it --
drivers/pinctrlis definitely your turf not mine and I assume that Olof's Ack was meant in his position as Tegra maintainer instead of his position as arm-soc maintainer.
Quoted 8 lines
Which means I have no ACK from any of the ARM SoC maintainers on this which is touching the ARM tree substantially and affecting more or less all recent ARM SoCs,
Which is actually bad enough for me to have second thoughts on this.
So I'm taking this branch off from -next until we resolve this.
Seriously? That's lame.
To be completely honest, I'm losing interest in spending time on pinctrl. Perhaps the solution here is to require bootloaders to set up the complete initial pinmux state, and only use pinctrl for dynamic pinmux. Then, most people can simply ignore pinctrl.
Quoted 6 lines
The big issue here is whether SoC hardware block properties (such as the pins and their names, and their groups) should be:
(A) open-coded in the driver or
(B) provided as data in the device tree
There's really no need for everyone to do the same thing here; it's an issue that's completely isolated within the individual drivers, and has no effect outside of them, other than kernel size in a multi-SoC kernel.
The main issue with (B) is that it slows down boot time measurably by requiring a ton of data to be parsed from it, which entails a bunch of string handling. And then, you end up with exactly the same data as if you'd just bundled it into the kernel in the first place.
Quoted 3 lines
nVidia Tegra have opted for the former, Texas OMAP for the latter. The in-kernel drivers also do like Tegra. However they are smaller due to less combinatorics.
Well, I think not so much because the SoCs don't have the same number of combinations, but that the drivers don't support all the HW's options.
Quoted 13 lines
Quoted 6 lines
One thing that worries me a bit is the object size of the tegra pinctrl driver: There are now about 70kb pinmux driver binary in each kernel that wants to run on tegra (about the same as the remaining tegra platform code), which can become a bottleneck in future multi-platform kernels that also want to run on a lot of other things.
This sounds like a correct observation and I think I have said the same previously.
Quoted 2 lines
Will it be possible to eventually put the pinmux driver into a loadable module?
Quoted 7 lines
Tony had made it possible to have pinctrl drivers as modules, but some systems may need their pin control up before they even bring up the filesystem :-(
Booting from initramfs and switchroot can solve the above but will slow down boot I believe, and ARM systems usually don't like that.
I guess we could load modules from an initrd OK, but that does indeed add some complexity.
Rather, it might be interesting to pursue building the pinctrl drivers as modules, but somehow binding them into the kernel image itself, and allowing them to be unloaded (like __init functions and __initdata) once we know they aren't used. That's somewhat similar to an initramfs, but avoids the need to package everything into a filesystem and explicitly load it before it can be used.
Signature · 1 line
nvpublic
Hi,
Quoted 31 lines · Linus Walleij
Quoted 3 lines · Arnd Bergmann
I guess if we could move the per-board pinmux data into dts files, that would mean we could actually get rid of the per-board source files in tegra, right?
If you mean these:
arch/arm/mach-tegra/board-harmony-pinmux.c | 362 ++- arch/arm/mach-tegra/board-paz00-pinmux.c | 362 ++- arch/arm/mach-tegra/board-pinmux.c | 62 +- arch/arm/mach-tegra/board-pinmux.h | 39 +- arch/arm/mach-tegra/board-seaboard-pinmux.c | 442 ++- arch/arm/mach-tegra/board-trimslice-pinmux.c | 366 ++-Then the answer is yes.
But not if you mean these:
drivers/pinctrl/pinctrl-tegra20.c | 2860 ++++++++++++++++ drivers/pinctrl/pinctrl-tegra30.c | 3726 +++++++++++++++++++++Because the large number of lines come from SoC
properties rather than board properties.The big issue here is whether SoC hardware block properties (such as the pins and their names, and their groups) should be:
(A) open-coded in the driver or
(B) provided as data in the device tree
Quoted 6 lines
nVidia Tegra have opted for the former, Texas OMAP for the latter. The in-kernel drivers also do like Tegra. However they are smaller due to less combinatorics.
This means that the Tegra driver gets (quite a bit) bigger and the OMAP driver (quite a bit) smaller.
Well I think both A and B should be supported, and also support a combination of A and B in the same driver if needed.
For doing DT only pinmux driver, my observations so far are:
1. Most of the pinmux data in the drivers is only needed for debugging and actually not needed in the driver at all.
The pinmux driver can get away without knowing what the settings are, it just needs to know where the registers are and how they should set based on the board specific .dts configuration.
2. Knowing how the pinmux registers are set is crucial for debugging. But this all can be done with userspace tools using pinctrl debugfs entries. So again the pinmux driver just needs to know just "how many, what type of registers, and where they are".
3. The board specific pinmux configuration for groups and values can be passed from .dts files without passing any strings in most cases. Once we have preprocessor working, the .dts mux configuration should be quite readable.
Quoted 6 lines
Quoted 2 lines
Will it be possible to eventually put the pinmux driver into a loadable module?
Tony had made it possible to have pinctrl drivers as modules, but some systems may need their pin control up before they even bring up the filesystem :-(
For development work loadable modules are much nicer to work with ;)
Loadable modules also automatically cut away the SoC specific spaghetti calls as things need to work in a standard way limited to EXPORT_SYMBOL.
So in general, from sanity checking point of view, we should probably require that anything under drivers at least builds as a loadable module.
Quoted 3 lines
Booting from initramfs and switchroot can solve the above but will slow down boot I believe, and ARM systems usually don't like that.
Yeah I guess for now most people would want to build it in. Then when ARM distros will be able to use the common zImage, most people will probably switch to initramfs based boot.
Regards,
Tony
Quoted 10 lines · Linus Walleij
Quoted 8 lines · Arnd Bergmann
[Me]
Quoted 2 lines
Olof, Arnd: please verify that this is a direction you accept for the Tegra. (Olof has already ACK:ed it, mainly thinking about Arnd.)
I would have liked to see a smaller pinctrl driver and one with fewer macros, but I'm not going to complain about it --
drivers/pinctrlis definitely your turf not mine and I assume that Olof's Ack was meant in his position as Tegra maintainer instead of his position as arm-soc maintainer.
Quoted 8 lines
Which means I have no ACK from any of the ARM SoC maintainers on this which is touching the ARM tree substantially and affecting more or less all recent ARM SoCs,
Which is actually bad enough for me to have second thoughts on this.
So I'm taking this branch off from -next until we resolve this.
That is the opposite of what I intended :(
I really meant that you don't need my Ack: the Tegra changes got an Ack from the subarch maintainers and the drivers/pinctrl changes are for you to judge. I don't have the resources to look into every patch with the level of detail required to make a final decision, I really have to rely on someone I trust like you to decide if something goes in or not. Of course I can offer an opinion when you ask me, which I did, but also didn't feel I understand the patch well enough to ack them -- even though it looks reasonable to me.
Regarding the process, you have my full Ack on the plan to merge them into mainline through your tree when you find them good enough and also put a copy into the arm-soc tree if needed to resolve any dependencies or conflicts with other stuff in arm-soc.
Quoted 8 lines
Quoted 4 lines
It's unfortunate that the number of lines in the board specific pinmux files is actually growing, even though the contents seem to be smaller and it seems to be done in a way that all the data will move into the device tree eventually. What is holding up that move right now?
This is being held up by the discussion in the thread:
"Pinmux bindings proposal V2" and its precursor.
Quoted 8 lines
Evidently it is hard to reach consensus on DT bindings, my analysis is that this is because these tend to turn into full-blown hardware-description committe work rather than Linux kernel issues. (This is both good and bad.)
There will be no pinmux DT bindings until there is a patch for it that gets an ACK from the majority of interested parties, preferably all.
Ok, I see.
Quoted 15 lines
Quoted 3 lines
I guess if we could move the per-board pinmux data into dts files, that would mean we could actually get rid of the per-board source files in tegra, right?
If you mean these:
arch/arm/mach-tegra/board-harmony-pinmux.c | 362 ++- arch/arm/mach-tegra/board-paz00-pinmux.c | 362 ++- arch/arm/mach-tegra/board-pinmux.c | 62 +- arch/arm/mach-tegra/board-pinmux.h | 39 +- arch/arm/mach-tegra/board-seaboard-pinmux.c | 442 ++- arch/arm/mach-tegra/board-trimslice-pinmux.c | 366 ++-Then the answer is yes.
Quoted 7 lines
But not if you mean these:
drivers/pinctrl/pinctrl-tegra20.c | 2860 ++++++++++++++++ drivers/pinctrl/pinctrl-tegra30.c | 3726 +++++++++++++++++++++Because the large number of lines come from SoC
properties rather than board properties.
Yes, that's exactly what I understood.
Quoted 19 lines
The big issue here is whether SoC hardware block properties (such as the pins and their names, and their groups) should be:
(A) open-coded in the driver or
(B) provided as data in the device treenVidia Tegra have opted for the former, Texas OMAP for the latter. The in-kernel drivers also do like Tegra. However they are smaller due to less combinatorics.
This means that the Tegra driver gets (quite a bit) bigger and the OMAP driver (quite a bit) smaller.
Then we've had some arguments about this, you can make a lot of points for and against one or the other, but we have no consensus on the individual rank of these arguments.
Quoted 7 lines
I have resorted to the solution found in
Documentation/ManagementStyle, chapter 1, which helpfully talks about handling situations of the type
(A) vs (B) ... which means no decision on my part until we sort it out! People will have to discuss it and start ACKing each others patches after finding some rough consensus.
Ok, thanks for the explanation.
Quoted 13 lines
Quoted 6 lines
One thing that worries me a bit is the object size of the tegra pinctrl driver: There are now about 70kb pinmux driver binary in each kernel that wants to run on tegra (about the same as the remaining tegra platform code), which can become a bottleneck in future multi-platform kernels that also want to run on a lot of other things.
This sounds like a correct observation and I think I have said the same previously.
Quoted 2 lines
Will it be possible to eventually put the pinmux driver into a loadable module?
Quoted 7 lines
Tony had made it possible to have pinctrl drivers as modules, but some systems may need their pin control up before they even bring up the filesystem :-(
Booting from initramfs and switchroot can solve the above but will slow down boot I believe, and ARM systems usually don't like that.
Sounds good enough for me. Anyone who wants a single kernel that runs on a lot different machines (distros like ubuntu, fedora, debian, opensuse) typically relies on initramfs already, the others can have the code built-in.
Arnd
Quoted 7 lines · Stephen Warren
Linus Walleij wrote at Friday, February 03, 2012 7:57 AM:
Quoted 4 lines
Which is actually bad enough for me to have second thoughts on this.
So I'm taking this branch off from -next until we resolve this.
Seriously? That's lame.
I'm not saying I won't add it back in when we've discussed this some more.
Several involved people are going to meet in person next week to discuss this, so let's see what kind of conclusions we can come to.
Try to see it from my point of view: when I presented the pinctrl subsystem to Torvalds it was with the promise that this would shrink the stuff stacking up in arch/arm/*, naturally I am afraid of breaking that promise.
If the end result is that none of the pinctrl stuff gets pulled for the next merge window, it will hit us all. For that reason I am requesting more consensus.
What speaks for it, even though it adds a few thousand lines, is that the added lines are functionality growth, so after this the T20 and T30 pin muxing is *complete*, and the versions that used to live up in arch/arm were *incomplete* which is nice.
What we need to figure out is if we really must have all these lines of code. And I must have something I can write in my pull request that justifies it. So I want help with that.
Quoted 11 lines
Quoted 2 lines
(A) open-coded in the driver or
(B) provided as data in the device treeThere's really no need for everyone to do the same thing here; it's an issue that's completely isolated within the individual drivers, and has no effect outside of them, other than kernel size in a multi-SoC kernel.
The main issue with (B) is that it slows down boot time measurably by requiring a ton of data to be parsed from it, which entails a bunch of string handling. And then, you end up with exactly the same data as if you'd just bundled it into the kernel in the first place.
That is for a tailored image for one system. If you compile in a few dozen platforms as is the goal of the single uImage. In which case we only end up with the stuff from one device tree and a few slim drivers with no data in them. (As observed by Arnd.)
But I think we could say that if one is preparing a multi-platform kernel, one should also take the hit of using an initramfs and as much modules as possible.
Quoted 6 lines
Quoted 3 lines
nVidia Tegra have opted for the former, Texas OMAP for the latter. The in-kernel drivers also do like Tegra. However they are smaller due to less combinatorics.
Well, I think not so much because the SoCs don't have the same number of combinations, but that the drivers don't support all the HW's options.
Yes that's true, we certainly have these different ideas as to whether the driver shall present all possible options or just the subset used by current kernel board files. Maybe I should implement all of U300's pin control just to get an idea of how much it really is, for comparison.
Quoted 6 lines
Rather, it might be interesting to pursue building the pinctrl drivers as modules, but somehow binding them into the kernel image itself, and allowing them to be unloaded (like
__initfunctions and__initdata) once we know they aren't used. That's somewhat similar to an initramfs, but avoids the need to package everything into a filesystem and explicitly load it before it can be used.
That is a pretty interesting approach if it could be made to work, but since the sectioning is done at compile-time I think the currently endorsed mechanism is using modules and initramfs:es for this.
Yours,
Linus Walleij
Quoted 5 lines · Arnd Bergmann
Quoted 2 lines · Linus Walleij
So I'm taking this branch off from -next until we resolve this.
That is the opposite of what I intended :(
OK I might put it back in next week after conferring with some of the involved people. I just want a credible story for my pull request at the end of the day and that's all.
Quoted 3 lines
I really meant that you don't need my Ack: the Tegra changes got an Ack from the subarch maintainers and the
drivers/pinctrlchanges are for you to judge.
OK so this was more from the point of "the ARM stuff is growing wild again" point of view, and Mr. Torvalds has made it pretty clear to me that he don't like it growing anywhere, no matter whether that is under arch/arm/* or any place else, like drivers/pinctrl/*.
If I had a few Atom, MIPS, Blackfin or CRIS pin controllers in tree or in the pipe, it wouldn't be so much of an ARM issue, but currently it sort of is, that's basically why I want to involve you guys.
BTW does anyone know of some inherent muxing in Intel hardware like the Langwell PCH?
Quoted 6 lines
I don't have the resources to look into every patch
with the level of detail required to make a final decision, I really have to rely on someone I trust like you to decide if something goes in or not. Of course I can offer an opinion when you ask me, which I did, but also didn't feel I understand the patch well enough to ack them -- even though it looks reasonable to me.
OK sorry it wasn't meant to stress you.
Quoted 4 lines
Regarding the process, you have my full Ack on the plan to merge them into mainline through your tree when you find them good enough and also put a copy into the arm-soc tree if needed to resolve any dependencies or conflicts with other stuff in arm-soc.
Yes, well the patches are a *real* *good* pinctrl driver, there is no question of that.
The only issue is size and open-coding.
I am open to any smart ideas on how to get rid of excess tables, I just happen to have run out of them myself, all sort of comes to the point of wanting the C preprocessor to have loop statements...
I'm leaning toward creating a pin and group specification language and put that into the kbuild to generate headers with them to cut the open-coded data down.
Quoted 11 lines
Quoted 7 lines
Tony had made it possible to have pinctrl drivers as modules, but some systems may need their pin control up before they even bring up the filesystem :-(
Booting from initramfs and switchroot can solve the above but will slow down boot I believe, and ARM systems usually don't like that.
Sounds good enough for me. Anyone who wants a single kernel that runs on a lot different machines (distros like ubuntu, fedora, debian, opensuse) typically relies on initramfs already, the others can have the code built-in.
Yep single uImage mandates modules, I thought so for long but now I'm ever more certain of it.
Yours,
Linus Walleij