blob: 241d83992692895958ce471b202a7d2a2ee39d0e [file] [log] [blame]
Barry Song3370dc92013-05-14 22:17:58 +08001/*
2 * pinctrl pads, groups, functions for CSR SiRFprimaII
3 *
4 * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#include <linux/pinctrl/pinctrl.h>
10#include <linux/bitops.h>
11
12#include "pinctrl-sirf.h"
13
14/*
15 * pad list for the pinmux subsystem
16 * refer to CS-131858-DC-6A.xls
17 */
18static const struct pinctrl_pin_desc sirfsoc_pads[] = {
19 PINCTRL_PIN(0, "gpio0-0"),
20 PINCTRL_PIN(1, "gpio0-1"),
21 PINCTRL_PIN(2, "gpio0-2"),
22 PINCTRL_PIN(3, "gpio0-3"),
23 PINCTRL_PIN(4, "pwm0"),
24 PINCTRL_PIN(5, "pwm1"),
25 PINCTRL_PIN(6, "pwm2"),
26 PINCTRL_PIN(7, "pwm3"),
27 PINCTRL_PIN(8, "warm_rst_b"),
28 PINCTRL_PIN(9, "odo_0"),
29 PINCTRL_PIN(10, "odo_1"),
30 PINCTRL_PIN(11, "dr_dir"),
31 PINCTRL_PIN(12, "viprom_fa"),
32 PINCTRL_PIN(13, "scl_1"),
33 PINCTRL_PIN(14, "ntrst"),
34 PINCTRL_PIN(15, "sda_1"),
35 PINCTRL_PIN(16, "x_ldd[16]"),
36 PINCTRL_PIN(17, "x_ldd[17]"),
37 PINCTRL_PIN(18, "x_ldd[18]"),
38 PINCTRL_PIN(19, "x_ldd[19]"),
39 PINCTRL_PIN(20, "x_ldd[20]"),
40 PINCTRL_PIN(21, "x_ldd[21]"),
41 PINCTRL_PIN(22, "x_ldd[22]"),
42 PINCTRL_PIN(23, "x_ldd[23], lcdrom_frdy"),
43 PINCTRL_PIN(24, "gps_sgn"),
44 PINCTRL_PIN(25, "gps_mag"),
45 PINCTRL_PIN(26, "gps_clk"),
46 PINCTRL_PIN(27, "sd_cd_b_1"),
47 PINCTRL_PIN(28, "sd_vcc_on_1"),
48 PINCTRL_PIN(29, "sd_wp_b_1"),
49 PINCTRL_PIN(30, "sd_clk_3"),
50 PINCTRL_PIN(31, "sd_cmd_3"),
51
52 PINCTRL_PIN(32, "x_sd_dat_3[0]"),
53 PINCTRL_PIN(33, "x_sd_dat_3[1]"),
54 PINCTRL_PIN(34, "x_sd_dat_3[2]"),
55 PINCTRL_PIN(35, "x_sd_dat_3[3]"),
56 PINCTRL_PIN(36, "x_sd_clk_4"),
57 PINCTRL_PIN(37, "x_sd_cmd_4"),
58 PINCTRL_PIN(38, "x_sd_dat_4[0]"),
59 PINCTRL_PIN(39, "x_sd_dat_4[1]"),
60 PINCTRL_PIN(40, "x_sd_dat_4[2]"),
61 PINCTRL_PIN(41, "x_sd_dat_4[3]"),
62 PINCTRL_PIN(42, "x_cko_1"),
63 PINCTRL_PIN(43, "x_ac97_bit_clk"),
64 PINCTRL_PIN(44, "x_ac97_dout"),
65 PINCTRL_PIN(45, "x_ac97_din"),
66 PINCTRL_PIN(46, "x_ac97_sync"),
67 PINCTRL_PIN(47, "x_txd_1"),
68 PINCTRL_PIN(48, "x_txd_2"),
69 PINCTRL_PIN(49, "x_rxd_1"),
70 PINCTRL_PIN(50, "x_rxd_2"),
71 PINCTRL_PIN(51, "x_usclk_0"),
72 PINCTRL_PIN(52, "x_utxd_0"),
73 PINCTRL_PIN(53, "x_urxd_0"),
74 PINCTRL_PIN(54, "x_utfs_0"),
75 PINCTRL_PIN(55, "x_urfs_0"),
76 PINCTRL_PIN(56, "x_usclk_1"),
77 PINCTRL_PIN(57, "x_utxd_1"),
78 PINCTRL_PIN(58, "x_urxd_1"),
79 PINCTRL_PIN(59, "x_utfs_1"),
80 PINCTRL_PIN(60, "x_urfs_1"),
81 PINCTRL_PIN(61, "x_usclk_2"),
82 PINCTRL_PIN(62, "x_utxd_2"),
83 PINCTRL_PIN(63, "x_urxd_2"),
84
85 PINCTRL_PIN(64, "x_utfs_2"),
86 PINCTRL_PIN(65, "x_urfs_2"),
87 PINCTRL_PIN(66, "x_df_we_b"),
88 PINCTRL_PIN(67, "x_df_re_b"),
89 PINCTRL_PIN(68, "x_txd_0"),
90 PINCTRL_PIN(69, "x_rxd_0"),
91 PINCTRL_PIN(78, "x_cko_0"),
92 PINCTRL_PIN(79, "x_vip_pxd[7]"),
93 PINCTRL_PIN(80, "x_vip_pxd[6]"),
94 PINCTRL_PIN(81, "x_vip_pxd[5]"),
95 PINCTRL_PIN(82, "x_vip_pxd[4]"),
96 PINCTRL_PIN(83, "x_vip_pxd[3]"),
97 PINCTRL_PIN(84, "x_vip_pxd[2]"),
98 PINCTRL_PIN(85, "x_vip_pxd[1]"),
99 PINCTRL_PIN(86, "x_vip_pxd[0]"),
100 PINCTRL_PIN(87, "x_vip_vsync"),
101 PINCTRL_PIN(88, "x_vip_hsync"),
102 PINCTRL_PIN(89, "x_vip_pxclk"),
103 PINCTRL_PIN(90, "x_sda_0"),
104 PINCTRL_PIN(91, "x_scl_0"),
105 PINCTRL_PIN(92, "x_df_ry_by"),
106 PINCTRL_PIN(93, "x_df_cs_b[1]"),
107 PINCTRL_PIN(94, "x_df_cs_b[0]"),
108 PINCTRL_PIN(95, "x_l_pclk"),
109
110 PINCTRL_PIN(96, "x_l_lck"),
111 PINCTRL_PIN(97, "x_l_fck"),
112 PINCTRL_PIN(98, "x_l_de"),
113 PINCTRL_PIN(99, "x_ldd[0]"),
114 PINCTRL_PIN(100, "x_ldd[1]"),
115 PINCTRL_PIN(101, "x_ldd[2]"),
116 PINCTRL_PIN(102, "x_ldd[3]"),
117 PINCTRL_PIN(103, "x_ldd[4]"),
118 PINCTRL_PIN(104, "x_ldd[5]"),
119 PINCTRL_PIN(105, "x_ldd[6]"),
120 PINCTRL_PIN(106, "x_ldd[7]"),
121 PINCTRL_PIN(107, "x_ldd[8]"),
122 PINCTRL_PIN(108, "x_ldd[9]"),
123 PINCTRL_PIN(109, "x_ldd[10]"),
124 PINCTRL_PIN(110, "x_ldd[11]"),
125 PINCTRL_PIN(111, "x_ldd[12]"),
126 PINCTRL_PIN(112, "x_ldd[13]"),
127 PINCTRL_PIN(113, "x_ldd[14]"),
128 PINCTRL_PIN(114, "x_ldd[15]"),
129};
130
131static const struct sirfsoc_muxmask lcd_16bits_sirfsoc_muxmask[] = {
132 {
133 .group = 3,
134 .mask = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) | BIT(6) | BIT(7) | BIT(8) |
135 BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(13) | BIT(14) | BIT(15) | BIT(16) |
136 BIT(17) | BIT(18),
137 }, {
138 .group = 2,
139 .mask = BIT(31),
140 },
141};
142
143static const struct sirfsoc_padmux lcd_16bits_padmux = {
144 .muxmask_counts = ARRAY_SIZE(lcd_16bits_sirfsoc_muxmask),
145 .muxmask = lcd_16bits_sirfsoc_muxmask,
146 .funcmask = BIT(4),
147 .funcval = 0,
148};
149
150static const unsigned lcd_16bits_pins[] = { 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
151 105, 106, 107, 108, 109, 110, 111, 112, 113, 114 };
152
153static const struct sirfsoc_muxmask lcd_18bits_muxmask[] = {
154 {
155 .group = 3,
156 .mask = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) | BIT(6) | BIT(7) | BIT(8) |
157 BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(13) | BIT(14) | BIT(15) | BIT(16) |
158 BIT(17) | BIT(18),
159 }, {
160 .group = 2,
161 .mask = BIT(31),
162 }, {
163 .group = 0,
164 .mask = BIT(16) | BIT(17),
165 },
166};
167
168static const struct sirfsoc_padmux lcd_18bits_padmux = {
169 .muxmask_counts = ARRAY_SIZE(lcd_18bits_muxmask),
170 .muxmask = lcd_18bits_muxmask,
171 .funcmask = BIT(4),
172 .funcval = 0,
173};
174
175static const unsigned lcd_18bits_pins[] = { 16, 17, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
176 105, 106, 107, 108, 109, 110, 111, 112, 113, 114};
177
178static const struct sirfsoc_muxmask lcd_24bits_muxmask[] = {
179 {
180 .group = 3,
181 .mask = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) | BIT(6) | BIT(7) | BIT(8) |
182 BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(13) | BIT(14) | BIT(15) | BIT(16) |
183 BIT(17) | BIT(18),
184 }, {
185 .group = 2,
186 .mask = BIT(31),
187 }, {
188 .group = 0,
189 .mask = BIT(16) | BIT(17) | BIT(18) | BIT(19) | BIT(20) | BIT(21) | BIT(22) | BIT(23),
190 },
191};
192
193static const struct sirfsoc_padmux lcd_24bits_padmux = {
194 .muxmask_counts = ARRAY_SIZE(lcd_24bits_muxmask),
195 .muxmask = lcd_24bits_muxmask,
196 .funcmask = BIT(4),
197 .funcval = 0,
198};
199
200static const unsigned lcd_24bits_pins[] = { 16, 17, 18, 19, 20, 21, 22, 23, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
201 105, 106, 107, 108, 109, 110, 111, 112, 113, 114 };
202
203static const struct sirfsoc_muxmask lcdrom_muxmask[] = {
204 {
205 .group = 3,
206 .mask = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) | BIT(6) | BIT(7) | BIT(8) |
207 BIT(9) | BIT(10) | BIT(11) | BIT(12) | BIT(13) | BIT(14) | BIT(15) | BIT(16) |
208 BIT(17) | BIT(18),
209 }, {
210 .group = 2,
211 .mask = BIT(31),
212 }, {
213 .group = 0,
214 .mask = BIT(23),
215 },
216};
217
218static const struct sirfsoc_padmux lcdrom_padmux = {
219 .muxmask_counts = ARRAY_SIZE(lcdrom_muxmask),
220 .muxmask = lcdrom_muxmask,
221 .funcmask = BIT(4),
222 .funcval = BIT(4),
223};
224
225static const unsigned lcdrom_pins[] = { 23, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
226 105, 106, 107, 108, 109, 110, 111, 112, 113, 114 };
227
228static const struct sirfsoc_muxmask uart0_muxmask[] = {
229 {
230 .group = 2,
231 .mask = BIT(4) | BIT(5),
232 }, {
233 .group = 1,
234 .mask = BIT(23) | BIT(28),
235 },
236};
237
238static const struct sirfsoc_padmux uart0_padmux = {
239 .muxmask_counts = ARRAY_SIZE(uart0_muxmask),
240 .muxmask = uart0_muxmask,
241 .funcmask = BIT(9),
242 .funcval = BIT(9),
243};
244
245static const unsigned uart0_pins[] = { 55, 60, 68, 69 };
246
247static const struct sirfsoc_muxmask uart0_nostreamctrl_muxmask[] = {
248 {
249 .group = 2,
250 .mask = BIT(4) | BIT(5),
251 },
252};
253
254static const struct sirfsoc_padmux uart0_nostreamctrl_padmux = {
255 .muxmask_counts = ARRAY_SIZE(uart0_nostreamctrl_muxmask),
256 .muxmask = uart0_nostreamctrl_muxmask,
257};
258
259static const unsigned uart0_nostreamctrl_pins[] = { 68, 69 };
260
261static const struct sirfsoc_muxmask uart1_muxmask[] = {
262 {
263 .group = 1,
264 .mask = BIT(15) | BIT(17),
265 },
266};
267
268static const struct sirfsoc_padmux uart1_padmux = {
269 .muxmask_counts = ARRAY_SIZE(uart1_muxmask),
270 .muxmask = uart1_muxmask,
271};
272
273static const unsigned uart1_pins[] = { 47, 49 };
274
275static const struct sirfsoc_muxmask uart2_muxmask[] = {
276 {
277 .group = 1,
278 .mask = BIT(16) | BIT(18) | BIT(24) | BIT(27),
279 },
280};
281
282static const struct sirfsoc_padmux uart2_padmux = {
283 .muxmask_counts = ARRAY_SIZE(uart2_muxmask),
284 .muxmask = uart2_muxmask,
285 .funcmask = BIT(10),
286 .funcval = BIT(10),
287};
288
289static const unsigned uart2_pins[] = { 48, 50, 56, 59 };
290
291static const struct sirfsoc_muxmask uart2_nostreamctrl_muxmask[] = {
292 {
293 .group = 1,
294 .mask = BIT(16) | BIT(18),
295 },
296};
297
298static const struct sirfsoc_padmux uart2_nostreamctrl_padmux = {
299 .muxmask_counts = ARRAY_SIZE(uart2_nostreamctrl_muxmask),
300 .muxmask = uart2_nostreamctrl_muxmask,
301};
302
303static const unsigned uart2_nostreamctrl_pins[] = { 48, 50 };
304
305static const struct sirfsoc_muxmask sdmmc3_muxmask[] = {
306 {
307 .group = 0,
308 .mask = BIT(30) | BIT(31),
309 }, {
310 .group = 1,
311 .mask = BIT(0) | BIT(1) | BIT(2) | BIT(3),
312 },
313};
314
315static const struct sirfsoc_padmux sdmmc3_padmux = {
316 .muxmask_counts = ARRAY_SIZE(sdmmc3_muxmask),
317 .muxmask = sdmmc3_muxmask,
318 .funcmask = BIT(7),
319 .funcval = 0,
320};
321
322static const unsigned sdmmc3_pins[] = { 30, 31, 32, 33, 34, 35 };
323
324static const struct sirfsoc_muxmask spi0_muxmask[] = {
325 {
326 .group = 1,
327 .mask = BIT(0) | BIT(1) | BIT(2) | BIT(3),
328 },
329};
330
331static const struct sirfsoc_padmux spi0_padmux = {
332 .muxmask_counts = ARRAY_SIZE(spi0_muxmask),
333 .muxmask = spi0_muxmask,
334 .funcmask = BIT(7),
335 .funcval = BIT(7),
336};
337
338static const unsigned spi0_pins[] = { 32, 33, 34, 35 };
339
340static const struct sirfsoc_muxmask sdmmc4_muxmask[] = {
341 {
342 .group = 1,
343 .mask = BIT(4) | BIT(5) | BIT(6) | BIT(7) | BIT(8) | BIT(9),
344 },
345};
346
347static const struct sirfsoc_padmux sdmmc4_padmux = {
348 .muxmask_counts = ARRAY_SIZE(sdmmc4_muxmask),
349 .muxmask = sdmmc4_muxmask,
350};
351
352static const unsigned sdmmc4_pins[] = { 36, 37, 38, 39, 40, 41 };
353
354static const struct sirfsoc_muxmask cko1_muxmask[] = {
355 {
356 .group = 1,
357 .mask = BIT(10),
358 },
359};
360
361static const struct sirfsoc_padmux cko1_padmux = {
362 .muxmask_counts = ARRAY_SIZE(cko1_muxmask),
363 .muxmask = cko1_muxmask,
364 .funcmask = BIT(3),
365 .funcval = 0,
366};
367
368static const unsigned cko1_pins[] = { 42 };
369
370static const struct sirfsoc_muxmask i2s_muxmask[] = {
371 {
372 .group = 1,
373 .mask =
374 BIT(10) | BIT(11) | BIT(12) | BIT(13) | BIT(14) | BIT(19)
375 | BIT(23) | BIT(28),
376 },
377};
378
379static const struct sirfsoc_padmux i2s_padmux = {
380 .muxmask_counts = ARRAY_SIZE(i2s_muxmask),
381 .muxmask = i2s_muxmask,
382 .funcmask = BIT(3) | BIT(9),
383 .funcval = BIT(3),
384};
385
386static const unsigned i2s_pins[] = { 42, 43, 44, 45, 46, 51, 55, 60 };
387
388static const struct sirfsoc_muxmask ac97_muxmask[] = {
389 {
390 .group = 1,
391 .mask = BIT(11) | BIT(12) | BIT(13) | BIT(14),
392 },
393};
394
395static const struct sirfsoc_padmux ac97_padmux = {
396 .muxmask_counts = ARRAY_SIZE(ac97_muxmask),
397 .muxmask = ac97_muxmask,
398 .funcmask = BIT(8),
399 .funcval = 0,
400};
401
402static const unsigned ac97_pins[] = { 33, 34, 35, 36 };
403
404static const struct sirfsoc_muxmask spi1_muxmask[] = {
405 {
406 .group = 1,
407 .mask = BIT(11) | BIT(12) | BIT(13) | BIT(14),
408 },
409};
410
411static const struct sirfsoc_padmux spi1_padmux = {
412 .muxmask_counts = ARRAY_SIZE(spi1_muxmask),
413 .muxmask = spi1_muxmask,
414 .funcmask = BIT(8),
415 .funcval = BIT(8),
416};
417
418static const unsigned spi1_pins[] = { 43, 44, 45, 46 };
419
420static const struct sirfsoc_muxmask sdmmc1_muxmask[] = {
421 {
422 .group = 0,
423 .mask = BIT(27) | BIT(28) | BIT(29),
424 },
425};
426
427static const struct sirfsoc_padmux sdmmc1_padmux = {
428 .muxmask_counts = ARRAY_SIZE(sdmmc1_muxmask),
429 .muxmask = sdmmc1_muxmask,
430};
431
432static const unsigned sdmmc1_pins[] = { 27, 28, 29 };
433
434static const struct sirfsoc_muxmask gps_muxmask[] = {
435 {
436 .group = 0,
437 .mask = BIT(24) | BIT(25) | BIT(26),
438 },
439};
440
441static const struct sirfsoc_padmux gps_padmux = {
442 .muxmask_counts = ARRAY_SIZE(gps_muxmask),
443 .muxmask = gps_muxmask,
444 .funcmask = BIT(12) | BIT(13) | BIT(14),
445 .funcval = BIT(12),
446};
447
448static const unsigned gps_pins[] = { 24, 25, 26 };
449
450static const struct sirfsoc_muxmask sdmmc5_muxmask[] = {
451 {
452 .group = 0,
453 .mask = BIT(24) | BIT(25) | BIT(26),
454 }, {
455 .group = 1,
456 .mask = BIT(29),
457 }, {
458 .group = 2,
459 .mask = BIT(0) | BIT(1),
460 },
461};
462
463static const struct sirfsoc_padmux sdmmc5_padmux = {
464 .muxmask_counts = ARRAY_SIZE(sdmmc5_muxmask),
465 .muxmask = sdmmc5_muxmask,
466 .funcmask = BIT(13) | BIT(14),
467 .funcval = BIT(13) | BIT(14),
468};
469
470static const unsigned sdmmc5_pins[] = { 24, 25, 26, 61, 64, 65 };
471
472static const struct sirfsoc_muxmask usp0_muxmask[] = {
473 {
474 .group = 1,
475 .mask = BIT(19) | BIT(20) | BIT(21) | BIT(22) | BIT(23),
476 },
477};
478
479static const struct sirfsoc_padmux usp0_padmux = {
480 .muxmask_counts = ARRAY_SIZE(usp0_muxmask),
481 .muxmask = usp0_muxmask,
482 .funcmask = BIT(1) | BIT(2) | BIT(6) | BIT(9),
483 .funcval = 0,
484};
485
486static const unsigned usp0_pins[] = { 51, 52, 53, 54, 55 };
487
Qipan Liaf614b22013-09-29 22:27:58 +0800488static const struct sirfsoc_muxmask usp0_uart_nostreamctrl_muxmask[] = {
489 {
490 .group = 1,
491 .mask = BIT(20) | BIT(21),
492 },
493};
494
495static const struct sirfsoc_padmux usp0_uart_nostreamctrl_padmux = {
496 .muxmask_counts = ARRAY_SIZE(usp0_uart_nostreamctrl_muxmask),
497 .muxmask = usp0_uart_nostreamctrl_muxmask,
498};
499
500static const unsigned usp0_uart_nostreamctrl_pins[] = { 52, 53 };
501
Barry Song3370dc92013-05-14 22:17:58 +0800502static const struct sirfsoc_muxmask usp1_muxmask[] = {
503 {
504 .group = 1,
505 .mask = BIT(24) | BIT(25) | BIT(26) | BIT(27) | BIT(28),
506 },
507};
508
509static const struct sirfsoc_padmux usp1_padmux = {
510 .muxmask_counts = ARRAY_SIZE(usp1_muxmask),
511 .muxmask = usp1_muxmask,
512 .funcmask = BIT(1) | BIT(9) | BIT(10) | BIT(11),
513 .funcval = 0,
514};
515
516static const unsigned usp1_pins[] = { 56, 57, 58, 59, 60 };
517
Qipan Liaf614b22013-09-29 22:27:58 +0800518static const struct sirfsoc_muxmask usp1_uart_nostreamctrl_muxmask[] = {
519 {
520 .group = 1,
521 .mask = BIT(25) | BIT(26),
522 },
523};
524
525static const struct sirfsoc_padmux usp1_uart_nostreamctrl_padmux = {
526 .muxmask_counts = ARRAY_SIZE(usp1_uart_nostreamctrl_muxmask),
527 .muxmask = usp1_uart_nostreamctrl_muxmask,
528};
529
530static const unsigned usp1_uart_nostreamctrl_pins[] = { 57, 58 };
531
Barry Song3370dc92013-05-14 22:17:58 +0800532static const struct sirfsoc_muxmask usp2_muxmask[] = {
533 {
534 .group = 1,
535 .mask = BIT(29) | BIT(30) | BIT(31),
536 }, {
537 .group = 2,
538 .mask = BIT(0) | BIT(1),
539 },
540};
541
542static const struct sirfsoc_padmux usp2_padmux = {
543 .muxmask_counts = ARRAY_SIZE(usp2_muxmask),
544 .muxmask = usp2_muxmask,
545 .funcmask = BIT(13) | BIT(14),
546 .funcval = 0,
547};
548
549static const unsigned usp2_pins[] = { 61, 62, 63, 64, 65 };
550
Qipan Liaf614b22013-09-29 22:27:58 +0800551static const struct sirfsoc_muxmask usp2_uart_nostreamctrl_muxmask[] = {
552 {
553 .group = 1,
554 .mask = BIT(30) | BIT(31),
555 },
556};
557
558static const struct sirfsoc_padmux usp2_uart_nostreamctrl_padmux = {
559 .muxmask_counts = ARRAY_SIZE(usp2_uart_nostreamctrl_muxmask),
560 .muxmask = usp2_uart_nostreamctrl_muxmask,
561};
562
563static const unsigned usp2_uart_nostreamctrl_pins[] = { 62, 63 };
564
Barry Song3370dc92013-05-14 22:17:58 +0800565static const struct sirfsoc_muxmask nand_muxmask[] = {
566 {
567 .group = 2,
568 .mask = BIT(2) | BIT(3) | BIT(28) | BIT(29) | BIT(30),
569 },
570};
571
572static const struct sirfsoc_padmux nand_padmux = {
573 .muxmask_counts = ARRAY_SIZE(nand_muxmask),
574 .muxmask = nand_muxmask,
575 .funcmask = BIT(5),
576 .funcval = 0,
577};
578
579static const unsigned nand_pins[] = { 64, 65, 92, 93, 94 };
580
581static const struct sirfsoc_padmux sdmmc0_padmux = {
582 .muxmask_counts = 0,
583 .funcmask = BIT(5),
584 .funcval = 0,
585};
586
587static const unsigned sdmmc0_pins[] = { };
588
589static const struct sirfsoc_muxmask sdmmc2_muxmask[] = {
590 {
591 .group = 2,
592 .mask = BIT(2) | BIT(3),
593 },
594};
595
596static const struct sirfsoc_padmux sdmmc2_padmux = {
597 .muxmask_counts = ARRAY_SIZE(sdmmc2_muxmask),
598 .muxmask = sdmmc2_muxmask,
599 .funcmask = BIT(5),
600 .funcval = BIT(5),
601};
602
603static const unsigned sdmmc2_pins[] = { 66, 67 };
604
605static const struct sirfsoc_muxmask cko0_muxmask[] = {
606 {
607 .group = 2,
608 .mask = BIT(14),
609 },
610};
611
612static const struct sirfsoc_padmux cko0_padmux = {
613 .muxmask_counts = ARRAY_SIZE(cko0_muxmask),
614 .muxmask = cko0_muxmask,
615};
616
617static const unsigned cko0_pins[] = { 78 };
618
619static const struct sirfsoc_muxmask vip_muxmask[] = {
620 {
621 .group = 2,
622 .mask = BIT(15) | BIT(16) | BIT(17) | BIT(18) | BIT(19)
623 | BIT(20) | BIT(21) | BIT(22) | BIT(23) | BIT(24) |
624 BIT(25),
625 },
626};
627
628static const struct sirfsoc_padmux vip_padmux = {
629 .muxmask_counts = ARRAY_SIZE(vip_muxmask),
630 .muxmask = vip_muxmask,
631 .funcmask = BIT(0),
632 .funcval = 0,
633};
634
635static const unsigned vip_pins[] = { 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 };
636
637static const struct sirfsoc_muxmask i2c0_muxmask[] = {
638 {
639 .group = 2,
640 .mask = BIT(26) | BIT(27),
641 },
642};
643
644static const struct sirfsoc_padmux i2c0_padmux = {
645 .muxmask_counts = ARRAY_SIZE(i2c0_muxmask),
646 .muxmask = i2c0_muxmask,
647};
648
649static const unsigned i2c0_pins[] = { 90, 91 };
650
651static const struct sirfsoc_muxmask i2c1_muxmask[] = {
652 {
653 .group = 0,
654 .mask = BIT(13) | BIT(15),
655 },
656};
657
658static const struct sirfsoc_padmux i2c1_padmux = {
659 .muxmask_counts = ARRAY_SIZE(i2c1_muxmask),
660 .muxmask = i2c1_muxmask,
661};
662
663static const unsigned i2c1_pins[] = { 13, 15 };
664
665static const struct sirfsoc_muxmask viprom_muxmask[] = {
666 {
667 .group = 2,
668 .mask = BIT(15) | BIT(16) | BIT(17) | BIT(18) | BIT(19)
669 | BIT(20) | BIT(21) | BIT(22) | BIT(23) | BIT(24) |
670 BIT(25),
671 }, {
672 .group = 0,
673 .mask = BIT(12),
674 },
675};
676
677static const struct sirfsoc_padmux viprom_padmux = {
678 .muxmask_counts = ARRAY_SIZE(viprom_muxmask),
679 .muxmask = viprom_muxmask,
680 .funcmask = BIT(0),
681 .funcval = BIT(0),
682};
683
684static const unsigned viprom_pins[] = { 12, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 };
685
686static const struct sirfsoc_muxmask pwm0_muxmask[] = {
687 {
688 .group = 0,
689 .mask = BIT(4),
690 },
691};
692
693static const struct sirfsoc_padmux pwm0_padmux = {
694 .muxmask_counts = ARRAY_SIZE(pwm0_muxmask),
695 .muxmask = pwm0_muxmask,
696 .funcmask = BIT(12),
697 .funcval = 0,
698};
699
700static const unsigned pwm0_pins[] = { 4 };
701
702static const struct sirfsoc_muxmask pwm1_muxmask[] = {
703 {
704 .group = 0,
705 .mask = BIT(5),
706 },
707};
708
709static const struct sirfsoc_padmux pwm1_padmux = {
710 .muxmask_counts = ARRAY_SIZE(pwm1_muxmask),
711 .muxmask = pwm1_muxmask,
712};
713
714static const unsigned pwm1_pins[] = { 5 };
715
716static const struct sirfsoc_muxmask pwm2_muxmask[] = {
717 {
718 .group = 0,
719 .mask = BIT(6),
720 },
721};
722
723static const struct sirfsoc_padmux pwm2_padmux = {
724 .muxmask_counts = ARRAY_SIZE(pwm2_muxmask),
725 .muxmask = pwm2_muxmask,
726};
727
728static const unsigned pwm2_pins[] = { 6 };
729
730static const struct sirfsoc_muxmask pwm3_muxmask[] = {
731 {
732 .group = 0,
733 .mask = BIT(7),
734 },
735};
736
737static const struct sirfsoc_padmux pwm3_padmux = {
738 .muxmask_counts = ARRAY_SIZE(pwm3_muxmask),
739 .muxmask = pwm3_muxmask,
740};
741
742static const unsigned pwm3_pins[] = { 7 };
743
744static const struct sirfsoc_muxmask warm_rst_muxmask[] = {
745 {
746 .group = 0,
747 .mask = BIT(8),
748 },
749};
750
751static const struct sirfsoc_padmux warm_rst_padmux = {
752 .muxmask_counts = ARRAY_SIZE(warm_rst_muxmask),
753 .muxmask = warm_rst_muxmask,
754};
755
756static const unsigned warm_rst_pins[] = { 8 };
757
758static const struct sirfsoc_muxmask usb0_utmi_drvbus_muxmask[] = {
759 {
760 .group = 1,
761 .mask = BIT(22),
762 },
763};
764static const struct sirfsoc_padmux usb0_utmi_drvbus_padmux = {
765 .muxmask_counts = ARRAY_SIZE(usb0_utmi_drvbus_muxmask),
766 .muxmask = usb0_utmi_drvbus_muxmask,
767 .funcmask = BIT(6),
768 .funcval = BIT(6), /* refer to PAD_UTMI_DRVVBUS0_ENABLE */
769};
770
771static const unsigned usb0_utmi_drvbus_pins[] = { 54 };
772
773static const struct sirfsoc_muxmask usb1_utmi_drvbus_muxmask[] = {
774 {
775 .group = 1,
776 .mask = BIT(27),
777 },
778};
779
780static const struct sirfsoc_padmux usb1_utmi_drvbus_padmux = {
781 .muxmask_counts = ARRAY_SIZE(usb1_utmi_drvbus_muxmask),
782 .muxmask = usb1_utmi_drvbus_muxmask,
783 .funcmask = BIT(11),
784 .funcval = BIT(11), /* refer to PAD_UTMI_DRVVBUS1_ENABLE */
785};
786
787static const unsigned usb1_utmi_drvbus_pins[] = { 59 };
788
789static const struct sirfsoc_muxmask pulse_count_muxmask[] = {
790 {
791 .group = 0,
792 .mask = BIT(9) | BIT(10) | BIT(11),
793 },
794};
795
796static const struct sirfsoc_padmux pulse_count_padmux = {
797 .muxmask_counts = ARRAY_SIZE(pulse_count_muxmask),
798 .muxmask = pulse_count_muxmask,
799};
800
801static const unsigned pulse_count_pins[] = { 9, 10, 11 };
802
803static const struct sirfsoc_pin_group sirfsoc_pin_groups[] = {
804 SIRFSOC_PIN_GROUP("lcd_16bitsgrp", lcd_16bits_pins),
805 SIRFSOC_PIN_GROUP("lcd_18bitsgrp", lcd_18bits_pins),
806 SIRFSOC_PIN_GROUP("lcd_24bitsgrp", lcd_24bits_pins),
807 SIRFSOC_PIN_GROUP("lcdrom_grp", lcdrom_pins),
808 SIRFSOC_PIN_GROUP("uart0grp", uart0_pins),
Qipan Lifb85f422013-09-29 22:27:57 +0800809 SIRFSOC_PIN_GROUP("uart0_nostreamctrlgrp", uart0_nostreamctrl_pins),
Barry Song3370dc92013-05-14 22:17:58 +0800810 SIRFSOC_PIN_GROUP("uart1grp", uart1_pins),
811 SIRFSOC_PIN_GROUP("uart2grp", uart2_pins),
812 SIRFSOC_PIN_GROUP("uart2_nostreamctrlgrp", uart2_nostreamctrl_pins),
813 SIRFSOC_PIN_GROUP("usp0grp", usp0_pins),
Qipan Liaf614b22013-09-29 22:27:58 +0800814 SIRFSOC_PIN_GROUP("usp0_uart_nostreamctrl_grp",
815 usp0_uart_nostreamctrl_pins),
Barry Song3370dc92013-05-14 22:17:58 +0800816 SIRFSOC_PIN_GROUP("usp1grp", usp1_pins),
Qipan Liaf614b22013-09-29 22:27:58 +0800817 SIRFSOC_PIN_GROUP("usp1_uart_nostreamctrl_grp",
818 usp1_uart_nostreamctrl_pins),
Barry Song3370dc92013-05-14 22:17:58 +0800819 SIRFSOC_PIN_GROUP("usp2grp", usp2_pins),
Qipan Liaf614b22013-09-29 22:27:58 +0800820 SIRFSOC_PIN_GROUP("usp2_uart_nostreamctrl_grp",
821 usp2_uart_nostreamctrl_pins),
Barry Song3370dc92013-05-14 22:17:58 +0800822 SIRFSOC_PIN_GROUP("i2c0grp", i2c0_pins),
823 SIRFSOC_PIN_GROUP("i2c1grp", i2c1_pins),
824 SIRFSOC_PIN_GROUP("pwm0grp", pwm0_pins),
825 SIRFSOC_PIN_GROUP("pwm1grp", pwm1_pins),
826 SIRFSOC_PIN_GROUP("pwm2grp", pwm2_pins),
827 SIRFSOC_PIN_GROUP("pwm3grp", pwm3_pins),
828 SIRFSOC_PIN_GROUP("vipgrp", vip_pins),
829 SIRFSOC_PIN_GROUP("vipromgrp", viprom_pins),
830 SIRFSOC_PIN_GROUP("warm_rstgrp", warm_rst_pins),
831 SIRFSOC_PIN_GROUP("cko0grp", cko0_pins),
832 SIRFSOC_PIN_GROUP("cko1grp", cko1_pins),
833 SIRFSOC_PIN_GROUP("sdmmc0grp", sdmmc0_pins),
834 SIRFSOC_PIN_GROUP("sdmmc1grp", sdmmc1_pins),
835 SIRFSOC_PIN_GROUP("sdmmc2grp", sdmmc2_pins),
836 SIRFSOC_PIN_GROUP("sdmmc3grp", sdmmc3_pins),
837 SIRFSOC_PIN_GROUP("sdmmc4grp", sdmmc4_pins),
838 SIRFSOC_PIN_GROUP("sdmmc5grp", sdmmc5_pins),
839 SIRFSOC_PIN_GROUP("usb0_utmi_drvbusgrp", usb0_utmi_drvbus_pins),
840 SIRFSOC_PIN_GROUP("usb1_utmi_drvbusgrp", usb1_utmi_drvbus_pins),
841 SIRFSOC_PIN_GROUP("pulse_countgrp", pulse_count_pins),
842 SIRFSOC_PIN_GROUP("i2sgrp", i2s_pins),
843 SIRFSOC_PIN_GROUP("ac97grp", ac97_pins),
844 SIRFSOC_PIN_GROUP("nandgrp", nand_pins),
845 SIRFSOC_PIN_GROUP("spi0grp", spi0_pins),
846 SIRFSOC_PIN_GROUP("spi1grp", spi1_pins),
847 SIRFSOC_PIN_GROUP("gpsgrp", gps_pins),
848};
849
850static const char * const lcd_16bitsgrp[] = { "lcd_16bitsgrp" };
851static const char * const lcd_18bitsgrp[] = { "lcd_18bitsgrp" };
852static const char * const lcd_24bitsgrp[] = { "lcd_24bitsgrp" };
853static const char * const lcdromgrp[] = { "lcdromgrp" };
854static const char * const uart0grp[] = { "uart0grp" };
Qipan Lifb85f422013-09-29 22:27:57 +0800855static const char * const uart0_nostreamctrlgrp[] = { "uart0_nostreamctrlgrp" };
Barry Song3370dc92013-05-14 22:17:58 +0800856static const char * const uart1grp[] = { "uart1grp" };
857static const char * const uart2grp[] = { "uart2grp" };
858static const char * const uart2_nostreamctrlgrp[] = { "uart2_nostreamctrlgrp" };
859static const char * const usp0grp[] = { "usp0grp" };
Qipan Liaf614b22013-09-29 22:27:58 +0800860static const char * const usp0_uart_nostreamctrl_grp[] =
861 { "usp0_uart_nostreamctrl_grp" };
Barry Song3370dc92013-05-14 22:17:58 +0800862static const char * const usp1grp[] = { "usp1grp" };
Qipan Liaf614b22013-09-29 22:27:58 +0800863static const char * const usp1_uart_nostreamctrl_grp[] =
864 { "usp1_uart_nostreamctrl_grp" };
Barry Song3370dc92013-05-14 22:17:58 +0800865static const char * const usp2grp[] = { "usp2grp" };
Qipan Liaf614b22013-09-29 22:27:58 +0800866static const char * const usp2_uart_nostreamctrl_grp[] =
867 { "usp2_uart_nostreamctrl_grp" };
Barry Song3370dc92013-05-14 22:17:58 +0800868static const char * const i2c0grp[] = { "i2c0grp" };
869static const char * const i2c1grp[] = { "i2c1grp" };
870static const char * const pwm0grp[] = { "pwm0grp" };
871static const char * const pwm1grp[] = { "pwm1grp" };
872static const char * const pwm2grp[] = { "pwm2grp" };
873static const char * const pwm3grp[] = { "pwm3grp" };
874static const char * const vipgrp[] = { "vipgrp" };
875static const char * const vipromgrp[] = { "vipromgrp" };
876static const char * const warm_rstgrp[] = { "warm_rstgrp" };
877static const char * const cko0grp[] = { "cko0grp" };
878static const char * const cko1grp[] = { "cko1grp" };
879static const char * const sdmmc0grp[] = { "sdmmc0grp" };
880static const char * const sdmmc1grp[] = { "sdmmc1grp" };
881static const char * const sdmmc2grp[] = { "sdmmc2grp" };
882static const char * const sdmmc3grp[] = { "sdmmc3grp" };
883static const char * const sdmmc4grp[] = { "sdmmc4grp" };
884static const char * const sdmmc5grp[] = { "sdmmc5grp" };
885static const char * const usb0_utmi_drvbusgrp[] = { "usb0_utmi_drvbusgrp" };
886static const char * const usb1_utmi_drvbusgrp[] = { "usb1_utmi_drvbusgrp" };
887static const char * const pulse_countgrp[] = { "pulse_countgrp" };
888static const char * const i2sgrp[] = { "i2sgrp" };
889static const char * const ac97grp[] = { "ac97grp" };
890static const char * const nandgrp[] = { "nandgrp" };
891static const char * const spi0grp[] = { "spi0grp" };
892static const char * const spi1grp[] = { "spi1grp" };
893static const char * const gpsgrp[] = { "gpsgrp" };
894
895static const struct sirfsoc_pmx_func sirfsoc_pmx_functions[] = {
896 SIRFSOC_PMX_FUNCTION("lcd_16bits", lcd_16bitsgrp, lcd_16bits_padmux),
897 SIRFSOC_PMX_FUNCTION("lcd_18bits", lcd_18bitsgrp, lcd_18bits_padmux),
898 SIRFSOC_PMX_FUNCTION("lcd_24bits", lcd_24bitsgrp, lcd_24bits_padmux),
899 SIRFSOC_PMX_FUNCTION("lcdrom", lcdromgrp, lcdrom_padmux),
900 SIRFSOC_PMX_FUNCTION("uart0", uart0grp, uart0_padmux),
Qipan Lifb85f422013-09-29 22:27:57 +0800901 SIRFSOC_PMX_FUNCTION("uart0_nostreamctrl", uart0_nostreamctrlgrp, uart0_nostreamctrl_padmux),
Barry Song3370dc92013-05-14 22:17:58 +0800902 SIRFSOC_PMX_FUNCTION("uart1", uart1grp, uart1_padmux),
903 SIRFSOC_PMX_FUNCTION("uart2", uart2grp, uart2_padmux),
904 SIRFSOC_PMX_FUNCTION("uart2_nostreamctrl", uart2_nostreamctrlgrp, uart2_nostreamctrl_padmux),
905 SIRFSOC_PMX_FUNCTION("usp0", usp0grp, usp0_padmux),
Qipan Liaf614b22013-09-29 22:27:58 +0800906 SIRFSOC_PMX_FUNCTION("usp0_uart_nostreamctrl",
907 usp0_uart_nostreamctrl_grp, usp0_uart_nostreamctrl_padmux),
Barry Song3370dc92013-05-14 22:17:58 +0800908 SIRFSOC_PMX_FUNCTION("usp1", usp1grp, usp1_padmux),
Qipan Liaf614b22013-09-29 22:27:58 +0800909 SIRFSOC_PMX_FUNCTION("usp1_uart_nostreamctrl",
910 usp1_uart_nostreamctrl_grp, usp1_uart_nostreamctrl_padmux),
Barry Song3370dc92013-05-14 22:17:58 +0800911 SIRFSOC_PMX_FUNCTION("usp2", usp2grp, usp2_padmux),
Qipan Liaf614b22013-09-29 22:27:58 +0800912 SIRFSOC_PMX_FUNCTION("usp2_uart_nostreamctrl",
913 usp2_uart_nostreamctrl_grp, usp2_uart_nostreamctrl_padmux),
Barry Song3370dc92013-05-14 22:17:58 +0800914 SIRFSOC_PMX_FUNCTION("i2c0", i2c0grp, i2c0_padmux),
915 SIRFSOC_PMX_FUNCTION("i2c1", i2c1grp, i2c1_padmux),
916 SIRFSOC_PMX_FUNCTION("pwm0", pwm0grp, pwm0_padmux),
917 SIRFSOC_PMX_FUNCTION("pwm1", pwm1grp, pwm1_padmux),
918 SIRFSOC_PMX_FUNCTION("pwm2", pwm2grp, pwm2_padmux),
919 SIRFSOC_PMX_FUNCTION("pwm3", pwm3grp, pwm3_padmux),
920 SIRFSOC_PMX_FUNCTION("vip", vipgrp, vip_padmux),
921 SIRFSOC_PMX_FUNCTION("viprom", vipromgrp, viprom_padmux),
922 SIRFSOC_PMX_FUNCTION("warm_rst", warm_rstgrp, warm_rst_padmux),
923 SIRFSOC_PMX_FUNCTION("cko0", cko0grp, cko0_padmux),
924 SIRFSOC_PMX_FUNCTION("cko1", cko1grp, cko1_padmux),
925 SIRFSOC_PMX_FUNCTION("sdmmc0", sdmmc0grp, sdmmc0_padmux),
926 SIRFSOC_PMX_FUNCTION("sdmmc1", sdmmc1grp, sdmmc1_padmux),
927 SIRFSOC_PMX_FUNCTION("sdmmc2", sdmmc2grp, sdmmc2_padmux),
928 SIRFSOC_PMX_FUNCTION("sdmmc3", sdmmc3grp, sdmmc3_padmux),
929 SIRFSOC_PMX_FUNCTION("sdmmc4", sdmmc4grp, sdmmc4_padmux),
930 SIRFSOC_PMX_FUNCTION("sdmmc5", sdmmc5grp, sdmmc5_padmux),
931 SIRFSOC_PMX_FUNCTION("usb0_utmi_drvbus", usb0_utmi_drvbusgrp, usb0_utmi_drvbus_padmux),
932 SIRFSOC_PMX_FUNCTION("usb1_utmi_drvbus", usb1_utmi_drvbusgrp, usb1_utmi_drvbus_padmux),
933 SIRFSOC_PMX_FUNCTION("pulse_count", pulse_countgrp, pulse_count_padmux),
934 SIRFSOC_PMX_FUNCTION("i2s", i2sgrp, i2s_padmux),
935 SIRFSOC_PMX_FUNCTION("ac97", ac97grp, ac97_padmux),
936 SIRFSOC_PMX_FUNCTION("nand", nandgrp, nand_padmux),
937 SIRFSOC_PMX_FUNCTION("spi0", spi0grp, spi0_padmux),
938 SIRFSOC_PMX_FUNCTION("spi1", spi1grp, spi1_padmux),
939 SIRFSOC_PMX_FUNCTION("gps", gpsgrp, gps_padmux),
940};
941
942struct sirfsoc_pinctrl_data prima2_pinctrl_data = {
943 (struct pinctrl_pin_desc *)sirfsoc_pads,
944 ARRAY_SIZE(sirfsoc_pads),
945 (struct sirfsoc_pin_group *)sirfsoc_pin_groups,
946 ARRAY_SIZE(sirfsoc_pin_groups),
947 (struct sirfsoc_pmx_func *)sirfsoc_pmx_functions,
948 ARRAY_SIZE(sirfsoc_pmx_functions),
949};
950