1 #include <linux/kernel.h>
6 #define _GPIO(offset) (offset)
8 #define DB8540_PIN_AH6 _GPIO(0)
9 #define DB8540_PIN_AG7 _GPIO(1)
10 #define DB8540_PIN_AF2 _GPIO(2)
11 #define DB8540_PIN_AD3 _GPIO(3)
12 #define DB8540_PIN_AF6 _GPIO(4)
13 #define DB8540_PIN_AG6 _GPIO(5)
14 #define DB8540_PIN_AD5 _GPIO(6)
15 #define DB8540_PIN_AF7 _GPIO(7)
16 #define DB8540_PIN_AG5 _GPIO(8)
17 #define DB8540_PIN_AH5 _GPIO(9)
18 #define DB8540_PIN_AE4 _GPIO(10)
19 #define DB8540_PIN_AD1 _GPIO(11)
20 #define DB8540_PIN_AD2 _GPIO(12)
21 #define DB8540_PIN_AC2 _GPIO(13)
22 #define DB8540_PIN_AC4 _GPIO(14)
23 #define DB8540_PIN_AC3 _GPIO(15)
24 #define DB8540_PIN_AH7 _GPIO(16)
25 #define DB8540_PIN_AE7 _GPIO(17)
27 #define DB8540_PIN_AF8 _GPIO(22)
28 #define DB8540_PIN_AH11 _GPIO(23)
29 #define DB8540_PIN_AG11 _GPIO(24)
30 #define DB8540_PIN_AF11 _GPIO(25)
31 #define DB8540_PIN_AH10 _GPIO(26)
32 #define DB8540_PIN_AG10 _GPIO(27)
33 #define DB8540_PIN_AF10 _GPIO(28)
35 #define DB8540_PIN_AD4 _GPIO(33)
36 #define DB8540_PIN_AF3 _GPIO(34)
37 #define DB8540_PIN_AF5 _GPIO(35)
38 #define DB8540_PIN_AG4 _GPIO(36)
39 #define DB8540_PIN_AF9 _GPIO(37)
40 #define DB8540_PIN_AE8 _GPIO(38)
42 #define DB8540_PIN_M26 _GPIO(64)
43 #define DB8540_PIN_M25 _GPIO(65)
44 #define DB8540_PIN_M27 _GPIO(66)
45 #define DB8540_PIN_N25 _GPIO(67)
47 #define DB8540_PIN_M28 _GPIO(70)
48 #define DB8540_PIN_N26 _GPIO(71)
49 #define DB8540_PIN_M22 _GPIO(72)
50 #define DB8540_PIN_N22 _GPIO(73)
51 #define DB8540_PIN_N27 _GPIO(74)
52 #define DB8540_PIN_N28 _GPIO(75)
53 #define DB8540_PIN_P22 _GPIO(76)
54 #define DB8540_PIN_P28 _GPIO(77)
55 #define DB8540_PIN_P26 _GPIO(78)
56 #define DB8540_PIN_T22 _GPIO(79)
57 #define DB8540_PIN_R27 _GPIO(80)
58 #define DB8540_PIN_P27 _GPIO(81)
59 #define DB8540_PIN_R26 _GPIO(82)
60 #define DB8540_PIN_R25 _GPIO(83)
61 #define DB8540_PIN_U22 _GPIO(84)
62 #define DB8540_PIN_T27 _GPIO(85)
63 #define DB8540_PIN_T25 _GPIO(86)
64 #define DB8540_PIN_T26 _GPIO(87)
66 #define DB8540_PIN_AF20 _GPIO(116)
67 #define DB8540_PIN_AG21 _GPIO(117)
68 #define DB8540_PIN_AH19 _GPIO(118)
69 #define DB8540_PIN_AE19 _GPIO(119)
70 #define DB8540_PIN_AG18 _GPIO(120)
71 #define DB8540_PIN_AH17 _GPIO(121)
72 #define DB8540_PIN_AF19 _GPIO(122)
73 #define DB8540_PIN_AF18 _GPIO(123)
74 #define DB8540_PIN_AE18 _GPIO(124)
75 #define DB8540_PIN_AG17 _GPIO(125)
76 #define DB8540_PIN_AF17 _GPIO(126)
77 #define DB8540_PIN_AE17 _GPIO(127)
78 #define DB8540_PIN_AC27 _GPIO(128)
79 #define DB8540_PIN_AD27 _GPIO(129)
80 #define DB8540_PIN_AE28 _GPIO(130)
81 #define DB8540_PIN_AG26 _GPIO(131)
82 #define DB8540_PIN_AF25 _GPIO(132)
83 #define DB8540_PIN_AE27 _GPIO(133)
84 #define DB8540_PIN_AF27 _GPIO(134)
85 #define DB8540_PIN_AG28 _GPIO(135)
86 #define DB8540_PIN_AF28 _GPIO(136)
87 #define DB8540_PIN_AG25 _GPIO(137)
88 #define DB8540_PIN_AG24 _GPIO(138)
89 #define DB8540_PIN_AD25 _GPIO(139)
90 #define DB8540_PIN_AH25 _GPIO(140)
91 #define DB8540_PIN_AF26 _GPIO(141)
92 #define DB8540_PIN_AF23 _GPIO(142)
93 #define DB8540_PIN_AG23 _GPIO(143)
94 #define DB8540_PIN_AE25 _GPIO(144)
95 #define DB8540_PIN_AH24 _GPIO(145)
96 #define DB8540_PIN_AJ25 _GPIO(146)
97 #define DB8540_PIN_AG27 _GPIO(147)
98 #define DB8540_PIN_AH23 _GPIO(148)
99 #define DB8540_PIN_AE26 _GPIO(149)
100 #define DB8540_PIN_AE24 _GPIO(150)
101 #define DB8540_PIN_AJ24 _GPIO(151)
102 #define DB8540_PIN_AE21 _GPIO(152)
103 #define DB8540_PIN_AG22 _GPIO(153)
104 #define DB8540_PIN_AF21 _GPIO(154)
105 #define DB8540_PIN_AF24 _GPIO(155)
106 #define DB8540_PIN_AH22 _GPIO(156)
107 #define DB8540_PIN_AJ23 _GPIO(157)
108 #define DB8540_PIN_AH21 _GPIO(158)
109 #define DB8540_PIN_AG20 _GPIO(159)
110 #define DB8540_PIN_AE23 _GPIO(160)
111 #define DB8540_PIN_AH20 _GPIO(161)
112 #define DB8540_PIN_AG19 _GPIO(162)
113 #define DB8540_PIN_AF22 _GPIO(163)
114 #define DB8540_PIN_AJ21 _GPIO(164)
115 #define DB8540_PIN_AD26 _GPIO(165)
116 #define DB8540_PIN_AD28 _GPIO(166)
117 #define DB8540_PIN_AC28 _GPIO(167)
118 #define DB8540_PIN_AC26 _GPIO(168)
120 #define DB8540_PIN_J3 _GPIO(192)
121 #define DB8540_PIN_H1 _GPIO(193)
122 #define DB8540_PIN_J2 _GPIO(194)
123 #define DB8540_PIN_H2 _GPIO(195)
124 #define DB8540_PIN_H3 _GPIO(196)
125 #define DB8540_PIN_H4 _GPIO(197)
126 #define DB8540_PIN_G2 _GPIO(198)
127 #define DB8540_PIN_G3 _GPIO(199)
128 #define DB8540_PIN_G4 _GPIO(200)
129 #define DB8540_PIN_F2 _GPIO(201)
130 #define DB8540_PIN_C6 _GPIO(202)
131 #define DB8540_PIN_B6 _GPIO(203)
132 #define DB8540_PIN_B7 _GPIO(204)
133 #define DB8540_PIN_A7 _GPIO(205)
134 #define DB8540_PIN_D7 _GPIO(206)
135 #define DB8540_PIN_D8 _GPIO(207)
136 #define DB8540_PIN_F3 _GPIO(208)
137 #define DB8540_PIN_E2 _GPIO(209)
138 #define DB8540_PIN_C7 _GPIO(210)
139 #define DB8540_PIN_B8 _GPIO(211)
140 #define DB8540_PIN_C10 _GPIO(212)
141 #define DB8540_PIN_C8 _GPIO(213)
142 #define DB8540_PIN_C9 _GPIO(214)
144 #define DB8540_PIN_B9 _GPIO(219)
145 #define DB8540_PIN_A10 _GPIO(220)
146 #define DB8540_PIN_D9 _GPIO(221)
147 #define DB8540_PIN_B11 _GPIO(222)
148 #define DB8540_PIN_B10 _GPIO(223)
149 #define DB8540_PIN_E10 _GPIO(224)
150 #define DB8540_PIN_B12 _GPIO(225)
151 #define DB8540_PIN_D10 _GPIO(226)
152 #define DB8540_PIN_D11 _GPIO(227)
153 #define DB8540_PIN_AJ6 _GPIO(228)
154 #define DB8540_PIN_B13 _GPIO(229)
155 #define DB8540_PIN_C12 _GPIO(230)
156 #define DB8540_PIN_B14 _GPIO(231)
157 #define DB8540_PIN_E11 _GPIO(232)
159 #define DB8540_PIN_D12 _GPIO(256)
160 #define DB8540_PIN_D15 _GPIO(257)
161 #define DB8540_PIN_C13 _GPIO(258)
162 #define DB8540_PIN_C14 _GPIO(259)
163 #define DB8540_PIN_C18 _GPIO(260)
164 #define DB8540_PIN_C16 _GPIO(261)
165 #define DB8540_PIN_B16 _GPIO(262)
166 #define DB8540_PIN_D18 _GPIO(263)
167 #define DB8540_PIN_C15 _GPIO(264)
168 #define DB8540_PIN_C17 _GPIO(265)
169 #define DB8540_PIN_B17 _GPIO(266)
170 #define DB8540_PIN_D17 _GPIO(267)
178 static const struct pinctrl_pin_desc nmk_db8540_pins[] = {
344 #define DB8540_GPIO_RANGE(a, b, c) { .name = "db8540", .id = a, .base = b, \
345 .pin_base = b, .npins = c }
351 static struct pinctrl_gpio_range nmk_db8540_ranges[] = {
442 static const unsigned msp2sck_a_1_pins[] = {
DB8540_PIN_J3 };
445 static const unsigned msp2rxd_a_1_pins[] = {
DB8540_PIN_H3 };
512 static const unsigned ddrtrig_b_1_pins[] = {
DB8540_PIN_J3 };
542 static const unsigned modobsresout_c_1_pins[] = {
DB8540_PIN_P28 };
549 static const unsigned modobspwrrst_c_1_pins[] = {
DB8540_PIN_T27 };
570 static const unsigned mc4rstn_c_1_pins[] = {
DB8540_PIN_C6 };
583 static const unsigned modobsrefclk_oc1_1_pins[] = {
DB8540_PIN_M26 };
584 static const unsigned modobspwrctrl_oc1_1_pins[] = {
DB8540_PIN_M25 };
585 static const unsigned modobsclkout_oc1_1_pins[] = {
DB8540_PIN_M27 };
587 static const unsigned modprcmudbg_oc1_1_pins[] = {
DB8540_PIN_M28,
593 static const unsigned modobsresout_oc1_1_pins[] = {
DB8540_PIN_N28 };
609 static const unsigned modaccuart_oc2_1_pins[] = {
DB8540_PIN_N25 };
612 static const unsigned moduartstmmux_oc2_1_pins[] = {
DB8540_PIN_N28 };
618 static const unsigned modobsservice_oc2_1_pins[] = {
DB8540_PIN_AJ23 };
645 static const unsigned moduart1txrx_oc4_1_pins[] = {
DB8540_PIN_U22,
651 static const unsigned modaccuartrtscts_oc4_1_pins[] = {
DB8540_PIN_AJ23,
655 static const unsigned moduartstmmux_oc4_1_pins[] = {
DB8540_PIN_T26 };
657 #define DB8540_PIN_GROUP(a, b) { .name = #a, .pins = a##_pins, \
658 .npins = ARRAY_SIZE(a##_pins), .altsetting = b }
660 static const struct nmk_pingroup nmk_db8540_groups[] = {
829 #define DB8540_FUNC_GROUPS(a, b...) \
830 static const char * const a##_groups[] = { b };
847 "ipgpio1_a_1",
"ipgpio1_c_1",
"ipgpio1_c_2",
848 "ipgpio2_b_1",
"ipgpio2_c_1",
"ipgpio2_c_2",
849 "ipgpio3_b_1",
"ipgpio3_c_1",
"ipgpio3_c_2",
850 "ipgpio4_c_1",
"ipgpio4_c_2",
851 "ipgpio5_c_1",
"ipgpio5_c_2",
852 "ipgpio6_c_1",
"ipgpio6_c_2",
853 "ipgpio7_b_1",
"ipgpio7_c_1");
857 "lcdvsi0_a_1",
"lcdvsi1_a_1");
868 "modaccuartrtccts_oc4_1");
871 "modobspwrctrl_oc1_1",
"modobspwrrst_c_1",
872 "modobsrefclk_oc1_1",
"modobsresout_c_1",
873 "modobsresout_oc1_1",
"modobsservice_oc2_1");
879 "moduart1txrx_oc4_1",
"moduart1rtscts_oc4_1",
"moduart0_oc2_1");
881 "moduartstmmux_oc4_1");
897 "smps0_c_1",
"smps1_c_1");
910 "u2rxtx_c_1",
"u2txrx_a_1",
"u2txrx_b_1",
"u2txrx_b_2",
917 #define FUNCTION(fname) \
920 .groups = fname##_groups, \
921 .ngroups = ARRAY_SIZE(fname##_groups), \
924 static const struct nmk_function nmk_db8540_functions[] = {
1237 static const u16 db8540_prcm_gpiocr_regs[] = {
1244 .gpio_ranges = nmk_db8540_ranges,
1245 .gpio_num_ranges =
ARRAY_SIZE(nmk_db8540_ranges),
1246 .pins = nmk_db8540_pins,
1248 .functions = nmk_db8540_functions,
1249 .nfunctions =
ARRAY_SIZE(nmk_db8540_functions),
1250 .groups = nmk_db8540_groups,
1252 .altcx_pins = db8540_altcx_pins,
1253 .npins_altcx =
ARRAY_SIZE(db8540_altcx_pins),
1254 .prcm_gpiocr_registers = db8540_prcm_gpiocr_regs,
1260 *soc = &nmk_db8540_soc;