forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 134
/
Copy pathpinctrl-npcm7xx.c
2166 lines (1972 loc) · 76.1 KB
/
pinctrl-npcm7xx.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2016-2018 Nuvoton Technology corporation.
// Copyright (c) 2016, Dell Inc
#include <linux/device.h>
#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/pinctrl/machine.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
/* GCR registers */
#define NPCM7XX_GCR_PDID 0x00
#define NPCM7XX_GCR_MFSEL1 0x0C
#define NPCM7XX_GCR_MFSEL2 0x10
#define NPCM7XX_GCR_MFSEL3 0x64
#define NPCM7XX_GCR_MFSEL4 0xb0
#define NPCM7XX_GCR_CPCTL 0xD0
#define NPCM7XX_GCR_CP2BST 0xD4
#define NPCM7XX_GCR_B2CPNT 0xD8
#define NPCM7XX_GCR_I2CSEGSEL 0xE0
#define NPCM7XX_GCR_I2CSEGCTL 0xE4
#define NPCM7XX_GCR_SRCNT 0x68
#define NPCM7XX_GCR_FLOCKR1 0x74
#define NPCM7XX_GCR_DSCNT 0x78
#define SRCNT_ESPI BIT(3)
/* reset registers */
#define NPCM7XX_RST_WD0RCR 0x38
#define NPCM7XX_RST_WD1RCR 0x3C
#define NPCM7XX_RST_WD2RCR 0x40
#define NPCM7XX_RST_SWRSTC1 0x44
#define NPCM7XX_RST_SWRSTC2 0x48
#define NPCM7XX_RST_SWRSTC3 0x4C
#define NPCM7XX_RST_SWRSTC4 0x50
#define NPCM7XX_RST_CORSTC 0x5C
#define GPIOX_MODULE_RESET BIT(16)
#define CA9C_MODULE_RESET BIT(0)
/* GPIO registers */
#define NPCM7XX_GP_N_TLOCK1 0x00
#define NPCM7XX_GP_N_DIN 0x04 /* Data IN */
#define NPCM7XX_GP_N_POL 0x08 /* Polarity */
#define NPCM7XX_GP_N_DOUT 0x0c /* Data OUT */
#define NPCM7XX_GP_N_OE 0x10 /* Output Enable */
#define NPCM7XX_GP_N_OTYP 0x14
#define NPCM7XX_GP_N_MP 0x18
#define NPCM7XX_GP_N_PU 0x1c /* Pull-up */
#define NPCM7XX_GP_N_PD 0x20 /* Pull-down */
#define NPCM7XX_GP_N_DBNC 0x24 /* Debounce */
#define NPCM7XX_GP_N_EVTYP 0x28 /* Event Type */
#define NPCM7XX_GP_N_EVBE 0x2c /* Event Both Edge */
#define NPCM7XX_GP_N_OBL0 0x30
#define NPCM7XX_GP_N_OBL1 0x34
#define NPCM7XX_GP_N_OBL2 0x38
#define NPCM7XX_GP_N_OBL3 0x3c
#define NPCM7XX_GP_N_EVEN 0x40 /* Event Enable */
#define NPCM7XX_GP_N_EVENS 0x44 /* Event Set (enable) */
#define NPCM7XX_GP_N_EVENC 0x48 /* Event Clear (disable) */
#define NPCM7XX_GP_N_EVST 0x4c /* Event Status */
#define NPCM7XX_GP_N_SPLCK 0x50
#define NPCM7XX_GP_N_MPLCK 0x54
#define NPCM7XX_GP_N_IEM 0x58 /* Input Enable */
#define NPCM7XX_GP_N_OSRC 0x5c
#define NPCM7XX_GP_N_ODSC 0x60
#define NPCM7XX_GP_N_DOS 0x68 /* Data OUT Set */
#define NPCM7XX_GP_N_DOC 0x6c /* Data OUT Clear */
#define NPCM7XX_GP_N_OES 0x70 /* Output Enable Set */
#define NPCM7XX_GP_N_OEC 0x74 /* Output Enable Clear */
#define NPCM7XX_GP_N_TLOCK2 0x7c
#define NPCM7XX_GPIO_PER_BANK 32
#define NPCM7XX_GPIO_BANK_NUM 8
#define NPCM7XX_GCR_NONE 0
/* Structure for register banks */
struct npcm7xx_gpio {
void __iomem *base;
struct gpio_chip gc;
int irqbase;
int irq;
void *priv;
struct irq_chip irq_chip;
u32 pinctrl_id;
int (*direction_input)(struct gpio_chip *chip, unsigned offset);
int (*direction_output)(struct gpio_chip *chip, unsigned offset,
int value);
int (*request)(struct gpio_chip *chip, unsigned offset);
void (*free)(struct gpio_chip *chip, unsigned offset);
};
struct npcm7xx_pinctrl {
struct pinctrl_dev *pctldev;
struct device *dev;
struct npcm7xx_gpio gpio_bank[NPCM7XX_GPIO_BANK_NUM];
struct irq_domain *domain;
struct regmap *gcr_regmap;
struct regmap *rst_regmap;
void __iomem *regs;
u32 bank_num;
};
/* GPIO handling in the pinctrl driver */
static void npcm_gpio_set(struct gpio_chip *gc, void __iomem *reg,
unsigned int pinmask)
{
unsigned long flags;
unsigned long val;
spin_lock_irqsave(&gc->bgpio_lock, flags);
val = ioread32(reg) | pinmask;
iowrite32(val, reg);
spin_unlock_irqrestore(&gc->bgpio_lock, flags);
}
static void npcm_gpio_clr(struct gpio_chip *gc, void __iomem *reg,
unsigned int pinmask)
{
unsigned long flags;
unsigned long val;
spin_lock_irqsave(&gc->bgpio_lock, flags);
val = ioread32(reg) & ~pinmask;
iowrite32(val, reg);
spin_unlock_irqrestore(&gc->bgpio_lock, flags);
}
static void npcmgpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
{
struct npcm7xx_gpio *bank = gpiochip_get_data(chip);
seq_printf(s, "-- module %d [gpio%d - %d]\n",
bank->gc.base / bank->gc.ngpio,
bank->gc.base,
bank->gc.base + bank->gc.ngpio);
seq_printf(s, "DIN :%.8x DOUT:%.8x IE :%.8x OE :%.8x\n",
ioread32(bank->base + NPCM7XX_GP_N_DIN),
ioread32(bank->base + NPCM7XX_GP_N_DOUT),
ioread32(bank->base + NPCM7XX_GP_N_IEM),
ioread32(bank->base + NPCM7XX_GP_N_OE));
seq_printf(s, "PU :%.8x PD :%.8x DB :%.8x POL :%.8x\n",
ioread32(bank->base + NPCM7XX_GP_N_PU),
ioread32(bank->base + NPCM7XX_GP_N_PD),
ioread32(bank->base + NPCM7XX_GP_N_DBNC),
ioread32(bank->base + NPCM7XX_GP_N_POL));
seq_printf(s, "ETYP:%.8x EVBE:%.8x EVEN:%.8x EVST:%.8x\n",
ioread32(bank->base + NPCM7XX_GP_N_EVTYP),
ioread32(bank->base + NPCM7XX_GP_N_EVBE),
ioread32(bank->base + NPCM7XX_GP_N_EVEN),
ioread32(bank->base + NPCM7XX_GP_N_EVST));
seq_printf(s, "OTYP:%.8x OSRC:%.8x ODSC:%.8x\n",
ioread32(bank->base + NPCM7XX_GP_N_OTYP),
ioread32(bank->base + NPCM7XX_GP_N_OSRC),
ioread32(bank->base + NPCM7XX_GP_N_ODSC));
seq_printf(s, "OBL0:%.8x OBL1:%.8x OBL2:%.8x OBL3:%.8x\n",
ioread32(bank->base + NPCM7XX_GP_N_OBL0),
ioread32(bank->base + NPCM7XX_GP_N_OBL1),
ioread32(bank->base + NPCM7XX_GP_N_OBL2),
ioread32(bank->base + NPCM7XX_GP_N_OBL3));
seq_printf(s, "SLCK:%.8x MLCK:%.8x\n",
ioread32(bank->base + NPCM7XX_GP_N_SPLCK),
ioread32(bank->base + NPCM7XX_GP_N_MPLCK));
}
static int npcmgpio_direction_input(struct gpio_chip *chip, unsigned int offset)
{
struct npcm7xx_gpio *bank = gpiochip_get_data(chip);
int ret;
ret = pinctrl_gpio_direction_input(offset + chip->base);
if (ret)
return ret;
return bank->direction_input(chip, offset);
}
/* Set GPIO to Output with initial value */
static int npcmgpio_direction_output(struct gpio_chip *chip,
unsigned int offset, int value)
{
struct npcm7xx_gpio *bank = gpiochip_get_data(chip);
int ret;
dev_dbg(chip->parent, "gpio_direction_output: offset%d = %x\n", offset,
value);
ret = pinctrl_gpio_direction_output(offset + chip->base);
if (ret)
return ret;
return bank->direction_output(chip, offset, value);
}
static int npcmgpio_gpio_request(struct gpio_chip *chip, unsigned int offset)
{
struct npcm7xx_gpio *bank = gpiochip_get_data(chip);
int ret;
dev_dbg(chip->parent, "gpio_request: offset%d\n", offset);
ret = pinctrl_gpio_request(offset + chip->base);
if (ret)
return ret;
return bank->request(chip, offset);
}
static void npcmgpio_gpio_free(struct gpio_chip *chip, unsigned int offset)
{
dev_dbg(chip->parent, "gpio_free: offset%d\n", offset);
pinctrl_gpio_free(offset + chip->base);
}
static void npcmgpio_irq_handler(struct irq_desc *desc)
{
struct gpio_chip *gc;
struct irq_chip *chip;
struct npcm7xx_gpio *bank;
u32 sts, en, bit;
gc = irq_desc_get_handler_data(desc);
bank = gpiochip_get_data(gc);
chip = irq_desc_get_chip(desc);
chained_irq_enter(chip, desc);
sts = ioread32(bank->base + NPCM7XX_GP_N_EVST);
en = ioread32(bank->base + NPCM7XX_GP_N_EVEN);
dev_dbg(chip->parent_device, "==> got irq sts %.8x %.8x\n", sts,
en);
sts &= en;
for_each_set_bit(bit, (const void *)&sts, NPCM7XX_GPIO_PER_BANK)
generic_handle_irq(irq_linear_revmap(gc->irq.domain, bit));
chained_irq_exit(chip, desc);
}
static int npcmgpio_set_irq_type(struct irq_data *d, unsigned int type)
{
struct npcm7xx_gpio *bank =
gpiochip_get_data(irq_data_get_irq_chip_data(d));
unsigned int gpio = BIT(d->hwirq);
dev_dbg(d->chip->parent_device, "setirqtype: %u.%u = %u\n", gpio,
d->irq, type);
switch (type) {
case IRQ_TYPE_EDGE_RISING:
dev_dbg(d->chip->parent_device, "edge.rising\n");
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_EVBE, gpio);
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_POL, gpio);
break;
case IRQ_TYPE_EDGE_FALLING:
dev_dbg(d->chip->parent_device, "edge.falling\n");
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_EVBE, gpio);
npcm_gpio_set(&bank->gc, bank->base + NPCM7XX_GP_N_POL, gpio);
break;
case IRQ_TYPE_EDGE_BOTH:
dev_dbg(d->chip->parent_device, "edge.both\n");
npcm_gpio_set(&bank->gc, bank->base + NPCM7XX_GP_N_EVBE, gpio);
break;
case IRQ_TYPE_LEVEL_LOW:
dev_dbg(d->chip->parent_device, "level.low\n");
npcm_gpio_set(&bank->gc, bank->base + NPCM7XX_GP_N_POL, gpio);
break;
case IRQ_TYPE_LEVEL_HIGH:
dev_dbg(d->chip->parent_device, "level.high\n");
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_POL, gpio);
break;
default:
dev_dbg(d->chip->parent_device, "invalid irq type\n");
return -EINVAL;
}
if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
npcm_gpio_clr(&bank->gc, bank->base + NPCM7XX_GP_N_EVTYP, gpio);
irq_set_handler_locked(d, handle_level_irq);
} else if (type & (IRQ_TYPE_EDGE_BOTH | IRQ_TYPE_EDGE_RISING
| IRQ_TYPE_EDGE_FALLING)) {
npcm_gpio_set(&bank->gc, bank->base + NPCM7XX_GP_N_EVTYP, gpio);
irq_set_handler_locked(d, handle_edge_irq);
}
return 0;
}
static void npcmgpio_irq_ack(struct irq_data *d)
{
struct npcm7xx_gpio *bank =
gpiochip_get_data(irq_data_get_irq_chip_data(d));
unsigned int gpio = d->hwirq;
dev_dbg(d->chip->parent_device, "irq_ack: %u.%u\n", gpio, d->irq);
iowrite32(BIT(gpio), bank->base + NPCM7XX_GP_N_EVST);
}
/* Disable GPIO interrupt */
static void npcmgpio_irq_mask(struct irq_data *d)
{
struct npcm7xx_gpio *bank =
gpiochip_get_data(irq_data_get_irq_chip_data(d));
unsigned int gpio = d->hwirq;
/* Clear events */
dev_dbg(d->chip->parent_device, "irq_mask: %u.%u\n", gpio, d->irq);
iowrite32(BIT(gpio), bank->base + NPCM7XX_GP_N_EVENC);
}
/* Enable GPIO interrupt */
static void npcmgpio_irq_unmask(struct irq_data *d)
{
struct npcm7xx_gpio *bank =
gpiochip_get_data(irq_data_get_irq_chip_data(d));
unsigned int gpio = d->hwirq;
/* Enable events */
dev_dbg(d->chip->parent_device, "irq_unmask: %u.%u\n", gpio, d->irq);
iowrite32(BIT(gpio), bank->base + NPCM7XX_GP_N_EVENS);
}
static unsigned int npcmgpio_irq_startup(struct irq_data *d)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
unsigned int gpio = d->hwirq;
/* active-high, input, clear interrupt, enable interrupt */
dev_dbg(d->chip->parent_device, "startup: %u.%u\n", gpio, d->irq);
npcmgpio_direction_input(gc, gpio);
npcmgpio_irq_ack(d);
npcmgpio_irq_unmask(d);
return 0;
}
static const struct irq_chip npcmgpio_irqchip = {
.name = "NPCM7XX-GPIO-IRQ",
.irq_ack = npcmgpio_irq_ack,
.irq_unmask = npcmgpio_irq_unmask,
.irq_mask = npcmgpio_irq_mask,
.irq_set_type = npcmgpio_set_irq_type,
.irq_startup = npcmgpio_irq_startup,
};
/* pinmux handing in the pinctrl driver*/
static const int smb0_pins[] = { 115, 114 };
static const int smb0b_pins[] = { 195, 194 };
static const int smb0c_pins[] = { 202, 196 };
static const int smb0d_pins[] = { 198, 199 };
static const int smb0den_pins[] = { 197 };
static const int smb1_pins[] = { 117, 116 };
static const int smb1b_pins[] = { 126, 127 };
static const int smb1c_pins[] = { 124, 125 };
static const int smb1d_pins[] = { 4, 5 };
static const int smb2_pins[] = { 119, 118 };
static const int smb2b_pins[] = { 122, 123 };
static const int smb2c_pins[] = { 120, 121 };
static const int smb2d_pins[] = { 6, 7 };
static const int smb3_pins[] = { 30, 31 };
static const int smb3b_pins[] = { 39, 40 };
static const int smb3c_pins[] = { 37, 38 };
static const int smb3d_pins[] = { 59, 60 };
static const int smb4_pins[] = { 28, 29 };
static const int smb4b_pins[] = { 18, 19 };
static const int smb4c_pins[] = { 20, 21 };
static const int smb4d_pins[] = { 22, 23 };
static const int smb4den_pins[] = { 17 };
static const int smb5_pins[] = { 26, 27 };
static const int smb5b_pins[] = { 13, 12 };
static const int smb5c_pins[] = { 15, 14 };
static const int smb5d_pins[] = { 94, 93 };
static const int ga20kbc_pins[] = { 94, 93 };
static const int smb6_pins[] = { 172, 171 };
static const int smb7_pins[] = { 174, 173 };
static const int smb8_pins[] = { 129, 128 };
static const int smb9_pins[] = { 131, 130 };
static const int smb10_pins[] = { 133, 132 };
static const int smb11_pins[] = { 135, 134 };
static const int smb12_pins[] = { 221, 220 };
static const int smb13_pins[] = { 223, 222 };
static const int smb14_pins[] = { 22, 23 };
static const int smb15_pins[] = { 20, 21 };
static const int fanin0_pins[] = { 64 };
static const int fanin1_pins[] = { 65 };
static const int fanin2_pins[] = { 66 };
static const int fanin3_pins[] = { 67 };
static const int fanin4_pins[] = { 68 };
static const int fanin5_pins[] = { 69 };
static const int fanin6_pins[] = { 70 };
static const int fanin7_pins[] = { 71 };
static const int fanin8_pins[] = { 72 };
static const int fanin9_pins[] = { 73 };
static const int fanin10_pins[] = { 74 };
static const int fanin11_pins[] = { 75 };
static const int fanin12_pins[] = { 76 };
static const int fanin13_pins[] = { 77 };
static const int fanin14_pins[] = { 78 };
static const int fanin15_pins[] = { 79 };
static const int faninx_pins[] = { 175, 176, 177, 203 };
static const int pwm0_pins[] = { 80 };
static const int pwm1_pins[] = { 81 };
static const int pwm2_pins[] = { 82 };
static const int pwm3_pins[] = { 83 };
static const int pwm4_pins[] = { 144 };
static const int pwm5_pins[] = { 145 };
static const int pwm6_pins[] = { 146 };
static const int pwm7_pins[] = { 147 };
static const int uart1_pins[] = { 43, 44, 45, 46, 47, 61, 62, 63 };
static const int uart2_pins[] = { 48, 49, 50, 51, 52, 53, 54, 55 };
/* RGMII 1 pin group */
static const int rg1_pins[] = { 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
106, 107 };
/* RGMII 1 MD interface pin group */
static const int rg1mdio_pins[] = { 108, 109 };
/* RGMII 2 pin group */
static const int rg2_pins[] = { 110, 111, 112, 113, 208, 209, 210, 211, 212,
213, 214, 215 };
/* RGMII 2 MD interface pin group */
static const int rg2mdio_pins[] = { 216, 217 };
static const int ddr_pins[] = { 110, 111, 112, 113, 208, 209, 210, 211, 212,
213, 214, 215, 216, 217 };
/* Serial I/O Expander 1 */
static const int iox1_pins[] = { 0, 1, 2, 3 };
/* Serial I/O Expander 2 */
static const int iox2_pins[] = { 4, 5, 6, 7 };
/* Host Serial I/O Expander 2 */
static const int ioxh_pins[] = { 10, 11, 24, 25 };
static const int mmc_pins[] = { 152, 154, 156, 157, 158, 159 };
static const int mmcwp_pins[] = { 153 };
static const int mmccd_pins[] = { 155 };
static const int mmcrst_pins[] = { 155 };
static const int mmc8_pins[] = { 148, 149, 150, 151 };
/* RMII 1 pin groups */
static const int r1_pins[] = { 178, 179, 180, 181, 182, 193, 201 };
static const int r1err_pins[] = { 56 };
static const int r1md_pins[] = { 57, 58 };
/* RMII 2 pin groups */
static const int r2_pins[] = { 84, 85, 86, 87, 88, 89, 200 };
static const int r2err_pins[] = { 90 };
static const int r2md_pins[] = { 91, 92 };
static const int sd1_pins[] = { 136, 137, 138, 139, 140, 141, 142, 143 };
static const int sd1pwr_pins[] = { 143 };
static const int wdog1_pins[] = { 218 };
static const int wdog2_pins[] = { 219 };
/* BMC serial port 0 */
static const int bmcuart0a_pins[] = { 41, 42 };
static const int bmcuart0b_pins[] = { 48, 49 };
static const int bmcuart1_pins[] = { 43, 44, 62, 63 };
/* System Control Interrupt and Power Management Event pin group */
static const int scipme_pins[] = { 169 };
/* System Management Interrupt pin group */
static const int sci_pins[] = { 170 };
/* Serial Interrupt Line pin group */
static const int serirq_pins[] = { 162 };
static const int clkout_pins[] = { 160 };
static const int clkreq_pins[] = { 231 };
static const int jtag2_pins[] = { 43, 44, 45, 46, 47 };
/* Graphics SPI Clock pin group */
static const int gspi_pins[] = { 12, 13, 14, 15 };
static const int spix_pins[] = { 224, 225, 226, 227, 229, 230 };
static const int spixcs1_pins[] = { 228 };
static const int pspi1_pins[] = { 175, 176, 177 };
static const int pspi2_pins[] = { 17, 18, 19 };
static const int spi0cs1_pins[] = { 32 };
static const int spi3_pins[] = { 183, 184, 185, 186 };
static const int spi3cs1_pins[] = { 187 };
static const int spi3quad_pins[] = { 188, 189 };
static const int spi3cs2_pins[] = { 188 };
static const int spi3cs3_pins[] = { 189 };
static const int ddc_pins[] = { 204, 205, 206, 207 };
static const int lpc_pins[] = { 95, 161, 163, 164, 165, 166, 167 };
static const int lpcclk_pins[] = { 168 };
static const int espi_pins[] = { 95, 161, 163, 164, 165, 166, 167, 168 };
static const int lkgpo0_pins[] = { 16 };
static const int lkgpo1_pins[] = { 8 };
static const int lkgpo2_pins[] = { 9 };
static const int nprd_smi_pins[] = { 190 };
static const int hgpio0_pins[] = { 20 };
static const int hgpio1_pins[] = { 21 };
static const int hgpio2_pins[] = { 22 };
static const int hgpio3_pins[] = { 23 };
static const int hgpio4_pins[] = { 24 };
static const int hgpio5_pins[] = { 25 };
static const int hgpio6_pins[] = { 59 };
static const int hgpio7_pins[] = { 60 };
/*
* pin: name, number
* group: name, npins, pins
* function: name, ngroups, groups
*/
struct npcm7xx_group {
const char *name;
const unsigned int *pins;
int npins;
};
#define NPCM7XX_GRPS \
NPCM7XX_GRP(smb0), \
NPCM7XX_GRP(smb0b), \
NPCM7XX_GRP(smb0c), \
NPCM7XX_GRP(smb0d), \
NPCM7XX_GRP(smb0den), \
NPCM7XX_GRP(smb1), \
NPCM7XX_GRP(smb1b), \
NPCM7XX_GRP(smb1c), \
NPCM7XX_GRP(smb1d), \
NPCM7XX_GRP(smb2), \
NPCM7XX_GRP(smb2b), \
NPCM7XX_GRP(smb2c), \
NPCM7XX_GRP(smb2d), \
NPCM7XX_GRP(smb3), \
NPCM7XX_GRP(smb3b), \
NPCM7XX_GRP(smb3c), \
NPCM7XX_GRP(smb3d), \
NPCM7XX_GRP(smb4), \
NPCM7XX_GRP(smb4b), \
NPCM7XX_GRP(smb4c), \
NPCM7XX_GRP(smb4d), \
NPCM7XX_GRP(smb4den), \
NPCM7XX_GRP(smb5), \
NPCM7XX_GRP(smb5b), \
NPCM7XX_GRP(smb5c), \
NPCM7XX_GRP(smb5d), \
NPCM7XX_GRP(ga20kbc), \
NPCM7XX_GRP(smb6), \
NPCM7XX_GRP(smb7), \
NPCM7XX_GRP(smb8), \
NPCM7XX_GRP(smb9), \
NPCM7XX_GRP(smb10), \
NPCM7XX_GRP(smb11), \
NPCM7XX_GRP(smb12), \
NPCM7XX_GRP(smb13), \
NPCM7XX_GRP(smb14), \
NPCM7XX_GRP(smb15), \
NPCM7XX_GRP(fanin0), \
NPCM7XX_GRP(fanin1), \
NPCM7XX_GRP(fanin2), \
NPCM7XX_GRP(fanin3), \
NPCM7XX_GRP(fanin4), \
NPCM7XX_GRP(fanin5), \
NPCM7XX_GRP(fanin6), \
NPCM7XX_GRP(fanin7), \
NPCM7XX_GRP(fanin8), \
NPCM7XX_GRP(fanin9), \
NPCM7XX_GRP(fanin10), \
NPCM7XX_GRP(fanin11), \
NPCM7XX_GRP(fanin12), \
NPCM7XX_GRP(fanin13), \
NPCM7XX_GRP(fanin14), \
NPCM7XX_GRP(fanin15), \
NPCM7XX_GRP(faninx), \
NPCM7XX_GRP(pwm0), \
NPCM7XX_GRP(pwm1), \
NPCM7XX_GRP(pwm2), \
NPCM7XX_GRP(pwm3), \
NPCM7XX_GRP(pwm4), \
NPCM7XX_GRP(pwm5), \
NPCM7XX_GRP(pwm6), \
NPCM7XX_GRP(pwm7), \
NPCM7XX_GRP(rg1), \
NPCM7XX_GRP(rg1mdio), \
NPCM7XX_GRP(rg2), \
NPCM7XX_GRP(rg2mdio), \
NPCM7XX_GRP(ddr), \
NPCM7XX_GRP(uart1), \
NPCM7XX_GRP(uart2), \
NPCM7XX_GRP(bmcuart0a), \
NPCM7XX_GRP(bmcuart0b), \
NPCM7XX_GRP(bmcuart1), \
NPCM7XX_GRP(iox1), \
NPCM7XX_GRP(iox2), \
NPCM7XX_GRP(ioxh), \
NPCM7XX_GRP(gspi), \
NPCM7XX_GRP(mmc), \
NPCM7XX_GRP(mmcwp), \
NPCM7XX_GRP(mmccd), \
NPCM7XX_GRP(mmcrst), \
NPCM7XX_GRP(mmc8), \
NPCM7XX_GRP(r1), \
NPCM7XX_GRP(r1err), \
NPCM7XX_GRP(r1md), \
NPCM7XX_GRP(r2), \
NPCM7XX_GRP(r2err), \
NPCM7XX_GRP(r2md), \
NPCM7XX_GRP(sd1), \
NPCM7XX_GRP(sd1pwr), \
NPCM7XX_GRP(wdog1), \
NPCM7XX_GRP(wdog2), \
NPCM7XX_GRP(scipme), \
NPCM7XX_GRP(sci), \
NPCM7XX_GRP(serirq), \
NPCM7XX_GRP(jtag2), \
NPCM7XX_GRP(spix), \
NPCM7XX_GRP(spixcs1), \
NPCM7XX_GRP(pspi1), \
NPCM7XX_GRP(pspi2), \
NPCM7XX_GRP(ddc), \
NPCM7XX_GRP(clkreq), \
NPCM7XX_GRP(clkout), \
NPCM7XX_GRP(spi3), \
NPCM7XX_GRP(spi3cs1), \
NPCM7XX_GRP(spi3quad), \
NPCM7XX_GRP(spi3cs2), \
NPCM7XX_GRP(spi3cs3), \
NPCM7XX_GRP(spi0cs1), \
NPCM7XX_GRP(lpc), \
NPCM7XX_GRP(lpcclk), \
NPCM7XX_GRP(espi), \
NPCM7XX_GRP(lkgpo0), \
NPCM7XX_GRP(lkgpo1), \
NPCM7XX_GRP(lkgpo2), \
NPCM7XX_GRP(nprd_smi), \
NPCM7XX_GRP(hgpio0), \
NPCM7XX_GRP(hgpio1), \
NPCM7XX_GRP(hgpio2), \
NPCM7XX_GRP(hgpio3), \
NPCM7XX_GRP(hgpio4), \
NPCM7XX_GRP(hgpio5), \
NPCM7XX_GRP(hgpio6), \
NPCM7XX_GRP(hgpio7), \
\
enum {
#define NPCM7XX_GRP(x) fn_ ## x
NPCM7XX_GRPS
/* add placeholder for none/gpio */
NPCM7XX_GRP(none),
NPCM7XX_GRP(gpio),
#undef NPCM7XX_GRP
};
static struct npcm7xx_group npcm7xx_groups[] = {
#define NPCM7XX_GRP(x) { .name = #x, .pins = x ## _pins, \
.npins = ARRAY_SIZE(x ## _pins) }
NPCM7XX_GRPS
#undef NPCM7XX_GRP
};
#define NPCM7XX_SFUNC(a) NPCM7XX_FUNC(a, #a)
#define NPCM7XX_FUNC(a, b...) static const char *a ## _grp[] = { b }
#define NPCM7XX_MKFUNC(nm) { .name = #nm, .ngroups = ARRAY_SIZE(nm ## _grp), \
.groups = nm ## _grp }
struct npcm7xx_func {
const char *name;
const unsigned int ngroups;
const char *const *groups;
};
NPCM7XX_SFUNC(smb0);
NPCM7XX_SFUNC(smb0b);
NPCM7XX_SFUNC(smb0c);
NPCM7XX_SFUNC(smb0d);
NPCM7XX_SFUNC(smb0den);
NPCM7XX_SFUNC(smb1);
NPCM7XX_SFUNC(smb1b);
NPCM7XX_SFUNC(smb1c);
NPCM7XX_SFUNC(smb1d);
NPCM7XX_SFUNC(smb2);
NPCM7XX_SFUNC(smb2b);
NPCM7XX_SFUNC(smb2c);
NPCM7XX_SFUNC(smb2d);
NPCM7XX_SFUNC(smb3);
NPCM7XX_SFUNC(smb3b);
NPCM7XX_SFUNC(smb3c);
NPCM7XX_SFUNC(smb3d);
NPCM7XX_SFUNC(smb4);
NPCM7XX_SFUNC(smb4b);
NPCM7XX_SFUNC(smb4c);
NPCM7XX_SFUNC(smb4d);
NPCM7XX_SFUNC(smb4den);
NPCM7XX_SFUNC(smb5);
NPCM7XX_SFUNC(smb5b);
NPCM7XX_SFUNC(smb5c);
NPCM7XX_SFUNC(smb5d);
NPCM7XX_SFUNC(ga20kbc);
NPCM7XX_SFUNC(smb6);
NPCM7XX_SFUNC(smb7);
NPCM7XX_SFUNC(smb8);
NPCM7XX_SFUNC(smb9);
NPCM7XX_SFUNC(smb10);
NPCM7XX_SFUNC(smb11);
NPCM7XX_SFUNC(smb12);
NPCM7XX_SFUNC(smb13);
NPCM7XX_SFUNC(smb14);
NPCM7XX_SFUNC(smb15);
NPCM7XX_SFUNC(fanin0);
NPCM7XX_SFUNC(fanin1);
NPCM7XX_SFUNC(fanin2);
NPCM7XX_SFUNC(fanin3);
NPCM7XX_SFUNC(fanin4);
NPCM7XX_SFUNC(fanin5);
NPCM7XX_SFUNC(fanin6);
NPCM7XX_SFUNC(fanin7);
NPCM7XX_SFUNC(fanin8);
NPCM7XX_SFUNC(fanin9);
NPCM7XX_SFUNC(fanin10);
NPCM7XX_SFUNC(fanin11);
NPCM7XX_SFUNC(fanin12);
NPCM7XX_SFUNC(fanin13);
NPCM7XX_SFUNC(fanin14);
NPCM7XX_SFUNC(fanin15);
NPCM7XX_SFUNC(faninx);
NPCM7XX_SFUNC(pwm0);
NPCM7XX_SFUNC(pwm1);
NPCM7XX_SFUNC(pwm2);
NPCM7XX_SFUNC(pwm3);
NPCM7XX_SFUNC(pwm4);
NPCM7XX_SFUNC(pwm5);
NPCM7XX_SFUNC(pwm6);
NPCM7XX_SFUNC(pwm7);
NPCM7XX_SFUNC(rg1);
NPCM7XX_SFUNC(rg1mdio);
NPCM7XX_SFUNC(rg2);
NPCM7XX_SFUNC(rg2mdio);
NPCM7XX_SFUNC(ddr);
NPCM7XX_SFUNC(uart1);
NPCM7XX_SFUNC(uart2);
NPCM7XX_SFUNC(bmcuart0a);
NPCM7XX_SFUNC(bmcuart0b);
NPCM7XX_SFUNC(bmcuart1);
NPCM7XX_SFUNC(iox1);
NPCM7XX_SFUNC(iox2);
NPCM7XX_SFUNC(ioxh);
NPCM7XX_SFUNC(gspi);
NPCM7XX_SFUNC(mmc);
NPCM7XX_SFUNC(mmcwp);
NPCM7XX_SFUNC(mmccd);
NPCM7XX_SFUNC(mmcrst);
NPCM7XX_SFUNC(mmc8);
NPCM7XX_SFUNC(r1);
NPCM7XX_SFUNC(r1err);
NPCM7XX_SFUNC(r1md);
NPCM7XX_SFUNC(r2);
NPCM7XX_SFUNC(r2err);
NPCM7XX_SFUNC(r2md);
NPCM7XX_SFUNC(sd1);
NPCM7XX_SFUNC(sd1pwr);
NPCM7XX_SFUNC(wdog1);
NPCM7XX_SFUNC(wdog2);
NPCM7XX_SFUNC(scipme);
NPCM7XX_SFUNC(sci);
NPCM7XX_SFUNC(serirq);
NPCM7XX_SFUNC(jtag2);
NPCM7XX_SFUNC(spix);
NPCM7XX_SFUNC(spixcs1);
NPCM7XX_SFUNC(pspi1);
NPCM7XX_SFUNC(pspi2);
NPCM7XX_SFUNC(ddc);
NPCM7XX_SFUNC(clkreq);
NPCM7XX_SFUNC(clkout);
NPCM7XX_SFUNC(spi3);
NPCM7XX_SFUNC(spi3cs1);
NPCM7XX_SFUNC(spi3quad);
NPCM7XX_SFUNC(spi3cs2);
NPCM7XX_SFUNC(spi3cs3);
NPCM7XX_SFUNC(spi0cs1);
NPCM7XX_SFUNC(lpc);
NPCM7XX_SFUNC(lpcclk);
NPCM7XX_SFUNC(espi);
NPCM7XX_SFUNC(lkgpo0);
NPCM7XX_SFUNC(lkgpo1);
NPCM7XX_SFUNC(lkgpo2);
NPCM7XX_SFUNC(nprd_smi);
NPCM7XX_SFUNC(hgpio0);
NPCM7XX_SFUNC(hgpio1);
NPCM7XX_SFUNC(hgpio2);
NPCM7XX_SFUNC(hgpio3);
NPCM7XX_SFUNC(hgpio4);
NPCM7XX_SFUNC(hgpio5);
NPCM7XX_SFUNC(hgpio6);
NPCM7XX_SFUNC(hgpio7);
/* Function names */
static struct npcm7xx_func npcm7xx_funcs[] = {
NPCM7XX_MKFUNC(smb0),
NPCM7XX_MKFUNC(smb0b),
NPCM7XX_MKFUNC(smb0c),
NPCM7XX_MKFUNC(smb0d),
NPCM7XX_MKFUNC(smb0den),
NPCM7XX_MKFUNC(smb1),
NPCM7XX_MKFUNC(smb1b),
NPCM7XX_MKFUNC(smb1c),
NPCM7XX_MKFUNC(smb1d),
NPCM7XX_MKFUNC(smb2),
NPCM7XX_MKFUNC(smb2b),
NPCM7XX_MKFUNC(smb2c),
NPCM7XX_MKFUNC(smb2d),
NPCM7XX_MKFUNC(smb3),
NPCM7XX_MKFUNC(smb3b),
NPCM7XX_MKFUNC(smb3c),
NPCM7XX_MKFUNC(smb3d),
NPCM7XX_MKFUNC(smb4),
NPCM7XX_MKFUNC(smb4b),
NPCM7XX_MKFUNC(smb4c),
NPCM7XX_MKFUNC(smb4d),
NPCM7XX_MKFUNC(smb4den),
NPCM7XX_MKFUNC(smb5),
NPCM7XX_MKFUNC(smb5b),
NPCM7XX_MKFUNC(smb5c),
NPCM7XX_MKFUNC(smb5d),
NPCM7XX_MKFUNC(ga20kbc),
NPCM7XX_MKFUNC(smb6),
NPCM7XX_MKFUNC(smb7),
NPCM7XX_MKFUNC(smb8),
NPCM7XX_MKFUNC(smb9),
NPCM7XX_MKFUNC(smb10),
NPCM7XX_MKFUNC(smb11),
NPCM7XX_MKFUNC(smb12),
NPCM7XX_MKFUNC(smb13),
NPCM7XX_MKFUNC(smb14),
NPCM7XX_MKFUNC(smb15),
NPCM7XX_MKFUNC(fanin0),
NPCM7XX_MKFUNC(fanin1),
NPCM7XX_MKFUNC(fanin2),
NPCM7XX_MKFUNC(fanin3),
NPCM7XX_MKFUNC(fanin4),
NPCM7XX_MKFUNC(fanin5),
NPCM7XX_MKFUNC(fanin6),
NPCM7XX_MKFUNC(fanin7),
NPCM7XX_MKFUNC(fanin8),
NPCM7XX_MKFUNC(fanin9),
NPCM7XX_MKFUNC(fanin10),
NPCM7XX_MKFUNC(fanin11),
NPCM7XX_MKFUNC(fanin12),
NPCM7XX_MKFUNC(fanin13),
NPCM7XX_MKFUNC(fanin14),
NPCM7XX_MKFUNC(fanin15),
NPCM7XX_MKFUNC(faninx),
NPCM7XX_MKFUNC(pwm0),
NPCM7XX_MKFUNC(pwm1),
NPCM7XX_MKFUNC(pwm2),
NPCM7XX_MKFUNC(pwm3),
NPCM7XX_MKFUNC(pwm4),
NPCM7XX_MKFUNC(pwm5),
NPCM7XX_MKFUNC(pwm6),
NPCM7XX_MKFUNC(pwm7),
NPCM7XX_MKFUNC(rg1),
NPCM7XX_MKFUNC(rg1mdio),
NPCM7XX_MKFUNC(rg2),
NPCM7XX_MKFUNC(rg2mdio),
NPCM7XX_MKFUNC(ddr),
NPCM7XX_MKFUNC(uart1),
NPCM7XX_MKFUNC(uart2),
NPCM7XX_MKFUNC(bmcuart0a),
NPCM7XX_MKFUNC(bmcuart0b),
NPCM7XX_MKFUNC(bmcuart1),
NPCM7XX_MKFUNC(iox1),
NPCM7XX_MKFUNC(iox2),
NPCM7XX_MKFUNC(ioxh),
NPCM7XX_MKFUNC(gspi),
NPCM7XX_MKFUNC(mmc),
NPCM7XX_MKFUNC(mmcwp),
NPCM7XX_MKFUNC(mmccd),
NPCM7XX_MKFUNC(mmcrst),
NPCM7XX_MKFUNC(mmc8),
NPCM7XX_MKFUNC(r1),
NPCM7XX_MKFUNC(r1err),
NPCM7XX_MKFUNC(r1md),
NPCM7XX_MKFUNC(r2),
NPCM7XX_MKFUNC(r2err),
NPCM7XX_MKFUNC(r2md),
NPCM7XX_MKFUNC(sd1),
NPCM7XX_MKFUNC(sd1pwr),
NPCM7XX_MKFUNC(wdog1),
NPCM7XX_MKFUNC(wdog2),
NPCM7XX_MKFUNC(scipme),
NPCM7XX_MKFUNC(sci),
NPCM7XX_MKFUNC(serirq),
NPCM7XX_MKFUNC(jtag2),
NPCM7XX_MKFUNC(spix),
NPCM7XX_MKFUNC(spixcs1),
NPCM7XX_MKFUNC(pspi1),
NPCM7XX_MKFUNC(pspi2),
NPCM7XX_MKFUNC(ddc),
NPCM7XX_MKFUNC(clkreq),
NPCM7XX_MKFUNC(clkout),
NPCM7XX_MKFUNC(spi3),
NPCM7XX_MKFUNC(spi3cs1),
NPCM7XX_MKFUNC(spi3quad),
NPCM7XX_MKFUNC(spi3cs2),
NPCM7XX_MKFUNC(spi3cs3),
NPCM7XX_MKFUNC(spi0cs1),
NPCM7XX_MKFUNC(lpc),
NPCM7XX_MKFUNC(lpcclk),
NPCM7XX_MKFUNC(espi),
NPCM7XX_MKFUNC(lkgpo0),
NPCM7XX_MKFUNC(lkgpo1),
NPCM7XX_MKFUNC(lkgpo2),
NPCM7XX_MKFUNC(nprd_smi),
NPCM7XX_MKFUNC(hgpio0),
NPCM7XX_MKFUNC(hgpio1),
NPCM7XX_MKFUNC(hgpio2),
NPCM7XX_MKFUNC(hgpio3),
NPCM7XX_MKFUNC(hgpio4),
NPCM7XX_MKFUNC(hgpio5),
NPCM7XX_MKFUNC(hgpio6),
NPCM7XX_MKFUNC(hgpio7),
};
#define NPCM7XX_PINCFG(a, b, c, d, e, f, g, h, i, j, k) \
[a] { .fn0 = fn_ ## b, .reg0 = NPCM7XX_GCR_ ## c, .bit0 = d, \
.fn1 = fn_ ## e, .reg1 = NPCM7XX_GCR_ ## f, .bit1 = g, \
.fn2 = fn_ ## h, .reg2 = NPCM7XX_GCR_ ## i, .bit2 = j, \
.flag = k }
/* Drive strength controlled by NPCM7XX_GP_N_ODSC */
#define DRIVE_STRENGTH_LO_SHIFT 8
#define DRIVE_STRENGTH_HI_SHIFT 12
#define DRIVE_STRENGTH_MASK 0x0000FF00
#define DS(lo, hi) (((lo) << DRIVE_STRENGTH_LO_SHIFT) | \
((hi) << DRIVE_STRENGTH_HI_SHIFT))
#define DSLO(x) (((x) >> DRIVE_STRENGTH_LO_SHIFT) & 0xF)
#define DSHI(x) (((x) >> DRIVE_STRENGTH_HI_SHIFT) & 0xF)
#define GPI 0x1 /* Not GPO */
#define GPO 0x2 /* Not GPI */
#define SLEW 0x4 /* Has Slew Control, NPCM7XX_GP_N_OSRC */
#define SLEWLPC 0x8 /* Has Slew Control, SRCNT.3 */
struct npcm7xx_pincfg {
int flag;
int fn0, reg0, bit0;
int fn1, reg1, bit1;
int fn2, reg2, bit2;
};
static const struct npcm7xx_pincfg pincfg[] = {
/* PIN FUNCTION 1 FUNCTION 2 FUNCTION 3 FLAGS */
NPCM7XX_PINCFG(0, iox1, MFSEL1, 30, none, NONE, 0, none, NONE, 0, 0),
NPCM7XX_PINCFG(1, iox1, MFSEL1, 30, none, NONE, 0, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(2, iox1, MFSEL1, 30, none, NONE, 0, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(3, iox1, MFSEL1, 30, none, NONE, 0, none, NONE, 0, 0),
NPCM7XX_PINCFG(4, iox2, MFSEL3, 14, smb1d, I2CSEGSEL, 7, none, NONE, 0, SLEW),
NPCM7XX_PINCFG(5, iox2, MFSEL3, 14, smb1d, I2CSEGSEL, 7, none, NONE, 0, SLEW),
NPCM7XX_PINCFG(6, iox2, MFSEL3, 14, smb2d, I2CSEGSEL, 10, none, NONE, 0, SLEW),
NPCM7XX_PINCFG(7, iox2, MFSEL3, 14, smb2d, I2CSEGSEL, 10, none, NONE, 0, SLEW),
NPCM7XX_PINCFG(8, lkgpo1, FLOCKR1, 4, none, NONE, 0, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(9, lkgpo2, FLOCKR1, 8, none, NONE, 0, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(10, ioxh, MFSEL3, 18, none, NONE, 0, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(11, ioxh, MFSEL3, 18, none, NONE, 0, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(12, gspi, MFSEL1, 24, smb5b, I2CSEGSEL, 19, none, NONE, 0, SLEW),
NPCM7XX_PINCFG(13, gspi, MFSEL1, 24, smb5b, I2CSEGSEL, 19, none, NONE, 0, SLEW),
NPCM7XX_PINCFG(14, gspi, MFSEL1, 24, smb5c, I2CSEGSEL, 20, none, NONE, 0, SLEW),
NPCM7XX_PINCFG(15, gspi, MFSEL1, 24, smb5c, I2CSEGSEL, 20, none, NONE, 0, SLEW),
NPCM7XX_PINCFG(16, lkgpo0, FLOCKR1, 0, none, NONE, 0, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(17, pspi2, MFSEL3, 13, smb4den, I2CSEGSEL, 23, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(18, pspi2, MFSEL3, 13, smb4b, I2CSEGSEL, 14, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(19, pspi2, MFSEL3, 13, smb4b, I2CSEGSEL, 14, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(20, hgpio0, MFSEL2, 24, smb15, MFSEL3, 8, smb4c, I2CSEGSEL, 15, 0),
NPCM7XX_PINCFG(21, hgpio1, MFSEL2, 25, smb15, MFSEL3, 8, smb4c, I2CSEGSEL, 15, 0),
NPCM7XX_PINCFG(22, hgpio2, MFSEL2, 26, smb14, MFSEL3, 7, smb4d, I2CSEGSEL, 16, 0),
NPCM7XX_PINCFG(23, hgpio3, MFSEL2, 27, smb14, MFSEL3, 7, smb4d, I2CSEGSEL, 16, 0),
NPCM7XX_PINCFG(24, hgpio4, MFSEL2, 28, ioxh, MFSEL3, 18, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(25, hgpio5, MFSEL2, 29, ioxh, MFSEL3, 18, none, NONE, 0, DS(8, 12)),
NPCM7XX_PINCFG(26, smb5, MFSEL1, 2, none, NONE, 0, none, NONE, 0, 0),