ARM: tegra: powermon: Fix copyrights from GPLv3 to GPLv2
[linux-3.10.git] / arch / arm / mach-tegra / pinmux-t12-tables.c
1 /*
2  * linux/arch/arm/mach-tegra/pinmux-t12-tables.c
3  *
4  * Common pinmux configurations for Tegra 12x SoCs
5  *
6  * Copyright (c) 2011-2013, NVIDIA CORPORATION.  All rights reserved.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
16  * more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21  */
22
23 #include <linux/kernel.h>
24 #include <linux/errno.h>
25 #include <linux/spinlock.h>
26 #include <linux/io.h>
27 #include <linux/init.h>
28 #include <linux/string.h>
29 #include <linux/syscore_ops.h>
30 #include <linux/bug.h>
31 #include <linux/bitops.h>
32
33 #include <mach/pinmux.h>
34 #include <mach/pinmux-t12.h>
35
36 #include "gpio-names.h"
37 #include "iomap.h"
38
39 #define PMC_DPD_SAMPLE          0x20
40 #define PMC_IO_DPD_REQ          0x1B8
41 #define PMC_IO_DPD2_REQ         0x1C0
42
43 #define PINGROUP_REG_A  0x868
44 #define MUXCTL_REG_A    0x3000
45
46 #define SET_DRIVE_PINGROUP(pg_name, r, drv_down_offset, drv_down_mask, drv_up_offset, drv_up_mask,      \
47         slew_rise_offset, slew_rise_mask, slew_fall_offset, slew_fall_mask)     \
48         [TEGRA_DRIVE_PINGROUP_ ## pg_name] = {                  \
49                 .name = #pg_name,                               \
50                 .reg_bank = 0,                                  \
51                 .reg = ((r) - PINGROUP_REG_A),                  \
52                 .drvup_offset = drv_up_offset,                  \
53                 .drvup_mask = drv_up_mask,                      \
54                 .drvdown_offset = drv_down_offset,              \
55                 .drvdown_mask = drv_down_mask,                  \
56                 .slewrise_offset = slew_rise_offset,            \
57                 .slewrise_mask = slew_rise_mask,                \
58                 .slewfall_offset = slew_fall_offset,            \
59                 .slewfall_mask = slew_fall_mask,                \
60         }
61
62 #define DEFAULT_DRIVE_PINGROUP(pg_name, r)              \
63         [TEGRA_DRIVE_PINGROUP_ ## pg_name] = {          \
64                 .name = #pg_name,                       \
65                 .reg_bank = 0,                          \
66                 .reg = ((r) - PINGROUP_REG_A),          \
67                 .drvup_offset = 20,                     \
68                 .drvup_mask = 0x1f,                     \
69                 .drvdown_offset = 12,                   \
70                 .drvdown_mask = 0x1f,                   \
71                 .slewrise_offset = 28,                  \
72                 .slewrise_mask = 0x3,                   \
73                 .slewfall_offset = 30,                  \
74                 .slewfall_mask = 0x3,                   \
75         }
76
77 const struct tegra_drive_pingroup_desc tegra_soc_drive_pingroups[TEGRA_MAX_DRIVE_PINGROUP] = {
78         DEFAULT_DRIVE_PINGROUP(AO1,             0x868),
79         DEFAULT_DRIVE_PINGROUP(AO2,             0x86c),
80         DEFAULT_DRIVE_PINGROUP(AT1,             0x870),
81         DEFAULT_DRIVE_PINGROUP(AT2,             0x874),
82         DEFAULT_DRIVE_PINGROUP(AT3,             0x878),
83         DEFAULT_DRIVE_PINGROUP(AT4,             0x87c),
84         DEFAULT_DRIVE_PINGROUP(AT5,             0x880),
85         DEFAULT_DRIVE_PINGROUP(CDEV1,           0x884),
86         DEFAULT_DRIVE_PINGROUP(CDEV2,           0x888),
87         DEFAULT_DRIVE_PINGROUP(CSUS,            0x88c),
88         DEFAULT_DRIVE_PINGROUP(DAP1,            0x890),
89         DEFAULT_DRIVE_PINGROUP(DAP2,            0x894),
90         DEFAULT_DRIVE_PINGROUP(DAP3,            0x898),
91         DEFAULT_DRIVE_PINGROUP(DAP4,            0x89c),
92         DEFAULT_DRIVE_PINGROUP(DBG,             0x8a0),
93         SET_DRIVE_PINGROUP(SDIO3,               0x8b0,  12,     0x7F,   20,
94                 0x7F,   28,     0x3,    30,     0x3),
95         DEFAULT_DRIVE_PINGROUP(SPI,             0x8b4),
96         DEFAULT_DRIVE_PINGROUP(UAA,             0x8b8),
97         DEFAULT_DRIVE_PINGROUP(UAB,             0x8bc),
98         DEFAULT_DRIVE_PINGROUP(UART2,           0x8c0),
99         DEFAULT_DRIVE_PINGROUP(UART3,           0x8c4),
100         SET_DRIVE_PINGROUP(SDIO1,               0x8ec,  12,     0x7F,   20,
101                 0x7F,   28,     0x3,    30,     0x3),
102         DEFAULT_DRIVE_PINGROUP(CRT,             0x8f8),
103         DEFAULT_DRIVE_PINGROUP(DDC,             0x8fc),
104         SET_DRIVE_PINGROUP(GMA,                 0x900,  14,     0x1F,   20,
105                 0x1F,   28,     0x3,    30,     0x3),
106         DEFAULT_DRIVE_PINGROUP(GME,             0x910),
107         DEFAULT_DRIVE_PINGROUP(GMF,             0x914),
108         DEFAULT_DRIVE_PINGROUP(GMG,             0x918),
109         DEFAULT_DRIVE_PINGROUP(GMH,             0x91c),
110         DEFAULT_DRIVE_PINGROUP(OWR,             0x920),
111         DEFAULT_DRIVE_PINGROUP(UAD,             0x924),
112         DEFAULT_DRIVE_PINGROUP(GPV,             0x928),
113         DEFAULT_DRIVE_PINGROUP(DEV3,            0x92c),
114         DEFAULT_DRIVE_PINGROUP(CEC,             0x938),
115         DEFAULT_DRIVE_PINGROUP(AT6,             0x994),
116         DEFAULT_DRIVE_PINGROUP(DAP5,            0x998),
117         DEFAULT_DRIVE_PINGROUP(VBUS,            0x99C),
118 };
119
120 #define PINGROUP(pg_name, gpio_nr, vdd, f0, f1, f2, f3, fs, iod, reg)   \
121         [TEGRA_PINGROUP_ ## pg_name] = {                        \
122                 .name = #pg_name,                               \
123                 .vddio = TEGRA_VDDIO_ ## vdd,                   \
124                 .funcs = {                                      \
125                         TEGRA_MUX_ ## f0,                       \
126                         TEGRA_MUX_ ## f1,                       \
127                         TEGRA_MUX_ ## f2,                       \
128                         TEGRA_MUX_ ## f3,                       \
129                 },                                              \
130                 .gpionr = TEGRA_GPIO_ ## gpio_nr,               \
131                 .func_safe = TEGRA_MUX_ ## fs,                  \
132                 .tri_bank = 1,                                  \
133                 .tri_reg = ((reg) - MUXCTL_REG_A),              \
134                 .tri_bit = 4,                                   \
135                 .mux_bank = 1,                                  \
136                 .mux_reg = ((reg) - MUXCTL_REG_A),              \
137                 .mux_bit = 0,                                   \
138                 .pupd_bank = 1,                                 \
139                 .pupd_reg = ((reg) - MUXCTL_REG_A),             \
140                 .pupd_bit = 2,                                  \
141                 .io_default = TEGRA_PIN_ ## iod,                \
142                 .od_bit = 6,                                    \
143                 .lock_bit = 7,                                  \
144                 .ioreset_bit = 8,                               \
145         }
146
147 #ifdef CONFIG_TEGRA_FPGA_PLATFORM
148 /* !!!FIXME!!! FILL IN fSafe COLUMN IN TABLE ....... */
149 #define PINGROUPS       \
150         /*       NAME             GPIO          VDD         f0          f1          f2          f3          fSafe       io      reg */\
151         PINGROUP(ULPI_DATA0,      PO1,          BB,         SPI3,       HSI,        UARTA,      ULPI,       RSVD,       INPUT,  0x3000),\
152         PINGROUP(ULPI_DATA1,      PO2,          BB,         SPI3,       HSI,        UARTA,      ULPI,       RSVD,       INPUT,  0x3004),\
153         PINGROUP(ULPI_DATA2,      PO3,          BB,         SPI3,       HSI,        UARTA,      ULPI,       RSVD,       INPUT,  0x3008),\
154         PINGROUP(ULPI_DATA3,      PO4,          BB,         SPI3,       HSI,        UARTA,      ULPI,       RSVD,       INPUT,  0x300c),\
155         PINGROUP(ULPI_DATA4,      PO5,          BB,         SPI2,       HSI,        UARTA,      ULPI,       RSVD,       INPUT,  0x3010),\
156         PINGROUP(ULPI_DATA5,      PO6,          BB,         SPI2,       HSI,        UARTA,      ULPI,       RSVD,       INPUT,  0x3014),\
157         PINGROUP(ULPI_DATA6,      PO7,          BB,         SPI2,       HSI,        UARTA,      ULPI,       RSVD,       INPUT,  0x3018),\
158         PINGROUP(ULPI_DATA7,      PO0,          BB,         SPI2,       HSI,        UARTA,      ULPI,       RSVD,       INPUT,  0x301c),\
159         PINGROUP(ULPI_CLK,        PY0,          BB,         SPI1,       SPI5,       UARTD,      ULPI,       RSVD,       INPUT,  0x3020),\
160         PINGROUP(ULPI_DIR,        PY1,          BB,         SPI1,       SPI5,       UARTD,      ULPI,       RSVD,       INPUT,  0x3024),\
161         PINGROUP(ULPI_NXT,        PY2,          BB,         SPI1,       SPI5,       UARTD,      ULPI,       RSVD,       INPUT,  0x3028),\
162         PINGROUP(ULPI_STP,        PY3,          BB,         SPI1,       SPI5,       UARTD,      ULPI,       RSVD,       INPUT,  0x302c),\
163         PINGROUP(DAP3_FS,         PP0,          BB,         I2S2,       SPI5,       DISPLAYA,   DISPLAYB,   RSVD,       INPUT,  0x3030),\
164         PINGROUP(DAP3_DIN,        PP1,          BB,         I2S2,       SPI5,       DISPLAYA,   DISPLAYB,   RSVD,       INPUT,  0x3034),\
165         PINGROUP(DAP3_DOUT,       PP2,          BB,         I2S2,       SPI5,       DISPLAYA,   DISPLAYB,   RSVD,       INPUT,  0x3038),\
166         PINGROUP(DAP3_SCLK,       PP3,          BB,         I2S2,       SPI5,       DISPLAYA,   DISPLAYB,   RSVD,       INPUT,  0x303c),\
167         PINGROUP(GPIO_PV0,        PV0,          BB,         RSVD,       RSVD,       RSVD,       RSVD,       RSVD,       INPUT,  0x3040),\
168         PINGROUP(GPIO_PV1,        PV1,          BB,         RSVD,       RSVD,       RSVD,       RSVD,       RSVD,       INPUT,  0x3044),\
169         PINGROUP(SDMMC1_CLK,      PZ0,          SDMMC1,     SDMMC1,     CLK12,      RSVD1,      RSVD2,      RSVD,       INPUT,  0x3048),\
170         PINGROUP(SDMMC1_CMD,      PZ1,          SDMMC1,     SDMMC1,     SPDIF,      SPI4,       UARTA,      RSVD,       INPUT,  0x304c),\
171         PINGROUP(SDMMC1_DAT3,     PY4,          SDMMC1,     SDMMC1,     SPDIF,      SPI4,       UARTA,      RSVD,       INPUT,  0x3050),\
172         PINGROUP(SDMMC1_DAT2,     PY5,          SDMMC1,     SDMMC1,     PWM0,       SPI4,       UARTA,      RSVD,       INPUT,  0x3054),\
173         PINGROUP(SDMMC1_DAT1,     PY6,          SDMMC1,     SDMMC1,     PWM1,       SPI4,       UARTA,      RSVD,       INPUT,  0x3058),\
174         PINGROUP(SDMMC1_DAT0,     PY7,          SDMMC1,     SDMMC1,     RSVD1,      RSVD2,      UARTA,      RSVD,       INPUT,  0x305c),\
175         PINGROUP(CLK2_OUT,        PW5,          SDMMC1,     EXTPERIPH2, RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3068),\
176         PINGROUP(CLK2_REQ,        PCC5,         SDMMC1,     DAP,        RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x306c),\
177         PINGROUP(HDMI_INT,        PN7,          LCD,        RSVD,       RSVD,       RSVD,       RSVD,       RSVD,       INPUT,  0x3110),\
178         PINGROUP(DDC_SCL,         PV4,          LCD,        I2C4,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3114),\
179         PINGROUP(DDC_SDA,         PV5,          LCD,        I2C4,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3118),\
180         PINGROUP(UART2_RXD,       PC3,          UART,       IRDA,       SPDIF,      UARTA,      SPI4,       RSVD,       INPUT,  0x3164),\
181         PINGROUP(UART2_TXD,       PC2,          UART,       IRDA,       SPDIF,      UARTA,      SPI4,       RSVD,       INPUT,  0x3168),\
182         PINGROUP(UART2_RTS_N,     PJ6,          UART,       UARTA,      UARTB,      RSVD,       SPI4,       RSVD,       INPUT,  0x316c),\
183         PINGROUP(UART2_CTS_N,     PJ5,          UART,       UARTA,      UARTB,      RSVD,       SPI4,       RSVD,       INPUT,  0x3170),\
184         PINGROUP(UART3_TXD,       PW6,          UART,       UARTC,      RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3174),\
185         PINGROUP(UART3_RXD,       PW7,          UART,       UARTC,      RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3178),\
186         PINGROUP(UART3_CTS_N,     PA1,          UART,       UARTC,      SDMMC1,     RSVD1,      RSVD2,      RSVD,       INPUT,  0x317c),\
187         PINGROUP(UART3_RTS_N,     PC0,          UART,       UARTC,      PWM0,       RSVD1,      RSVD2,      RSVD,       INPUT,  0x3180),\
188         PINGROUP(GPIO_PU0,        PU0,          UART,       OWR,        UARTA,      GMI,        RSVD3,      RSVD,       INPUT,  0x3184),\
189         PINGROUP(GPIO_PU1,        PU1,          UART,       RSVD0,      UARTA,      GMI,        RSVD3,      RSVD,       INPUT,  0x3188),\
190         PINGROUP(GPIO_PU2,        PU2,          UART,       RSVD1,      UARTA,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x318c),\
191         PINGROUP(GPIO_PU3,        PU3,          UART,       PWM0,       UARTA,      RSVD1,      RSVD2,      RSVD,       INPUT,  0x3190),\
192         PINGROUP(GPIO_PU4,        PU4,          UART,       PWM1,       UARTA,      RSVD1,      RSVD2,      RSVD,       INPUT,  0x3194),\
193         PINGROUP(GPIO_PU5,        PU5,          UART,       PWM2,       UARTA,      RSVD1,      RSVD2,      RSVD,       INPUT,  0x3198),\
194         PINGROUP(GPIO_PU6,        PU6,          UART,       PWM3,       UARTA,      USB,        RSVD2,      RSVD,       INPUT,  0x319c),\
195         PINGROUP(GEN1_I2C_SDA,    PC5,          UART,       I2C1,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x31a0),\
196         PINGROUP(GEN1_I2C_SCL,    PC4,          UART,       I2C1,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x31a4),\
197         PINGROUP(DAP4_FS,         PP4,          UART,       I2S3,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x31a8),\
198         PINGROUP(DAP4_DIN,        PP5,          UART,       I2S3,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x31ac),\
199         PINGROUP(DAP4_DOUT,       PP6,          UART,       I2S3,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x31b0),\
200         PINGROUP(DAP4_SCLK,       PP7,          UART,       I2S3,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x31b4),\
201         PINGROUP(CLK3_OUT,        PEE0,         UART,       EXTPERIPH3, RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x31b8),\
202         PINGROUP(CLK3_REQ,        PEE1,         UART,       DEV3,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x31bc),\
203         PINGROUP(GMI_WP_N,        PC7,          GMI,        RSVD1,      NAND,       GMI,        GMI_ALT,    RSVD,       INPUT,  0x31c0),\
204         PINGROUP(GMI_IORDY,       PI5,          GMI,        SDMMC2,     NAND,       GMI,        TRACE,      RSVD,       INPUT,  0x31c4),\
205         PINGROUP(GMI_WAIT,        PI7,          GMI,        RSVD1,      NAND,       GMI,        TRACE,      RSVD,       INPUT,  0x31c8),\
206         PINGROUP(GMI_ADV_N,       PK0,          GMI,        SDMMC2,     NAND,       GMI,        TRACE,      RSVD,       INPUT,  0x31cc),\
207         PINGROUP(GMI_CLK,         PK1,          GMI,        SDMMC2,     NAND,       GMI,        TRACE,      RSVD,       INPUT,  0x31d0),\
208         PINGROUP(GMI_CS0_N,       PJ0,          GMI,        RSVD1,      NAND,       GMI,        RSVD,       RSVD,       INPUT,  0x31d4),\
209         PINGROUP(GMI_CS1_N,       PJ2,          GMI,        RSVD1,      NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x31d8),\
210         PINGROUP(GMI_CS2_N,       PK3,          GMI,        SDMMC2,     NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x31dc),\
211         PINGROUP(GMI_CS3_N,       PK4,          GMI,        SDMMC2,     NAND,       GMI,        GMI_ALT,    RSVD,       INPUT,  0x31e0),\
212         PINGROUP(GMI_CS4_N,       PK2,          GMI,        USB,        NAND,       GMI,        TRACE,      RSVD,       INPUT,  0x31e4),\
213         PINGROUP(GMI_CS6_N,       PI3,          GMI,        NAND,       NAND_ALT,   GMI,        SATA,       RSVD,       INPUT,  0x31e8),\
214         PINGROUP(GMI_CS7_N,       PI6,          GMI,        NAND,       NAND_ALT,   GMI,        RSVD,       RSVD,       INPUT,  0x31ec),\
215         PINGROUP(GMI_AD0,         PG0,          GMI,        RSVD1,      NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x31f0),\
216         PINGROUP(GMI_AD1,         PG1,          GMI,        RSVD1,      NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x31f4),\
217         PINGROUP(GMI_AD2,         PG2,          GMI,        RSVD1,      NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x31f8),\
218         PINGROUP(GMI_AD3,         PG3,          GMI,        RSVD1,      NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x31fc),\
219         PINGROUP(GMI_AD4,         PG4,          GMI,        RSVD1,      NAND,       GMI,        SPI4,       RSVD,       INPUT,  0x3200),\
220         PINGROUP(GMI_AD5,         PG5,          GMI,        RSVD1,      NAND,       GMI,        SPI4,       RSVD,       INPUT,  0x3204),\
221         PINGROUP(GMI_AD6,         PG6,          GMI,        RSVD1,      NAND,       GMI,        SPI4,       RSVD,       INPUT,  0x3208),\
222         PINGROUP(GMI_AD7,         PG7,          GMI,        RSVD1,      NAND,       GMI,        SPI4,       RSVD,       INPUT,  0x320c),\
223         PINGROUP(GMI_AD8,         PH0,          GMI,        PWM0,       NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x3210),\
224         PINGROUP(GMI_AD9,         PH1,          GMI,        PWM1,       NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x3214),\
225         PINGROUP(GMI_AD10,        PH2,          GMI,        PWM2,       NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x3218),\
226         PINGROUP(GMI_AD11,        PH3,          GMI,        PWM3,       NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x321c),\
227         PINGROUP(GMI_AD12,        PH4,          GMI,        SDMMC2,     NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x3220),\
228         PINGROUP(GMI_AD13,        PH5,          GMI,        SDMMC2,     NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x3224),\
229         PINGROUP(GMI_AD14,        PH6,          GMI,        SDMMC2,     NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x3228),\
230         PINGROUP(GMI_AD15,        PH7,          GMI,        SDMMC2,     NAND,       GMI,        RSVD2,      RSVD,       INPUT,  0x322c),\
231         PINGROUP(GMI_A16,         PJ7,          GMI,        UARTD,      SPI4,       GMI,        GMI_ALT,    RSVD,       INPUT,  0x3230),\
232         PINGROUP(GMI_A17,         PB0,          GMI,        UARTD,      SPI4,       GMI,        TRACE,      RSVD,       INPUT,  0x3234),\
233         PINGROUP(GMI_A18,         PB1,          GMI,        UARTD,      SPI4,       GMI,        TRACE,      RSVD,       INPUT,  0x3238),\
234         PINGROUP(GMI_A19,         PK7,          GMI,        UARTD,      SPI4,       GMI,        TRACE,      RSVD,       INPUT,  0x323c),\
235         PINGROUP(GMI_WR_N,        PI0,          GMI,        RSVD1,      NAND,       GMI,        RSVD3,      RSVD,       INPUT,  0x3240),\
236         PINGROUP(GMI_OE_N,        PI1,          GMI,        RSVD1,      NAND,       GMI,        RSVD3,      RSVD,       INPUT,  0x3244),\
237         PINGROUP(GMI_DQS_P,       PJ3,          GMI,        SDMMC2,     NAND,       GMI,        TRACE,      RSVD,       INPUT,  0x3248),\
238         PINGROUP(GMI_RST_N,       PI4,          GMI,        NAND,       NAND_ALT,   GMI,        SDMMC2,     RSVD,       INPUT,  0x324c),\
239         PINGROUP(GEN2_I2C_SCL,    PT5,          GMI,        I2C2,       RSVD1,      GMI,        RSVD3,      RSVD,       INPUT,  0x3250),\
240         PINGROUP(GEN2_I2C_SDA,    PT6,          GMI,        I2C2,       RSVD1,      GMI,        RSVD3,      RSVD,       INPUT,  0x3254),\
241         PINGROUP(SDMMC4_CLK,      PCC4,         SDMMC4,     SDMMC4,     RSVD1,      GMI,        RSVD2,      RSVD,       INPUT,  0x3258),\
242         PINGROUP(SDMMC4_CMD,      PT7,          SDMMC4,     SDMMC4,     RSVD1,      GMI,        RSVD2,      RSVD,       INPUT,  0x325c),\
243         PINGROUP(SDMMC4_DAT0,     PAA0,         SDMMC4,     SDMMC4,     SPI3,       GMI,        RSVD2,      RSVD,       INPUT,  0x3260),\
244         PINGROUP(SDMMC4_DAT1,     PAA1,         SDMMC4,     SDMMC4,     SPI3,       GMI,        RSVD2,      RSVD,       INPUT,  0x3264),\
245         PINGROUP(SDMMC4_DAT2,     PAA2,         SDMMC4,     SDMMC4,     SPI3,       GMI,        RSVD2,      RSVD,       INPUT,  0x3268),\
246         PINGROUP(SDMMC4_DAT3,     PAA3,         SDMMC4,     SDMMC4,     SPI3,       GMI,        RSVD2,      RSVD,       INPUT,  0x326c),\
247         PINGROUP(SDMMC4_DAT4,     PAA4,         SDMMC4,     SDMMC4,     RSVD1,      GMI,        RSVD2,      RSVD,       INPUT,  0x3270),\
248         PINGROUP(SDMMC4_DAT5,     PAA5,         SDMMC4,     SDMMC4,     RSVD1,      GMI,        RSVD2,      RSVD,       INPUT,  0x3274),\
249         PINGROUP(SDMMC4_DAT6,     PAA6,         SDMMC4,     SDMMC4,     RSVD1,      GMI,        RSVD2,      RSVD,       INPUT,  0x3278),\
250         PINGROUP(SDMMC4_DAT7,     PAA7,         SDMMC4,     SDMMC4,     RSVD1,      GMI,        RSVD2,      RSVD,       INPUT,  0x327c),\
251         PINGROUP(SDMMC4_RST_N,    INVALID,      SDMMC4,     RSVD1,      RSVD2,      RSVD3,      SDMMC4,     RSVD,       INPUT,  0x3280),\
252         PINGROUP(CAM_MCLK,        PCC0,         CAM,        VI,         INVALID,    VI_ALT2,    RSVD,       RSVD,       INPUT,  0x3284),\
253         PINGROUP(GPIO_PCC1,       PCC1,         CAM,        I2S4,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3288),\
254         PINGROUP(GPIO_PBB0,       PBB0,         CAM,        I2S4,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x328c),\
255         PINGROUP(CAM_I2C_SCL,     PBB1,         CAM,        INVALID,    I2C3,       RSVD2,      RSVD3,      RSVD,       INPUT,  0x3290),\
256         PINGROUP(CAM_I2C_SDA,     PBB2,         CAM,        INVALID,    I2C3,       RSVD2,      RSVD3,      RSVD,       INPUT,  0x3294),\
257         PINGROUP(GPIO_PBB3,       PBB3,         CAM,        VGP3,       DISPLAYA,   DISPLAYB,   RSVD2,      RSVD,       INPUT,  0x3298),\
258         PINGROUP(GPIO_PBB4,       PBB4,         CAM,        VGP4,       DISPLAYA,   DISPLAYB,   RSVD2,      RSVD,       INPUT,  0x329c),\
259         PINGROUP(GPIO_PBB5,       PBB5,         CAM,        VGP5,       DISPLAYA,   DISPLAYB,   RSVD,       RSVD,       INPUT,  0x32a0),\
260         PINGROUP(GPIO_PBB6,       PBB6,         CAM,        VGP6,       DISPLAYA,   DISPLAYB,   POPSDMMC4,  RSVD,       INPUT,  0x32a4),\
261         PINGROUP(GPIO_PBB7,       PBB7,         CAM,        I2S4,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x32a8),\
262         PINGROUP(GPIO_PCC2,       PCC2,         CAM,        I2S4,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x32ac),\
263         PINGROUP(JTAG_RTCK,       PU7,          SYS,        RTCK,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x32b0),\
264         PINGROUP(PWR_I2C_SCL,     PZ6,          SYS,        I2CPWR,     RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x32b4),\
265         PINGROUP(PWR_I2C_SDA,     PZ7,          SYS,        I2CPWR,     RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x32b8),\
266         PINGROUP(KB_ROW0,         PR0,          SYS,        KBC,        RSVD2,      DTV,        RSVD3,      RSVD,       INPUT,  0x32bc),\
267         PINGROUP(KB_ROW1,         PR1,          SYS,        KBC,        RSVD2,      DTV,        RSVD3,      RSVD,       INPUT,  0x32c0),\
268         PINGROUP(KB_ROW2,         PR2,          SYS,        KBC,        RSVD2,      DTV,        RSVD3,      RSVD,       INPUT,  0x32c4),\
269         PINGROUP(KB_ROW3,         PR3,          SYS,        KBC,        DISPLAYA,   DTV,        DISPLAYB,   RSVD,       INPUT,  0x32c8),\
270         PINGROUP(KB_ROW4,         PR4,          SYS,        KBC,        DISPLAYA,   SPI2,       DISPLAYB,   RSVD,       INPUT,  0x32cc),\
271         PINGROUP(KB_ROW5,         PR5,          SYS,        KBC,        DISPLAYA,   SPI2,       DISPLAYB,   RSVD,       INPUT,  0x32d0),\
272         PINGROUP(KB_ROW6,         PR6,          SYS,        KBC,        DISPLAYA,   DISPLAYA_ALT,       DISPLAYB,   DISPLAYA_ALT,       INPUT,  0x32d4),\
273         PINGROUP(KB_ROW7,         PR7,          SYS,        KBC,        RSVD,       RSVD2,      UARTA,      RSVD,       INPUT,  0x32d8),\
274         PINGROUP(KB_ROW8,         PS0,          SYS,        KBC,        RSVD,       RSVD2,      UARTA,      RSVD,       INPUT,  0x32dc),\
275         PINGROUP(KB_ROW9,         PS1,          SYS,        KBC,        RSVD,       RSVD2,      UARTA,      RSVD,       INPUT,  0x32e0),\
276         PINGROUP(KB_ROW10,        PS2,          SYS,        KBC,        RSVD,       RSVD2,      UARTA,      RSVD,       INPUT,  0x32e4),\
277         PINGROUP(KB_COL0,         PQ0,          SYS,        KBC,        USB,        SPI2,       EMC_DLL,    RSVD,       INPUT,  0x32fc),\
278         PINGROUP(KB_COL1,         PQ1,          SYS,        KBC,        RSVD2,      SPI2,       EMC_DLL,    RSVD,       INPUT,  0x3300),\
279         PINGROUP(KB_COL2,         PQ2,          SYS,        KBC,        RSVD2,      SPI2,       RSVD,       RSVD,       INPUT,  0x3304),\
280         PINGROUP(KB_COL3,         PQ3,          SYS,        KBC,        RSVD2,      PWM2,       UARTA,      RSVD,       INPUT,  0x3308),\
281         PINGROUP(KB_COL4,         PQ4,          SYS,        KBC,        OWR,        SDMMC3,     UARTA,      RSVD,       INPUT,  0x330c),\
282         PINGROUP(KB_COL5,         PQ5,          SYS,        KBC,        RSVD1,      SDMMC1,     RSVD2,      RSVD,       INPUT,  0x3310),\
283         PINGROUP(KB_COL6,         PQ6,          SYS,        KBC,        RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3314),\
284         PINGROUP(KB_COL7,         PQ7,          SYS,        KBC,        RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3318),\
285         PINGROUP(CLK_32K_OUT,     PA0,          SYS,        BLINK,      RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x331c),\
286         PINGROUP(SYS_CLK_REQ,     PZ5,          SYS,        SYSCLK,     RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3320),\
287         PINGROUP(CORE_PWR_REQ,    INVALID,      SYS,        RSVD,       RSVD,       RSVD,       RSVD,       RSVD,       INPUT,  0x3324),\
288         PINGROUP(CPU_PWR_REQ,     INVALID,      SYS,        RSVD,       RSVD,       RSVD,       RSVD,       RSVD,       INPUT,  0x3328),\
289         PINGROUP(PWR_INT_N,       INVALID,      SYS,        RSVD,       RSVD,       RSVD,       RSVD,       RSVD,       INPUT,  0x332c),\
290         PINGROUP(CLK_32K_IN,      INVALID,      SYS,        RSVD,       RSVD,       RSVD,       RSVD,       RSVD,       INPUT,  0x3330),\
291         PINGROUP(OWR,             INVALID,      SYS,        RSVD,       RSVD,       RSVD,       RSVD,       RSVD,       INPUT,  0x3334),\
292         PINGROUP(DAP1_FS,         PN0,          AUDIO,      I2S0,       HDA,        GMI,        RSVD,       RSVD,       INPUT,  0x3338),\
293         PINGROUP(DAP1_DIN,        PN1,          AUDIO,      I2S0,       HDA,        GMI,        RSVD,       RSVD,       INPUT,  0x333c),\
294         PINGROUP(DAP1_DOUT,       PN2,          AUDIO,      I2S0,       HDA,        GMI,        RSVD,       RSVD,       INPUT,  0x3340),\
295         PINGROUP(DAP1_SCLK,       PN3,          AUDIO,      I2S0,       HDA,        GMI,        RSVD,       RSVD,       INPUT,  0x3344),\
296         PINGROUP(CLK1_REQ,        PEE2,         AUDIO,      DAP,        HDA,        RSVD2,      RSVD3,      RSVD,       INPUT,  0x3348),\
297         PINGROUP(CLK1_OUT,        PW4,          AUDIO,      EXTPERIPH1, DAP2,       RSVD2,      RSVD3,      RSVD,       INPUT,  0x334c),\
298         PINGROUP(SPDIF_IN,        PK6,          AUDIO,      SPDIF,      RSVD1,      I2C1,       RSVD2,      RSVD,       INPUT,  0x3350),\
299         PINGROUP(SPDIF_OUT,       PK5,          AUDIO,      SPDIF,      RSVD1,      I2C1,       RSVD2,      RSVD,       INPUT,  0x3354),\
300         PINGROUP(DAP2_FS,         PA2,          AUDIO,      I2S1,       HDA,        RSVD1,      RSVD2,      RSVD,       INPUT,  0x3358),\
301         PINGROUP(DAP2_DIN,        PA4,          AUDIO,      I2S1,       HDA,        RSVD1,      RSVD2,      RSVD,       INPUT,  0x335c),\
302         PINGROUP(DAP2_DOUT,       PA5,          AUDIO,      I2S1,       HDA,        RSVD1,      RSVD2,      RSVD,       INPUT,  0x3360),\
303         PINGROUP(DAP2_SCLK,       PA3,          AUDIO,      I2S1,       HDA,        RSVD1,      RSVD2,      RSVD,       INPUT,  0x3364),\
304         PINGROUP(SPI2_MOSI,       PX0,          AUDIO,      SPI6,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3368),\
305         PINGROUP(SPI2_MISO,       PX1,          AUDIO,      SPI6,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x336c),\
306         PINGROUP(SPI2_CS0_N,      PX3,          AUDIO,      SPI6,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3370),\
307         PINGROUP(SPI2_SCK,        PX2,          AUDIO,      SPI6,       RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x3374),\
308         PINGROUP(SPI1_MOSI,       PX4,          AUDIO,      SPI6,       RSVD1,      RSVD2,      DAP2,       RSVD,       INPUT,  0x3378),\
309         PINGROUP(SPI1_SCK,        PX5,          AUDIO,      SPI2,       SPI1,       INVALID,    GMI,        RSVD,       INPUT,  0x337c),\
310         PINGROUP(SPI1_CS0_N,      PX6,          AUDIO,      SPI2,       SPI1,       INVALID,    GMI,        RSVD,       INPUT,  0x3380),\
311         PINGROUP(SPI1_MISO,       PX7,          AUDIO,      RSVD1,      SPI1,       SPI2,       RSVD2,      RSVD,       INPUT,  0x3384),\
312         PINGROUP(SDMMC3_CLK,      PA6,          SDMMC3,     SDMMC3,     RSVD1,      RSVD2,      SPI3,       RSVD,       INPUT,  0x3390),\
313         PINGROUP(SDMMC3_CMD,      PA7,          SDMMC3,     SDMMC3,     PWM3,       UARTA,      RSVD,       RSVD,       INPUT,  0x3394),\
314         PINGROUP(SDMMC3_DAT0,     PB7,          SDMMC3,     SDMMC3,     PWM3,       RSVD3,      SPI3,       RSVD,       INPUT,  0x3398),\
315         PINGROUP(SDMMC3_DAT1,     PB6,          SDMMC3,     SDMMC3,     RSVD1,      UARTA,      SPI3,       RSVD,       INPUT,  0x339c),\
316         PINGROUP(SDMMC3_DAT2,     PB5,          SDMMC3,     SDMMC3,     PWM2,       RSVD,       SPI3,       RSVD,       INPUT,  0x33a0),\
317         PINGROUP(SDMMC3_DAT3,     PB4,          SDMMC3,     SDMMC3,     PWM1,       RSVD,       SPI3,       RSVD,       INPUT,  0x33a4),\
318         PINGROUP(HDMI_CEC,        PEE3,         SYS,        CEC,        SDMMC3,     RSVD2,      RSVD3,      RSVD,       INPUT,  0x33e0),\
319         PINGROUP(SDMMC1_WP_N,     PV3,          SDMMC1,     SDMMC1,     CLK12,      RSVD2,      UARTA,      RSVD,       INPUT,  0x33e4),\
320         PINGROUP(SDMMC3_CD_N,     PV2,          SDMMC3,     CLK12,      RSVD1,      RSVD2,      RSVD3,      RSVD,       INPUT,  0x33e8),\
321         PINGROUP(SPI1_CS1_N,      PW2,          AUDIO,      RSVD1,      SPI1,       SPI2,       I2C1,       RSVD,       INPUT,  0x33ec),\
322         PINGROUP(SPI1_CS2_N,      PW3,          AUDIO,      RSVD1,      SPI1,       SPI2,       I2C1,       RSVD,       INPUT,  0x33f0),\
323         PINGROUP(USB_VBUS_EN0,    PN4,          SYS,        RSVD,       RSVD,       RSVD,       RSVD,       RSVD,       INPUT,  0x33f4),\
324         PINGROUP(USB_VBUS_EN1,    PM5,          SYS,        RSVD,       RSVD,       RSVD,       RSVD,       RSVD,       INPUT,  0x33f8),\
325
326 #else
327
328 /* !!!FIXME!!! FILL IN fSafe COLUMN IN TABLE ....... */
329 #define PINGROUPS       \
330         /*       NAME           GPIO    VDD     f0              f1              f2              f3              fSafe           io      reg */\
331         PINGROUP(ULPI_DATA0,    PO1,    BB,     SPI3,           HSI,            UARTA,          ULPI,           SPI3,           INPUT,  0x3000),\
332         PINGROUP(ULPI_DATA1,    PO2,    BB,     SPI3,           HSI,            UARTA,          ULPI,           SPI3,           INPUT,  0x3004),\
333         PINGROUP(ULPI_DATA2,    PO3,    BB,     SPI3,           HSI,            UARTA,          ULPI,           SPI3,           INPUT,  0x3008),\
334         PINGROUP(ULPI_DATA3,    PO4,    BB,     SPI3,           HSI,            UARTA,          ULPI,           SPI3,           INPUT,  0x300c),\
335         PINGROUP(ULPI_DATA4,    PO5,    BB,     SPI2,           HSI,            UARTA,          ULPI,           SPI2,           INPUT,  0x3010),\
336         PINGROUP(ULPI_DATA5,    PO6,    BB,     SPI2,           HSI,            UARTA,          ULPI,           SPI2,           INPUT,  0x3014),\
337         PINGROUP(ULPI_DATA6,    PO7,    BB,     SPI2,           HSI,            UARTA,          ULPI,           SPI2,           INPUT,  0x3018),\
338         PINGROUP(ULPI_DATA7,    PO0,    BB,     SPI2,           HSI,            UARTA,          ULPI,           SPI2,           INPUT,  0x301c),\
339         PINGROUP(ULPI_CLK,      PY0,    BB,     SPI1,           SPI5,           UARTD,          ULPI,           RSVD,           INPUT,  0x3020),\
340         PINGROUP(ULPI_DIR,      PY1,    BB,     SPI1,           SPI5,           UARTD,          ULPI,           RSVD,           INPUT,  0x3024),\
341         PINGROUP(ULPI_NXT,      PY2,    BB,     SPI1,           SPI5,           UARTD,          ULPI,           RSVD,           INPUT,  0x3028),\
342         PINGROUP(ULPI_STP,      PY3,    BB,     SPI1,           SPI5,           UARTD,          ULPI,           RSVD,           INPUT,  0x302c),\
343         PINGROUP(DAP3_FS,       PP0,    BB,     I2S2,           SPI5,           DISPLAYA,       DISPLAYB,       I2S2,           INPUT,  0x3030),\
344         PINGROUP(DAP3_DIN,      PP1,    BB,     I2S2,           SPI5,           DISPLAYA,       DISPLAYB,       I2S2,           INPUT,  0x3034),\
345         PINGROUP(DAP3_DOUT,     PP2,    BB,     I2S2,           SPI5,           DISPLAYA,       RSVD3,          I2S2,           INPUT,  0x3038),\
346         PINGROUP(DAP3_SCLK,     PP3,    BB,     I2S2,           SPI5,           RSVD2,          DISPLAYB,       I2S2,           INPUT,  0x303c),\
347         PINGROUP(GPIO_PV0,      PV0,    BB,     RSVD0,          RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x3040),\
348         PINGROUP(GPIO_PV1,      PV1,    BB,     RSVD0,          RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x3044),\
349         PINGROUP(SDMMC1_CLK,    PZ0,    SDMMC1, SDMMC1,         CLK12,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x3048),\
350         PINGROUP(SDMMC1_CMD,    PZ1,    SDMMC1, SDMMC1,         SPDIF,          SPI4,           UARTA,          RSVD,           INPUT,  0x304c),\
351         PINGROUP(SDMMC1_DAT3,   PY4,    SDMMC1, SDMMC1,         SPDIF,          SPI4,           UARTA,          RSVD,           INPUT,  0x3050),\
352         PINGROUP(SDMMC1_DAT2,   PY5,    SDMMC1, SDMMC1,         PWM0,           SPI4,           UARTA,          RSVD,           INPUT,  0x3054),\
353         PINGROUP(SDMMC1_DAT1,   PY6,    SDMMC1, SDMMC1,         PWM1,           SPI4,           UARTA,          RSVD,           INPUT,  0x3058),\
354         PINGROUP(SDMMC1_DAT0,   PY7,    SDMMC1, SDMMC1,         RSVD1,          SPI4,           UARTA,          RSVD,           INPUT,  0x305c),\
355         PINGROUP(CLK2_OUT,      PW5,    SDMMC1, EXTPERIPH2,     RSVD1,          RSVD2,          RSVD3,          EXTPERIPH2,     INPUT,  0x3068),\
356         PINGROUP(CLK2_REQ,      PCC5,   SDMMC1, DAP,            RSVD1,          RSVD2,          RSVD3,          DAP,            INPUT,  0x306c),\
357         PINGROUP(HDMI_INT,      PN7,    HV,     RSVD0,          RSVD1,          RSVD2,          RSVD3,          RSVD0,          INPUT,  0x3110),\
358         PINGROUP(DDC_SCL,       PV4,    HV,     I2C4,           RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x3114),\
359         PINGROUP(DDC_SDA,       PV5,    HV,     I2C4,           RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x3118),\
360         PINGROUP(UART2_RXD,     PC3,    UART,   IRDA,           SPDIF,          UARTA,          SPI4,           RSVD,           INPUT,  0x3164),\
361         PINGROUP(UART2_TXD,     PC2,    UART,   IRDA,           SPDIF,          UARTA,          SPI4,           RSVD,           INPUT,  0x3168),\
362         PINGROUP(UART2_RTS_N,   PJ5,    UART,   UARTA,          UARTB,          GMI,            SPI4,           RSVD,           INPUT,  0x316c),\
363         PINGROUP(UART2_CTS_N,   PJ6,    UART,   UARTA,          UARTB,          GMI,            SPI4,           RSVD,           INPUT,  0x3170),\
364         PINGROUP(UART3_TXD,     PW6,    UART,   UARTC,          RSVD1,          GMI,            SPI4,           RSVD,           INPUT,  0x3174),\
365         PINGROUP(UART3_RXD,     PW7,    UART,   UARTC,          RSVD1,          GMI,            SPI4,           RSVD,           INPUT,  0x3178),\
366         PINGROUP(UART3_CTS_N,   PA1,    UART,   UARTC,          SDMMC1,         DTV,            GMI,            RSVD,           INPUT,  0x317c),\
367         PINGROUP(UART3_RTS_N,   PC0,    UART,   UARTC,          PWM0,           DTV,            GMI,            RSVD,           INPUT,  0x3180),\
368         PINGROUP(GPIO_PU0,      PU0,    UART,   OWR,            UARTA,          GMI,            RSVD3,          RSVD3,          INPUT,  0x3184),\
369         PINGROUP(GPIO_PU1,      PU1,    UART,   RSVD0,          UARTA,          GMI,            RSVD3,          RSVD3,          INPUT,  0x3188),\
370         PINGROUP(GPIO_PU2,      PU2,    UART,   RSVD0,          UARTA,          GMI,            RSVD3,          RSVD3,          INPUT,  0x318c),\
371         PINGROUP(GPIO_PU3,      PU3,    UART,   PWM0,           UARTA,          GMI,            DISPLAYB,       PWM0,           INPUT,  0x3190),\
372         PINGROUP(GPIO_PU4,      PU4,    UART,   PWM1,           UARTA,          GMI,            DISPLAYB,       PWM1,           INPUT,  0x3194),\
373         PINGROUP(GPIO_PU5,      PU5,    UART,   PWM2,           UARTA,          GMI,            DISPLAYB,       PWM2,           INPUT,  0x3198),\
374         PINGROUP(GPIO_PU6,      PU6,    UART,   PWM3,           UARTA,          RSVD2,          GMI,            RSVD2,          INPUT,  0x319c),\
375         PINGROUP(GEN1_I2C_SCL,  PC4,    UART,   I2C1,           RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x31a0),\
376         PINGROUP(GEN1_I2C_SDA,  PC5,    UART,   I2C1,           RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x31a4),\
377         PINGROUP(DAP4_FS,       PP4,    UART,   I2S3,           GMI,            DTV,            RSVD3,          RSVD,           INPUT,  0x31a8),\
378         PINGROUP(DAP4_DIN,      PP5,    UART,   I2S3,           GMI,            RSVD2,          RSVD3,          RSVD,           INPUT,  0x31ac),\
379         PINGROUP(DAP4_DOUT,     PP6,    UART,   I2S3,           GMI,            DTV,            RSVD3,          RSVD,           INPUT,  0x31b0),\
380         PINGROUP(DAP4_SCLK,     PP7,    UART,   I2S3,           GMI,            RSVD2,          RSVD3,          RSVD,           INPUT,  0x31b4),\
381         PINGROUP(CLK3_OUT,      PE0,    UART,   EXTPERIPH3,     RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x31b8),\
382         PINGROUP(CLK3_REQ,      PE1,    UART,   DEV3,           RSVD1,          RSVD2,          RSVD3,          RSVD3,          INPUT,  0x31bc),\
383         PINGROUP(GPIO_PC7,      PC7,    GMI,    RSVD0,          RSVD1,          GMI,            GMI_ALT,        RSVD0,          INPUT,  0x31c0),\
384         PINGROUP(GPIO_PI5,      PI5,    GMI,    SDMMC2,         RSVD1,          GMI,            RSVD3,          GMI,            INPUT,  0x31c4),\
385         PINGROUP(GPIO_PI7,      PI7,    GMI,    RSVD0,          TRACE,          GMI,            DTV,            RSVD0,          INPUT,  0x31c8),\
386         PINGROUP(GPIO_PK0,      PK0,    GMI,    RSVD0,          SDMMC3,         GMI,            SOC,            RSVD,           INPUT,  0x31cc),\
387         PINGROUP(GPIO_PK1,      PK1,    GMI,    SDMMC2,         TRACE,          GMI,            RSVD3,          GMI,            INPUT,  0x31d0),\
388         PINGROUP(GPIO_PJ0,      PJ0,    GMI,    RSVD0,          RSVD1,          GMI,            USB,            RSVD0,          INPUT,  0x31d4),\
389         PINGROUP(GPIO_PJ2,      PJ2,    GMI,    RSVD0,          RSVD1,          GMI,            SOC,            RSVD,           INPUT,  0x31d8),\
390         PINGROUP(GPIO_PK3,      PK3,    GMI,    SDMMC2,         TRACE,          GMI,            CCLA,           GMI,            INPUT,  0x31dc),\
391         PINGROUP(GPIO_PK4,      PK4,    GMI,    SDMMC2,         RSVD1,          GMI,            GMI_ALT,        GMI,            INPUT,  0x31e0),\
392         PINGROUP(GPIO_PK2,      PK2,    GMI,    RSVD0,          RSVD1,          GMI,            RSVD3,          RSVD3,          INPUT,  0x31e4),\
393         PINGROUP(GPIO_PI3,      PI3,    GMI,    RSVD0,          RSVD1,          GMI,            SPI4,           RSVD0,          INPUT,  0x31e8),\
394         PINGROUP(GPIO_PI6,      PI6,    GMI,    RSVD0,          RSVD1,          GMI,            SDMMC2,         RSVD0,          INPUT,  0x31ec),\
395         PINGROUP(GPIO_PG0,      PG0,    GMI,    RSVD0,          RSVD1,          GMI,            RSVD3,          RSVD3,          INPUT,  0x31f0),\
396         PINGROUP(GPIO_PG1,      PG1,    GMI,    RSVD0,          RSVD1,          GMI,            RSVD3,          RSVD3,          INPUT,  0x31f4),\
397         PINGROUP(GPIO_PG2,      PG2,    GMI,    RSVD0,          TRACE,          GMI,            RSVD3,          RSVD3,          INPUT,  0x31f8),\
398         PINGROUP(GPIO_PG3,      PG3,    GMI,    RSVD0,          TRACE,          GMI,            RSVD3,          RSVD3,          INPUT,  0x31fc),\
399         PINGROUP(GPIO_PG4,      PG4,    GMI,    RSVD0,          TMDS,           GMI,            SPI4,           RSVD,           INPUT,  0x3200),\
400         PINGROUP(GPIO_PG5,      PG5,    GMI,    RSVD0,          RSVD1,          GMI,            SPI4,           RSVD,           INPUT,  0x3204),\
401         PINGROUP(GPIO_PG6,      PG6,    GMI,    RSVD0,          RSVD1,          GMI,            SPI4,           RSVD,           INPUT,  0x3208),\
402         PINGROUP(GPIO_PG7,      PG7,    GMI,    RSVD0,          RSVD1,          GMI,            SPI4,           RSVD,           INPUT,  0x320c),\
403         PINGROUP(GPIO_PH0,      PH0,    GMI,    PWM0,           TRACE,          GMI,            DTV,            RSVD,           INPUT,  0x3210),\
404         PINGROUP(GPIO_PH1,      PH1,    GMI,    PWM1,           TMDS,           GMI,            DISPLAYA,       RSVD,           INPUT,  0x3214),\
405         PINGROUP(GPIO_PH2,      PH2,    GMI,    PWM2,           TMDS,           GMI,            CLDVFS,         GMI,            INPUT,  0x3218),\
406         PINGROUP(GPIO_PH3,      PH3,    GMI,    PWM3,           SPI4,           GMI,            CLDVFS,         GMI,            INPUT,  0x321c),\
407         PINGROUP(GPIO_PH4,      PH4,    GMI,    SDMMC2,         RSVD1,          GMI,            RSVD3,          GMI,            INPUT,  0x3220),\
408         PINGROUP(GPIO_PH5,      PH5,    GMI,    SDMMC2,         RSVD1,          GMI,            RSVD3,          GMI,            INPUT,  0x3224),\
409         PINGROUP(GPIO_PH6,      PH6,    GMI,    SDMMC2,         TRACE,          GMI,            DTV,            GMI,            INPUT,  0x3228),\
410         PINGROUP(GPIO_PH7,      PH7,    GMI,    SDMMC2,         TRACE,          GMI,            DTV,            GMI,            INPUT,  0x322c),\
411         PINGROUP(GPIO_PJ7,      PJ7,    GMI,    UARTD,          RSVD1,          GMI,            GMI_ALT,        RSVD,           INPUT,  0x3230),\
412         PINGROUP(GPIO_PB0,      PB0,    GMI,    UARTD,          RSVD1,          GMI,            RSVD3,          RSVD,           INPUT,  0x3234),\
413         PINGROUP(GPIO_PB1,      PB1,    GMI,    UARTD,          RSVD1,          GMI,            RSVD3,          RSVD,           INPUT,  0x3238),\
414         PINGROUP(GPIO_PK7,      PK7,    GMI,    UARTD,          RSVD1,          GMI,            RSVD3,          RSVD,           INPUT,  0x323c),\
415         PINGROUP(GPIO_PI0,      PI0,    GMI,    RSVD0,          RSVD1,          GMI,            RSVD3,          RSVD3,          INPUT,  0x3240),\
416         PINGROUP(GPIO_PI1,      PI1,    GMI,    RSVD0,          RSVD1,          GMI,            RSVD3,          RSVD0,          INPUT,  0x3244),\
417         PINGROUP(GPIO_PI2,      PI2,    GMI,    SDMMC2,         TRACE,          GMI,            RSVD3,          GMI,            INPUT,  0x3248),\
418         PINGROUP(GPIO_PI4,      PI4,    GMI,    SPI4,           TRACE,          GMI,            DISPLAYA,       GMI,            INPUT,  0x324c),\
419         PINGROUP(GEN2_I2C_SCL,  PT5,    GMI,    I2C2,           RSVD1,          GMI,            RSVD3,          RSVD,           INPUT,  0x3250),\
420         PINGROUP(GEN2_I2C_SDA,  PT6,    GMI,    I2C2,           RSVD1,          GMI,            RSVD3,          RSVD,           INPUT,  0x3254),\
421         PINGROUP(SDMMC4_CLK,    PCC4,   SDMMC4, SDMMC4,         RSVD1,          GMI,            RSVD3,          RSVD,           INPUT,  0x3258),\
422         PINGROUP(SDMMC4_CMD,    PT7,    SDMMC4, SDMMC4,         RSVD1,          GMI,            RSVD3,          RSVD,           INPUT,  0x325c),\
423         PINGROUP(SDMMC4_DAT0,   PA0,    SDMMC4, SDMMC4,         SPI3,           GMI,            RSVD3,          RSVD,           INPUT,  0x3260),\
424         PINGROUP(SDMMC4_DAT1,   PA1,    SDMMC4, SDMMC4,         SPI3,           GMI,            RSVD3,          RSVD,           INPUT,  0x3264),\
425         PINGROUP(SDMMC4_DAT2,   PA2,    SDMMC4, SDMMC4,         SPI3,           GMI,            RSVD3,          RSVD,           INPUT,  0x3268),\
426         PINGROUP(SDMMC4_DAT3,   PA3,    SDMMC4, SDMMC4,         SPI3,           GMI,            RSVD3,          RSVD,           INPUT,  0x326c),\
427         PINGROUP(SDMMC4_DAT4,   PA4,    SDMMC4, SDMMC4,         SPI3,           GMI,            RSVD3,          RSVD,           INPUT,  0x3270),\
428         PINGROUP(SDMMC4_DAT5,   PA5,    SDMMC4, SDMMC4,         SPI3,           RSVD2,          RSVD3,          RSVD,           INPUT,  0x3274),\
429         PINGROUP(SDMMC4_DAT6,   PA6,    SDMMC4, SDMMC4,         SPI3,           GMI,            RSVD3,          RSVD,           INPUT,  0x3278),\
430         PINGROUP(SDMMC4_DAT7,   PA7,    SDMMC4, SDMMC4,         RSVD1,          GMI,            RSVD3,          RSVD,           INPUT,  0x327c),\
431         PINGROUP(CAM_MCLK,      PCC0,   CAM,    VI,             VI_ALT1,        VI_ALT3,        SDMMC2,         RSVD,           INPUT,  0x3284),\
432         PINGROUP(GPIO_PCC1,     PCC1,   CAM,    I2S4,           RSVD1,          RSVD2,          SDMMC2,         I2S4,           INPUT,  0x3288),\
433         PINGROUP(GPIO_PBB0,     PBB0,   CAM,    VGP6,           VIMCLK2,        SDMMC2,         VIMCLK2_ALT,    RSVD,           INPUT,  0x328c),\
434         PINGROUP(CAM_I2C_SCL,   PBB1,   CAM,    VGP1,           I2C3,           RSVD2,          SDMMC2,         RSVD,           INPUT,  0x3290),\
435         PINGROUP(CAM_I2C_SDA,   PBB2,   CAM,    VGP2,           I2C3,           RSVD2,          SDMMC2,         RSVD,           INPUT,  0x3294),\
436         PINGROUP(GPIO_PBB3,     PBB3,   CAM,    VGP3,           DISPLAYA,       DISPLAYB,       SDMMC2,         VGP3,           INPUT,  0x3298),\
437         PINGROUP(GPIO_PBB4,     PBB4,   CAM,    VGP4,           DISPLAYA,       DISPLAYB,       SDMMC2,         VGP4,           INPUT,  0x329c),\
438         PINGROUP(GPIO_PBB5,     PBB5,   CAM,    VGP5,           DISPLAYA,       RSVD2,          SDMMC2,         VGP5,           INPUT,  0x32a0),\
439         PINGROUP(GPIO_PBB6,     PBB6,   CAM,    I2S4,           RSVD1,          DISPLAYB,       SDMMC2,         I2S4,           INPUT,  0x32a4),\
440         PINGROUP(GPIO_PBB7,     PBB7,   CAM,    I2S4,           RSVD1,          RSVD2,          SDMMC2,         I2S4,           INPUT,  0x32a8),\
441         PINGROUP(GPIO_PCC2,     PCC2,   CAM,    I2S4,           RSVD1,          SDMMC3,         SDMMC2,         I2S4,           INPUT,  0x32ac),\
442         PINGROUP(JTAG_RTCK,     INVALID, SYS,   RTCK,           RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x32b0),\
443         PINGROUP(PWR_I2C_SCL,   PZ6,    SYS,    I2CPWR,         RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x32b4),\
444         PINGROUP(PWR_I2C_SDA,   PZ7,    SYS,    I2CPWR,         RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x32b8),\
445         PINGROUP(KB_ROW0,       PR0,    SYS,    KBC,            RSVD1,          RSVD2,          RSVD3,          RSVD3,          INPUT,  0x32bc),\
446         PINGROUP(KB_ROW1,       PR1,    SYS,    KBC,            RSVD1,          RSVD2,          RSVD3,          RSVD3,          INPUT,  0x32c0),\
447         PINGROUP(KB_ROW2,       PR2,    SYS,    KBC,            RSVD1,          RSVD2,          RSVD3,          RSVD3,          INPUT,  0x32c4),\
448         PINGROUP(KB_ROW3,       PR3,    SYS,    KBC,            DISPLAYA,       SYS,            DISPLAYB,       RSVD,           INPUT,  0x32c8),\
449         PINGROUP(KB_ROW4,       PR4,    SYS,    KBC,            DISPLAYA,       RSVD2,          DISPLAYB,       RSVD2,          INPUT,  0x32cc),\
450         PINGROUP(KB_ROW5,       PR5,    SYS,    KBC,            DISPLAYA,       RSVD2,          DISPLAYB,       RSVD2,          INPUT,  0x32d0),\
451         PINGROUP(KB_ROW6,       PR6,    SYS,    KBC,            DISPLAYA,       DISPLAYA_ALT,   DISPLAYB,       RSVD,           INPUT,  0x32d4),\
452         PINGROUP(KB_ROW7,       PR7,    SYS,    KBC,            RSVD1,          CLDVFS,         UARTA,          RSVD1,          INPUT,  0x32d8),\
453         PINGROUP(KB_ROW8,       PS0,    SYS,    KBC,            RSVD1,          CLDVFS,         UARTA,          RSVD1,          INPUT,  0x32dc),\
454         PINGROUP(KB_ROW9,       PS1,    SYS,    KBC,            RSVD1,          RSVD2,          UARTA,          RSVD,           INPUT,  0x32e0),\
455         PINGROUP(KB_ROW10,      PS2,    SYS,    KBC,            RSVD1,          RSVD2,          UARTA,          RSVD,           INPUT,  0x32e4),\
456         PINGROUP(KB_ROW11,      PS3,    SYS,    KBC,            RSVD1,          RSVD2,          IRDA,           RSVD2,          INPUT,  0x32e8),\
457         PINGROUP(KB_ROW12,      PS4,    SYS,    KBC,            RSVD1,          RSVD2,          IRDA,           RSVD2,          INPUT,  0x32ec),\
458         PINGROUP(KB_ROW13,      PS5,    SYS,    KBC,            RSVD1,          SPI2,           RSVD3,          RSVD3,          INPUT,  0x32f0),\
459         PINGROUP(KB_ROW14,      PS6,    SYS,    KBC,            RSVD1,          SPI2,           RSVD3,          RSVD3,          INPUT,  0x32f4),\
460         PINGROUP(KB_ROW15,      PS7,    SYS,    KBC,            SOC,            RSVD2,          RSVD3,          RSVD,           INPUT,  0x32f8),\
461         PINGROUP(KB_COL0,       PQ0,    SYS,    KBC,            RSVD1,          SPI2,           RSVD3,          RSVD3,          INPUT,  0x32fc),\
462         PINGROUP(KB_COL1,       PQ1,    SYS,    KBC,            RSVD1,          SPI2,           RSVD3,          RSVD3,          INPUT,  0x3300),\
463         PINGROUP(KB_COL2,       PQ2,    SYS,    KBC,            RSVD1,          SPI2,           RSVD3,          RSVD3,          INPUT,  0x3304),\
464         PINGROUP(KB_COL3,       PQ3,    SYS,    KBC,            DISPLAYA,       PWM2,           UARTA,          KBC,            INPUT,  0x3308),\
465         PINGROUP(KB_COL4,       PQ4,    SYS,    KBC,            OWR,            SDMMC3,         UARTA,          RSVD,           INPUT,  0x330c),\
466         PINGROUP(KB_COL5,       PQ5,    SYS,    KBC,            RSVD1,          SDMMC3,         RSVD3,          RSVD3,          INPUT,  0x3310),\
467         PINGROUP(KB_COL6,       PQ6,    SYS,    KBC,            RSVD1,          SPI2,           UARTD,          RSVD1,          INPUT,  0x3314),\
468         PINGROUP(KB_COL7,       PQ7,    SYS,    KBC,            RSVD1,          SPI2,           UARTD,          RSVD1,          INPUT,  0x3318),\
469         PINGROUP(CLK_32K_OUT,   PA0,    SYS,    BLINK,          SOC,            RSVD2,          RSVD3,          RSVD,           INPUT,  0x331c),\
470         PINGROUP(CORE_PWR_REQ,  INVALID, SYS,   PWRON,          RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x3324),\
471         PINGROUP(CPU_PWR_REQ,   INVALID, SYS,   CPU,            RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x3328),\
472         PINGROUP(PWR_INT_N,     INVALID, SYS,   PMI,            RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x332c),\
473         PINGROUP(CLK_32K_IN,    INVALID, SYS,   CLK,            RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x3330),\
474         PINGROUP(OWR,           INVALID, HV,    OWR,            RSVD1,          RSVD2,          RSVD3,          RSVD1,          INPUT,  0x3334),\
475         PINGROUP(DAP1_FS,       PN0,    AUDIO,  I2S0,           HDA,            GMI,            RSVD3,          RSVD,           INPUT,  0x3338),\
476         PINGROUP(DAP1_DIN,      PN1,    AUDIO,  I2S0,           HDA,            GMI,            RSVD3,          RSVD,           INPUT,  0x333c),\
477         PINGROUP(DAP1_DOUT,     PN2,    AUDIO,  I2S0,           HDA,            GMI,            SATA,           RSVD,           INPUT,  0x3340),\
478         PINGROUP(DAP1_SCLK,     PN3,    AUDIO,  I2S0,           HDA,            GMI,            RSVD3,          RSVD,           INPUT,  0x3344),\
479         PINGROUP(DAP_MCLK1_REQ, PEE2,   AUDIO,  DAP,            DAP1,           SATA,           RSVD3,          DAP,            INPUT,  0x3348),\
480         PINGROUP(DAP_MCLK1,     PW4,    AUDIO,  EXTPERIPH1,     DAP2,           RSVD2,          RSVD3,          RSVD,           INPUT,  0x334c),\
481         PINGROUP(SPDIF_IN,      PK6,    HV,     SPDIF,          RSVD1,          RSVD2,          I2C3,           RSVD2,          INPUT,  0x3350),\
482         PINGROUP(SPDIF_OUT,     PK5,    HV,     SPDIF,          RSVD1,          RSVD2,          I2C3,           RSVD2,          INPUT,  0x3354),\
483         PINGROUP(DAP2_FS,       PA2,    AUDIO,  I2S1,           HDA,            GMI,            RSVD3,          RSVD,           INPUT,  0x3358),\
484         PINGROUP(DAP2_DIN,      PA4,    AUDIO,  I2S1,           HDA,            GMI,            RSVD3,          RSVD,           INPUT,  0x335c),\
485         PINGROUP(DAP2_DOUT,     PA5,    AUDIO,  I2S1,           HDA,            GMI,            RSVD3,          RSVD,           INPUT,  0x3360),\
486         PINGROUP(DAP2_SCLK,     PA3,    AUDIO,  I2S1,           HDA,            GMI,            RSVD3,          RSVD,           INPUT,  0x3364),\
487         PINGROUP(DVFS_PWM,      PX0,    AUDIO,  SPI6,           CLDVFS,         GMI,            RSVD3,          RSVD,           INPUT,  0x3368),\
488         PINGROUP(GPIO_X1_AUD,   PX1,    AUDIO,  SPI6,           RSVD1,          GMI,            RSVD3,          SPI6,           INPUT,  0x336c),\
489         PINGROUP(GPIO_X3_AUD,   PX3,    AUDIO,  SPI6,           SPI1,           GMI,            RSVD3,          SPI6,           INPUT,  0x3370),\
490         PINGROUP(DVFS_CLK,      PX2,    AUDIO,  SPI6,           CLDVFS,         GMI,            RSVD3,          RSVD,           INPUT,  0x3374),\
491         PINGROUP(GPIO_X4_AUD,   PX4,    AUDIO,  GMI,            SPI1,           SPI2,           DAP2,           SPI1,           INPUT,  0x3378),\
492         PINGROUP(GPIO_X5_AUD,   PX5,    AUDIO,  GMI,            SPI1,           SPI2,           RSVD3,          SPI1,           INPUT,  0x337c),\
493         PINGROUP(GPIO_X6_AUD,   PX6,    AUDIO,  SPI6,           SPI1,           SPI2,           GMI,            SPI1,           INPUT,  0x3380),\
494         PINGROUP(GPIO_X7_AUD,   PX7,    AUDIO,  RSVD0,          SPI1,           SPI2,           RSVD3,          SPI1,           INPUT,  0x3384),\
495         PINGROUP(SDMMC3_CLK,    PA6,    SDMMC3, SDMMC3,         RSVD1,          RSVD2,          SPI3,           RSVD,           INPUT,  0x3390),\
496         PINGROUP(SDMMC3_CMD,    PA7,    SDMMC3, SDMMC3,         PWM3,           UARTA,          SPI3,           RSVD,           INPUT,  0x3394),\
497         PINGROUP(SDMMC3_DAT0,   PB7,    SDMMC3, SDMMC3,         RSVD1,          RSVD2,          SPI3,           RSVD,           INPUT,  0x3398),\
498         PINGROUP(SDMMC3_DAT1,   PB6,    SDMMC3, SDMMC3,         PWM2,           UARTA,          SPI3,           RSVD,           INPUT,  0x339c),\
499         PINGROUP(SDMMC3_DAT2,   PB5,    SDMMC3, SDMMC3,         PWM1,           DISPLAYA,       SPI3,           RSVD,           INPUT,  0x33a0),\
500         PINGROUP(SDMMC3_DAT3,   PB4,    SDMMC3, SDMMC3,         PWM0,           DISPLAYB,       SPI3,           RSVD,           INPUT,  0x33a4),\
501         PINGROUP(PEX_L0_RST_N,  PDD1,   PEXCTL, PE0,            RSVD1,          RSVD2,          RSVD3,          PE0,            INPUT,  0x33bc),\
502         PINGROUP(PEX_L0_CLKREQ_N, PDD2, PEXCTL, PE0,            RSVD1,          RSVD2,          RSVD3,          PE0,            INPUT,  0x33c0),\
503         PINGROUP(PEX_WAKE_N,    PDD3,   PEXCTL, PE,             RSVD1,          RSVD2,          RSVD3,          PE,             INPUT,  0x33c4),\
504         PINGROUP(PEX_L1_RST_N,  PDD5,   PEXCTL, PE1,            RSVD1,          RSVD2,          RSVD3,          PE1,            INPUT,  0x33cc),\
505         PINGROUP(PEX_L1_CLKREQ_N, PDD6, PEXCTL, PE1,            RSVD1,          RSVD2,          RSVD3,          PE1,            INPUT,  0x33d0),\
506         PINGROUP(HDMI_CEC,      PEE3,   HV,     CEC,            RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x33e0),\
507         PINGROUP(SDMMC1_WP_N,   PV3,    SDMMC1, SDMMC1,         CLK12,          SPI4,           UARTA,          SDMMC1,         INPUT,  0x33e4),\
508         PINGROUP(SDMMC3_CD_N,   PV2,    SYS,    SDMMC3,         OWR,            RSVD2,          RSVD3,          RSVD,           INPUT,  0x33e8),\
509         PINGROUP(GPIO_W2_AUD,   PW2,    AUDIO,  SPI6,           RSVD1,          SPI2,           I2C1,           RSVD1,          INPUT,  0x33ec),\
510         PINGROUP(GPIO_W3_AUD,   PW3,    AUDIO,  SPI6,           SPI1,           SPI2,           I2C1,           SPI1,           INPUT,  0x33f0),\
511         PINGROUP(USB_VBUS_EN0,  PN4,    HV,     USB,            RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x33f4),\
512         PINGROUP(USB_VBUS_EN1,  PN5,    HV,     USB,            RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x33f8),\
513         PINGROUP(SDMMC3_CLK_LB_OUT, PEE4, SDMMC3, SDMMC3,       RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x33fc),\
514         PINGROUP(SDMMC3_CLK_LB_IN, PEE5, SDMMC3,  SDMMC3,               RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x3400),\
515         PINGROUP(GMI_CLK_LB,    INVALID, SYS,   SDMMC2,         RSVD1,          GMI,            RSVD3,          RSVD,           INPUT,  0x3404),\
516         PINGROUP(RESET_OUT_N,   INVALID, SYS,   RSVD0,          RSVD1,          RSVD2,          RESET_OUT_N,    RSVD,           INPUT,  0x3408),\
517         PINGROUP(KB_ROW16,      PT0,    SYS,    KBC,            RSVD1,          RSVD2,          UARTC,          KBC,            INPUT,  0x340c),\
518         PINGROUP(KB_ROW17,      PT1,    SYS,    KBC,            RSVD1,          RSVD2,          UARTC,          KBC,            INPUT,  0x3410),\
519         PINGROUP(USB_VBUS_EN2,  PFF1,   PEXCTL, USB,            RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x3414),\
520         PINGROUP(GPIO_PFF2,     PFF2,   PEXCTL, SATA,           RSVD1,          RSVD2,          RSVD3,          RSVD1,          INPUT,  0x3418),\
521         PINGROUP(DP_HPD,        PFF0,   HV,     DP,             RSVD1,          RSVD2,          RSVD3,          RSVD,           INPUT,  0x3430),\
522
523 #endif
524
525 const struct tegra_pingroup_desc tegra_soc_pingroups[TEGRA_MAX_PINGROUP] = {
526         PINGROUPS
527 };
528
529
530 #undef PINGROUP
531
532 /* HACK to workaround -1 index (for INVALID index) */
533 #undef TEGRA_GPIO_INVALID
534 #define TEGRA_GPIO_INVALID      TEGRA_MAX_GPIO
535
536 #define PINGROUP(pg_name, gpio_nr, vdd, f0, f1, f2, f3, fs, iod, reg)   \
537         [TEGRA_GPIO_##gpio_nr] =  TEGRA_PINGROUP_ ##pg_name\
538
539 const int gpio_to_pingroup[TEGRA_MAX_GPIO + 1] = {
540         PINGROUPS
541
542 };
543
544 #define SET_DRIVE(_name, _hsm, _schmitt, _drive, _pulldn_drive, _pullup_drive, _pulldn_slew, _pullup_slew) \
545         {                                                       \
546                 .pingroup = TEGRA_DRIVE_PINGROUP_##_name,       \
547                 .hsm = TEGRA_HSM_##_hsm,                        \
548                 .schmitt = TEGRA_SCHMITT_##_schmitt,            \
549                 .drive = TEGRA_DRIVE_##_drive,                  \
550                 .pull_down = TEGRA_PULL_##_pulldn_drive,        \
551                 .pull_up = TEGRA_PULL_##_pullup_drive,          \
552                 .slew_rising = TEGRA_SLEW_##_pulldn_slew,       \
553                 .slew_falling = TEGRA_SLEW_##_pullup_slew,      \
554         }
555
556 static __initdata struct tegra_drive_pingroup_config t12x_def_drive_pinmux[] = {
557         SET_DRIVE(DAP2, DISABLE, ENABLE, DIV_1, 31, 31, FASTEST, FASTEST),
558 };
559
560 #ifdef CONFIG_PM_SLEEP
561
562 static u32 pinmux_reg[TEGRA_MAX_PINGROUP + ARRAY_SIZE(tegra_soc_drive_pingroups)];
563
564 static int tegra12x_pinmux_suspend(void)
565 {
566         unsigned int i;
567         u32 *ctx = pinmux_reg;
568
569         for (i = 0; i < TEGRA_MAX_PINGROUP; i++)
570                 *ctx++ = pg_readl(tegra_soc_pingroups[i].mux_bank,
571                                 tegra_soc_pingroups[i].mux_reg);
572
573         for (i = 0; i < ARRAY_SIZE(tegra_soc_drive_pingroups); i++)
574                 *ctx++ = pg_readl(tegra_soc_drive_pingroups[i].reg_bank,
575                                 tegra_soc_drive_pingroups[i].reg);
576
577         return 0;
578 }
579
580 static void tegra12x_pinmux_resume(void)
581 {
582         static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
583         unsigned int i;
584         u32 *ctx = pinmux_reg;
585         u32 *tmp = pinmux_reg;
586         u32 reg_value;
587
588         for (i = 0; i < TEGRA_MAX_PINGROUP; i++) {
589                 reg_value = *tmp++;
590                 reg_value |= BIT(4); /* tristate */
591                 pg_writel(reg_value, tegra_soc_pingroups[i].mux_bank,
592                         tegra_soc_pingroups[i].mux_reg);
593         }
594
595         writel(0x400fffff, pmc + PMC_IO_DPD_REQ);
596         writel(0x40001fff, pmc + PMC_IO_DPD2_REQ);
597
598         for (i = 0; i < TEGRA_MAX_PINGROUP; i++)
599                 pg_writel(*ctx++, tegra_soc_pingroups[i].mux_bank,
600                         tegra_soc_pingroups[i].mux_reg);
601
602         for (i = 0; i < ARRAY_SIZE(tegra_soc_drive_pingroups); i++)
603                 pg_writel(*ctx++, tegra_soc_drive_pingroups[i].reg_bank,
604                         tegra_soc_drive_pingroups[i].reg);
605
606         /* Clear DPD sample */
607         writel(0x0, pmc + PMC_DPD_SAMPLE);
608 }
609
610 static struct syscore_ops tegra_pinmux_syscore_ops = {
611         .suspend = tegra12x_pinmux_suspend,
612         .resume = tegra12x_pinmux_resume,
613 };
614 #endif
615
616 void tegra12x_pinmux_init(const struct tegra_pingroup_desc **pg,
617                 int *pg_max, const struct tegra_drive_pingroup_desc **pgdrive,
618                 int *pgdrive_max, const int **gpiomap, int *gpiomap_max)
619 {
620         *pg = tegra_soc_pingroups;
621         *pg_max = TEGRA_MAX_PINGROUP;
622         *pgdrive = tegra_soc_drive_pingroups;
623         *pgdrive_max = TEGRA_MAX_DRIVE_PINGROUP;
624         *gpiomap = gpio_to_pingroup;
625         *gpiomap_max = TEGRA_MAX_GPIO;
626
627 #ifdef CONFIG_PM_SLEEP
628         register_syscore_ops(&tegra_pinmux_syscore_ops);
629 #endif
630 }
631
632 void tegra12x_default_pinmux(void)
633 {
634         tegra_drive_pinmux_config_table(t12x_def_drive_pinmux,
635                                         ARRAY_SIZE(t12x_def_drive_pinmux));
636 }