]>
Commit | Line | Data |
---|---|---|
2874c5fd | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
ee086577 TP |
2 | /* |
3 | * Marvell Armada 39x pinctrl driver based on mvebu pinctrl core | |
4 | * | |
5 | * Copyright (C) 2015 Marvell | |
6 | * | |
7 | * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | |
ee086577 TP |
8 | */ |
9 | ||
10 | #include <linux/err.h> | |
11 | #include <linux/init.h> | |
12 | #include <linux/io.h> | |
ee086577 TP |
13 | #include <linux/platform_device.h> |
14 | #include <linux/of.h> | |
15 | #include <linux/of_device.h> | |
16 | #include <linux/pinctrl/pinctrl.h> | |
17 | ||
18 | #include "pinctrl-mvebu.h" | |
19 | ||
ee086577 TP |
20 | enum { |
21 | V_88F6920 = BIT(0), | |
e73ac02d TP |
22 | V_88F6925 = BIT(1), |
23 | V_88F6928 = BIT(2), | |
24 | V_88F6920_PLUS = (V_88F6920 | V_88F6925 | V_88F6928), | |
25 | V_88F6925_PLUS = (V_88F6925 | V_88F6928), | |
ee086577 TP |
26 | }; |
27 | ||
28 | static struct mvebu_mpp_mode armada_39x_mpp_modes[] = { | |
29 | MPP_MODE(0, | |
30 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
31 | MPP_VAR_FUNCTION(1, "ua0", "rxd", V_88F6920_PLUS)), | |
32 | MPP_MODE(1, | |
33 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
34 | MPP_VAR_FUNCTION(1, "ua0", "txd", V_88F6920_PLUS)), | |
35 | MPP_MODE(2, | |
36 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
37 | MPP_VAR_FUNCTION(1, "i2c0", "sck", V_88F6920_PLUS)), | |
38 | MPP_MODE(3, | |
39 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
40 | MPP_VAR_FUNCTION(1, "i2c0", "sda", V_88F6920_PLUS)), | |
41 | MPP_MODE(4, | |
42 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
43 | MPP_VAR_FUNCTION(2, "ua1", "txd", V_88F6920_PLUS), | |
44 | MPP_VAR_FUNCTION(3, "ua0", "rts", V_88F6920_PLUS), | |
45 | MPP_VAR_FUNCTION(7, "smi", "mdc", V_88F6920_PLUS)), | |
46 | MPP_MODE(5, | |
47 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
48 | MPP_VAR_FUNCTION(2, "ua1", "rxd", V_88F6920_PLUS), | |
49 | MPP_VAR_FUNCTION(3, "ua0", "cts", V_88F6920_PLUS), | |
50 | MPP_VAR_FUNCTION(7, "smi", "mdio", V_88F6920_PLUS)), | |
51 | MPP_MODE(6, | |
52 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
53 | MPP_VAR_FUNCTION(5, "dev", "cs3", V_88F6920_PLUS), | |
54 | MPP_VAR_FUNCTION(7, "xsmi", "mdio", V_88F6920_PLUS)), | |
55 | MPP_MODE(7, | |
56 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
57 | MPP_VAR_FUNCTION(5, "dev", "ad9", V_88F6920_PLUS), | |
58 | MPP_VAR_FUNCTION(7, "xsmi", "mdc", V_88F6920_PLUS)), | |
59 | MPP_MODE(8, | |
60 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
61 | MPP_VAR_FUNCTION(5, "dev", "ad10", V_88F6920_PLUS), | |
62 | MPP_VAR_FUNCTION(7, "ptp", "trig", V_88F6920_PLUS)), | |
63 | MPP_MODE(9, | |
64 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
65 | MPP_VAR_FUNCTION(5, "dev", "ad11", V_88F6920_PLUS), | |
66 | MPP_VAR_FUNCTION(7, "ptp", "clk", V_88F6920_PLUS)), | |
67 | MPP_MODE(10, | |
68 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
69 | MPP_VAR_FUNCTION(5, "dev", "ad12", V_88F6920_PLUS), | |
9540cf53 | 70 | MPP_VAR_FUNCTION(7, "ptp", "evreq", V_88F6920_PLUS)), |
ee086577 TP |
71 | MPP_MODE(11, |
72 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
73 | MPP_VAR_FUNCTION(5, "dev", "ad13", V_88F6920_PLUS), | |
74 | MPP_VAR_FUNCTION(7, "led", "clk", V_88F6920_PLUS)), | |
75 | MPP_MODE(12, | |
76 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
77 | MPP_VAR_FUNCTION(2, "pcie0", "rstout", V_88F6920_PLUS), | |
78 | MPP_VAR_FUNCTION(5, "dev", "ad14", V_88F6920_PLUS), | |
79 | MPP_VAR_FUNCTION(7, "led", "stb", V_88F6920_PLUS)), | |
80 | MPP_MODE(13, | |
81 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
82 | MPP_VAR_FUNCTION(5, "dev", "ad15", V_88F6920_PLUS), | |
c0adb877 | 83 | MPP_VAR_FUNCTION(6, "pcie2", "clkreq", V_88F6920_PLUS), |
ee086577 TP |
84 | MPP_VAR_FUNCTION(7, "led", "data", V_88F6920_PLUS)), |
85 | MPP_MODE(14, | |
86 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
100dc5d8 | 87 | MPP_VAR_FUNCTION(3, "dram", "vttctrl", V_88F6920_PLUS), |
7bd6a26d | 88 | MPP_VAR_FUNCTION(5, "dev", "we1", V_88F6920_PLUS), |
ee086577 TP |
89 | MPP_VAR_FUNCTION(7, "ua1", "txd", V_88F6920_PLUS)), |
90 | MPP_MODE(15, | |
91 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
92 | MPP_VAR_FUNCTION(3, "pcie0", "rstout", V_88F6920_PLUS), | |
93 | MPP_VAR_FUNCTION(4, "spi0", "mosi", V_88F6920_PLUS), | |
94 | MPP_VAR_FUNCTION(7, "i2c1", "sck", V_88F6920_PLUS)), | |
95 | MPP_MODE(16, | |
96 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
100dc5d8 | 97 | MPP_VAR_FUNCTION(3, "dram", "deccerr", V_88F6920_PLUS), |
ee086577 | 98 | MPP_VAR_FUNCTION(4, "spi0", "miso", V_88F6920_PLUS), |
c0adb877 | 99 | MPP_VAR_FUNCTION(5, "pcie0", "clkreq", V_88F6920_PLUS), |
ee086577 TP |
100 | MPP_VAR_FUNCTION(7, "i2c1", "sda", V_88F6920_PLUS)), |
101 | MPP_MODE(17, | |
102 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
103 | MPP_VAR_FUNCTION(3, "ua1", "rxd", V_88F6920_PLUS), | |
104 | MPP_VAR_FUNCTION(4, "spi0", "sck", V_88F6920_PLUS), | |
e73ac02d TP |
105 | MPP_VAR_FUNCTION(5, "sata1", "prsnt", V_88F6925_PLUS), |
106 | MPP_VAR_FUNCTION(6, "sata0", "prsnt", V_88F6925_PLUS), | |
ee086577 TP |
107 | MPP_VAR_FUNCTION(7, "smi", "mdio", V_88F6920_PLUS)), |
108 | MPP_MODE(18, | |
109 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
110 | MPP_VAR_FUNCTION(3, "ua1", "txd", V_88F6920_PLUS), | |
111 | MPP_VAR_FUNCTION(4, "spi0", "cs0", V_88F6920_PLUS), | |
112 | MPP_VAR_FUNCTION(7, "i2c2", "sck", V_88F6920_PLUS)), | |
113 | MPP_MODE(19, | |
114 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
e73ac02d | 115 | MPP_VAR_FUNCTION(4, "sata1", "prsnt", V_88F6925_PLUS), |
ee086577 TP |
116 | MPP_VAR_FUNCTION(5, "ua0", "cts", V_88F6920_PLUS), |
117 | MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6920_PLUS), | |
118 | MPP_VAR_FUNCTION(7, "i2c2", "sda", V_88F6920_PLUS)), | |
119 | MPP_MODE(20, | |
120 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
e73ac02d | 121 | MPP_VAR_FUNCTION(4, "sata0", "prsnt", V_88F6925_PLUS), |
ee086577 TP |
122 | MPP_VAR_FUNCTION(5, "ua0", "rts", V_88F6920_PLUS), |
123 | MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6920_PLUS), | |
124 | MPP_VAR_FUNCTION(7, "smi", "mdc", V_88F6920_PLUS)), | |
125 | MPP_MODE(21, | |
126 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
127 | MPP_VAR_FUNCTION(1, "spi0", "cs1", V_88F6920_PLUS), | |
e73ac02d | 128 | MPP_VAR_FUNCTION(3, "sata0", "prsnt", V_88F6925_PLUS), |
ddf3f19e | 129 | MPP_VAR_FUNCTION(4, "sd0", "cmd", V_88F6920_PLUS), |
ee086577 | 130 | MPP_VAR_FUNCTION(5, "dev", "bootcs", V_88F6920_PLUS), |
e73ac02d | 131 | MPP_VAR_FUNCTION(6, "sata1", "prsnt", V_88F6925_PLUS), |
ee086577 TP |
132 | MPP_VAR_FUNCTION(8, "ge", "rxd0", V_88F6920_PLUS)), |
133 | MPP_MODE(22, | |
134 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
135 | MPP_VAR_FUNCTION(1, "spi0", "mosi", V_88F6920_PLUS), | |
136 | MPP_VAR_FUNCTION(5, "dev", "ad0", V_88F6920_PLUS)), | |
137 | MPP_MODE(23, | |
138 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
139 | MPP_VAR_FUNCTION(1, "spi0", "sck", V_88F6920_PLUS), | |
140 | MPP_VAR_FUNCTION(5, "dev", "ad2", V_88F6920_PLUS)), | |
141 | MPP_MODE(24, | |
142 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
143 | MPP_VAR_FUNCTION(1, "spi0", "miso", V_88F6920_PLUS), | |
144 | MPP_VAR_FUNCTION(2, "ua0", "cts", V_88F6920_PLUS), | |
145 | MPP_VAR_FUNCTION(3, "ua1", "rxd", V_88F6920_PLUS), | |
ddf3f19e | 146 | MPP_VAR_FUNCTION(4, "sd0", "d4", V_88F6920_PLUS), |
7bd6a26d | 147 | MPP_VAR_FUNCTION(5, "dev", "ready", V_88F6920_PLUS)), |
ee086577 TP |
148 | MPP_MODE(25, |
149 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
150 | MPP_VAR_FUNCTION(1, "spi0", "cs0", V_88F6920_PLUS), | |
151 | MPP_VAR_FUNCTION(2, "ua0", "rts", V_88F6920_PLUS), | |
152 | MPP_VAR_FUNCTION(3, "ua1", "txd", V_88F6920_PLUS), | |
ddf3f19e | 153 | MPP_VAR_FUNCTION(4, "sd0", "d5", V_88F6920_PLUS), |
ee086577 TP |
154 | MPP_VAR_FUNCTION(5, "dev", "cs0", V_88F6920_PLUS)), |
155 | MPP_MODE(26, | |
156 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
157 | MPP_VAR_FUNCTION(1, "spi0", "cs2", V_88F6920_PLUS), | |
158 | MPP_VAR_FUNCTION(3, "i2c1", "sck", V_88F6920_PLUS), | |
ddf3f19e | 159 | MPP_VAR_FUNCTION(4, "sd0", "d6", V_88F6920_PLUS), |
ee086577 TP |
160 | MPP_VAR_FUNCTION(5, "dev", "cs1", V_88F6920_PLUS)), |
161 | MPP_MODE(27, | |
162 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
163 | MPP_VAR_FUNCTION(1, "spi0", "cs3", V_88F6920_PLUS), | |
164 | MPP_VAR_FUNCTION(3, "i2c1", "sda", V_88F6920_PLUS), | |
ddf3f19e | 165 | MPP_VAR_FUNCTION(4, "sd0", "d7", V_88F6920_PLUS), |
ee086577 TP |
166 | MPP_VAR_FUNCTION(5, "dev", "cs2", V_88F6920_PLUS), |
167 | MPP_VAR_FUNCTION(8, "ge", "txclkout", V_88F6920_PLUS)), | |
168 | MPP_MODE(28, | |
169 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
ddf3f19e | 170 | MPP_VAR_FUNCTION(4, "sd0", "clk", V_88F6920_PLUS), |
ee086577 TP |
171 | MPP_VAR_FUNCTION(5, "dev", "ad5", V_88F6920_PLUS), |
172 | MPP_VAR_FUNCTION(8, "ge", "txd0", V_88F6920_PLUS)), | |
173 | MPP_MODE(29, | |
174 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
175 | MPP_VAR_FUNCTION(5, "dev", "ale0", V_88F6920_PLUS), | |
176 | MPP_VAR_FUNCTION(8, "ge", "txd1", V_88F6920_PLUS)), | |
177 | MPP_MODE(30, | |
178 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
7bd6a26d | 179 | MPP_VAR_FUNCTION(5, "dev", "oe", V_88F6920_PLUS), |
ee086577 TP |
180 | MPP_VAR_FUNCTION(8, "ge", "txd2", V_88F6920_PLUS)), |
181 | MPP_MODE(31, | |
182 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
183 | MPP_VAR_FUNCTION(5, "dev", "ale1", V_88F6920_PLUS), | |
184 | MPP_VAR_FUNCTION(8, "ge", "txd3", V_88F6920_PLUS)), | |
185 | MPP_MODE(32, | |
186 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
7bd6a26d | 187 | MPP_VAR_FUNCTION(5, "dev", "we0", V_88F6920_PLUS), |
ee086577 TP |
188 | MPP_VAR_FUNCTION(8, "ge", "txctl", V_88F6920_PLUS)), |
189 | MPP_MODE(33, | |
190 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
100dc5d8 | 191 | MPP_VAR_FUNCTION(1, "dram", "deccerr", V_88F6920_PLUS), |
ee086577 TP |
192 | MPP_VAR_FUNCTION(5, "dev", "ad3", V_88F6920_PLUS)), |
193 | MPP_MODE(34, | |
194 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
195 | MPP_VAR_FUNCTION(5, "dev", "ad1", V_88F6920_PLUS)), | |
196 | MPP_MODE(35, | |
197 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
691a8216 | 198 | MPP_VAR_FUNCTION(1, "ref", "clk_out1", V_88F6920_PLUS), |
ee086577 TP |
199 | MPP_VAR_FUNCTION(5, "dev", "a1", V_88F6920_PLUS)), |
200 | MPP_MODE(36, | |
201 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
202 | MPP_VAR_FUNCTION(5, "dev", "a0", V_88F6920_PLUS)), | |
203 | MPP_MODE(37, | |
204 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
ddf3f19e | 205 | MPP_VAR_FUNCTION(4, "sd0", "d3", V_88F6920_PLUS), |
ee086577 TP |
206 | MPP_VAR_FUNCTION(5, "dev", "ad8", V_88F6920_PLUS), |
207 | MPP_VAR_FUNCTION(8, "ge", "rxclk", V_88F6920_PLUS)), | |
208 | MPP_MODE(38, | |
209 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
691a8216 | 210 | MPP_VAR_FUNCTION(3, "ref", "clk_out0", V_88F6920_PLUS), |
ddf3f19e | 211 | MPP_VAR_FUNCTION(4, "sd0", "d0", V_88F6920_PLUS), |
ee086577 TP |
212 | MPP_VAR_FUNCTION(5, "dev", "ad4", V_88F6920_PLUS), |
213 | MPP_VAR_FUNCTION(8, "ge", "rxd1", V_88F6920_PLUS)), | |
214 | MPP_MODE(39, | |
215 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
216 | MPP_VAR_FUNCTION(1, "i2c1", "sck", V_88F6920_PLUS), | |
217 | MPP_VAR_FUNCTION(3, "ua0", "cts", V_88F6920_PLUS), | |
ddf3f19e | 218 | MPP_VAR_FUNCTION(4, "sd0", "d1", V_88F6920_PLUS), |
ee086577 TP |
219 | MPP_VAR_FUNCTION(5, "dev", "a2", V_88F6920_PLUS), |
220 | MPP_VAR_FUNCTION(8, "ge", "rxd2", V_88F6920_PLUS)), | |
221 | MPP_MODE(40, | |
222 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
223 | MPP_VAR_FUNCTION(1, "i2c1", "sda", V_88F6920_PLUS), | |
224 | MPP_VAR_FUNCTION(3, "ua0", "rts", V_88F6920_PLUS), | |
ddf3f19e | 225 | MPP_VAR_FUNCTION(4, "sd0", "d2", V_88F6920_PLUS), |
ee086577 TP |
226 | MPP_VAR_FUNCTION(5, "dev", "ad6", V_88F6920_PLUS), |
227 | MPP_VAR_FUNCTION(8, "ge", "rxd3", V_88F6920_PLUS)), | |
228 | MPP_MODE(41, | |
229 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
230 | MPP_VAR_FUNCTION(1, "ua1", "rxd", V_88F6920_PLUS), | |
231 | MPP_VAR_FUNCTION(3, "ua0", "cts", V_88F6920_PLUS), | |
232 | MPP_VAR_FUNCTION(4, "spi1", "cs3", V_88F6920_PLUS), | |
7bd6a26d | 233 | MPP_VAR_FUNCTION(5, "dev", "burst/last", V_88F6920_PLUS), |
5cc0de1f | 234 | MPP_VAR_FUNCTION(6, "nand", "rb0", V_88F6920_PLUS), |
ee086577 TP |
235 | MPP_VAR_FUNCTION(8, "ge", "rxctl", V_88F6920_PLUS)), |
236 | MPP_MODE(42, | |
237 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
238 | MPP_VAR_FUNCTION(1, "ua1", "txd", V_88F6920_PLUS), | |
239 | MPP_VAR_FUNCTION(3, "ua0", "rts", V_88F6920_PLUS), | |
240 | MPP_VAR_FUNCTION(5, "dev", "ad7", V_88F6920_PLUS)), | |
241 | MPP_MODE(43, | |
242 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
243 | MPP_VAR_FUNCTION(1, "pcie0", "clkreq", V_88F6920_PLUS), | |
100dc5d8 TP |
244 | MPP_VAR_FUNCTION(2, "dram", "vttctrl", V_88F6920_PLUS), |
245 | MPP_VAR_FUNCTION(3, "dram", "deccerr", V_88F6920_PLUS), | |
ee086577 TP |
246 | MPP_VAR_FUNCTION(4, "spi1", "cs2", V_88F6920_PLUS), |
247 | MPP_VAR_FUNCTION(5, "dev", "clkout", V_88F6920_PLUS), | |
5cc0de1f | 248 | MPP_VAR_FUNCTION(6, "nand", "rb1", V_88F6920_PLUS)), |
ee086577 TP |
249 | MPP_MODE(44, |
250 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
e73ac02d TP |
251 | MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6925_PLUS), |
252 | MPP_VAR_FUNCTION(2, "sata1", "prsnt", V_88F6925_PLUS), | |
6afc0c0f TP |
253 | MPP_VAR_FUNCTION(3, "sata2", "prsnt", V_88F6928), |
254 | MPP_VAR_FUNCTION(4, "sata3", "prsnt", V_88F6928), | |
ee086577 TP |
255 | MPP_VAR_FUNCTION(7, "led", "clk", V_88F6920_PLUS)), |
256 | MPP_MODE(45, | |
257 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
691a8216 | 258 | MPP_VAR_FUNCTION(1, "ref", "clk_out0", V_88F6920_PLUS), |
ee086577 TP |
259 | MPP_VAR_FUNCTION(2, "pcie0", "rstout", V_88F6920_PLUS), |
260 | MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6920_PLUS)), | |
261 | MPP_MODE(46, | |
262 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
691a8216 | 263 | MPP_VAR_FUNCTION(1, "ref", "clk_out1", V_88F6920_PLUS), |
ee086577 TP |
264 | MPP_VAR_FUNCTION(2, "pcie0", "rstout", V_88F6920_PLUS), |
265 | MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6920_PLUS), | |
266 | MPP_VAR_FUNCTION(7, "led", "stb", V_88F6920_PLUS)), | |
267 | MPP_MODE(47, | |
268 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
e73ac02d TP |
269 | MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6925_PLUS), |
270 | MPP_VAR_FUNCTION(2, "sata1", "prsnt", V_88F6925_PLUS), | |
6afc0c0f TP |
271 | MPP_VAR_FUNCTION(3, "sata2", "prsnt", V_88F6928), |
272 | MPP_VAR_FUNCTION(5, "sata3", "prsnt", V_88F6928), | |
ee086577 TP |
273 | MPP_VAR_FUNCTION(7, "led", "data", V_88F6920_PLUS)), |
274 | MPP_MODE(48, | |
275 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
e73ac02d | 276 | MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6925_PLUS), |
100dc5d8 | 277 | MPP_VAR_FUNCTION(2, "dram", "vttctrl", V_88F6920_PLUS), |
ee086577 TP |
278 | MPP_VAR_FUNCTION(3, "tdm", "pclk", V_88F6928), |
279 | MPP_VAR_FUNCTION(4, "audio", "mclk", V_88F6928), | |
ddf3f19e | 280 | MPP_VAR_FUNCTION(5, "sd0", "d4", V_88F6920_PLUS), |
ee086577 TP |
281 | MPP_VAR_FUNCTION(6, "pcie0", "clkreq", V_88F6920_PLUS), |
282 | MPP_VAR_FUNCTION(7, "ua1", "txd", V_88F6920_PLUS)), | |
283 | MPP_MODE(49, | |
284 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
6afc0c0f TP |
285 | MPP_VAR_FUNCTION(1, "sata2", "prsnt", V_88F6928), |
286 | MPP_VAR_FUNCTION(2, "sata3", "prsnt", V_88F6928), | |
ee086577 TP |
287 | MPP_VAR_FUNCTION(3, "tdm", "fsync", V_88F6928), |
288 | MPP_VAR_FUNCTION(4, "audio", "lrclk", V_88F6928), | |
ddf3f19e | 289 | MPP_VAR_FUNCTION(5, "sd0", "d5", V_88F6920_PLUS), |
ee086577 TP |
290 | MPP_VAR_FUNCTION(7, "ua2", "rxd", V_88F6920_PLUS)), |
291 | MPP_MODE(50, | |
292 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
293 | MPP_VAR_FUNCTION(1, "pcie0", "rstout", V_88F6920_PLUS), | |
294 | MPP_VAR_FUNCTION(3, "tdm", "drx", V_88F6928), | |
295 | MPP_VAR_FUNCTION(4, "audio", "extclk", V_88F6928), | |
ddf3f19e | 296 | MPP_VAR_FUNCTION(5, "sd0", "cmd", V_88F6920_PLUS), |
ee086577 TP |
297 | MPP_VAR_FUNCTION(7, "ua2", "rxd", V_88F6920_PLUS)), |
298 | MPP_MODE(51, | |
299 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
300 | MPP_VAR_FUNCTION(3, "tdm", "dtx", V_88F6928), | |
301 | MPP_VAR_FUNCTION(4, "audio", "sdo", V_88F6928), | |
100dc5d8 | 302 | MPP_VAR_FUNCTION(5, "dram", "deccerr", V_88F6920_PLUS), |
ee086577 TP |
303 | MPP_VAR_FUNCTION(7, "ua2", "txd", V_88F6920_PLUS)), |
304 | MPP_MODE(52, | |
305 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
306 | MPP_VAR_FUNCTION(1, "pcie0", "rstout", V_88F6920_PLUS), | |
dae5597f | 307 | MPP_VAR_FUNCTION(3, "tdm", "int", V_88F6928), |
ee086577 | 308 | MPP_VAR_FUNCTION(4, "audio", "sdi", V_88F6928), |
ddf3f19e | 309 | MPP_VAR_FUNCTION(5, "sd0", "d6", V_88F6920_PLUS), |
ee086577 TP |
310 | MPP_VAR_FUNCTION(7, "i2c3", "sck", V_88F6920_PLUS)), |
311 | MPP_MODE(53, | |
312 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
e73ac02d TP |
313 | MPP_VAR_FUNCTION(1, "sata1", "prsnt", V_88F6925_PLUS), |
314 | MPP_VAR_FUNCTION(2, "sata0", "prsnt", V_88F6925_PLUS), | |
dae5597f | 315 | MPP_VAR_FUNCTION(3, "tdm", "rst", V_88F6928), |
ee086577 | 316 | MPP_VAR_FUNCTION(4, "audio", "bclk", V_88F6928), |
ddf3f19e | 317 | MPP_VAR_FUNCTION(5, "sd0", "d7", V_88F6920_PLUS), |
ee086577 TP |
318 | MPP_VAR_FUNCTION(7, "i2c3", "sda", V_88F6920_PLUS)), |
319 | MPP_MODE(54, | |
320 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
e73ac02d TP |
321 | MPP_VAR_FUNCTION(1, "sata0", "prsnt", V_88F6925_PLUS), |
322 | MPP_VAR_FUNCTION(2, "sata1", "prsnt", V_88F6925_PLUS), | |
ee086577 | 323 | MPP_VAR_FUNCTION(3, "pcie0", "rstout", V_88F6920_PLUS), |
ddf3f19e | 324 | MPP_VAR_FUNCTION(5, "sd0", "d3", V_88F6920_PLUS), |
ee086577 TP |
325 | MPP_VAR_FUNCTION(7, "ua3", "txd", V_88F6920_PLUS)), |
326 | MPP_MODE(55, | |
327 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
328 | MPP_VAR_FUNCTION(1, "ua1", "cts", V_88F6920_PLUS), | |
329 | MPP_VAR_FUNCTION(4, "spi1", "cs1", V_88F6920_PLUS), | |
ddf3f19e | 330 | MPP_VAR_FUNCTION(5, "sd0", "d0", V_88F6920_PLUS), |
ee086577 TP |
331 | MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6920_PLUS), |
332 | MPP_VAR_FUNCTION(7, "ua3", "rxd", V_88F6920_PLUS)), | |
333 | MPP_MODE(56, | |
334 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
335 | MPP_VAR_FUNCTION(1, "ua1", "rts", V_88F6920_PLUS), | |
100dc5d8 | 336 | MPP_VAR_FUNCTION(3, "dram", "deccerr", V_88F6920_PLUS), |
ee086577 TP |
337 | MPP_VAR_FUNCTION(4, "spi1", "mosi", V_88F6920_PLUS), |
338 | MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6920_PLUS)), | |
339 | MPP_MODE(57, | |
340 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
341 | MPP_VAR_FUNCTION(4, "spi1", "sck", V_88F6920_PLUS), | |
ddf3f19e | 342 | MPP_VAR_FUNCTION(5, "sd0", "clk", V_88F6920_PLUS), |
ee086577 TP |
343 | MPP_VAR_FUNCTION(6, "ua1", "txd", V_88F6920_PLUS)), |
344 | MPP_MODE(58, | |
345 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
346 | MPP_VAR_FUNCTION(2, "i2c1", "sck", V_88F6920_PLUS), | |
347 | MPP_VAR_FUNCTION(3, "pcie2", "clkreq", V_88F6920_PLUS), | |
348 | MPP_VAR_FUNCTION(4, "spi1", "miso", V_88F6920_PLUS), | |
ddf3f19e | 349 | MPP_VAR_FUNCTION(5, "sd0", "d1", V_88F6920_PLUS), |
ee086577 TP |
350 | MPP_VAR_FUNCTION(6, "ua1", "rxd", V_88F6920_PLUS)), |
351 | MPP_MODE(59, | |
352 | MPP_VAR_FUNCTION(0, "gpio", NULL, V_88F6920_PLUS), | |
353 | MPP_VAR_FUNCTION(1, "pcie0", "rstout", V_88F6920_PLUS), | |
354 | MPP_VAR_FUNCTION(2, "i2c1", "sda", V_88F6920_PLUS), | |
355 | MPP_VAR_FUNCTION(4, "spi1", "cs0", V_88F6920_PLUS), | |
ddf3f19e | 356 | MPP_VAR_FUNCTION(5, "sd0", "d2", V_88F6920_PLUS)), |
ee086577 TP |
357 | }; |
358 | ||
359 | static struct mvebu_pinctrl_soc_info armada_39x_pinctrl_info; | |
360 | ||
baa9946e | 361 | static const struct of_device_id armada_39x_pinctrl_of_match[] = { |
ee086577 TP |
362 | { |
363 | .compatible = "marvell,mv88f6920-pinctrl", | |
364 | .data = (void *) V_88F6920, | |
365 | }, | |
e73ac02d TP |
366 | { |
367 | .compatible = "marvell,mv88f6925-pinctrl", | |
368 | .data = (void *) V_88F6925, | |
369 | }, | |
ee086577 TP |
370 | { |
371 | .compatible = "marvell,mv88f6928-pinctrl", | |
372 | .data = (void *) V_88F6928, | |
373 | }, | |
374 | { }, | |
375 | }; | |
376 | ||
30be3fb9 | 377 | static const struct mvebu_mpp_ctrl armada_39x_mpp_controls[] = { |
ad9ec4ec | 378 | MPP_FUNC_CTRL(0, 59, NULL, mvebu_mmio_mpp_ctrl), |
ee086577 TP |
379 | }; |
380 | ||
381 | static struct pinctrl_gpio_range armada_39x_mpp_gpio_ranges[] = { | |
382 | MPP_GPIO_RANGE(0, 0, 0, 32), | |
7c580311 | 383 | MPP_GPIO_RANGE(1, 32, 32, 28), |
ee086577 TP |
384 | }; |
385 | ||
386 | static int armada_39x_pinctrl_probe(struct platform_device *pdev) | |
387 | { | |
388 | struct mvebu_pinctrl_soc_info *soc = &armada_39x_pinctrl_info; | |
389 | const struct of_device_id *match = | |
390 | of_match_device(armada_39x_pinctrl_of_match, &pdev->dev); | |
ee086577 TP |
391 | |
392 | if (!match) | |
393 | return -ENODEV; | |
394 | ||
ee086577 TP |
395 | soc->variant = (unsigned) match->data & 0xff; |
396 | soc->controls = armada_39x_mpp_controls; | |
397 | soc->ncontrols = ARRAY_SIZE(armada_39x_mpp_controls); | |
398 | soc->gpioranges = armada_39x_mpp_gpio_ranges; | |
399 | soc->ngpioranges = ARRAY_SIZE(armada_39x_mpp_gpio_ranges); | |
400 | soc->modes = armada_39x_mpp_modes; | |
401 | soc->nmodes = armada_39x_mpp_controls[0].npins; | |
402 | ||
403 | pdev->dev.platform_data = soc; | |
404 | ||
ad9ec4ec | 405 | return mvebu_pinctrl_simple_mmio_probe(pdev); |
ee086577 TP |
406 | } |
407 | ||
ee086577 TP |
408 | static struct platform_driver armada_39x_pinctrl_driver = { |
409 | .driver = { | |
410 | .name = "armada-39x-pinctrl", | |
411 | .of_match_table = of_match_ptr(armada_39x_pinctrl_of_match), | |
412 | }, | |
413 | .probe = armada_39x_pinctrl_probe, | |
ee086577 | 414 | }; |
fdbde81b | 415 | builtin_platform_driver(armada_39x_pinctrl_driver); |