1 /*
2  * Copyright (C) 2016 Socionext Inc.
3  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  */
15 
16 #include <linux/kernel.h>
17 #include <linux/module.h>
18 #include <linux/pinctrl/pinctrl.h>
19 #include <linux/platform_device.h>
20 
21 #include "pinctrl-uniphier.h"
22 
23 static const struct pinctrl_pin_desc uniphier_ld11_pins[] = {
24 	UNIPHIER_PINCTRL_PIN(0, "XECS1", 0,
25 			     0, UNIPHIER_PIN_DRV_1BIT,
26 			     0, UNIPHIER_PIN_PULL_UP),
27 	UNIPHIER_PINCTRL_PIN(1, "ERXW", UNIPHIER_PIN_IECTRL_NONE,
28 			     1, UNIPHIER_PIN_DRV_1BIT,
29 			     1, UNIPHIER_PIN_PULL_UP),
30 	UNIPHIER_PINCTRL_PIN(2, "XERWE1", UNIPHIER_PIN_IECTRL_NONE,
31 			     2, UNIPHIER_PIN_DRV_1BIT,
32 			     2, UNIPHIER_PIN_PULL_UP),
33 	UNIPHIER_PINCTRL_PIN(3, "XNFWP", 3,
34 			     3, UNIPHIER_PIN_DRV_1BIT,
35 			     3, UNIPHIER_PIN_PULL_DOWN),
36 	UNIPHIER_PINCTRL_PIN(4, "XNFCE0", 4,
37 			     4, UNIPHIER_PIN_DRV_1BIT,
38 			     4, UNIPHIER_PIN_PULL_UP),
39 	UNIPHIER_PINCTRL_PIN(5, "NFRYBY0", 5,
40 			     5, UNIPHIER_PIN_DRV_1BIT,
41 			     5, UNIPHIER_PIN_PULL_UP),
42 	UNIPHIER_PINCTRL_PIN(6, "XNFRE", UNIPHIER_PIN_IECTRL_NONE,
43 			     6, UNIPHIER_PIN_DRV_1BIT,
44 			     6, UNIPHIER_PIN_PULL_UP),
45 	UNIPHIER_PINCTRL_PIN(7, "XNFWE", UNIPHIER_PIN_IECTRL_NONE,
46 			     7, UNIPHIER_PIN_DRV_1BIT,
47 			     7, UNIPHIER_PIN_PULL_UP),
48 	UNIPHIER_PINCTRL_PIN(8, "NFALE", UNIPHIER_PIN_IECTRL_NONE,
49 			     8, UNIPHIER_PIN_DRV_1BIT,
50 			     8, UNIPHIER_PIN_PULL_UP),
51 	UNIPHIER_PINCTRL_PIN(9, "NFCLE", UNIPHIER_PIN_IECTRL_NONE,
52 			     9, UNIPHIER_PIN_DRV_1BIT,
53 			     9, UNIPHIER_PIN_PULL_UP),
54 	UNIPHIER_PINCTRL_PIN(10, "NFD0", 10,
55 			     10, UNIPHIER_PIN_DRV_1BIT,
56 			     10, UNIPHIER_PIN_PULL_UP),
57 	UNIPHIER_PINCTRL_PIN(11, "NFD1", 11,
58 			     11, UNIPHIER_PIN_DRV_1BIT,
59 			     11, UNIPHIER_PIN_PULL_UP),
60 	UNIPHIER_PINCTRL_PIN(12, "NFD2", 12,
61 			     12, UNIPHIER_PIN_DRV_1BIT,
62 			     12, UNIPHIER_PIN_PULL_UP),
63 	UNIPHIER_PINCTRL_PIN(13, "NFD3", 13,
64 			     13, UNIPHIER_PIN_DRV_1BIT,
65 			     13, UNIPHIER_PIN_PULL_UP),
66 	UNIPHIER_PINCTRL_PIN(14, "NFD4", 14,
67 			     14, UNIPHIER_PIN_DRV_1BIT,
68 			     14, UNIPHIER_PIN_PULL_UP),
69 	UNIPHIER_PINCTRL_PIN(15, "NFD5", 15,
70 			     15, UNIPHIER_PIN_DRV_1BIT,
71 			     15, UNIPHIER_PIN_PULL_UP),
72 	UNIPHIER_PINCTRL_PIN(16, "NFD6", 16,
73 			     16, UNIPHIER_PIN_DRV_1BIT,
74 			     16, UNIPHIER_PIN_PULL_UP),
75 	UNIPHIER_PINCTRL_PIN(17, "NFD7", 17,
76 			     17, UNIPHIER_PIN_DRV_1BIT,
77 			     17, UNIPHIER_PIN_PULL_UP),
78 	UNIPHIER_PINCTRL_PIN(18, "XERST", 18,
79 			     0, UNIPHIER_PIN_DRV_2BIT,
80 			     18, UNIPHIER_PIN_PULL_UP),
81 	UNIPHIER_PINCTRL_PIN(19, "MMCCLK", 19,
82 			     1, UNIPHIER_PIN_DRV_2BIT,
83 			     19, UNIPHIER_PIN_PULL_UP),
84 	UNIPHIER_PINCTRL_PIN(20, "MMCCMD", 20,
85 			     2, UNIPHIER_PIN_DRV_2BIT,
86 			     20, UNIPHIER_PIN_PULL_UP),
87 	UNIPHIER_PINCTRL_PIN(21, "MMCDS", 21,
88 			     3, UNIPHIER_PIN_DRV_2BIT,
89 			     21, UNIPHIER_PIN_PULL_UP),
90 	UNIPHIER_PINCTRL_PIN(22, "MMCDAT0", 22,
91 			     4, UNIPHIER_PIN_DRV_2BIT,
92 			     22, UNIPHIER_PIN_PULL_UP),
93 	UNIPHIER_PINCTRL_PIN(23, "MMCDAT1", 23,
94 			     5, UNIPHIER_PIN_DRV_2BIT,
95 			     23, UNIPHIER_PIN_PULL_UP),
96 	UNIPHIER_PINCTRL_PIN(24, "MMCDAT2", 24,
97 			     6, UNIPHIER_PIN_DRV_2BIT,
98 			     24, UNIPHIER_PIN_PULL_UP),
99 	UNIPHIER_PINCTRL_PIN(25, "MMCDAT3", 25,
100 			     7, UNIPHIER_PIN_DRV_2BIT,
101 			     25, UNIPHIER_PIN_PULL_UP),
102 	UNIPHIER_PINCTRL_PIN(26, "MMCDAT4", 26,
103 			     8, UNIPHIER_PIN_DRV_2BIT,
104 			     26, UNIPHIER_PIN_PULL_UP),
105 	UNIPHIER_PINCTRL_PIN(27, "MMCDAT5", 27,
106 			     9, UNIPHIER_PIN_DRV_2BIT,
107 			     27, UNIPHIER_PIN_PULL_UP),
108 	UNIPHIER_PINCTRL_PIN(28, "MMCDAT6", 28,
109 			     10, UNIPHIER_PIN_DRV_2BIT,
110 			     28, UNIPHIER_PIN_PULL_UP),
111 	UNIPHIER_PINCTRL_PIN(29, "MMCDAT7", 29,
112 			     11, UNIPHIER_PIN_DRV_2BIT,
113 			     29, UNIPHIER_PIN_PULL_UP),
114 	UNIPHIER_PINCTRL_PIN(46, "USB0VBUS", 46,
115 			     46, UNIPHIER_PIN_DRV_1BIT,
116 			     46, UNIPHIER_PIN_PULL_DOWN),
117 	UNIPHIER_PINCTRL_PIN(47, "USB0OD", UNIPHIER_PIN_IECTRL_NONE,
118 			     47, UNIPHIER_PIN_DRV_1BIT,
119 			     47, UNIPHIER_PIN_PULL_UP),
120 	UNIPHIER_PINCTRL_PIN(48, "USB1VBUS", 48,
121 			     48, UNIPHIER_PIN_DRV_1BIT,
122 			     48, UNIPHIER_PIN_PULL_DOWN),
123 	UNIPHIER_PINCTRL_PIN(49, "USB1OD", 49,
124 			     49, UNIPHIER_PIN_DRV_1BIT,
125 			     49, UNIPHIER_PIN_PULL_UP),
126 	UNIPHIER_PINCTRL_PIN(50, "USB2VBUS", 50,
127 			     50, UNIPHIER_PIN_DRV_1BIT,
128 			     50, UNIPHIER_PIN_PULL_DOWN),
129 	UNIPHIER_PINCTRL_PIN(51, "USB2OD", 51,
130 			     51, UNIPHIER_PIN_DRV_1BIT,
131 			     51, UNIPHIER_PIN_PULL_UP),
132 	UNIPHIER_PINCTRL_PIN(54, "TXD0", 54,
133 			     54, UNIPHIER_PIN_DRV_1BIT,
134 			     54, UNIPHIER_PIN_PULL_UP),
135 	UNIPHIER_PINCTRL_PIN(55, "RXD0", 55,
136 			     55, UNIPHIER_PIN_DRV_1BIT,
137 			     55, UNIPHIER_PIN_PULL_UP),
138 	UNIPHIER_PINCTRL_PIN(56, "SPISYNC0", 56,
139 			     56, UNIPHIER_PIN_DRV_1BIT,
140 			     56, UNIPHIER_PIN_PULL_DOWN),
141 	UNIPHIER_PINCTRL_PIN(57, "SPISCLK0", 57,
142 			     57, UNIPHIER_PIN_DRV_1BIT,
143 			     57, UNIPHIER_PIN_PULL_DOWN),
144 	UNIPHIER_PINCTRL_PIN(58, "SPITXD0", 58,
145 			     58, UNIPHIER_PIN_DRV_1BIT,
146 			     58, UNIPHIER_PIN_PULL_DOWN),
147 	UNIPHIER_PINCTRL_PIN(59, "SPIRXD0", 59,
148 			     59, UNIPHIER_PIN_DRV_1BIT,
149 			     59, UNIPHIER_PIN_PULL_DOWN),
150 	UNIPHIER_PINCTRL_PIN(60, "AGCI", 60,
151 			     60, UNIPHIER_PIN_DRV_1BIT,
152 			     60, UNIPHIER_PIN_PULL_DOWN),
153 	UNIPHIER_PINCTRL_PIN(61, "DMDSDA0", 61,
154 			     -1, UNIPHIER_PIN_DRV_FIXED4,
155 			     -1, UNIPHIER_PIN_PULL_NONE),
156 	UNIPHIER_PINCTRL_PIN(62, "DMDSCL0", 62,
157 			     -1, UNIPHIER_PIN_DRV_FIXED4,
158 			     -1, UNIPHIER_PIN_PULL_NONE),
159 	UNIPHIER_PINCTRL_PIN(63, "SDA0", 63,
160 			     -1, UNIPHIER_PIN_DRV_FIXED4,
161 			     -1, UNIPHIER_PIN_PULL_NONE),
162 	UNIPHIER_PINCTRL_PIN(64, "SCL0", 64,
163 			     -1, UNIPHIER_PIN_DRV_FIXED4,
164 			     -1, UNIPHIER_PIN_PULL_NONE),
165 	UNIPHIER_PINCTRL_PIN(65, "SDA1", 65,
166 			     -1, UNIPHIER_PIN_DRV_FIXED4,
167 			     -1, UNIPHIER_PIN_PULL_NONE),
168 	UNIPHIER_PINCTRL_PIN(66, "SCL1", 66,
169 			     -1, UNIPHIER_PIN_DRV_FIXED4,
170 			     -1, UNIPHIER_PIN_PULL_NONE),
171 	UNIPHIER_PINCTRL_PIN(67, "HIN", 67,
172 			     -1, UNIPHIER_PIN_DRV_FIXED5,
173 			     -1, UNIPHIER_PIN_PULL_NONE),
174 	UNIPHIER_PINCTRL_PIN(68, "VIN", 68,
175 			     -1, UNIPHIER_PIN_DRV_FIXED5,
176 			     -1, UNIPHIER_PIN_PULL_NONE),
177 	UNIPHIER_PINCTRL_PIN(69, "PCA00", 69,
178 			     69, UNIPHIER_PIN_DRV_1BIT,
179 			     69, UNIPHIER_PIN_PULL_DOWN),
180 	UNIPHIER_PINCTRL_PIN(70, "PCA01", 70,
181 			     70, UNIPHIER_PIN_DRV_1BIT,
182 			     70, UNIPHIER_PIN_PULL_DOWN),
183 	UNIPHIER_PINCTRL_PIN(71, "PCA02", 71,
184 			     71, UNIPHIER_PIN_DRV_1BIT,
185 			     71, UNIPHIER_PIN_PULL_DOWN),
186 	UNIPHIER_PINCTRL_PIN(72, "PCA03", 72,
187 			     72, UNIPHIER_PIN_DRV_1BIT,
188 			     72, UNIPHIER_PIN_PULL_DOWN),
189 	UNIPHIER_PINCTRL_PIN(73, "PCA04", 73,
190 			     73, UNIPHIER_PIN_DRV_1BIT,
191 			     73, UNIPHIER_PIN_PULL_DOWN),
192 	UNIPHIER_PINCTRL_PIN(74, "PCA05", 74,
193 			     74, UNIPHIER_PIN_DRV_1BIT,
194 			     74, UNIPHIER_PIN_PULL_DOWN),
195 	UNIPHIER_PINCTRL_PIN(75, "PCA06", 75,
196 			     75, UNIPHIER_PIN_DRV_1BIT,
197 			     75, UNIPHIER_PIN_PULL_DOWN),
198 	UNIPHIER_PINCTRL_PIN(76, "PCA07", 76,
199 			     76, UNIPHIER_PIN_DRV_1BIT,
200 			     76, UNIPHIER_PIN_PULL_DOWN),
201 	UNIPHIER_PINCTRL_PIN(77, "PCA08", 77,
202 			     77, UNIPHIER_PIN_DRV_1BIT,
203 			     77, UNIPHIER_PIN_PULL_DOWN),
204 	UNIPHIER_PINCTRL_PIN(78, "PCA09", 78,
205 			     78, UNIPHIER_PIN_DRV_1BIT,
206 			     78, UNIPHIER_PIN_PULL_DOWN),
207 	UNIPHIER_PINCTRL_PIN(79, "PCA10", 79,
208 			     79, UNIPHIER_PIN_DRV_1BIT,
209 			     79, UNIPHIER_PIN_PULL_DOWN),
210 	UNIPHIER_PINCTRL_PIN(80, "PCA11", 80,
211 			     80, UNIPHIER_PIN_DRV_1BIT,
212 			     80, UNIPHIER_PIN_PULL_DOWN),
213 	UNIPHIER_PINCTRL_PIN(81, "PCA12", 81,
214 			     81, UNIPHIER_PIN_DRV_1BIT,
215 			     81, UNIPHIER_PIN_PULL_DOWN),
216 	UNIPHIER_PINCTRL_PIN(82, "PCA13", 82,
217 			     82, UNIPHIER_PIN_DRV_1BIT,
218 			     82, UNIPHIER_PIN_PULL_DOWN),
219 	UNIPHIER_PINCTRL_PIN(83, "PCA14", 83,
220 			     83, UNIPHIER_PIN_DRV_1BIT,
221 			     83, UNIPHIER_PIN_PULL_DOWN),
222 	UNIPHIER_PINCTRL_PIN(84, "PC0READY", 84,
223 			     84, UNIPHIER_PIN_DRV_1BIT,
224 			     84, UNIPHIER_PIN_PULL_DOWN),
225 	UNIPHIER_PINCTRL_PIN(85, "PC0CD1", 85,
226 			     85, UNIPHIER_PIN_DRV_1BIT,
227 			     85, UNIPHIER_PIN_PULL_DOWN),
228 	UNIPHIER_PINCTRL_PIN(86, "PC0CD2", 86,
229 			     86, UNIPHIER_PIN_DRV_1BIT,
230 			     86, UNIPHIER_PIN_PULL_DOWN),
231 	UNIPHIER_PINCTRL_PIN(87, "PC0WAIT", 87,
232 			     87, UNIPHIER_PIN_DRV_1BIT,
233 			     87, UNIPHIER_PIN_PULL_DOWN),
234 	UNIPHIER_PINCTRL_PIN(88, "PC0RESET", 88,
235 			     88, UNIPHIER_PIN_DRV_1BIT,
236 			     88, UNIPHIER_PIN_PULL_DOWN),
237 	UNIPHIER_PINCTRL_PIN(89, "PC0CE1", 89,
238 			     89, UNIPHIER_PIN_DRV_1BIT,
239 			     89, UNIPHIER_PIN_PULL_DOWN),
240 	UNIPHIER_PINCTRL_PIN(90, "PC0WE", 90,
241 			     90, UNIPHIER_PIN_DRV_1BIT,
242 			     90, UNIPHIER_PIN_PULL_DOWN),
243 	UNIPHIER_PINCTRL_PIN(91, "PC0OE", 91,
244 			     91, UNIPHIER_PIN_DRV_1BIT,
245 			     91, UNIPHIER_PIN_PULL_DOWN),
246 	UNIPHIER_PINCTRL_PIN(92, "PC0IOWR", 92,
247 			     92, UNIPHIER_PIN_DRV_1BIT,
248 			     92, UNIPHIER_PIN_PULL_DOWN),
249 	UNIPHIER_PINCTRL_PIN(93, "PC0IORD", 93,
250 			     93, UNIPHIER_PIN_DRV_1BIT,
251 			     93, UNIPHIER_PIN_PULL_DOWN),
252 	UNIPHIER_PINCTRL_PIN(94, "PCD00", 94,
253 			     94, UNIPHIER_PIN_DRV_1BIT,
254 			     94, UNIPHIER_PIN_PULL_DOWN),
255 	UNIPHIER_PINCTRL_PIN(95, "PCD01", 95,
256 			     95, UNIPHIER_PIN_DRV_1BIT,
257 			     95, UNIPHIER_PIN_PULL_DOWN),
258 	UNIPHIER_PINCTRL_PIN(96, "PCD02", 96,
259 			     96, UNIPHIER_PIN_DRV_1BIT,
260 			     96, UNIPHIER_PIN_PULL_DOWN),
261 	UNIPHIER_PINCTRL_PIN(97, "PCD03", 97,
262 			     97, UNIPHIER_PIN_DRV_1BIT,
263 			     97, UNIPHIER_PIN_PULL_DOWN),
264 	UNIPHIER_PINCTRL_PIN(98, "PCD04", 98,
265 			     98, UNIPHIER_PIN_DRV_1BIT,
266 			     98, UNIPHIER_PIN_PULL_DOWN),
267 	UNIPHIER_PINCTRL_PIN(99, "PCD05", 99,
268 			     99, UNIPHIER_PIN_DRV_1BIT,
269 			     99, UNIPHIER_PIN_PULL_DOWN),
270 	UNIPHIER_PINCTRL_PIN(100, "PCD06", 100,
271 			     100, UNIPHIER_PIN_DRV_1BIT,
272 			     100, UNIPHIER_PIN_PULL_DOWN),
273 	UNIPHIER_PINCTRL_PIN(101, "PCD07", 101,
274 			     101, UNIPHIER_PIN_DRV_1BIT,
275 			     101, UNIPHIER_PIN_PULL_DOWN),
276 	UNIPHIER_PINCTRL_PIN(102, "HS0BCLKIN", 102,
277 			     102, UNIPHIER_PIN_DRV_1BIT,
278 			     102, UNIPHIER_PIN_PULL_DOWN),
279 	UNIPHIER_PINCTRL_PIN(103, "HS0SYNCIN", 103,
280 			     103, UNIPHIER_PIN_DRV_1BIT,
281 			     103, UNIPHIER_PIN_PULL_DOWN),
282 	UNIPHIER_PINCTRL_PIN(104, "HS0VALIN", 104,
283 			     104, UNIPHIER_PIN_DRV_1BIT,
284 			     104, UNIPHIER_PIN_PULL_DOWN),
285 	UNIPHIER_PINCTRL_PIN(105, "HS0DIN0", 105,
286 			     105, UNIPHIER_PIN_DRV_1BIT,
287 			     105, UNIPHIER_PIN_PULL_DOWN),
288 	UNIPHIER_PINCTRL_PIN(106, "HS0DIN1", 106,
289 			     106, UNIPHIER_PIN_DRV_1BIT,
290 			     106, UNIPHIER_PIN_PULL_DOWN),
291 	UNIPHIER_PINCTRL_PIN(107, "HS0DIN2", 107,
292 			     107, UNIPHIER_PIN_DRV_1BIT,
293 			     107, UNIPHIER_PIN_PULL_DOWN),
294 	UNIPHIER_PINCTRL_PIN(108, "HS0DIN3", 108,
295 			     108, UNIPHIER_PIN_DRV_1BIT,
296 			     108, UNIPHIER_PIN_PULL_DOWN),
297 	UNIPHIER_PINCTRL_PIN(109, "HS0DIN4", 109,
298 			     109, UNIPHIER_PIN_DRV_1BIT,
299 			     109, UNIPHIER_PIN_PULL_DOWN),
300 	UNIPHIER_PINCTRL_PIN(110, "HS0DIN5", 110,
301 			     110, UNIPHIER_PIN_DRV_1BIT,
302 			     110, UNIPHIER_PIN_PULL_DOWN),
303 	UNIPHIER_PINCTRL_PIN(111, "HS0DIN6", 111,
304 			     111, UNIPHIER_PIN_DRV_1BIT,
305 			     111, UNIPHIER_PIN_PULL_DOWN),
306 	UNIPHIER_PINCTRL_PIN(112, "HS0DIN7", 112,
307 			     112, UNIPHIER_PIN_DRV_1BIT,
308 			     112, UNIPHIER_PIN_PULL_DOWN),
309 	UNIPHIER_PINCTRL_PIN(113, "HS0BCLKOUT", 113,
310 			     113, UNIPHIER_PIN_DRV_1BIT,
311 			     113, UNIPHIER_PIN_PULL_DOWN),
312 	UNIPHIER_PINCTRL_PIN(114, "HS0SYNCOUT", 114,
313 			     114, UNIPHIER_PIN_DRV_1BIT,
314 			     114, UNIPHIER_PIN_PULL_DOWN),
315 	UNIPHIER_PINCTRL_PIN(115, "HS0VALOUT", 115,
316 			     115, UNIPHIER_PIN_DRV_1BIT,
317 			     115, UNIPHIER_PIN_PULL_DOWN),
318 	UNIPHIER_PINCTRL_PIN(116, "HS0DOUT0", 116,
319 			     116, UNIPHIER_PIN_DRV_1BIT,
320 			     116, UNIPHIER_PIN_PULL_DOWN),
321 	UNIPHIER_PINCTRL_PIN(117, "HS0DOUT1", 117,
322 			     117, UNIPHIER_PIN_DRV_1BIT,
323 			     117, UNIPHIER_PIN_PULL_DOWN),
324 	UNIPHIER_PINCTRL_PIN(118, "HS0DOUT2", 118,
325 			     118, UNIPHIER_PIN_DRV_1BIT,
326 			     118, UNIPHIER_PIN_PULL_DOWN),
327 	UNIPHIER_PINCTRL_PIN(119, "HS0DOUT3", 119,
328 			     119, UNIPHIER_PIN_DRV_1BIT,
329 			     119, UNIPHIER_PIN_PULL_DOWN),
330 	UNIPHIER_PINCTRL_PIN(120, "HS0DOUT4", 120,
331 			     120, UNIPHIER_PIN_DRV_1BIT,
332 			     120, UNIPHIER_PIN_PULL_DOWN),
333 	UNIPHIER_PINCTRL_PIN(121, "HS0DOUT5", 121,
334 			     121, UNIPHIER_PIN_DRV_1BIT,
335 			     121, UNIPHIER_PIN_PULL_DOWN),
336 	UNIPHIER_PINCTRL_PIN(122, "HS0DOUT6", 122,
337 			     122, UNIPHIER_PIN_DRV_1BIT,
338 			     122, UNIPHIER_PIN_PULL_DOWN),
339 	UNIPHIER_PINCTRL_PIN(123, "HS0DOUT7", 123,
340 			     123, UNIPHIER_PIN_DRV_1BIT,
341 			     123, UNIPHIER_PIN_PULL_DOWN),
342 	UNIPHIER_PINCTRL_PIN(124, "HS1BCLKIN", 124,
343 			     124, UNIPHIER_PIN_DRV_1BIT,
344 			     124, UNIPHIER_PIN_PULL_DOWN),
345 	UNIPHIER_PINCTRL_PIN(125, "HS1SYNCIN", 125,
346 			     125, UNIPHIER_PIN_DRV_1BIT,
347 			     125, UNIPHIER_PIN_PULL_DOWN),
348 	UNIPHIER_PINCTRL_PIN(126, "HS1VALIN", 126,
349 			     126, UNIPHIER_PIN_DRV_1BIT,
350 			     126, UNIPHIER_PIN_PULL_DOWN),
351 	UNIPHIER_PINCTRL_PIN(127, "HS1DIN0", 127,
352 			     127, UNIPHIER_PIN_DRV_1BIT,
353 			     127, UNIPHIER_PIN_PULL_DOWN),
354 	UNIPHIER_PINCTRL_PIN(128, "HS1DIN1", 128,
355 			     128, UNIPHIER_PIN_DRV_1BIT,
356 			     128, UNIPHIER_PIN_PULL_DOWN),
357 	UNIPHIER_PINCTRL_PIN(129, "HS1DIN2", 129,
358 			     129, UNIPHIER_PIN_DRV_1BIT,
359 			     129, UNIPHIER_PIN_PULL_DOWN),
360 	UNIPHIER_PINCTRL_PIN(130, "HS1DIN3", 130,
361 			     130, UNIPHIER_PIN_DRV_1BIT,
362 			     130, UNIPHIER_PIN_PULL_DOWN),
363 	UNIPHIER_PINCTRL_PIN(131, "HS1DIN4", 131,
364 			     131, UNIPHIER_PIN_DRV_1BIT,
365 			     131, UNIPHIER_PIN_PULL_DOWN),
366 	UNIPHIER_PINCTRL_PIN(132, "HS1DIN5", 132,
367 			     132, UNIPHIER_PIN_DRV_1BIT,
368 			     132, UNIPHIER_PIN_PULL_DOWN),
369 	UNIPHIER_PINCTRL_PIN(133, "HS1DIN6", 133,
370 			     133, UNIPHIER_PIN_DRV_1BIT,
371 			     133, UNIPHIER_PIN_PULL_DOWN),
372 	UNIPHIER_PINCTRL_PIN(134, "HS1DIN7", 134,
373 			     134, UNIPHIER_PIN_DRV_1BIT,
374 			     134, UNIPHIER_PIN_PULL_DOWN),
375 	UNIPHIER_PINCTRL_PIN(135, "AO1IEC", 135,
376 			     135, UNIPHIER_PIN_DRV_1BIT,
377 			     135, UNIPHIER_PIN_PULL_DOWN),
378 	UNIPHIER_PINCTRL_PIN(136, "AO1ARC", 136,
379 			     136, UNIPHIER_PIN_DRV_1BIT,
380 			     136, UNIPHIER_PIN_PULL_DOWN),
381 	UNIPHIER_PINCTRL_PIN(137, "AO1DACCK", 137,
382 			     137, UNIPHIER_PIN_DRV_1BIT,
383 			     137, UNIPHIER_PIN_PULL_DOWN),
384 	UNIPHIER_PINCTRL_PIN(138, "AO1BCK", 138,
385 			     138, UNIPHIER_PIN_DRV_1BIT,
386 			     138, UNIPHIER_PIN_PULL_DOWN),
387 	UNIPHIER_PINCTRL_PIN(139, "AO1LRCK", 139,
388 			     139, UNIPHIER_PIN_DRV_1BIT,
389 			     139, UNIPHIER_PIN_PULL_DOWN),
390 	UNIPHIER_PINCTRL_PIN(140, "AO1D0", 140,
391 			     140, UNIPHIER_PIN_DRV_1BIT,
392 			     140, UNIPHIER_PIN_PULL_DOWN),
393 	UNIPHIER_PINCTRL_PIN(141, "TCON0", 141,
394 			     141, UNIPHIER_PIN_DRV_1BIT,
395 			     141, UNIPHIER_PIN_PULL_DOWN),
396 	UNIPHIER_PINCTRL_PIN(142, "TCON1", 142,
397 			     142, UNIPHIER_PIN_DRV_1BIT,
398 			     142, UNIPHIER_PIN_PULL_DOWN),
399 	UNIPHIER_PINCTRL_PIN(143, "TCON2", 143,
400 			     143, UNIPHIER_PIN_DRV_1BIT,
401 			     143, UNIPHIER_PIN_PULL_DOWN),
402 	UNIPHIER_PINCTRL_PIN(144, "TCON3", 144,
403 			     144, UNIPHIER_PIN_DRV_1BIT,
404 			     144, UNIPHIER_PIN_PULL_DOWN),
405 	UNIPHIER_PINCTRL_PIN(145, "TCON4", 145,
406 			     145, UNIPHIER_PIN_DRV_1BIT,
407 			     145, UNIPHIER_PIN_PULL_DOWN),
408 	UNIPHIER_PINCTRL_PIN(146, "TCON5", 146,
409 			     146, UNIPHIER_PIN_DRV_1BIT,
410 			     146, UNIPHIER_PIN_PULL_DOWN),
411 	UNIPHIER_PINCTRL_PIN(147, "PWMA", 147,
412 			     147, UNIPHIER_PIN_DRV_1BIT,
413 			     147, UNIPHIER_PIN_PULL_DOWN),
414 	UNIPHIER_PINCTRL_PIN(148, "LR_GOUT", 148,
415 			     148, UNIPHIER_PIN_DRV_1BIT,
416 			     148, UNIPHIER_PIN_PULL_DOWN),
417 	UNIPHIER_PINCTRL_PIN(149, "XIRQ0", 149,
418 			     149, UNIPHIER_PIN_DRV_1BIT,
419 			     149, UNIPHIER_PIN_PULL_DOWN),
420 	UNIPHIER_PINCTRL_PIN(150, "XIRQ1", 150,
421 			     150, UNIPHIER_PIN_DRV_1BIT,
422 			     150, UNIPHIER_PIN_PULL_DOWN),
423 	UNIPHIER_PINCTRL_PIN(151, "XIRQ2", 151,
424 			     151, UNIPHIER_PIN_DRV_1BIT,
425 			     151, UNIPHIER_PIN_PULL_DOWN),
426 	UNIPHIER_PINCTRL_PIN(152, "XIRQ3", 152,
427 			     152, UNIPHIER_PIN_DRV_1BIT,
428 			     152, UNIPHIER_PIN_PULL_DOWN),
429 	UNIPHIER_PINCTRL_PIN(153, "XIRQ4", 153,
430 			     153, UNIPHIER_PIN_DRV_1BIT,
431 			     153, UNIPHIER_PIN_PULL_DOWN),
432 	UNIPHIER_PINCTRL_PIN(154, "XIRQ5", 154,
433 			     154, UNIPHIER_PIN_DRV_1BIT,
434 			     154, UNIPHIER_PIN_PULL_DOWN),
435 	UNIPHIER_PINCTRL_PIN(155, "XIRQ6", 155,
436 			     155, UNIPHIER_PIN_DRV_1BIT,
437 			     155, UNIPHIER_PIN_PULL_DOWN),
438 	UNIPHIER_PINCTRL_PIN(156, "XIRQ7", 156,
439 			     156, UNIPHIER_PIN_DRV_1BIT,
440 			     156, UNIPHIER_PIN_PULL_DOWN),
441 	UNIPHIER_PINCTRL_PIN(157, "XIRQ8", 157,
442 			     157, UNIPHIER_PIN_DRV_1BIT,
443 			     157, UNIPHIER_PIN_PULL_DOWN),
444 	UNIPHIER_PINCTRL_PIN(158, "AGCBS", 158,
445 			     158, UNIPHIER_PIN_DRV_1BIT,
446 			     158, UNIPHIER_PIN_PULL_DOWN),
447 	UNIPHIER_PINCTRL_PIN(159, "XIRQ21", 159,
448 			     159, UNIPHIER_PIN_DRV_1BIT,
449 			     159, UNIPHIER_PIN_PULL_DOWN),
450 	UNIPHIER_PINCTRL_PIN(160, "XIRQ22", 160,
451 			     160, UNIPHIER_PIN_DRV_1BIT,
452 			     160, UNIPHIER_PIN_PULL_DOWN),
453 	UNIPHIER_PINCTRL_PIN(161, "XIRQ23", 161,
454 			     161, UNIPHIER_PIN_DRV_1BIT,
455 			     161, UNIPHIER_PIN_PULL_DOWN),
456 	UNIPHIER_PINCTRL_PIN(162, "CH2CLK", 162,
457 			     162, UNIPHIER_PIN_DRV_1BIT,
458 			     162, UNIPHIER_PIN_PULL_DOWN),
459 	UNIPHIER_PINCTRL_PIN(163, "CH2PSYNC", 163,
460 			     163, UNIPHIER_PIN_DRV_1BIT,
461 			     163, UNIPHIER_PIN_PULL_DOWN),
462 	UNIPHIER_PINCTRL_PIN(164, "CH2VAL", 164,
463 			     164, UNIPHIER_PIN_DRV_1BIT,
464 			     164, UNIPHIER_PIN_PULL_DOWN),
465 	UNIPHIER_PINCTRL_PIN(165, "CH2DATA", 165,
466 			     165, UNIPHIER_PIN_DRV_1BIT,
467 			     165, UNIPHIER_PIN_PULL_DOWN),
468 	UNIPHIER_PINCTRL_PIN(166, "CK25O", 166,
469 			     166, UNIPHIER_PIN_DRV_1BIT,
470 			     166, UNIPHIER_PIN_PULL_DOWN),
471 };
472 
473 static const unsigned emmc_pins[] = {18, 19, 20, 21, 22, 23, 24, 25};
474 static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0};
475 static const unsigned emmc_dat8_pins[] = {26, 27, 28, 29};
476 static const int emmc_dat8_muxvals[] = {0, 0, 0, 0};
477 static const unsigned ether_rmii_pins[] = {6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
478 					   16, 17};
479 static const int ether_rmii_muxvals[] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4};
480 static const unsigned i2c0_pins[] = {63, 64};
481 static const int i2c0_muxvals[] = {0, 0};
482 static const unsigned i2c1_pins[] = {65, 66};
483 static const int i2c1_muxvals[] = {0, 0};
484 static const unsigned i2c3_pins[] = {67, 68};
485 static const int i2c3_muxvals[] = {1, 1};
486 static const unsigned i2c4_pins[] = {61, 62};
487 static const int i2c4_muxvals[] = {1, 1};
488 static const unsigned nand_pins[] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
489 				     15, 16, 17};
490 static const int nand_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
491 static const unsigned system_bus_pins[] = {1, 2, 6, 7, 8, 9, 10, 11, 12, 13,
492 					   14, 15, 16, 17};
493 static const int system_bus_muxvals[] = {0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494 					 2};
495 static const unsigned system_bus_cs1_pins[] = {0};
496 static const int system_bus_cs1_muxvals[] = {0};
497 static const unsigned uart0_pins[] = {54, 55};
498 static const int uart0_muxvals[] = {0, 0};
499 static const unsigned uart1_pins[] = {58, 59};
500 static const int uart1_muxvals[] = {1, 1};
501 static const unsigned uart2_pins[] = {90, 91};
502 static const int uart2_muxvals[] = {1, 1};
503 static const unsigned uart3_pins[] = {94, 95};
504 static const int uart3_muxvals[] = {1, 1};
505 static const unsigned usb0_pins[] = {46, 47};
506 static const int usb0_muxvals[] = {0, 0};
507 static const unsigned usb1_pins[] = {48, 49};
508 static const int usb1_muxvals[] = {0, 0};
509 static const unsigned usb2_pins[] = {50, 51};
510 static const int usb2_muxvals[] = {0, 0};
511 static const unsigned port_range_pins[] = {
512 	159, 160, 161, 162, 163, 164, 165, 166,		/* PORT0x */
513 	0, 1, 2, 3, 4, 5, 6, 7,				/* PORT1x */
514 	8, 9, 10, 11, 12, 13, 14, 15,			/* PORT2x */
515 	16, 17, 18, -1, -1, -1, -1, -1,			/* PORT3x */
516 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT4x */
517 	-1, -1, -1, 46, 47, 48, 49, 50,			/* PORT5x */
518 	51, -1, -1, 54, 55, 56, 57, 58,			/* PORT6x */
519 	59, 60, 69, 70, 71, 72, 73, 74,			/* PORT7x */
520 	75, 76, 77, 78, 79, 80, 81, 82,			/* PORT8x */
521 	83, 84, 85, 86, 87, 88, 89, 90,			/* PORT9x */
522 	91, 92, 93, 94, 95, 96, 97, 98,			/* PORT10x */
523 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT11x */
524 	99, 100, 101, 102, 103, 104, 105, 106,		/* PORT12x */
525 	107, 108, 109, 110, 111, 112, 113, 114,		/* PORT13x */
526 	115, 116, 117, 118, 119, 120, 121, 122,		/* PORT14x */
527 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT15x */
528 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT16x */
529 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT17x */
530 	61, 62, 63, 64, 65, 66, 67, 68,			/* PORT18x */
531 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT19x */
532 	123, 124, 125, 126, 127, 128, 129, 130,		/* PORT20x */
533 	131, 132, 133, 134, 135, 136, 137, 138,		/* PORT21x */
534 	139, 140, 141, 142, -1, -1, -1, -1,		/* PORT22x */
535 	147, 148, 149, 150, 151, 152, 153, 154,		/* PORT23x */
536 	155, 156, 157, 143, 144, 145, 146, 158,		/* PORT24x */
537 };
538 static const int port_range_muxvals[] = {
539 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT0x */
540 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT1x */
541 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT2x */
542 	15, 15, 15, -1, -1, -1, -1, -1,			/* PORT3x */
543 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT4x */
544 	-1, -1, -1, 15, 15, 15, 15, 15,			/* PORT5x */
545 	15, -1, -1, 15, 15, 15, 15, 15,			/* PORT6x */
546 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT7x */
547 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT8x */
548 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT9x */
549 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT10x */
550 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT11x */
551 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT12x */
552 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT13x */
553 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT14x */
554 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT15x */
555 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT16x */
556 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT17x */
557 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT18x */
558 	-1, -1, -1, -1, -1, -1, -1, -1,			/* PORT19x */
559 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT20x */
560 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT21x */
561 	15, 15, 15, 15, -1, -1, -1, -1,			/* PORT22x */
562 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT23x */
563 	15, 15, 15, 15, 15, 15, 15, 15,			/* PORT24x */
564 };
565 static const unsigned xirq_pins[] = {
566 	149, 150, 151, 152, 153, 154, 155, 156,		/* XIRQ0-7 */
567 	157, 143, 144, 145, 85, 146, 158, 84,		/* XIRQ8-15 */
568 	141, 142, 148, 50, 51, 159, 160, 161,		/* XIRQ16-23 */
569 };
570 static const int xirq_muxvals[] = {
571 	14, 14, 14, 14, 14, 14, 14, 14,			/* XIRQ0-7 */
572 	14, 14, 14, 14, 13, 14, 14, 13,			/* XIRQ8-15 */
573 	14, 14, 14, 14, 14, 14, 14, 14,			/* XIRQ16-23 */
574 };
575 static const unsigned xirq_alternatives_pins[] = {
576 	94, 95, 96, 97, 98, 99, 100, 101,		/* XIRQ0-7 */
577 	102, 103, 104, 105, 106, 107,			/* XIRQ8-11,13,14 */
578 	108, 109, 110, 111, 112, 113, 114, 115,		/* XIRQ16-23 */
579 	9, 10, 11, 12, 13, 14, 15, 16,			/* XIRQ4-11 */
580 	17, 0, 1, 2, 3, 4, 5, 6, 7, 8,			/* XIRQ13,14,16-23 */
581 	139, 140, 135, 147,				/* XIRQ17,18,21,22 */
582 };
583 static const int xirq_alternatives_muxvals[] = {
584 	14, 14, 14, 14, 14, 14, 14, 14,			/* XIRQ0-7 */
585 	14, 14, 14, 14, 14, 14,				/* XIRQ8-11,13,14 */
586 	14, 14, 14, 14, 14, 14, 14, 14,			/* XIRQ16-23 */
587 	14, 14, 14, 14, 14, 14, 14, 14,			/* XIRQ4-11 */
588 	14, 14, 14, 14, 14, 14, 14, 14, 14, 14,		/* XIRQ13,14,16-23 */
589 	14, 14, 14, 14,					/* XIRQ17,18,21,22 */
590 };
591 
592 static const struct uniphier_pinctrl_group uniphier_ld11_groups[] = {
593 	UNIPHIER_PINCTRL_GROUP(emmc),
594 	UNIPHIER_PINCTRL_GROUP(emmc_dat8),
595 	UNIPHIER_PINCTRL_GROUP(ether_rmii),
596 	UNIPHIER_PINCTRL_GROUP(i2c0),
597 	UNIPHIER_PINCTRL_GROUP(i2c1),
598 	UNIPHIER_PINCTRL_GROUP(i2c3),
599 	UNIPHIER_PINCTRL_GROUP(i2c4),
600 	UNIPHIER_PINCTRL_GROUP(nand),
601 	UNIPHIER_PINCTRL_GROUP(system_bus),
602 	UNIPHIER_PINCTRL_GROUP(system_bus_cs1),
603 	UNIPHIER_PINCTRL_GROUP(uart0),
604 	UNIPHIER_PINCTRL_GROUP(uart1),
605 	UNIPHIER_PINCTRL_GROUP(uart2),
606 	UNIPHIER_PINCTRL_GROUP(uart3),
607 	UNIPHIER_PINCTRL_GROUP(usb0),
608 	UNIPHIER_PINCTRL_GROUP(usb1),
609 	UNIPHIER_PINCTRL_GROUP(usb2),
610 	UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_PORT(port_range),
611 	UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq),
612 	UNIPHIER_PINCTRL_GROUP_GPIO_RANGE_IRQ(xirq_alternatives),
613 	UNIPHIER_PINCTRL_GROUP_SINGLE(port00, port_range, 0),
614 	UNIPHIER_PINCTRL_GROUP_SINGLE(port01, port_range, 1),
615 	UNIPHIER_PINCTRL_GROUP_SINGLE(port02, port_range, 2),
616 	UNIPHIER_PINCTRL_GROUP_SINGLE(port03, port_range, 3),
617 	UNIPHIER_PINCTRL_GROUP_SINGLE(port04, port_range, 4),
618 	UNIPHIER_PINCTRL_GROUP_SINGLE(port05, port_range, 5),
619 	UNIPHIER_PINCTRL_GROUP_SINGLE(port06, port_range, 6),
620 	UNIPHIER_PINCTRL_GROUP_SINGLE(port07, port_range, 7),
621 	UNIPHIER_PINCTRL_GROUP_SINGLE(port10, port_range, 8),
622 	UNIPHIER_PINCTRL_GROUP_SINGLE(port11, port_range, 9),
623 	UNIPHIER_PINCTRL_GROUP_SINGLE(port12, port_range, 10),
624 	UNIPHIER_PINCTRL_GROUP_SINGLE(port13, port_range, 11),
625 	UNIPHIER_PINCTRL_GROUP_SINGLE(port14, port_range, 12),
626 	UNIPHIER_PINCTRL_GROUP_SINGLE(port15, port_range, 13),
627 	UNIPHIER_PINCTRL_GROUP_SINGLE(port16, port_range, 14),
628 	UNIPHIER_PINCTRL_GROUP_SINGLE(port17, port_range, 15),
629 	UNIPHIER_PINCTRL_GROUP_SINGLE(port20, port_range, 16),
630 	UNIPHIER_PINCTRL_GROUP_SINGLE(port21, port_range, 17),
631 	UNIPHIER_PINCTRL_GROUP_SINGLE(port22, port_range, 18),
632 	UNIPHIER_PINCTRL_GROUP_SINGLE(port23, port_range, 19),
633 	UNIPHIER_PINCTRL_GROUP_SINGLE(port24, port_range, 20),
634 	UNIPHIER_PINCTRL_GROUP_SINGLE(port25, port_range, 21),
635 	UNIPHIER_PINCTRL_GROUP_SINGLE(port26, port_range, 22),
636 	UNIPHIER_PINCTRL_GROUP_SINGLE(port27, port_range, 23),
637 	UNIPHIER_PINCTRL_GROUP_SINGLE(port30, port_range, 24),
638 	UNIPHIER_PINCTRL_GROUP_SINGLE(port31, port_range, 25),
639 	UNIPHIER_PINCTRL_GROUP_SINGLE(port32, port_range, 26),
640 	UNIPHIER_PINCTRL_GROUP_SINGLE(port53, port_range, 43),
641 	UNIPHIER_PINCTRL_GROUP_SINGLE(port54, port_range, 44),
642 	UNIPHIER_PINCTRL_GROUP_SINGLE(port55, port_range, 45),
643 	UNIPHIER_PINCTRL_GROUP_SINGLE(port56, port_range, 46),
644 	UNIPHIER_PINCTRL_GROUP_SINGLE(port57, port_range, 47),
645 	UNIPHIER_PINCTRL_GROUP_SINGLE(port60, port_range, 48),
646 	UNIPHIER_PINCTRL_GROUP_SINGLE(port63, port_range, 51),
647 	UNIPHIER_PINCTRL_GROUP_SINGLE(port64, port_range, 52),
648 	UNIPHIER_PINCTRL_GROUP_SINGLE(port65, port_range, 53),
649 	UNIPHIER_PINCTRL_GROUP_SINGLE(port66, port_range, 54),
650 	UNIPHIER_PINCTRL_GROUP_SINGLE(port67, port_range, 55),
651 	UNIPHIER_PINCTRL_GROUP_SINGLE(port70, port_range, 56),
652 	UNIPHIER_PINCTRL_GROUP_SINGLE(port71, port_range, 57),
653 	UNIPHIER_PINCTRL_GROUP_SINGLE(port72, port_range, 58),
654 	UNIPHIER_PINCTRL_GROUP_SINGLE(port73, port_range, 59),
655 	UNIPHIER_PINCTRL_GROUP_SINGLE(port74, port_range, 60),
656 	UNIPHIER_PINCTRL_GROUP_SINGLE(port75, port_range, 61),
657 	UNIPHIER_PINCTRL_GROUP_SINGLE(port76, port_range, 62),
658 	UNIPHIER_PINCTRL_GROUP_SINGLE(port77, port_range, 63),
659 	UNIPHIER_PINCTRL_GROUP_SINGLE(port80, port_range, 64),
660 	UNIPHIER_PINCTRL_GROUP_SINGLE(port81, port_range, 65),
661 	UNIPHIER_PINCTRL_GROUP_SINGLE(port82, port_range, 66),
662 	UNIPHIER_PINCTRL_GROUP_SINGLE(port83, port_range, 67),
663 	UNIPHIER_PINCTRL_GROUP_SINGLE(port84, port_range, 68),
664 	UNIPHIER_PINCTRL_GROUP_SINGLE(port85, port_range, 69),
665 	UNIPHIER_PINCTRL_GROUP_SINGLE(port86, port_range, 70),
666 	UNIPHIER_PINCTRL_GROUP_SINGLE(port87, port_range, 71),
667 	UNIPHIER_PINCTRL_GROUP_SINGLE(port90, port_range, 72),
668 	UNIPHIER_PINCTRL_GROUP_SINGLE(port91, port_range, 73),
669 	UNIPHIER_PINCTRL_GROUP_SINGLE(port92, port_range, 74),
670 	UNIPHIER_PINCTRL_GROUP_SINGLE(port93, port_range, 75),
671 	UNIPHIER_PINCTRL_GROUP_SINGLE(port94, port_range, 76),
672 	UNIPHIER_PINCTRL_GROUP_SINGLE(port95, port_range, 77),
673 	UNIPHIER_PINCTRL_GROUP_SINGLE(port96, port_range, 78),
674 	UNIPHIER_PINCTRL_GROUP_SINGLE(port97, port_range, 79),
675 	UNIPHIER_PINCTRL_GROUP_SINGLE(port100, port_range, 80),
676 	UNIPHIER_PINCTRL_GROUP_SINGLE(port101, port_range, 81),
677 	UNIPHIER_PINCTRL_GROUP_SINGLE(port102, port_range, 82),
678 	UNIPHIER_PINCTRL_GROUP_SINGLE(port103, port_range, 83),
679 	UNIPHIER_PINCTRL_GROUP_SINGLE(port104, port_range, 84),
680 	UNIPHIER_PINCTRL_GROUP_SINGLE(port105, port_range, 85),
681 	UNIPHIER_PINCTRL_GROUP_SINGLE(port106, port_range, 86),
682 	UNIPHIER_PINCTRL_GROUP_SINGLE(port107, port_range, 87),
683 	UNIPHIER_PINCTRL_GROUP_SINGLE(port120, port_range, 96),
684 	UNIPHIER_PINCTRL_GROUP_SINGLE(port121, port_range, 97),
685 	UNIPHIER_PINCTRL_GROUP_SINGLE(port122, port_range, 98),
686 	UNIPHIER_PINCTRL_GROUP_SINGLE(port123, port_range, 99),
687 	UNIPHIER_PINCTRL_GROUP_SINGLE(port124, port_range, 100),
688 	UNIPHIER_PINCTRL_GROUP_SINGLE(port125, port_range, 101),
689 	UNIPHIER_PINCTRL_GROUP_SINGLE(port126, port_range, 102),
690 	UNIPHIER_PINCTRL_GROUP_SINGLE(port127, port_range, 103),
691 	UNIPHIER_PINCTRL_GROUP_SINGLE(port130, port_range, 104),
692 	UNIPHIER_PINCTRL_GROUP_SINGLE(port131, port_range, 105),
693 	UNIPHIER_PINCTRL_GROUP_SINGLE(port132, port_range, 106),
694 	UNIPHIER_PINCTRL_GROUP_SINGLE(port133, port_range, 107),
695 	UNIPHIER_PINCTRL_GROUP_SINGLE(port134, port_range, 108),
696 	UNIPHIER_PINCTRL_GROUP_SINGLE(port135, port_range, 109),
697 	UNIPHIER_PINCTRL_GROUP_SINGLE(port136, port_range, 110),
698 	UNIPHIER_PINCTRL_GROUP_SINGLE(port137, port_range, 111),
699 	UNIPHIER_PINCTRL_GROUP_SINGLE(port140, port_range, 112),
700 	UNIPHIER_PINCTRL_GROUP_SINGLE(port141, port_range, 113),
701 	UNIPHIER_PINCTRL_GROUP_SINGLE(port142, port_range, 114),
702 	UNIPHIER_PINCTRL_GROUP_SINGLE(port143, port_range, 115),
703 	UNIPHIER_PINCTRL_GROUP_SINGLE(port144, port_range, 116),
704 	UNIPHIER_PINCTRL_GROUP_SINGLE(port145, port_range, 117),
705 	UNIPHIER_PINCTRL_GROUP_SINGLE(port146, port_range, 118),
706 	UNIPHIER_PINCTRL_GROUP_SINGLE(port147, port_range, 119),
707 	UNIPHIER_PINCTRL_GROUP_SINGLE(port180, port_range, 144),
708 	UNIPHIER_PINCTRL_GROUP_SINGLE(port181, port_range, 145),
709 	UNIPHIER_PINCTRL_GROUP_SINGLE(port182, port_range, 146),
710 	UNIPHIER_PINCTRL_GROUP_SINGLE(port183, port_range, 147),
711 	UNIPHIER_PINCTRL_GROUP_SINGLE(port184, port_range, 148),
712 	UNIPHIER_PINCTRL_GROUP_SINGLE(port185, port_range, 149),
713 	UNIPHIER_PINCTRL_GROUP_SINGLE(port186, port_range, 150),
714 	UNIPHIER_PINCTRL_GROUP_SINGLE(port187, port_range, 151),
715 	UNIPHIER_PINCTRL_GROUP_SINGLE(port200, port_range, 160),
716 	UNIPHIER_PINCTRL_GROUP_SINGLE(port201, port_range, 161),
717 	UNIPHIER_PINCTRL_GROUP_SINGLE(port202, port_range, 162),
718 	UNIPHIER_PINCTRL_GROUP_SINGLE(port203, port_range, 163),
719 	UNIPHIER_PINCTRL_GROUP_SINGLE(port204, port_range, 164),
720 	UNIPHIER_PINCTRL_GROUP_SINGLE(port205, port_range, 165),
721 	UNIPHIER_PINCTRL_GROUP_SINGLE(port206, port_range, 166),
722 	UNIPHIER_PINCTRL_GROUP_SINGLE(port207, port_range, 167),
723 	UNIPHIER_PINCTRL_GROUP_SINGLE(port210, port_range, 168),
724 	UNIPHIER_PINCTRL_GROUP_SINGLE(port211, port_range, 169),
725 	UNIPHIER_PINCTRL_GROUP_SINGLE(port212, port_range, 170),
726 	UNIPHIER_PINCTRL_GROUP_SINGLE(port213, port_range, 171),
727 	UNIPHIER_PINCTRL_GROUP_SINGLE(port214, port_range, 172),
728 	UNIPHIER_PINCTRL_GROUP_SINGLE(port215, port_range, 173),
729 	UNIPHIER_PINCTRL_GROUP_SINGLE(port216, port_range, 174),
730 	UNIPHIER_PINCTRL_GROUP_SINGLE(port217, port_range, 175),
731 	UNIPHIER_PINCTRL_GROUP_SINGLE(port220, port_range, 176),
732 	UNIPHIER_PINCTRL_GROUP_SINGLE(port221, port_range, 177),
733 	UNIPHIER_PINCTRL_GROUP_SINGLE(port222, port_range, 178),
734 	UNIPHIER_PINCTRL_GROUP_SINGLE(port223, port_range, 179),
735 	UNIPHIER_PINCTRL_GROUP_SINGLE(port230, port_range, 184),
736 	UNIPHIER_PINCTRL_GROUP_SINGLE(port231, port_range, 185),
737 	UNIPHIER_PINCTRL_GROUP_SINGLE(port232, port_range, 186),
738 	UNIPHIER_PINCTRL_GROUP_SINGLE(port233, port_range, 187),
739 	UNIPHIER_PINCTRL_GROUP_SINGLE(port234, port_range, 188),
740 	UNIPHIER_PINCTRL_GROUP_SINGLE(port235, port_range, 189),
741 	UNIPHIER_PINCTRL_GROUP_SINGLE(port236, port_range, 190),
742 	UNIPHIER_PINCTRL_GROUP_SINGLE(port237, port_range, 191),
743 	UNIPHIER_PINCTRL_GROUP_SINGLE(port240, port_range, 192),
744 	UNIPHIER_PINCTRL_GROUP_SINGLE(port241, port_range, 193),
745 	UNIPHIER_PINCTRL_GROUP_SINGLE(port242, port_range, 194),
746 	UNIPHIER_PINCTRL_GROUP_SINGLE(port243, port_range, 195),
747 	UNIPHIER_PINCTRL_GROUP_SINGLE(port244, port_range, 196),
748 	UNIPHIER_PINCTRL_GROUP_SINGLE(port245, port_range, 197),
749 	UNIPHIER_PINCTRL_GROUP_SINGLE(port246, port_range, 198),
750 	UNIPHIER_PINCTRL_GROUP_SINGLE(port247, port_range, 199),
751 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0, xirq, 0),
752 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1, xirq, 1),
753 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2, xirq, 2),
754 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3, xirq, 3),
755 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4, xirq, 4),
756 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5, xirq, 5),
757 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6, xirq, 6),
758 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7, xirq, 7),
759 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8, xirq, 8),
760 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9, xirq, 9),
761 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10, xirq, 10),
762 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11, xirq, 11),
763 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq12, xirq, 12),
764 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13, xirq, 13),
765 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14, xirq, 14),
766 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq15, xirq, 15),
767 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16, xirq, 16),
768 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17, xirq, 17),
769 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18, xirq, 18),
770 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19, xirq, 19),
771 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20, xirq, 20),
772 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21, xirq, 21),
773 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22, xirq, 22),
774 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq23, xirq, 23),
775 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq0b, xirq_alternatives, 0),
776 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq1b, xirq_alternatives, 1),
777 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq2b, xirq_alternatives, 2),
778 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq3b, xirq_alternatives, 3),
779 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4b, xirq_alternatives, 4),
780 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5b, xirq_alternatives, 5),
781 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6b, xirq_alternatives, 6),
782 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7b, xirq_alternatives, 7),
783 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8b, xirq_alternatives, 8),
784 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9b, xirq_alternatives, 9),
785 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10b, xirq_alternatives, 10),
786 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11b, xirq_alternatives, 11),
787 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13b, xirq_alternatives, 12),
788 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14b, xirq_alternatives, 13),
789 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16b, xirq_alternatives, 14),
790 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17b, xirq_alternatives, 15),
791 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18b, xirq_alternatives, 16),
792 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19b, xirq_alternatives, 17),
793 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20b, xirq_alternatives, 18),
794 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21b, xirq_alternatives, 19),
795 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22b, xirq_alternatives, 20),
796 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq23b, xirq_alternatives, 21),
797 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq4c, xirq_alternatives, 22),
798 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq5c, xirq_alternatives, 23),
799 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq6c, xirq_alternatives, 24),
800 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq7c, xirq_alternatives, 25),
801 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq8c, xirq_alternatives, 26),
802 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq9c, xirq_alternatives, 27),
803 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq10c, xirq_alternatives, 28),
804 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq11c, xirq_alternatives, 29),
805 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq13c, xirq_alternatives, 30),
806 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq14c, xirq_alternatives, 31),
807 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq16c, xirq_alternatives, 32),
808 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17c, xirq_alternatives, 33),
809 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18c, xirq_alternatives, 34),
810 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq19c, xirq_alternatives, 35),
811 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq20c, xirq_alternatives, 36),
812 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21c, xirq_alternatives, 37),
813 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22c, xirq_alternatives, 38),
814 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq23c, xirq_alternatives, 39),
815 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq17d, xirq_alternatives, 40),
816 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq18d, xirq_alternatives, 41),
817 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq21d, xirq_alternatives, 42),
818 	UNIPHIER_PINCTRL_GROUP_SINGLE(xirq22d, xirq_alternatives, 43),
819 };
820 
821 static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
822 static const char * const ether_rmii_groups[] = {"ether_rmii"};
823 static const char * const i2c0_groups[] = {"i2c0"};
824 static const char * const i2c1_groups[] = {"i2c1"};
825 static const char * const i2c3_groups[] = {"i2c3"};
826 static const char * const i2c4_groups[] = {"i2c4"};
827 static const char * const nand_groups[] = {"nand"};
828 static const char * const system_bus_groups[] = {"system_bus",
829 						 "system_bus_cs1"};
830 static const char * const uart0_groups[] = {"uart0"};
831 static const char * const uart1_groups[] = {"uart1"};
832 static const char * const uart2_groups[] = {"uart2"};
833 static const char * const uart3_groups[] = {"uart3"};
834 static const char * const usb0_groups[] = {"usb0"};
835 static const char * const usb1_groups[] = {"usb1"};
836 static const char * const usb2_groups[] = {"usb2"};
837 static const char * const port_groups[] = {
838 	"port00",  "port01",  "port02",  "port03",
839 	"port04",  "port05",  "port06",  "port07",
840 	"port10",  "port11",  "port12",  "port13",
841 	"port14",  "port15",  "port16",  "port17",
842 	"port20",  "port21",  "port22",  "port23",
843 	"port24",  "port25",  "port26",  "port27",
844 	"port30",  "port31",  "port32",
845 	/* port33-52 missing */          "port53",
846 	"port54",  "port55",  "port56",  "port57",
847 	"port60", /* port61-62 missing*/ "port63",
848 	"port64",  "port65",  "port66",  "port67",
849 	"port70",  "port71",  "port72",  "port73",
850 	"port74",  "port75",  "port76",  "port77",
851 	"port80",  "port81",  "port82",  "port83",
852 	"port84",  "port85",  "port86",  "port87",
853 	"port90",  "port91",  "port92",  "port93",
854 	"port94",  "port95",  "port96",  "port97",
855 	"port100", "port101", "port102", "port103",
856 	"port104", "port105", "port106", "port107",
857 	/* port110-117 missing */
858 	"port120", "port121", "port122", "port123",
859 	"port124", "port125", "port126", "port127",
860 	"port130", "port131", "port132", "port133",
861 	"port134", "port135", "port136", "port137",
862 	"port140", "port141", "port142", "port143",
863 	"port144", "port145", "port146", "port147",
864 	/* port150-177 missing */
865 	"port180", "port181", "port182", "port183",
866 	"port184", "port185", "port186", "port187",
867 	/* port190-197 missing */
868 	"port200", "port201", "port202", "port203",
869 	"port204", "port205", "port206", "port207",
870 	"port210", "port211", "port212", "port213",
871 	"port214", "port215", "port216", "port217",
872 	"port220", "port221", "port222", "port223",
873 	/* port224-227 missing */
874 	"port230", "port231", "port232", "port233",
875 	"port234", "port235", "port236", "port237",
876 	"port240", "port241", "port242", "port243",
877 	"port244", "port245", "port246", "port247",
878 };
879 static const char * const xirq_groups[] = {
880 	"xirq0",  "xirq1",  "xirq2",  "xirq3",
881 	"xirq4",  "xirq5",  "xirq6",  "xirq7",
882 	"xirq8",  "xirq9",  "xirq10", "xirq11",
883 	"xirq12", "xirq13", "xirq14", "xirq15",
884 	"xirq16", "xirq17", "xirq18", "xirq19",
885 	"xirq20", "xirq21", "xirq22", "xirq23",
886 	"xirq0b",  "xirq1b",  "xirq2b",  "xirq3b",
887 	"xirq4b",  "xirq5b",  "xirq6b",  "xirq7b",
888 	"xirq8b",  "xirq9b",  "xirq10b", "xirq11b",
889 	/* none */ "xirq13b", "xirq14b", /* none */
890 	"xirq16b", "xirq17b", "xirq18b", "xirq19b",
891 	"xirq20b", "xirq21b", "xirq22b", "xirq23b",
892 	"xirq4c",  "xirq5c",  "xirq6c",  "xirq7c",
893 	"xirq8c",  "xirq9c",  "xirq10c", "xirq11c",
894 	/* none */ "xirq13c", "xirq14c", /* none */
895 	"xirq16c", "xirq17c", "xirq18c", "xirq19c",
896 	"xirq20c", "xirq21c", "xirq22c", "xirq23c",
897 	"xirq17d", "xirq18d", "xirq21d", "xirq22d",
898 };
899 
900 static const struct uniphier_pinmux_function uniphier_ld11_functions[] = {
901 	UNIPHIER_PINMUX_FUNCTION(emmc),
902 	UNIPHIER_PINMUX_FUNCTION(ether_rmii),
903 	UNIPHIER_PINMUX_FUNCTION(i2c0),
904 	UNIPHIER_PINMUX_FUNCTION(i2c1),
905 	UNIPHIER_PINMUX_FUNCTION(i2c3),
906 	UNIPHIER_PINMUX_FUNCTION(i2c4),
907 	UNIPHIER_PINMUX_FUNCTION(nand),
908 	UNIPHIER_PINMUX_FUNCTION(system_bus),
909 	UNIPHIER_PINMUX_FUNCTION(uart0),
910 	UNIPHIER_PINMUX_FUNCTION(uart1),
911 	UNIPHIER_PINMUX_FUNCTION(uart2),
912 	UNIPHIER_PINMUX_FUNCTION(uart3),
913 	UNIPHIER_PINMUX_FUNCTION(usb0),
914 	UNIPHIER_PINMUX_FUNCTION(usb1),
915 	UNIPHIER_PINMUX_FUNCTION(usb2),
916 	UNIPHIER_PINMUX_FUNCTION(port),
917 	UNIPHIER_PINMUX_FUNCTION(xirq),
918 };
919 
920 static struct uniphier_pinctrl_socdata uniphier_ld11_pindata = {
921 	.pins = uniphier_ld11_pins,
922 	.npins = ARRAY_SIZE(uniphier_ld11_pins),
923 	.groups = uniphier_ld11_groups,
924 	.groups_count = ARRAY_SIZE(uniphier_ld11_groups),
925 	.functions = uniphier_ld11_functions,
926 	.functions_count = ARRAY_SIZE(uniphier_ld11_functions),
927 	.caps = UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL,
928 };
929 
930 static int uniphier_ld11_pinctrl_probe(struct platform_device *pdev)
931 {
932 	return uniphier_pinctrl_probe(pdev, &uniphier_ld11_pindata);
933 }
934 
935 static const struct of_device_id uniphier_ld11_pinctrl_match[] = {
936 	{ .compatible = "socionext,uniphier-ld11-pinctrl" },
937 	{ /* sentinel */ }
938 };
939 MODULE_DEVICE_TABLE(of, uniphier_ld11_pinctrl_match);
940 
941 static struct platform_driver uniphier_ld11_pinctrl_driver = {
942 	.probe = uniphier_ld11_pinctrl_probe,
943 	.driver = {
944 		.name = "uniphier-ld11-pinctrl",
945 		.of_match_table = uniphier_ld11_pinctrl_match,
946 	},
947 };
948 module_platform_driver(uniphier_ld11_pinctrl_driver);
949 
950 MODULE_AUTHOR("Masahiro Yamada <yamada.masahiro@socionext.com>");
951 MODULE_DESCRIPTION("UniPhier PH1-LD11 pinctrl driver");
952 MODULE_LICENSE("GPL");
953