diff options
| author | Colin Cross <ccross@android.com> | 2010-07-09 18:13:52 -0400 |
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2010-10-21 21:11:41 -0400 |
| commit | c5f04b8d10a73f2a016d6815d64dd5eebc734097 (patch) | |
| tree | 54b6fd1ed295d7e9c5c85fce7c9767f1eced6569 | |
| parent | 460907bc26f5565aced3cf35a10e3579c671ef50 (diff) | |
[ARM] tegra: pinmux: add safe values, move tegra2, add suspend
- the reset values for some pin groups in the tegra pin mux can result in
functional errors due to conflicting with actively-configured pin groups
muxing from the same controller. this change adds a known safe, non-
conflicting mux for every pin group, which can be used on platforms
where the pin group is not routed to any peripheral
- also add each pin group's I/O voltage rail, to enable platform code to
map from the pin groups used by each interface to the regulators used
for dynamic voltage control
- add routines to individually configure the tristate, pin mux and pull-
ups for a pingroup_config array, so that it is possible to program
individual values at run-time without modifying other values.
this allows driver power-management code to reprogram individual
interfaces into lower power states during idle / suspend, or to
reprogram the pin mux to support multiple physical busses per
internal controller (e.g., sharing a single I2C or SPI controller
across multiple pin groups)
- move chip-specific data like pingroups and drive-pingroups
out of the common code and into chip-specific code
- fix debug output for group with no pullups
- add a TEGRA_MUX_SAFE function. Setting a pingroup to TEGRA_MUX_SAFE
will automatically select a mux setting that is guaranteed not to
conflict with any of the hardware blocks.
Signed-off-by: Gary King <gking@nvidia.com>
| -rw-r--r-- | arch/arm/mach-tegra/Makefile | 1 | ||||
| -rw-r--r-- | arch/arm/mach-tegra/include/mach/pinmux-t2.h | 174 | ||||
| -rw-r--r-- | arch/arm/mach-tegra/include/mach/pinmux.h | 210 | ||||
| -rw-r--r-- | arch/arm/mach-tegra/pinmux-t2-tables.c | 260 | ||||
| -rw-r--r-- | arch/arm/mach-tegra/pinmux.c | 354 |
5 files changed, 603 insertions, 396 deletions
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index 0a975b5fe493..87d065e65113 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile | |||
| @@ -7,6 +7,7 @@ obj-y += gpio.o | |||
| 7 | obj-y += pinmux.o | 7 | obj-y += pinmux.o |
| 8 | obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clock.o | 8 | obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clock.o |
| 9 | obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_clocks.o | 9 | obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_clocks.o |
| 10 | obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += pinmux-t2-tables.o | ||
| 10 | obj-$(CONFIG_SMP) += platsmp.o localtimer.o headsmp.o | 11 | obj-$(CONFIG_SMP) += platsmp.o localtimer.o headsmp.o |
| 11 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 12 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
| 12 | 13 | ||
diff --git a/arch/arm/mach-tegra/include/mach/pinmux-t2.h b/arch/arm/mach-tegra/include/mach/pinmux-t2.h new file mode 100644 index 000000000000..e5b9d740f973 --- /dev/null +++ b/arch/arm/mach-tegra/include/mach/pinmux-t2.h | |||
| @@ -0,0 +1,174 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/mach-tegra/include/mach/pinmux-t2.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Google, Inc. | ||
| 5 | * | ||
| 6 | * This software is licensed under the terms of the GNU General Public | ||
| 7 | * License version 2, as published by the Free Software Foundation, and | ||
| 8 | * may be copied, distributed, and modified under those terms. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef __MACH_TEGRA_PINMUX_T2_H | ||
| 18 | #define __MACH_TEGRA_PINMUX_T2_H | ||
| 19 | |||
| 20 | enum tegra_pingroup { | ||
| 21 | TEGRA_PINGROUP_ATA = 0, | ||
| 22 | TEGRA_PINGROUP_ATB, | ||
| 23 | TEGRA_PINGROUP_ATC, | ||
| 24 | TEGRA_PINGROUP_ATD, | ||
| 25 | TEGRA_PINGROUP_ATE, | ||
| 26 | TEGRA_PINGROUP_CDEV1, | ||
| 27 | TEGRA_PINGROUP_CDEV2, | ||
| 28 | TEGRA_PINGROUP_CRTP, | ||
| 29 | TEGRA_PINGROUP_CSUS, | ||
| 30 | TEGRA_PINGROUP_DAP1, | ||
| 31 | TEGRA_PINGROUP_DAP2, | ||
| 32 | TEGRA_PINGROUP_DAP3, | ||
| 33 | TEGRA_PINGROUP_DAP4, | ||
| 34 | TEGRA_PINGROUP_DDC, | ||
| 35 | TEGRA_PINGROUP_DTA, | ||
| 36 | TEGRA_PINGROUP_DTB, | ||
| 37 | TEGRA_PINGROUP_DTC, | ||
| 38 | TEGRA_PINGROUP_DTD, | ||
| 39 | TEGRA_PINGROUP_DTE, | ||
| 40 | TEGRA_PINGROUP_DTF, | ||
| 41 | TEGRA_PINGROUP_GMA, | ||
| 42 | TEGRA_PINGROUP_GMB, | ||
| 43 | TEGRA_PINGROUP_GMC, | ||
| 44 | TEGRA_PINGROUP_GMD, | ||
| 45 | TEGRA_PINGROUP_GME, | ||
| 46 | TEGRA_PINGROUP_GPU, | ||
| 47 | TEGRA_PINGROUP_GPU7, | ||
| 48 | TEGRA_PINGROUP_GPV, | ||
| 49 | TEGRA_PINGROUP_HDINT, | ||
| 50 | TEGRA_PINGROUP_I2CP, | ||
| 51 | TEGRA_PINGROUP_IRRX, | ||
| 52 | TEGRA_PINGROUP_IRTX, | ||
| 53 | TEGRA_PINGROUP_KBCA, | ||
| 54 | TEGRA_PINGROUP_KBCB, | ||
| 55 | TEGRA_PINGROUP_KBCC, | ||
| 56 | TEGRA_PINGROUP_KBCD, | ||
| 57 | TEGRA_PINGROUP_KBCE, | ||
| 58 | TEGRA_PINGROUP_KBCF, | ||
| 59 | TEGRA_PINGROUP_LCSN, | ||
| 60 | TEGRA_PINGROUP_LD0, | ||
| 61 | TEGRA_PINGROUP_LD1, | ||
| 62 | TEGRA_PINGROUP_LD10, | ||
| 63 | TEGRA_PINGROUP_LD11, | ||
| 64 | TEGRA_PINGROUP_LD12, | ||
| 65 | TEGRA_PINGROUP_LD13, | ||
| 66 | TEGRA_PINGROUP_LD14, | ||
| 67 | TEGRA_PINGROUP_LD15, | ||
| 68 | TEGRA_PINGROUP_LD16, | ||
| 69 | TEGRA_PINGROUP_LD17, | ||
| 70 | TEGRA_PINGROUP_LD2, | ||
| 71 | TEGRA_PINGROUP_LD3, | ||
| 72 | TEGRA_PINGROUP_LD4, | ||
| 73 | TEGRA_PINGROUP_LD5, | ||
| 74 | TEGRA_PINGROUP_LD6, | ||
| 75 | TEGRA_PINGROUP_LD7, | ||
| 76 | TEGRA_PINGROUP_LD8, | ||
| 77 | TEGRA_PINGROUP_LD9, | ||
| 78 | TEGRA_PINGROUP_LDC, | ||
| 79 | TEGRA_PINGROUP_LDI, | ||
| 80 | TEGRA_PINGROUP_LHP0, | ||
| 81 | TEGRA_PINGROUP_LHP1, | ||
| 82 | TEGRA_PINGROUP_LHP2, | ||
| 83 | TEGRA_PINGROUP_LHS, | ||
| 84 | TEGRA_PINGROUP_LM0, | ||
| 85 | TEGRA_PINGROUP_LM1, | ||
| 86 | TEGRA_PINGROUP_LPP, | ||
| 87 | TEGRA_PINGROUP_LPW0, | ||
| 88 | TEGRA_PINGROUP_LPW1, | ||
| 89 | TEGRA_PINGROUP_LPW2, | ||
| 90 | TEGRA_PINGROUP_LSC0, | ||
| 91 | TEGRA_PINGROUP_LSC1, | ||
| 92 | TEGRA_PINGROUP_LSCK, | ||
| 93 | TEGRA_PINGROUP_LSDA, | ||
| 94 | TEGRA_PINGROUP_LSDI, | ||
| 95 | TEGRA_PINGROUP_LSPI, | ||
| 96 | TEGRA_PINGROUP_LVP0, | ||
| 97 | TEGRA_PINGROUP_LVP1, | ||
| 98 | TEGRA_PINGROUP_LVS, | ||
| 99 | TEGRA_PINGROUP_OWC, | ||
| 100 | TEGRA_PINGROUP_PMC, | ||
| 101 | TEGRA_PINGROUP_PTA, | ||
| 102 | TEGRA_PINGROUP_RM, | ||
| 103 | TEGRA_PINGROUP_SDB, | ||
| 104 | TEGRA_PINGROUP_SDC, | ||
| 105 | TEGRA_PINGROUP_SDD, | ||
| 106 | TEGRA_PINGROUP_SDIO1, | ||
| 107 | TEGRA_PINGROUP_SLXA, | ||
| 108 | TEGRA_PINGROUP_SLXC, | ||
| 109 | TEGRA_PINGROUP_SLXD, | ||
| 110 | TEGRA_PINGROUP_SLXK, | ||
| 111 | TEGRA_PINGROUP_SPDI, | ||
| 112 | TEGRA_PINGROUP_SPDO, | ||
| 113 | TEGRA_PINGROUP_SPIA, | ||
| 114 | TEGRA_PINGROUP_SPIB, | ||
| 115 | TEGRA_PINGROUP_SPIC, | ||
| 116 | TEGRA_PINGROUP_SPID, | ||
| 117 | TEGRA_PINGROUP_SPIE, | ||
| 118 | TEGRA_PINGROUP_SPIF, | ||
| 119 | TEGRA_PINGROUP_SPIG, | ||
| 120 | TEGRA_PINGROUP_SPIH, | ||
| 121 | TEGRA_PINGROUP_UAA, | ||
| 122 | TEGRA_PINGROUP_UAB, | ||
| 123 | TEGRA_PINGROUP_UAC, | ||
| 124 | TEGRA_PINGROUP_UAD, | ||
| 125 | TEGRA_PINGROUP_UCA, | ||
| 126 | TEGRA_PINGROUP_UCB, | ||
| 127 | TEGRA_PINGROUP_UDA, | ||
| 128 | /* these pin groups only have pullup and pull down control */ | ||
| 129 | TEGRA_PINGROUP_CK32, | ||
| 130 | TEGRA_PINGROUP_DDRC, | ||
| 131 | TEGRA_PINGROUP_PMCA, | ||
| 132 | TEGRA_PINGROUP_PMCB, | ||
| 133 | TEGRA_PINGROUP_PMCC, | ||
| 134 | TEGRA_PINGROUP_PMCD, | ||
| 135 | TEGRA_PINGROUP_PMCE, | ||
| 136 | TEGRA_PINGROUP_XM2C, | ||
| 137 | TEGRA_PINGROUP_XM2D, | ||
| 138 | TEGRA_MAX_PINGROUP, | ||
| 139 | }; | ||
| 140 | |||
| 141 | enum tegra_drive_pingroup { | ||
| 142 | TEGRA_DRIVE_PINGROUP_AO1 = 0, | ||
| 143 | TEGRA_DRIVE_PINGROUP_AO2, | ||
| 144 | TEGRA_DRIVE_PINGROUP_AT1, | ||
| 145 | TEGRA_DRIVE_PINGROUP_AT2, | ||
| 146 | TEGRA_DRIVE_PINGROUP_CDEV1, | ||
| 147 | TEGRA_DRIVE_PINGROUP_CDEV2, | ||
| 148 | TEGRA_DRIVE_PINGROUP_CSUS, | ||
| 149 | TEGRA_DRIVE_PINGROUP_DAP1, | ||
| 150 | TEGRA_DRIVE_PINGROUP_DAP2, | ||
| 151 | TEGRA_DRIVE_PINGROUP_DAP3, | ||
| 152 | TEGRA_DRIVE_PINGROUP_DAP4, | ||
| 153 | TEGRA_DRIVE_PINGROUP_DBG, | ||
| 154 | TEGRA_DRIVE_PINGROUP_LCD1, | ||
| 155 | TEGRA_DRIVE_PINGROUP_LCD2, | ||
| 156 | TEGRA_DRIVE_PINGROUP_SDMMC2, | ||
| 157 | TEGRA_DRIVE_PINGROUP_SDMMC3, | ||
| 158 | TEGRA_DRIVE_PINGROUP_SPI, | ||
| 159 | TEGRA_DRIVE_PINGROUP_UAA, | ||
| 160 | TEGRA_DRIVE_PINGROUP_UAB, | ||
| 161 | TEGRA_DRIVE_PINGROUP_UART2, | ||
| 162 | TEGRA_DRIVE_PINGROUP_UART3, | ||
| 163 | TEGRA_DRIVE_PINGROUP_VI1, | ||
| 164 | TEGRA_DRIVE_PINGROUP_VI2, | ||
