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