ARM: tegra: powermon: Fix copyrights from GPLv3 to GPLv2
[linux-3.10.git] / arch / arm / mach-tegra / pinmux-tegra30-tables.c
1 /*
2  * linux/arch/arm/mach-tegra/pinmux-tegra30-tables.c
3  *
4  * Common pinmux configurations for Tegra30 SoCs
5  *
6  * Copyright (c) 2010-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.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15  * more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20  */
21
22 #include <linux/kernel.h>
23 #include <linux/errno.h>
24 #include <linux/spinlock.h>
25 #include <linux/io.h>
26 #include <linux/init.h>
27 #include <linux/string.h>
28 #include <linux/syscore_ops.h>
29
30 #include <mach/pinmux.h>
31 #include <mach/pinmux-tegra30.h>
32
33 #include "iomap.h"
34 #include "pm.h"
35 #include "gpio-names.h"
36
37 #define PINGROUP_REG_A  0x868
38 #define MUXCTL_REG_A    0x3000
39
40 #define SET_DRIVE_PINGROUP(pg_name, r, drv_down_offset, drv_down_mask, drv_up_offset, drv_up_mask,      \
41         slew_rise_offset, slew_rise_mask, slew_fall_offset, slew_fall_mask)     \
42         [TEGRA_DRIVE_PINGROUP_ ## pg_name] = {                  \
43                 .name = #pg_name,                               \
44                 .reg_bank = 0,                                  \
45                 .reg = ((r) - PINGROUP_REG_A),                  \
46                 .drvup_offset = drv_up_offset,                  \
47                 .drvup_mask = drv_up_mask,                      \
48                 .drvdown_offset = drv_down_offset,              \
49                 .drvdown_mask = drv_down_mask,                  \
50                 .slewrise_offset = slew_rise_offset,            \
51                 .slewrise_mask = slew_rise_mask,                \
52                 .slewfall_offset = slew_fall_offset,            \
53                 .slewfall_mask = slew_fall_mask,                \
54         }
55
56 #define DEFAULT_DRIVE_PINGROUP(pg_name, r)              \
57         [TEGRA_DRIVE_PINGROUP_ ## pg_name] = {          \
58                 .name = #pg_name,                       \
59                 .reg_bank = 0,                          \
60                 .reg = ((r) - PINGROUP_REG_A),          \
61                 .drvup_offset = 20,                     \
62                 .drvup_mask = 0x1f,                     \
63                 .drvdown_offset = 12,                   \
64                 .drvdown_mask = 0x1f,                   \
65                 .slewrise_offset = 28,                  \
66                 .slewrise_mask = 0x3,                   \
67                 .slewfall_offset = 30,                  \
68                 .slewfall_mask = 0x3,                   \
69         }
70
71 const struct tegra_drive_pingroup_desc tegra_soc_drive_pingroups[TEGRA_MAX_DRIVE_PINGROUP] = {
72         DEFAULT_DRIVE_PINGROUP(AO1,             0x868),
73         DEFAULT_DRIVE_PINGROUP(AO2,             0x86c),
74         SET_DRIVE_PINGROUP(AT1,         0x870,  14,     0x1f,   19,     0x1f,
75         24,     0x3,    28,     0x3),
76         SET_DRIVE_PINGROUP(AT2,         0x874,  14,     0x1f,   19,     0x1f,
77         24,     0x3,    28,     0x3),
78         SET_DRIVE_PINGROUP(AT3,         0x878,  14,     0x1f,   19,     0x1f,
79         28,     0x3,    30,     0x3),
80         SET_DRIVE_PINGROUP(AT4,         0x87c,  14,     0x1f,   19,     0x1f,
81         28,     0x3,    30,     0x3),
82         SET_DRIVE_PINGROUP(AT5,         0x880,  14,     0x1f,   19,     0x1f,
83         28,     0x3,    30,     0x3),
84         DEFAULT_DRIVE_PINGROUP(CDEV1,           0x884),
85         DEFAULT_DRIVE_PINGROUP(CDEV2,           0x888),
86         DEFAULT_DRIVE_PINGROUP(CSUS,            0x88c),
87         DEFAULT_DRIVE_PINGROUP(DAP1,            0x890),
88         DEFAULT_DRIVE_PINGROUP(DAP2,            0x894),
89         DEFAULT_DRIVE_PINGROUP(DAP3,            0x898),
90         DEFAULT_DRIVE_PINGROUP(DAP4,            0x89c),
91         DEFAULT_DRIVE_PINGROUP(DBG,             0x8a0),
92         DEFAULT_DRIVE_PINGROUP(LCD1,            0x8a4),
93         DEFAULT_DRIVE_PINGROUP(LCD2,            0x8a8),
94         SET_DRIVE_PINGROUP(SDIO2,               0x8ac,  12,     0x7f,   20,     0x7f,
95                 28,     0x3,    30,     0x3),
96         SET_DRIVE_PINGROUP(SDIO3,               0x8b0,  12,     0x7f,   20,     0x7f,
97                 28,     0x3,    30,     0x3),
98         DEFAULT_DRIVE_PINGROUP(SPI,             0x8b4),
99         DEFAULT_DRIVE_PINGROUP(UAA,             0x8b8),
100         DEFAULT_DRIVE_PINGROUP(UAB,             0x8bc),
101         DEFAULT_DRIVE_PINGROUP(UART2,           0x8c0),
102         DEFAULT_DRIVE_PINGROUP(UART3,           0x8c4),
103         DEFAULT_DRIVE_PINGROUP(VI1,             0x8c8),
104         SET_DRIVE_PINGROUP(SDIO1,               0x8ec,  12,     0x7f,   20,     0x7f,
105                 28,     0x3,    30,     0x3),
106         DEFAULT_DRIVE_PINGROUP(CRT,             0x8f8),
107         DEFAULT_DRIVE_PINGROUP(DDC,             0x8fc),
108         SET_DRIVE_PINGROUP(GMA,                 0x900,  14,     0x1f,   19,     0x1f,
109                 24,     0xf,    28,     0xf),
110         SET_DRIVE_PINGROUP(GMB,                 0x904,  14,     0x1f,   19,     0x1f,
111                 24,     0xf,    28,     0xf),
112         SET_DRIVE_PINGROUP(GMC,                 0x908,  14,     0x1f,   19,     0x1f,
113                 24,     0xf,    28,     0xf),
114         SET_DRIVE_PINGROUP(GMD,                 0x90c,  14,     0x1f,   19,     0x1f,
115                 24,     0xf,    28,     0xf),
116         SET_DRIVE_PINGROUP(GME,         0x910,  14,     0x1f,   19,     0x1f,
117         28,     0x3,    30,     0x3),
118         SET_DRIVE_PINGROUP(GMF,         0x914,  14,     0x1f,   19,     0x1f,
119         28,     0x3,    30,     0x3),
120         SET_DRIVE_PINGROUP(GMG,         0x918,  14,     0x1f,   19,     0x1f,
121         28,     0x3,    30,     0x3),
122         SET_DRIVE_PINGROUP(GMH,         0x91c,  14,     0x1f,   19,     0x1f,
123         28,     0x3,    30,     0x3),
124         DEFAULT_DRIVE_PINGROUP(OWR,             0x920),
125         DEFAULT_DRIVE_PINGROUP(UAD,             0x924),
126         DEFAULT_DRIVE_PINGROUP(GPV,             0x928),
127         DEFAULT_DRIVE_PINGROUP(DEV3,            0x92c),
128         DEFAULT_DRIVE_PINGROUP(CEC,             0x938),
129 };
130
131 #define PINGROUP(pg_name, gpio_nr, vdd, f0, f1, f2, f3, fs, iod, reg)   \
132         [TEGRA_PINGROUP_ ## pg_name] = {                        \
133                 .name = #pg_name,                               \
134                 .vddio = TEGRA_VDDIO_ ## vdd,                   \
135                 .funcs = {                                      \
136                         TEGRA_MUX_ ## f0,                       \
137                         TEGRA_MUX_ ## f1,                       \
138                         TEGRA_MUX_ ## f2,                       \
139                         TEGRA_MUX_ ## f3,                       \
140                 },                                              \
141                 .gpionr = TEGRA_GPIO_ ## gpio_nr,               \
142                 .func_safe = TEGRA_MUX_ ## fs,                  \
143                 .tri_bank = 1,                                  \
144                 .tri_reg = ((reg) - MUXCTL_REG_A),              \
145                 .tri_bit = 4,                                   \
146                 .mux_bank = 1,                                  \
147                 .mux_reg = ((reg) - MUXCTL_REG_A),              \
148                 .mux_bit = 0,                                   \
149                 .pupd_bank = 1,                                 \
150                 .pupd_reg = ((reg) - MUXCTL_REG_A),             \
151                 .pupd_bit = 2,                                  \
152                 .io_default = TEGRA_PIN_ ## iod,                \
153                 .od_bit = 6,                                    \
154                 .lock_bit = 7,                                  \
155                 .ioreset_bit = 8,                               \
156                 .rcv_sel_bit = -1,                              \
157         }
158
159 /* !!!FIXME!!! FILL IN fSafe COLUMN IN TABLE ....... */
160
161 #define PINGROUPS       \
162         /*       NAME                   GPIO            VDD             f0              f1              f2              f3              fSafe   io      reg */\
163         PINGROUP(ULPI_DATA0,            PO1,            BB,             SPI3,           HSI,            UARTA,          ULPI,           ULPI,   INPUT,  0x3000),\
164         PINGROUP(ULPI_DATA1,            PO2,            BB,             SPI3,           HSI,            UARTA,          ULPI,           ULPI,   INPUT,  0x3004),\
165         PINGROUP(ULPI_DATA2,            PO3,            BB,             SPI3,           HSI,            UARTA,          ULPI,           ULPI,   INPUT,  0x3008),\
166         PINGROUP(ULPI_DATA3,            PO4,            BB,             SPI3,           HSI,            UARTA,          ULPI,           ULPI,   INPUT,  0x300c),\
167         PINGROUP(ULPI_DATA4,            PO5,            BB,             SPI2,           HSI,            UARTA,          ULPI,           ULPI,   INPUT,  0x3010),\
168         PINGROUP(ULPI_DATA5,            PO6,            BB,             SPI2,           HSI,            UARTA,          ULPI,           ULPI,   INPUT,  0x3014),\
169         PINGROUP(ULPI_DATA6,            PO7,            BB,             SPI2,           HSI,            UARTA,          ULPI,           ULPI,   INPUT,  0x3018),\
170         PINGROUP(ULPI_DATA7,            PO0,            BB,             SPI2,           HSI,            UARTA,          ULPI,           ULPI,   INPUT,  0x301c),\
171         PINGROUP(ULPI_CLK,              PY0,            BB,             SPI1,           RSVD,           UARTD,          ULPI,           ULPI,   INPUT,  0x3020),\
172         PINGROUP(ULPI_DIR,              PY1,            BB,             SPI1,           RSVD,           UARTD,          ULPI,           ULPI,   INPUT,  0x3024),\
173         PINGROUP(ULPI_NXT,              PY2,            BB,             SPI1,           RSVD,           UARTD,          ULPI,           ULPI,   INPUT,  0x3028),\
174         PINGROUP(ULPI_STP,              PY3,            BB,             SPI1,           RSVD,           UARTD,          ULPI,           ULPI,   INPUT,  0x302c),\
175         PINGROUP(DAP3_FS,               PP0,            BB,             I2S2,           RSVD1,          DISPLAYA,       DISPLAYB,       I2S2,   INPUT,  0x3030),\
176         PINGROUP(DAP3_DIN,              PP1,            BB,             I2S2,           RSVD1,          DISPLAYA,       DISPLAYB,       I2S2,   INPUT,  0x3034),\
177         PINGROUP(DAP3_DOUT,             PP2,            BB,             I2S2,           RSVD1,          DISPLAYA,       DISPLAYB,       I2S2,   INPUT,  0x3038),\
178         PINGROUP(DAP3_SCLK,             PP3,            BB,             I2S2,           RSVD1,          DISPLAYA,       DISPLAYB,       I2S2,   INPUT,  0x303c),\
179         PINGROUP(GPIO_PV0,              PV0,            BB,             RSVD,           RSVD,           RSVD,           RSVD,           RSVD,   INPUT,  0x3040),\
180         PINGROUP(GPIO_PV1,              PV1,            BB,             RSVD,           RSVD,           RSVD,           RSVD,           RSVD,   INPUT,  0x3044),\
181         PINGROUP(SDMMC1_CLK,            PZ0,            SDMMC1,         SDIO1,          RSVD1,          RSVD2,          INVALID,        SDMMC1, INPUT,  0x3048),\
182         PINGROUP(SDMMC1_CMD,            PZ1,            SDMMC1,         SDIO1,          RSVD1,          RSVD2,          INVALID,        SDMMC1, INPUT,  0x304c),\
183         PINGROUP(SDMMC1_DAT3,           PY4,            SDMMC1,         SDIO1,          RSVD1,          UARTE,          INVALID,        SDMMC1, INPUT,  0x3050),\
184         PINGROUP(SDMMC1_DAT2,           PY5,            SDMMC1,         SDIO1,          RSVD1,          UARTE,          INVALID,        SDMMC1, INPUT,  0x3054),\
185         PINGROUP(SDMMC1_DAT1,           PY6,            SDMMC1,         SDIO1,          RSVD1,          UARTE,          INVALID,        SDMMC1, INPUT,  0x3058),\
186         PINGROUP(SDMMC1_DAT0,           PY7,            SDMMC1,         SDIO1,          RSVD1,          UARTE,          INVALID,        SDMMC1, INPUT,  0x305c),\
187         PINGROUP(GPIO_PV2,              PV2,            SDMMC1,         OWR,            RSVD1,          RSVD2,          RSVD3,          RSVD,   INPUT,  0x3060),\
188         PINGROUP(GPIO_PV3,              PV3,            SDMMC1,         INVALID,        RSVD1,          RSVD2,          RSVD3,          RSVD,   INPUT,  0x3064),\
189         PINGROUP(CLK2_OUT,              PW5,            SDMMC1,         EXTPERIPH2,     RSVD1,          RSVD2,          RSVD3,          EXTPERIPH2,     INPUT,  0x3068),\
190         PINGROUP(CLK2_REQ,              PCC5,           SDMMC1,         DAP,            RSVD1,          RSVD2,          RSVD3,          DAP,    INPUT,  0x306c),\
191         PINGROUP(LCD_PWR1,              PC1,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x3070),\
192         PINGROUP(LCD_PWR2,              PC6,            LCD,            DISPLAYA,       DISPLAYB,       SPI5,           RSVD,           DISPLAYA,       OUTPUT, 0x3074),\
193         PINGROUP(LCD_SDIN,              PZ2,            LCD,            DISPLAYA,       DISPLAYB,       SPI5,           RSVD,           DISPLAYA,       OUTPUT, 0x3078),\
194         PINGROUP(LCD_SDOUT,             PN5,            LCD,            DISPLAYA,       DISPLAYB,       SPI5,           INVALID,        DISPLAYA,       OUTPUT, 0x307c),\
195         PINGROUP(LCD_WR_N,              PZ3,            LCD,            DISPLAYA,       DISPLAYB,       SPI5,           RSVD,           DISPLAYA,       OUTPUT, 0x3080),\
196         PINGROUP(LCD_CS0_N,             PN4,            LCD,            DISPLAYA,       DISPLAYB,       SPI5,           RSVD,           DISPLAYA,       OUTPUT, 0x3084),\
197         PINGROUP(LCD_DC0,               PN6,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x3088),\
198         PINGROUP(LCD_SCK,               PZ4,            LCD,            DISPLAYA,       DISPLAYB,       SPI5,           INVALID,        DISPLAYA,       OUTPUT, 0x308c),\
199         PINGROUP(LCD_PWR0,              PB2,            LCD,            DISPLAYA,       DISPLAYB,       SPI5,           INVALID,        DISPLAYA,       OUTPUT, 0x3090),\
200         PINGROUP(LCD_PCLK,              PB3,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x3094),\
201         PINGROUP(LCD_DE,                PJ1,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x3098),\
202         PINGROUP(LCD_HSYNC,             PJ3,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x309c),\
203         PINGROUP(LCD_VSYNC,             PJ4,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30a0),\
204         PINGROUP(LCD_D0,                PE0,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30a4),\
205         PINGROUP(LCD_D1,                PE1,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30a8),\
206         PINGROUP(LCD_D2,                PE2,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30ac),\
207         PINGROUP(LCD_D3,                PE3,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30b0),\
208         PINGROUP(LCD_D4,                PE4,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30b4),\
209         PINGROUP(LCD_D5,                PE5,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30b8),\
210         PINGROUP(LCD_D6,                PE6,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30bc),\
211         PINGROUP(LCD_D7,                PE7,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30c0),\
212         PINGROUP(LCD_D8,                PF0,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30c4),\
213         PINGROUP(LCD_D9,                PF1,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30c8),\
214         PINGROUP(LCD_D10,               PF2,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30cc),\
215         PINGROUP(LCD_D11,               PF3,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30d0),\
216         PINGROUP(LCD_D12,               PF4,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30d4),\
217         PINGROUP(LCD_D13,               PF5,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30d8),\
218         PINGROUP(LCD_D14,               PF6,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30dc),\
219         PINGROUP(LCD_D15,               PF7,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30e0),\
220         PINGROUP(LCD_D16,               PM0,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30e4),\
221         PINGROUP(LCD_D17,               PM1,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30e8),\
222         PINGROUP(LCD_D18,               PM2,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30ec),\
223         PINGROUP(LCD_D19,               PM3,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30f0),\
224         PINGROUP(LCD_D20,               PM4,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30f4),\
225         PINGROUP(LCD_D21,               PM5,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30f8),\
226         PINGROUP(LCD_D22,               PM6,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x30fc),\
227         PINGROUP(LCD_D23,               PM7,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x3100),\
228         PINGROUP(LCD_CS1_N,             PW0,            LCD,            DISPLAYA,       DISPLAYB,       SPI5,           RSVD2,          DISPLAYA,       OUTPUT, 0x3104),\
229         PINGROUP(LCD_M1,                PW1,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x3108),\
230         PINGROUP(LCD_DC1,               PD2,            LCD,            DISPLAYA,       DISPLAYB,       RSVD1,          RSVD2,          DISPLAYA,       OUTPUT, 0x310c),\
231         PINGROUP(HDMI_INT,              PN7,            LCD,            RSVD,           RSVD,           RSVD,           RSVD,           RSVD,   INPUT,  0x3110),\
232         PINGROUP(DDC_SCL,               PV4,            LCD,            I2C4,           RSVD1,          RSVD2,          RSVD3,          I2C4,   INPUT,  0x3114),\
233         PINGROUP(DDC_SDA,               PV5,            LCD,            I2C4,           RSVD1,          RSVD2,          RSVD3,          I2C4,   INPUT,  0x3118),\
234         PINGROUP(CRT_HSYNC,             PV6,            LCD,            CRT,            RSVD1,          RSVD2,          RSVD3,          CRT,    INPUT,  0x311c),\
235         PINGROUP(CRT_VSYNC,             PV7,            LCD,            CRT,            RSVD1,          RSVD2,          RSVD3,          CRT,    INPUT,  0x3120),\
236         PINGROUP(VI_D0,                 PT4,            VI,             INVALID,        RSVD1,          VI,             RSVD2,          VI,     INPUT,  0x3124),\
237         PINGROUP(VI_D1,                 PD5,            VI,             INVALID,        SDIO2,          VI,             RSVD1,          VI,     INPUT,  0x3128),\
238         PINGROUP(VI_D2,                 PL0,            VI,             INVALID,        SDIO2,          VI,             RSVD1,          VI,     INPUT,  0x312c),\
239         PINGROUP(VI_D3,                 PL1,            VI,             INVALID,        SDIO2,          VI,             RSVD1,          VI,     INPUT,  0x3130),\
240         PINGROUP(VI_D4,                 PL2,            VI,             INVALID,        SDIO2,          VI,             RSVD1,          VI,     INPUT,  0x3134),\
241         PINGROUP(VI_D5,                 PL3,            VI,             INVALID,        SDIO2,          VI,             RSVD1,          VI,     INPUT,  0x3138),\
242         PINGROUP(VI_D6,                 PL4,            VI,             INVALID,        SDIO2,          VI,             RSVD1,          VI,     INPUT,  0x313c),\
243         PINGROUP(VI_D7,                 PL5,            VI,             INVALID,        SDIO2,          VI,             RSVD1,          VI,     INPUT,  0x3140),\
244         PINGROUP(VI_D8,                 PL6,            VI,             INVALID,        SDIO2,          VI,             RSVD1,          VI,     INPUT,  0x3144),\
245         PINGROUP(VI_D9,                 PL7,            VI,             INVALID,        SDIO2,          VI,             RSVD1,          VI,     INPUT,  0x3148),\
246         PINGROUP(VI_D10,                PT2,            VI,             INVALID,        RSVD1,          VI,             RSVD2,          VI,     INPUT,  0x314c),\
247         PINGROUP(VI_D11,                PT3,            VI,             INVALID,        RSVD1,          VI,             RSVD2,          VI,     INPUT,  0x3150),\
248         PINGROUP(VI_PCLK,               PT0,            VI,             RSVD1,          SDIO2,          VI,             RSVD2,          VI,     INPUT,  0x3154),\
249         PINGROUP(VI_MCLK,               PT1,            VI,             INVALID,        INVALID,        INVALID,        VI,             RSVD,   INPUT,  0x3158),\
250         PINGROUP(VI_VSYNC,              PD6,            VI,             INVALID,        RSVD1,          VI,             RSVD2,          VI,     INPUT,  0x315c),\
251         PINGROUP(VI_HSYNC,              PD7,            VI,             INVALID,        RSVD1,          VI,             RSVD2,          VI,     INPUT,  0x3160),\
252         PINGROUP(UART2_RXD,             PC3,            UART,           IRDA,           SPDIF,          UARTA,          SPI4,           IRDA,   INPUT,  0x3164),\
253         PINGROUP(UART2_TXD,             PC2,            UART,           IRDA,           SPDIF,          UARTA,          SPI4,           IRDA,   INPUT,  0x3168),\
254         PINGROUP(UART2_RTS_N,           PJ6,            UART,           UARTA,          UARTB,          GMI,            SPI4,           UARTB,  INPUT,  0x316c),\
255         PINGROUP(UART2_CTS_N,           PJ5,            UART,           UARTA,          UARTB,          GMI,            SPI4,           UARTB,  INPUT,  0x3170),\
256         PINGROUP(UART3_TXD,             PW6,            UART,           UARTC,          RSVD1,          GMI,            RSVD2,          UARTC,  INPUT,  0x3174),\
257         PINGROUP(UART3_RXD,             PW7,            UART,           UARTC,          RSVD1,          GMI,            RSVD2,          UARTC,  INPUT,  0x3178),\
258         PINGROUP(UART3_CTS_N,           PA1,            UART,           UARTC,          RSVD1,          GMI,            RSVD2,          UARTC,  INPUT,  0x317c),\
259         PINGROUP(UART3_RTS_N,           PC0,            UART,           UARTC,          PWM0,           GMI,            RSVD2,          UARTC,  INPUT,  0x3180),\
260         PINGROUP(GPIO_PU0,              PU0,            UART,           OWR,            UARTA,          GMI,            RSVD1,          GMI,    INPUT,  0x3184),\
261         PINGROUP(GPIO_PU1,              PU1,            UART,           RSVD1,          UARTA,          GMI,            RSVD2,          GMI,    INPUT,  0x3188),\
262         PINGROUP(GPIO_PU2,              PU2,            UART,           RSVD1,          UARTA,          GMI,            RSVD2,          GMI,    INPUT,  0x318c),\
263         PINGROUP(GPIO_PU3,              PU3,            UART,           PWM0,           UARTA,          GMI,            RSVD1,          GMI,    INPUT,  0x3190),\
264         PINGROUP(GPIO_PU4,              PU4,            UART,           PWM1,           UARTA,          GMI,            RSVD1,          GMI,    INPUT,  0x3194),\
265         PINGROUP(GPIO_PU5,              PU5,            UART,           PWM2,           UARTA,          GMI,            RSVD1,          GMI,    INPUT,  0x3198),\
266         PINGROUP(GPIO_PU6,              PU6,            UART,           PWM3,           UARTA,          GMI,            RSVD1,          GMI,    INPUT,  0x319c),\
267         PINGROUP(GEN1_I2C_SDA,          PC5,            UART,           I2C,            RSVD1,          RSVD2,          RSVD3,          I2C1,   INPUT,  0x31a0),\
268         PINGROUP(GEN1_I2C_SCL,          PC4,            UART,           I2C,            RSVD1,          RSVD2,          RSVD3,          I2C1,   INPUT,  0x31a4),\
269         PINGROUP(DAP4_FS,               PP4,            UART,           I2S3,           RSVD1,          GMI,            RSVD2,          I2S3,   INPUT,  0x31a8),\
270         PINGROUP(DAP4_DIN,              PP5,            UART,           I2S3,           RSVD1,          GMI,            RSVD2,          I2S3,   INPUT,  0x31ac),\
271         PINGROUP(DAP4_DOUT,             PP6,            UART,           I2S3,           RSVD1,          GMI,            RSVD2,          I2S3,   INPUT,  0x31b0),\
272         PINGROUP(DAP4_SCLK,             PP7,            UART,           I2S3,           RSVD1,          GMI,            RSVD2,          I2S3,   INPUT,  0x31b4),\
273         PINGROUP(CLK3_OUT,              PEE0,           UART,           EXTPERIPH3,     RSVD1,          RSVD2,          RSVD3,          EXTPERIPH3,     INPUT,  0x31b8),\
274         PINGROUP(CLK3_REQ,              PEE1,           UART,           DEV3,           RSVD1,          RSVD2,          RSVD3,          DEV3,   INPUT,  0x31bc),\
275         PINGROUP(GMI_WP_N,              PC7,            GMI,            RSVD1,          NAND,           GMI,            GMI_ALT,        GMI,    INPUT,  0x31c0),\
276         PINGROUP(GMI_IORDY,             PI5,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x31c4),\
277         PINGROUP(GMI_WAIT,              PI7,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x31c8),\
278         PINGROUP(GMI_ADV_N,             PK0,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x31cc),\
279         PINGROUP(GMI_CLK,               PK1,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x31d0),\
280         PINGROUP(GMI_CS0_N,             PJ0,            GMI,            RSVD1,          NAND,           GMI,            DTV,            GMI,    INPUT,  0x31d4),\
281         PINGROUP(GMI_CS1_N,             PJ2,            GMI,            RSVD1,          NAND,           GMI,            DTV,            GMI,    INPUT,  0x31d8),\
282         PINGROUP(GMI_CS2_N,             PK3,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x31dc),\
283         PINGROUP(GMI_CS3_N,             PK4,            GMI,            RSVD1,          NAND,           GMI,            GMI_ALT,        GMI,    INPUT,  0x31e0),\
284         PINGROUP(GMI_CS4_N,             PK2,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x31e4),\
285         PINGROUP(GMI_CS6_N,             PI3,            GMI,            NAND,           NAND_ALT,       GMI,            SATA,           NAND,   INPUT,  0x31e8),\
286         PINGROUP(GMI_CS7_N,             PI6,            GMI,            NAND,           NAND_ALT,       GMI,            GMI_ALT,        NAND,   INPUT,  0x31ec),\
287         PINGROUP(GMI_AD0,               PG0,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x31f0),\
288         PINGROUP(GMI_AD1,               PG1,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x31f4),\
289         PINGROUP(GMI_AD2,               PG2,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x31f8),\
290         PINGROUP(GMI_AD3,               PG3,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x31fc),\
291         PINGROUP(GMI_AD4,               PG4,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x3200),\
292         PINGROUP(GMI_AD5,               PG5,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x3204),\
293         PINGROUP(GMI_AD6,               PG6,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x3208),\
294         PINGROUP(GMI_AD7,               PG7,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x320c),\
295         PINGROUP(GMI_AD8,               PH0,            GMI,            PWM0,           NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x3210),\
296         PINGROUP(GMI_AD9,               PH1,            GMI,            PWM1,           NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x3214),\
297         PINGROUP(GMI_AD10,              PH2,            GMI,            PWM2,           NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x3218),\
298         PINGROUP(GMI_AD11,              PH3,            GMI,            PWM3,           NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x321c),\
299         PINGROUP(GMI_AD12,              PH4,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x3220),\
300         PINGROUP(GMI_AD13,              PH5,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x3224),\
301         PINGROUP(GMI_AD14,              PH6,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x3228),\
302         PINGROUP(GMI_AD15,              PH7,            GMI,            RSVD1,          NAND,           GMI,            RSVD2,          GMI,    INPUT,  0x322c),\
303         PINGROUP(GMI_A16,               PJ7,            GMI,            UARTD,          SPI4,           GMI,            GMI_ALT,        GMI,    INPUT,  0x3230),\
304         PINGROUP(GMI_A17,               PB0,            GMI,            UARTD,          SPI4,           GMI,            DTV,            GMI,    INPUT,  0x3234),\
305         PINGROUP(GMI_A18,               PB1,            GMI,            UARTD,          SPI4,           GMI,            DTV,            GMI,    INPUT,  0x3238),\
306         PINGROUP(GMI_A19,               PK7,            GMI,            UARTD,          SPI4,           GMI,            RSVD3,          GMI,    INPUT,  0x323c),\
307         PINGROUP(GMI_WR_N,              PI0,            GMI,            RSVD1,          NAND,           GMI,            RSVD3,          GMI,    INPUT,  0x3240),\
308         PINGROUP(GMI_OE_N,              PI1,            GMI,            RSVD1,          NAND,           GMI,            RSVD3,          GMI,    INPUT,  0x3244),\
309         PINGROUP(GMI_DQS,               PI2,            GMI,            RSVD1,          NAND,           GMI,            RSVD3,          NAND,   INPUT,  0x3248),\
310         PINGROUP(GMI_RST_N,             PI4,            GMI,            NAND,           NAND_ALT,       GMI,            RSVD3,          NAND,   INPUT,  0x324c),\
311         PINGROUP(GEN2_I2C_SCL,          PT5,            GMI,            I2C2,           INVALID,        GMI,            RSVD3,          I2C2,   INPUT,  0x3250),\
312         PINGROUP(GEN2_I2C_SDA,          PT6,            GMI,            I2C2,           INVALID,        GMI,            RSVD3,          I2C2,   INPUT,  0x3254),\
313         PINGROUP(SDMMC4_CLK,            PCC4,           SDMMC4,         INVALID,        NAND,           GMI,            SDIO4,          GMI,    INPUT,  0x3258),\
314         PINGROUP(SDMMC4_CMD,            PT7,            SDMMC4,         I2C3,           NAND,           GMI,            SDIO4,          GMI,    INPUT,  0x325c),\
315         PINGROUP(SDMMC4_DAT0,           PAA0,           SDMMC4,         UARTE,          SPI3,           GMI,            SDIO4,          GMI,    INPUT,  0x3260),\
316         PINGROUP(SDMMC4_DAT1,           PAA1,           SDMMC4,         UARTE,          SPI3,           GMI,            SDIO4,          GMI,    INPUT,  0x3264),\
317         PINGROUP(SDMMC4_DAT2,           PAA2,           SDMMC4,         UARTE,          SPI3,           GMI,            SDIO4,          GMI,    INPUT,  0x3268),\
318         PINGROUP(SDMMC4_DAT3,           PAA3,           SDMMC4,         UARTE,          SPI3,           GMI,            SDIO4,          GMI,    INPUT,  0x326c),\
319         PINGROUP(SDMMC4_DAT4,           PAA4,           SDMMC4,         I2C3,           I2S4,           GMI,            SDIO4,          GMI,    INPUT,  0x3270),\
320         PINGROUP(SDMMC4_DAT5,           PAA5,           SDMMC4,         VGP3,           I2S4,           GMI,            SDIO4,          GMI,    INPUT,  0x3274),\
321         PINGROUP(SDMMC4_DAT6,           PAA6,           SDMMC4,         VGP4,           I2S4,           GMI,            SDIO4,          GMI,    INPUT,  0x3278),\
322         PINGROUP(SDMMC4_DAT7,           PAA7,           SDMMC4,         VGP5,           I2S4,           GMI,            SDIO4,          GMI,    INPUT,  0x327c),\
323         PINGROUP(SDMMC4_RST_N,          PCC3,           SDMMC4,         VGP6,           RSVD1,          RSVD2,          POPSDMMC4,      RSVD,   INPUT,  0x3280),\
324         PINGROUP(CAM_MCLK,              PCC0,           CAM,            VI,             INVALID,        VI_ALT2,        POPSDMMC4,      RSVD,   INPUT,  0x3284),\
325         PINGROUP(GPIO_PCC1,             PCC1,           CAM,            I2S4,           RSVD1,          RSVD2,          POPSDMMC4,      RSVD,   INPUT,  0x3288),\
326         PINGROUP(GPIO_PBB0,             PBB0,           CAM,            I2S4,           RSVD1,          RSVD2,          POPSDMMC4,      RSVD,   INPUT,  0x328c),\
327         PINGROUP(CAM_I2C_SCL,           PBB1,           CAM,            INVALID,        I2C3,           RSVD2,          POPSDMMC4,      RSVD,   INPUT,  0x3290),\
328         PINGROUP(CAM_I2C_SDA,           PBB2,           CAM,            INVALID,        I2C3,           RSVD2,          POPSDMMC4,      RSVD,   INPUT,  0x3294),\
329         PINGROUP(GPIO_PBB3,             PBB3,           CAM,            VGP3,           DISPLAYA,       DISPLAYB,       POPSDMMC4,      RSVD,   INPUT,  0x3298),\
330         PINGROUP(GPIO_PBB4,             PBB4,           CAM,            VGP4,           DISPLAYA,       DISPLAYB,       POPSDMMC4,      RSVD,   INPUT,  0x329c),\
331         PINGROUP(GPIO_PBB5,             PBB5,           CAM,            VGP5,           DISPLAYA,       DISPLAYB,       POPSDMMC4,      RSVD,   INPUT,  0x32a0),\
332         PINGROUP(GPIO_PBB6,             PBB6,           CAM,            VGP6,           DISPLAYA,       DISPLAYB,       POPSDMMC4,      RSVD,   INPUT,  0x32a4),\
333         PINGROUP(GPIO_PBB7,             PBB7,           CAM,            I2S4,           RSVD1,          RSVD2,          POPSDMMC4,      RSVD,   INPUT,  0x32a8),\
334         PINGROUP(GPIO_PCC2,             PCC2,           CAM,            I2S4,           RSVD1,          RSVD2,          POPSDMMC4,      RSVD,   INPUT,  0x32ac),\
335         PINGROUP(JTAG_RTCK,             PU7,            SYS,            RTCK,           RSVD1,          RSVD2,          RSVD3,          RTCK,   INPUT,  0x32b0),\
336         PINGROUP(PWR_I2C_SCL,           PZ6,            SYS,            I2CPWR,         RSVD1,          RSVD2,          RSVD3,          I2CPWR, INPUT,  0x32b4),\
337         PINGROUP(PWR_I2C_SDA,           PZ7,            SYS,            I2CPWR,         RSVD1,          RSVD2,          RSVD3,          I2CPWR, INPUT,  0x32b8),\
338         PINGROUP(KB_ROW0,               PR0,            SYS,            KBC,            INVALID,        RSVD2,          RSVD3,          KBC,    INPUT,  0x32bc),\
339         PINGROUP(KB_ROW1,               PR1,            SYS,            KBC,            INVALID,        RSVD2,          RSVD3,          KBC,    INPUT,  0x32c0),\
340         PINGROUP(KB_ROW2,               PR2,            SYS,            KBC,            INVALID,        RSVD2,          RSVD3,          KBC,    INPUT,  0x32c4),\
341         PINGROUP(KB_ROW3,               PR3,            SYS,            KBC,            INVALID,        RSVD2,          INVALID,        KBC,    INPUT,  0x32c8),\
342         PINGROUP(KB_ROW4,               PR4,            SYS,            KBC,            INVALID,        TRACE,          RSVD3,          KBC,    INPUT,  0x32cc),\
343         PINGROUP(KB_ROW5,               PR5,            SYS,            KBC,            INVALID,        TRACE,          OWR,            KBC,    INPUT,  0x32d0),\
344         PINGROUP(KB_ROW6,               PR6,            SYS,            KBC,            INVALID,        SDIO2,          INVALID,        KBC,    INPUT,  0x32d4),\
345         PINGROUP(KB_ROW7,               PR7,            SYS,            KBC,            INVALID,        SDIO2,          INVALID,        KBC,    INPUT,  0x32d8),\
346         PINGROUP(KB_ROW8,               PS0,            SYS,            KBC,            INVALID,        SDIO2,          INVALID,        KBC,    INPUT,  0x32dc),\
347         PINGROUP(KB_ROW9,               PS1,            SYS,            KBC,            INVALID,        SDIO2,          INVALID,        KBC,    INPUT,  0x32e0),\
348         PINGROUP(KB_ROW10,              PS2,            SYS,            KBC,            INVALID,        SDIO2,          INVALID,        KBC,    INPUT,  0x32e4),\
349         PINGROUP(KB_ROW11,              PS3,            SYS,            KBC,            INVALID,        SDIO2,          INVALID,        KBC,    INPUT,  0x32e8),\
350         PINGROUP(KB_ROW12,              PS4,            SYS,            KBC,            INVALID,        SDIO2,          INVALID,        KBC,    INPUT,  0x32ec),\
351         PINGROUP(KB_ROW13,              PS5,            SYS,            KBC,            INVALID,        SDIO2,          INVALID,        KBC,    INPUT,  0x32f0),\
352         PINGROUP(KB_ROW14,              PS6,            SYS,            KBC,            INVALID,        SDIO2,          INVALID,        KBC,    INPUT,  0x32f4),\
353         PINGROUP(KB_ROW15,              PS7,            SYS,            KBC,            INVALID,        SDIO2,          INVALID,        KBC,    INPUT,  0x32f8),\
354         PINGROUP(KB_COL0,               PQ0,            SYS,            KBC,            INVALID,        TRACE,          INVALID,        KBC,    INPUT,  0x32fc),\
355         PINGROUP(KB_COL1,               PQ1,            SYS,            KBC,            INVALID,        TRACE,          INVALID,        KBC,    INPUT,  0x3300),\
356         PINGROUP(KB_COL2,               PQ2,            SYS,            KBC,            INVALID,        TRACE,          RSVD,           KBC,    INPUT,  0x3304),\
357         PINGROUP(KB_COL3,               PQ3,            SYS,            KBC,            INVALID,        TRACE,          RSVD,           KBC,    INPUT,  0x3308),\
358         PINGROUP(KB_COL4,               PQ4,            SYS,            KBC,            INVALID,        TRACE,          RSVD,           KBC,    INPUT,  0x330c),\
359         PINGROUP(KB_COL5,               PQ5,            SYS,            KBC,            INVALID,        TRACE,          RSVD,           KBC,    INPUT,  0x3310),\
360         PINGROUP(KB_COL6,               PQ6,            SYS,            KBC,            INVALID,        TRACE,          INVALID,        KBC,    INPUT,  0x3314),\
361         PINGROUP(KB_COL7,               PQ7,            SYS,            KBC,            INVALID,        TRACE,          INVALID,        KBC,    INPUT,  0x3318),\
362         PINGROUP(CLK_32K_OUT,           PA0,            SYS,            BLINK,          RSVD1,          RSVD2,          RSVD3,          BLINK,  INPUT,  0x331c),\
363         PINGROUP(SYS_CLK_REQ,           PZ5,            SYS,            SYSCLK,         RSVD1,          RSVD2,          RSVD3,          SYSCLK, INPUT,  0x3320),\
364         PINGROUP(CORE_PWR_REQ,          INVALID,        SYS,            RSVD,           RSVD,           RSVD,           RSVD,           RSVD,   INPUT,  0x3324),\
365         PINGROUP(CPU_PWR_REQ,           INVALID,        SYS,            RSVD,           RSVD,           RSVD,           RSVD,           RSVD,   INPUT,  0x3328),\
366         PINGROUP(PWR_INT_N,             INVALID,        SYS,            RSVD,           RSVD,           RSVD,           RSVD,           RSVD,   INPUT,  0x332c),\
367         PINGROUP(CLK_32K_IN,            INVALID,        SYS,            RSVD,           RSVD,           RSVD,           RSVD,           RSVD,   INPUT,  0x3330),\
368         PINGROUP(OWR,                   INVALID,        SYS,            OWR,            RSVD,           RSVD,           RSVD,           OWR,    INPUT,  0x3334),\
369         PINGROUP(DAP1_FS,               PN0,            AUDIO,          I2S0,           HDA,            GMI,            SDIO2,          I2S0,   INPUT,  0x3338),\
370         PINGROUP(DAP1_DIN,              PN1,            AUDIO,          I2S0,           HDA,            GMI,            SDIO2,          I2S0,   INPUT,  0x333c),\
371         PINGROUP(DAP1_DOUT,             PN2,            AUDIO,          I2S0,           HDA,            GMI,            SDIO2,          I2S0,   INPUT,  0x3340),\
372         PINGROUP(DAP1_SCLK,             PN3,            AUDIO,          I2S0,           HDA,            GMI,            SDIO2,          I2S0,   INPUT,  0x3344),\
373         PINGROUP(CLK1_REQ,              PEE2,           AUDIO,          DAP,            HDA,            RSVD2,          RSVD3,          DAP,    INPUT,  0x3348),\
374         PINGROUP(CLK1_OUT,              PW4,            AUDIO,          EXTPERIPH1,     RSVD1,          RSVD2,          RSVD3,          EXTPERIPH1,     INPUT,  0x334c),\
375         PINGROUP(SPDIF_IN,              PK6,            AUDIO,          SPDIF,          HDA,            INVALID,        DAPSDMMC2,      RSVD,   INPUT,  0x3350),\
376         PINGROUP(SPDIF_OUT,             PK5,            AUDIO,          SPDIF,          RSVD1,          INVALID,        DAPSDMMC2,      RSVD1,  INPUT,  0x3354),\
377         PINGROUP(DAP2_FS,               PA2,            AUDIO,          I2S1,           HDA,            RSVD2,          GMI,            I2S1,   INPUT,  0x3358),\
378         PINGROUP(DAP2_DIN,              PA4,            AUDIO,          I2S1,           HDA,            RSVD2,          GMI,            I2S1,   INPUT,  0x335c),\
379         PINGROUP(DAP2_DOUT,             PA5,            AUDIO,          I2S1,           HDA,            RSVD2,          GMI,            I2S1,   INPUT,  0x3360),\
380         PINGROUP(DAP2_SCLK,             PA3,            AUDIO,          I2S1,           HDA,            RSVD2,          GMI,            I2S1,   INPUT,  0x3364),\
381         PINGROUP(SPI2_MOSI,             PX0,            AUDIO,          SPI6,           SPI2,           INVALID,        GMI,            SPI6,   INPUT,  0x3368),\
382         PINGROUP(SPI2_MISO,             PX1,            AUDIO,          SPI6,           SPI2,           INVALID,        GMI,            SPI6,   INPUT,  0x336c),\
383         PINGROUP(SPI2_CS0_N,            PX3,            AUDIO,          SPI6,           SPI2,           INVALID,        GMI,            SPI6,   INPUT,  0x3370),\
384         PINGROUP(SPI2_SCK,              PX2,            AUDIO,          SPI6,           SPI2,           INVALID,        GMI,            SPI6,   INPUT,  0x3374),\
385         PINGROUP(SPI1_MOSI,             PX4,            AUDIO,          SPI2,           SPI1,           INVALID,        GMI,            GMI,    INPUT,  0x3378),\
386         PINGROUP(SPI1_SCK,              PX5,            AUDIO,          SPI2,           SPI1,           INVALID,        GMI,            GMI,    INPUT,  0x337c),\
387         PINGROUP(SPI1_CS0_N,            PX6,            AUDIO,          SPI2,           SPI1,           INVALID,        GMI,            GMI,    INPUT,  0x3380),\
388         PINGROUP(SPI1_MISO,             PX7,            AUDIO,          INVALID,        SPI1,           INVALID,        RSVD3,          RSVD,   INPUT,  0x3384),\
389         PINGROUP(SPI2_CS1_N,            PW2,            AUDIO,          INVALID,        SPI2,           INVALID,        INVALID,        RSVD,   INPUT,  0x3388),\
390         PINGROUP(SPI2_CS2_N,            PW3,            AUDIO,          INVALID,        SPI2,           INVALID,        INVALID,        RSVD,   INPUT,  0x338c),\
391         PINGROUP(SDMMC3_CLK,            PA6,            SDMMC3,         UARTA,          PWM2,           SDIO3,          SPI3,           SDMMC3, INPUT,  0x3390),\
392         PINGROUP(SDMMC3_CMD,            PA7,            SDMMC3,         UARTA,          PWM3,           SDIO3,          INVALID,        SDMMC3, INPUT,  0x3394),\
393         PINGROUP(SDMMC3_DAT0,           PB7,            SDMMC3,         RSVD,           RSVD1,          SDIO3,          SPI3,           SDMMC3, INPUT,  0x3398),\
394         PINGROUP(SDMMC3_DAT1,           PB6,            SDMMC3,         RSVD,           RSVD1,          SDIO3,          SPI3,           SDMMC3, INPUT,  0x339c),\
395         PINGROUP(SDMMC3_DAT2,           PB5,            SDMMC3,         RSVD,           PWM1,           SDIO3,          SPI3,           SDMMC3, INPUT,  0x33a0),\
396         PINGROUP(SDMMC3_DAT3,           PB4,            SDMMC3,         RSVD,           PWM0,           SDIO3,          INVALID,        SDMMC3, INPUT,  0x33a4),\
397         PINGROUP(SDMMC3_DAT4,           PD1,            SDMMC3,         PWM1,           INVALID,        SDIO3,          INVALID,        SDMMC3, INPUT,  0x33a8),\
398         PINGROUP(SDMMC3_DAT5,           PD0,            SDMMC3,         PWM0,           INVALID,        SDIO3,          INVALID,        SDMMC3, INPUT,  0x33ac),\
399         PINGROUP(SDMMC3_DAT6,           PD3,            SDMMC3,         SPDIF,          INVALID,        SDIO3,          INVALID,        SDMMC3, INPUT,  0x33b0),\
400         PINGROUP(SDMMC3_DAT7,           PD4,            SDMMC3,         SPDIF,          RSVD,           SDIO3,          INVALID,        SDMMC3, INPUT,  0x33b4),\
401         PINGROUP(PEX_L0_PRSNT_N,        PDD0,           PEXCTL,         PCIE,           HDA,            RSVD2,          RSVD3,          PCIE,   INPUT,  0x33b8),\
402         PINGROUP(PEX_L0_RST_N,          PDD1,           PEXCTL,         PCIE,           HDA,            RSVD2,          RSVD3,          PCIE,   INPUT,  0x33bc),\
403         PINGROUP(PEX_L0_CLKREQ_N,       PDD2,           PEXCTL,         PCIE,           HDA,            RSVD2,          RSVD3,          PCIE,   INPUT,  0x33c0),\
404         PINGROUP(PEX_WAKE_N,            PDD3,           PEXCTL,         PCIE,           HDA,            RSVD2,          RSVD3,          PCIE,   INPUT,  0x33c4),\
405         PINGROUP(PEX_L1_PRSNT_N,        PDD4,           PEXCTL,         PCIE,           HDA,            RSVD2,          RSVD3,          PCIE,   INPUT,  0x33c8),\
406         PINGROUP(PEX_L1_RST_N,          PDD5,           PEXCTL,         PCIE,           HDA,            RSVD2,          RSVD3,          PCIE,   INPUT,  0x33cc),\
407         PINGROUP(PEX_L1_CLKREQ_N,       PDD6,           PEXCTL,         PCIE,           HDA,            RSVD2,          RSVD3,          PCIE,   INPUT,  0x33d0),\
408         PINGROUP(PEX_L2_PRSNT_N,        PDD7,           PEXCTL,         PCIE,           HDA,            RSVD2,          RSVD3,          PCIE,   INPUT,  0x33d4),\
409         PINGROUP(PEX_L2_RST_N,          PCC6,           PEXCTL,         PCIE,           HDA,            RSVD2,          RSVD3,          PCIE,   INPUT,  0x33d8),\
410         PINGROUP(PEX_L2_CLKREQ_N,       PCC7,           PEXCTL,         PCIE,           HDA,            RSVD2,          RSVD3,          PCIE,   INPUT,  0x33dc),\
411         PINGROUP(HDMI_CEC,              PEE3,           SYS,            CEC,            RSVD1,          RSVD2,          RSVD3,          RSVD,   INPUT,  0x33e0),\
412         /* END OF LIST */
413
414 static const struct tegra_pingroup_desc tegra_soc_pingroups[TEGRA_MAX_PINGROUP] = {
415         PINGROUPS
416 };
417
418 #undef PINGROUP
419 #undef TEGRA_GPIO_INVALID
420 #define TEGRA_GPIO_INVALID      TEGRA_MAX_GPIO
421
422 #define PINGROUP(pg_name, gpio_nr, vdd, f0, f1, f2, f3, fs, iod, reg)   \
423         [TEGRA_GPIO_##gpio_nr] =  TEGRA_PINGROUP_ ##pg_name\
424
425 static const int gpio_to_pingroup[TEGRA_MAX_GPIO + 1] = {
426         PINGROUPS
427 };
428
429 #define SET_DRIVE(_name, _hsm, _schmitt, _drive, _pulldn_drive, _pullup_drive, _pulldn_slew, _pullup_slew) \
430         {                                                       \
431                 .pingroup = TEGRA_DRIVE_PINGROUP_##_name,       \
432                 .hsm = TEGRA_HSM_##_hsm,                        \
433                 .schmitt = TEGRA_SCHMITT_##_schmitt,            \
434                 .drive = TEGRA_DRIVE_##_drive,                  \
435                 .pull_down = TEGRA_PULL_##_pulldn_drive,        \
436                 .pull_up = TEGRA_PULL_##_pullup_drive,          \
437                 .slew_rising = TEGRA_SLEW_##_pulldn_slew,       \
438                 .slew_falling = TEGRA_SLEW_##_pullup_slew,      \
439         }
440
441 static __initdata struct tegra_drive_pingroup_config t30_def_drive_pinmux[] = {
442         SET_DRIVE(DAP2, DISABLE, ENABLE, DIV_1, 31, 31, FASTEST, FASTEST),
443         SET_DRIVE(DAP1, DISABLE, ENABLE, DIV_1, 31, 31, FASTEST, FASTEST),
444 };
445
446 #ifdef CONFIG_PM_SLEEP
447
448 static u32 pinmux_reg[TEGRA_MAX_PINGROUP + ARRAY_SIZE(tegra_soc_drive_pingroups)];
449
450 static int tegra30_pinmux_suspend(void)
451 {
452         unsigned int i;
453         u32 *ctx = pinmux_reg;
454
455         for (i = 0; i < TEGRA_MAX_PINGROUP; i++) {
456                 *ctx++ = pg_readl(tegra_soc_pingroups[i].mux_bank,
457                                 tegra_soc_pingroups[i].mux_reg);
458         }
459
460         for (i = 0; i < ARRAY_SIZE(tegra_soc_drive_pingroups); i++) {
461                 *ctx++ = pg_readl(tegra_soc_drive_pingroups[i].reg_bank,
462                                 tegra_soc_drive_pingroups[i].reg);
463         }
464
465         return 0;
466 }
467
468 static void tegra30_pinmux_resume(void)
469 {
470         unsigned int i;
471         u32 *ctx = pinmux_reg;
472
473         for (i = 0; i < TEGRA_MAX_PINGROUP; i++) {
474                 pg_writel(*ctx++, tegra_soc_pingroups[i].mux_bank,
475                         tegra_soc_pingroups[i].mux_reg);
476         }
477
478         for (i = 0; i < ARRAY_SIZE(tegra_soc_drive_pingroups); i++) {
479                 pg_writel(*ctx++, tegra_soc_drive_pingroups[i].reg_bank,
480                         tegra_soc_drive_pingroups[i].reg);
481         }
482 }
483
484 static struct syscore_ops tegra30_pinmux_syscore_ops = {
485         .suspend = tegra30_pinmux_suspend,
486         .resume = tegra30_pinmux_resume,
487 };
488 #endif
489
490 void tegra30_pinmux_init(const struct tegra_pingroup_desc **pg,
491                 int *pg_max, const struct tegra_drive_pingroup_desc **pgdrive,
492                 int *pgdrive_max, const int **gpiomap, int *gpiomap_max)
493 {
494         *pg = tegra_soc_pingroups;
495         *pg_max = TEGRA_MAX_PINGROUP;
496         *pgdrive = tegra_soc_drive_pingroups;
497         *pgdrive_max = TEGRA_MAX_DRIVE_PINGROUP;
498         *gpiomap = gpio_to_pingroup;
499         *gpiomap_max = TEGRA_MAX_GPIO;
500
501 #ifdef CONFIG_PM_SLEEP
502         register_syscore_ops(&tegra30_pinmux_syscore_ops);
503 #endif
504 }
505
506 void tegra30_default_pinmux(void)
507 {
508         tegra_drive_pinmux_config_table(t30_def_drive_pinmux,
509                                         ARRAY_SIZE(t30_def_drive_pinmux));
510 }