blob: fe6c46cdd5b0f52336bf7777e95f300ec35e4996 [file] [log] [blame]
Samuel Hollande3095022021-08-12 20:09:43 -05001// SPDX-License-Identifier: GPL-2.0
2
3#include <clk.h>
4#include <dm.h>
5#include <dm/device-internal.h>
6#include <dm/lists.h>
7#include <dm/pinctrl.h>
8#include <errno.h>
9#include <malloc.h>
10
11#include <asm/gpio.h>
12
13extern U_BOOT_DRIVER(gpio_sunxi);
14
Samuel Hollandecbbedb2021-08-16 23:56:47 -050015/*
16 * This structure implements a simplified view of the possible pinmux settings:
17 * Each mux value is assumed to be the same for a given function, across the
18 * pins in each group (almost universally true, with same rare exceptions not
19 * relevant to U-Boot), but also across different ports (not true in many
20 * cases). We ignore the first problem, and work around the latter by just
21 * supporting one particular port for a each function. This works fine for all
22 * board configurations so far. If this would need to be revisited, we could
23 * add a "u8 port;" below and match that, with 0 encoding the "don't care" case.
24 */
25struct sunxi_pinctrl_function {
26 const char name[sizeof("gpio_out")];
27 u8 mux;
28};
29
Samuel Hollande3095022021-08-12 20:09:43 -050030struct sunxi_pinctrl_desc {
Samuel Hollandecbbedb2021-08-16 23:56:47 -050031 const struct sunxi_pinctrl_function *functions;
32 u8 num_functions;
Samuel Hollande3095022021-08-12 20:09:43 -050033 u8 first_bank;
34 u8 num_banks;
35};
36
37struct sunxi_pinctrl_plat {
38 struct sunxi_gpio __iomem *base;
39};
40
Samuel Hollandecbbedb2021-08-16 23:56:47 -050041static int sunxi_pinctrl_get_pins_count(struct udevice *dev)
42{
43 const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev);
44
45 return desc->num_banks * SUNXI_GPIOS_PER_BANK;
46}
47
48static const char *sunxi_pinctrl_get_pin_name(struct udevice *dev,
49 uint pin_selector)
50{
51 const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev);
52 static char pin_name[sizeof("PN31")];
53
54 snprintf(pin_name, sizeof(pin_name), "P%c%d",
55 pin_selector / SUNXI_GPIOS_PER_BANK + desc->first_bank + 'A',
56 pin_selector % SUNXI_GPIOS_PER_BANK);
57
58 return pin_name;
59}
60
61static int sunxi_pinctrl_get_functions_count(struct udevice *dev)
62{
63 const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev);
64
65 return desc->num_functions;
66}
67
68static const char *sunxi_pinctrl_get_function_name(struct udevice *dev,
69 uint func_selector)
70{
71 const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev);
72
73 return desc->functions[func_selector].name;
74}
75
76static int sunxi_pinctrl_pinmux_set(struct udevice *dev, uint pin_selector,
77 uint func_selector)
78{
79 const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev);
80 struct sunxi_pinctrl_plat *plat = dev_get_plat(dev);
81 int bank = pin_selector / SUNXI_GPIOS_PER_BANK;
82 int pin = pin_selector % SUNXI_GPIOS_PER_BANK;
83
84 debug("set mux: %-4s => %s (%d)\n",
85 sunxi_pinctrl_get_pin_name(dev, pin_selector),
86 sunxi_pinctrl_get_function_name(dev, func_selector),
87 desc->functions[func_selector].mux);
88
89 sunxi_gpio_set_cfgbank(plat->base + bank, pin,
90 desc->functions[func_selector].mux);
91
92 return 0;
93}
94
Samuel Hollande3095022021-08-12 20:09:43 -050095static const struct pinctrl_ops sunxi_pinctrl_ops = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -050096 .get_pins_count = sunxi_pinctrl_get_pins_count,
97 .get_pin_name = sunxi_pinctrl_get_pin_name,
98 .get_functions_count = sunxi_pinctrl_get_functions_count,
99 .get_function_name = sunxi_pinctrl_get_function_name,
100 .pinmux_set = sunxi_pinctrl_pinmux_set,
Samuel Hollande3095022021-08-12 20:09:43 -0500101 .set_state = pinctrl_generic_set_state,
102};
103
104static int sunxi_pinctrl_bind(struct udevice *dev)
105{
106 struct sunxi_pinctrl_plat *plat = dev_get_plat(dev);
107 struct sunxi_pinctrl_desc *desc;
108 struct sunxi_gpio_plat *gpio_plat;
109 struct udevice *gpio_dev;
110 int i, ret;
111
112 desc = (void *)dev_get_driver_data(dev);
113 if (!desc)
114 return -EINVAL;
115 dev_set_priv(dev, desc);
116
117 plat->base = dev_read_addr_ptr(dev);
118
119 ret = device_bind_driver_to_node(dev, "gpio_sunxi", dev->name,
120 dev_ofnode(dev), &gpio_dev);
121 if (ret)
122 return ret;
123
124 for (i = 0; i < desc->num_banks; ++i) {
125 gpio_plat = malloc(sizeof(*gpio_plat));
126 if (!gpio_plat)
127 return -ENOMEM;
128
129 gpio_plat->regs = plat->base + i;
130 gpio_plat->bank_name[0] = 'P';
131 gpio_plat->bank_name[1] = 'A' + desc->first_bank + i;
132 gpio_plat->bank_name[2] = '\0';
133
134 ret = device_bind(gpio_dev, DM_DRIVER_REF(gpio_sunxi),
135 gpio_plat->bank_name, gpio_plat,
136 ofnode_null(), NULL);
137 if (ret)
138 return ret;
139 }
140
141 return 0;
142}
143
144static int sunxi_pinctrl_probe(struct udevice *dev)
145{
146 struct clk *apb_clk;
147
148 apb_clk = devm_clk_get(dev, "apb");
149 if (!IS_ERR(apb_clk))
150 clk_enable(apb_clk);
151
152 return 0;
153}
154
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500155static const struct sunxi_pinctrl_function suniv_f1c100s_pinctrl_functions[] = {
156 { "gpio_in", 0 },
157 { "gpio_out", 1 },
158};
159
Samuel Hollande3095022021-08-12 20:09:43 -0500160static const struct sunxi_pinctrl_desc __maybe_unused suniv_f1c100s_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500161 .functions = suniv_f1c100s_pinctrl_functions,
162 .num_functions = ARRAY_SIZE(suniv_f1c100s_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500163 .first_bank = SUNXI_GPIO_A,
164 .num_banks = 6,
165};
166
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500167static const struct sunxi_pinctrl_function sun4i_a10_pinctrl_functions[] = {
168 { "gpio_in", 0 },
169 { "gpio_out", 1 },
170};
171
Samuel Hollande3095022021-08-12 20:09:43 -0500172static const struct sunxi_pinctrl_desc __maybe_unused sun4i_a10_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500173 .functions = sun4i_a10_pinctrl_functions,
174 .num_functions = ARRAY_SIZE(sun4i_a10_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500175 .first_bank = SUNXI_GPIO_A,
176 .num_banks = 9,
177};
178
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500179static const struct sunxi_pinctrl_function sun5i_a13_pinctrl_functions[] = {
180 { "gpio_in", 0 },
181 { "gpio_out", 1 },
182};
183
Samuel Hollande3095022021-08-12 20:09:43 -0500184static const struct sunxi_pinctrl_desc __maybe_unused sun5i_a13_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500185 .functions = sun5i_a13_pinctrl_functions,
186 .num_functions = ARRAY_SIZE(sun5i_a13_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500187 .first_bank = SUNXI_GPIO_A,
188 .num_banks = 7,
189};
190
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500191static const struct sunxi_pinctrl_function sun6i_a31_pinctrl_functions[] = {
192 { "gpio_in", 0 },
193 { "gpio_out", 1 },
194};
195
Samuel Hollande3095022021-08-12 20:09:43 -0500196static const struct sunxi_pinctrl_desc __maybe_unused sun6i_a31_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500197 .functions = sun6i_a31_pinctrl_functions,
198 .num_functions = ARRAY_SIZE(sun6i_a31_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500199 .first_bank = SUNXI_GPIO_A,
200 .num_banks = 8,
201};
202
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500203static const struct sunxi_pinctrl_function sun6i_a31_r_pinctrl_functions[] = {
204 { "gpio_in", 0 },
205 { "gpio_out", 1 },
206};
207
Samuel Hollande3095022021-08-12 20:09:43 -0500208static const struct sunxi_pinctrl_desc __maybe_unused sun6i_a31_r_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500209 .functions = sun6i_a31_r_pinctrl_functions,
210 .num_functions = ARRAY_SIZE(sun6i_a31_r_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500211 .first_bank = SUNXI_GPIO_L,
212 .num_banks = 2,
213};
214
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500215static const struct sunxi_pinctrl_function sun7i_a20_pinctrl_functions[] = {
216 { "gpio_in", 0 },
217 { "gpio_out", 1 },
218};
219
Samuel Hollande3095022021-08-12 20:09:43 -0500220static const struct sunxi_pinctrl_desc __maybe_unused sun7i_a20_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500221 .functions = sun7i_a20_pinctrl_functions,
222 .num_functions = ARRAY_SIZE(sun7i_a20_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500223 .first_bank = SUNXI_GPIO_A,
224 .num_banks = 9,
225};
226
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500227static const struct sunxi_pinctrl_function sun8i_a23_pinctrl_functions[] = {
228 { "gpio_in", 0 },
229 { "gpio_out", 1 },
230};
231
Samuel Hollande3095022021-08-12 20:09:43 -0500232static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a23_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500233 .functions = sun8i_a23_pinctrl_functions,
234 .num_functions = ARRAY_SIZE(sun8i_a23_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500235 .first_bank = SUNXI_GPIO_A,
236 .num_banks = 8,
237};
238
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500239static const struct sunxi_pinctrl_function sun8i_a23_r_pinctrl_functions[] = {
240 { "gpio_in", 0 },
241 { "gpio_out", 1 },
242};
243
Samuel Hollande3095022021-08-12 20:09:43 -0500244static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a23_r_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500245 .functions = sun8i_a23_r_pinctrl_functions,
246 .num_functions = ARRAY_SIZE(sun8i_a23_r_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500247 .first_bank = SUNXI_GPIO_L,
248 .num_banks = 1,
249};
250
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500251static const struct sunxi_pinctrl_function sun8i_a33_pinctrl_functions[] = {
252 { "gpio_in", 0 },
253 { "gpio_out", 1 },
254};
255
Samuel Hollande3095022021-08-12 20:09:43 -0500256static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a33_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500257 .functions = sun8i_a33_pinctrl_functions,
258 .num_functions = ARRAY_SIZE(sun8i_a33_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500259 .first_bank = SUNXI_GPIO_A,
260 .num_banks = 8,
261};
262
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500263static const struct sunxi_pinctrl_function sun8i_a83t_pinctrl_functions[] = {
264 { "gpio_in", 0 },
265 { "gpio_out", 1 },
266};
267
Samuel Hollande3095022021-08-12 20:09:43 -0500268static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a83t_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500269 .functions = sun8i_a83t_pinctrl_functions,
270 .num_functions = ARRAY_SIZE(sun8i_a83t_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500271 .first_bank = SUNXI_GPIO_A,
272 .num_banks = 8,
273};
274
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500275static const struct sunxi_pinctrl_function sun8i_a83t_r_pinctrl_functions[] = {
276 { "gpio_in", 0 },
277 { "gpio_out", 1 },
278};
279
Samuel Hollande3095022021-08-12 20:09:43 -0500280static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a83t_r_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500281 .functions = sun8i_a83t_r_pinctrl_functions,
282 .num_functions = ARRAY_SIZE(sun8i_a83t_r_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500283 .first_bank = SUNXI_GPIO_L,
284 .num_banks = 1,
285};
286
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500287static const struct sunxi_pinctrl_function sun8i_h3_pinctrl_functions[] = {
288 { "gpio_in", 0 },
289 { "gpio_out", 1 },
290};
291
Samuel Hollande3095022021-08-12 20:09:43 -0500292static const struct sunxi_pinctrl_desc __maybe_unused sun8i_h3_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500293 .functions = sun8i_h3_pinctrl_functions,
294 .num_functions = ARRAY_SIZE(sun8i_h3_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500295 .first_bank = SUNXI_GPIO_A,
296 .num_banks = 7,
297};
298
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500299static const struct sunxi_pinctrl_function sun8i_h3_r_pinctrl_functions[] = {
300 { "gpio_in", 0 },
301 { "gpio_out", 1 },
302};
303
Samuel Hollande3095022021-08-12 20:09:43 -0500304static const struct sunxi_pinctrl_desc __maybe_unused sun8i_h3_r_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500305 .functions = sun8i_h3_r_pinctrl_functions,
306 .num_functions = ARRAY_SIZE(sun8i_h3_r_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500307 .first_bank = SUNXI_GPIO_L,
308 .num_banks = 1,
309};
310
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500311static const struct sunxi_pinctrl_function sun8i_v3s_pinctrl_functions[] = {
312 { "gpio_in", 0 },
313 { "gpio_out", 1 },
314};
315
Samuel Hollande3095022021-08-12 20:09:43 -0500316static const struct sunxi_pinctrl_desc __maybe_unused sun8i_v3s_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500317 .functions = sun8i_v3s_pinctrl_functions,
318 .num_functions = ARRAY_SIZE(sun8i_v3s_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500319 .first_bank = SUNXI_GPIO_A,
320 .num_banks = 7,
321};
322
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500323static const struct sunxi_pinctrl_function sun9i_a80_pinctrl_functions[] = {
324 { "gpio_in", 0 },
325 { "gpio_out", 1 },
326};
327
Samuel Hollande3095022021-08-12 20:09:43 -0500328static const struct sunxi_pinctrl_desc __maybe_unused sun9i_a80_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500329 .functions = sun9i_a80_pinctrl_functions,
330 .num_functions = ARRAY_SIZE(sun9i_a80_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500331 .first_bank = SUNXI_GPIO_A,
332 .num_banks = 8,
333};
334
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500335static const struct sunxi_pinctrl_function sun9i_a80_r_pinctrl_functions[] = {
336 { "gpio_in", 0 },
337 { "gpio_out", 1 },
338};
339
Samuel Hollande3095022021-08-12 20:09:43 -0500340static const struct sunxi_pinctrl_desc __maybe_unused sun9i_a80_r_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500341 .functions = sun9i_a80_r_pinctrl_functions,
342 .num_functions = ARRAY_SIZE(sun9i_a80_r_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500343 .first_bank = SUNXI_GPIO_L,
344 .num_banks = 3,
345};
346
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500347static const struct sunxi_pinctrl_function sun50i_a64_pinctrl_functions[] = {
348 { "gpio_in", 0 },
349 { "gpio_out", 1 },
350};
351
Samuel Hollande3095022021-08-12 20:09:43 -0500352static const struct sunxi_pinctrl_desc __maybe_unused sun50i_a64_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500353 .functions = sun50i_a64_pinctrl_functions,
354 .num_functions = ARRAY_SIZE(sun50i_a64_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500355 .first_bank = SUNXI_GPIO_A,
356 .num_banks = 8,
357};
358
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500359static const struct sunxi_pinctrl_function sun50i_a64_r_pinctrl_functions[] = {
360 { "gpio_in", 0 },
361 { "gpio_out", 1 },
362};
363
Samuel Hollande3095022021-08-12 20:09:43 -0500364static const struct sunxi_pinctrl_desc __maybe_unused sun50i_a64_r_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500365 .functions = sun50i_a64_r_pinctrl_functions,
366 .num_functions = ARRAY_SIZE(sun50i_a64_r_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500367 .first_bank = SUNXI_GPIO_L,
368 .num_banks = 1,
369};
370
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500371static const struct sunxi_pinctrl_function sun50i_h5_pinctrl_functions[] = {
372 { "gpio_in", 0 },
373 { "gpio_out", 1 },
374};
375
Samuel Hollande3095022021-08-12 20:09:43 -0500376static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h5_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500377 .functions = sun50i_h5_pinctrl_functions,
378 .num_functions = ARRAY_SIZE(sun50i_h5_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500379 .first_bank = SUNXI_GPIO_A,
380 .num_banks = 7,
381};
382
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500383static const struct sunxi_pinctrl_function sun50i_h6_pinctrl_functions[] = {
384 { "gpio_in", 0 },
385 { "gpio_out", 1 },
386};
387
Samuel Hollande3095022021-08-12 20:09:43 -0500388static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h6_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500389 .functions = sun50i_h6_pinctrl_functions,
390 .num_functions = ARRAY_SIZE(sun50i_h6_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500391 .first_bank = SUNXI_GPIO_A,
392 .num_banks = 8,
393};
394
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500395static const struct sunxi_pinctrl_function sun50i_h6_r_pinctrl_functions[] = {
396 { "gpio_in", 0 },
397 { "gpio_out", 1 },
398};
399
Samuel Hollande3095022021-08-12 20:09:43 -0500400static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h6_r_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500401 .functions = sun50i_h6_r_pinctrl_functions,
402 .num_functions = ARRAY_SIZE(sun50i_h6_r_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500403 .first_bank = SUNXI_GPIO_L,
404 .num_banks = 2,
405};
406
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500407static const struct sunxi_pinctrl_function sun50i_h616_pinctrl_functions[] = {
408 { "gpio_in", 0 },
409 { "gpio_out", 1 },
410};
411
Samuel Hollande3095022021-08-12 20:09:43 -0500412static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h616_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500413 .functions = sun50i_h616_pinctrl_functions,
414 .num_functions = ARRAY_SIZE(sun50i_h616_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500415 .first_bank = SUNXI_GPIO_A,
416 .num_banks = 9,
417};
418
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500419static const struct sunxi_pinctrl_function sun50i_h616_r_pinctrl_functions[] = {
420 { "gpio_in", 0 },
421 { "gpio_out", 1 },
422};
423
Samuel Hollande3095022021-08-12 20:09:43 -0500424static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h616_r_pinctrl_desc = {
Samuel Hollandecbbedb2021-08-16 23:56:47 -0500425 .functions = sun50i_h616_r_pinctrl_functions,
426 .num_functions = ARRAY_SIZE(sun50i_h616_r_pinctrl_functions),
Samuel Hollande3095022021-08-12 20:09:43 -0500427 .first_bank = SUNXI_GPIO_L,
428 .num_banks = 1,
429};
430
431static const struct udevice_id sunxi_pinctrl_ids[] = {
432#ifdef CONFIG_PINCTRL_SUNIV_F1C100S
433 {
434 .compatible = "allwinner,suniv-f1c100s-pinctrl",
435 .data = (ulong)&suniv_f1c100s_pinctrl_desc,
436 },
437#endif
438#ifdef CONFIG_PINCTRL_SUN4I_A10
439 {
440 .compatible = "allwinner,sun4i-a10-pinctrl",
441 .data = (ulong)&sun4i_a10_pinctrl_desc,
442 },
443#endif
444#ifdef CONFIG_PINCTRL_SUN5I_A13
445 {
446 .compatible = "allwinner,sun5i-a10s-pinctrl",
447 .data = (ulong)&sun5i_a13_pinctrl_desc,
448 },
449 {
450 .compatible = "allwinner,sun5i-a13-pinctrl",
451 .data = (ulong)&sun5i_a13_pinctrl_desc,
452 },
453#endif
454#ifdef CONFIG_PINCTRL_SUN6I_A31
455 {
456 .compatible = "allwinner,sun6i-a31-pinctrl",
457 .data = (ulong)&sun6i_a31_pinctrl_desc,
458 },
459 {
460 .compatible = "allwinner,sun6i-a31s-pinctrl",
461 .data = (ulong)&sun6i_a31_pinctrl_desc,
462 },
463#endif
464#ifdef CONFIG_PINCTRL_SUN6I_A31_R
465 {
466 .compatible = "allwinner,sun6i-a31-r-pinctrl",
467 .data = (ulong)&sun6i_a31_r_pinctrl_desc,
468 },
469#endif
470#ifdef CONFIG_PINCTRL_SUN7I_A20
471 {
472 .compatible = "allwinner,sun7i-a20-pinctrl",
473 .data = (ulong)&sun7i_a20_pinctrl_desc,
474 },
475#endif
476#ifdef CONFIG_PINCTRL_SUN8I_A23
477 {
478 .compatible = "allwinner,sun8i-a23-pinctrl",
479 .data = (ulong)&sun8i_a23_pinctrl_desc,
480 },
481#endif
482#ifdef CONFIG_PINCTRL_SUN8I_A23_R
483 {
484 .compatible = "allwinner,sun8i-a23-r-pinctrl",
485 .data = (ulong)&sun8i_a23_r_pinctrl_desc,
486 },
487#endif
488#ifdef CONFIG_PINCTRL_SUN8I_A33
489 {
490 .compatible = "allwinner,sun8i-a33-pinctrl",
491 .data = (ulong)&sun8i_a33_pinctrl_desc,
492 },
493#endif
494#ifdef CONFIG_PINCTRL_SUN8I_A83T
495 {
496 .compatible = "allwinner,sun8i-a83t-pinctrl",
497 .data = (ulong)&sun8i_a83t_pinctrl_desc,
498 },
499#endif
500#ifdef CONFIG_PINCTRL_SUN8I_A83T_R
501 {
502 .compatible = "allwinner,sun8i-a83t-r-pinctrl",
503 .data = (ulong)&sun8i_a83t_r_pinctrl_desc,
504 },
505#endif
506#ifdef CONFIG_PINCTRL_SUN8I_H3
507 {
508 .compatible = "allwinner,sun8i-h3-pinctrl",
509 .data = (ulong)&sun8i_h3_pinctrl_desc,
510 },
511#endif
512#ifdef CONFIG_PINCTRL_SUN8I_H3_R
513 {
514 .compatible = "allwinner,sun8i-h3-r-pinctrl",
515 .data = (ulong)&sun8i_h3_r_pinctrl_desc,
516 },
517#endif
518#ifdef CONFIG_PINCTRL_SUN7I_A20
519 {
520 .compatible = "allwinner,sun8i-r40-pinctrl",
521 .data = (ulong)&sun7i_a20_pinctrl_desc,
522 },
523#endif
524#ifdef CONFIG_PINCTRL_SUN8I_V3S
525 {
526 .compatible = "allwinner,sun8i-v3-pinctrl",
527 .data = (ulong)&sun8i_v3s_pinctrl_desc,
528 },
529 {
530 .compatible = "allwinner,sun8i-v3s-pinctrl",
531 .data = (ulong)&sun8i_v3s_pinctrl_desc,
532 },
533#endif
534#ifdef CONFIG_PINCTRL_SUN9I_A80
535 {
536 .compatible = "allwinner,sun9i-a80-pinctrl",
537 .data = (ulong)&sun9i_a80_pinctrl_desc,
538 },
539#endif
540#ifdef CONFIG_PINCTRL_SUN9I_A80_R
541 {
542 .compatible = "allwinner,sun9i-a80-r-pinctrl",
543 .data = (ulong)&sun9i_a80_r_pinctrl_desc,
544 },
545#endif
546#ifdef CONFIG_PINCTRL_SUN50I_A64
547 {
548 .compatible = "allwinner,sun50i-a64-pinctrl",
549 .data = (ulong)&sun50i_a64_pinctrl_desc,
550 },
551#endif
552#ifdef CONFIG_PINCTRL_SUN50I_A64_R
553 {
554 .compatible = "allwinner,sun50i-a64-r-pinctrl",
555 .data = (ulong)&sun50i_a64_r_pinctrl_desc,
556 },
557#endif
558#ifdef CONFIG_PINCTRL_SUN50I_H5
559 {
560 .compatible = "allwinner,sun50i-h5-pinctrl",
561 .data = (ulong)&sun50i_h5_pinctrl_desc,
562 },
563#endif
564#ifdef CONFIG_PINCTRL_SUN50I_H6
565 {
566 .compatible = "allwinner,sun50i-h6-pinctrl",
567 .data = (ulong)&sun50i_h6_pinctrl_desc,
568 },
569#endif
570#ifdef CONFIG_PINCTRL_SUN50I_H6_R
571 {
572 .compatible = "allwinner,sun50i-h6-r-pinctrl",
573 .data = (ulong)&sun50i_h6_r_pinctrl_desc,
574 },
575#endif
576#ifdef CONFIG_PINCTRL_SUN50I_H616
577 {
578 .compatible = "allwinner,sun50i-h616-pinctrl",
579 .data = (ulong)&sun50i_h616_pinctrl_desc,
580 },
581#endif
582#ifdef CONFIG_PINCTRL_SUN50I_H616_R
583 {
584 .compatible = "allwinner,sun50i-h616-r-pinctrl",
585 .data = (ulong)&sun50i_h616_r_pinctrl_desc,
586 },
587#endif
588 {}
589};
590
591U_BOOT_DRIVER(sunxi_pinctrl) = {
592 .name = "sunxi-pinctrl",
593 .id = UCLASS_PINCTRL,
594 .of_match = sunxi_pinctrl_ids,
595 .bind = sunxi_pinctrl_bind,
596 .probe = sunxi_pinctrl_probe,
597 .plat_auto = sizeof(struct sunxi_pinctrl_plat),
598 .ops = &sunxi_pinctrl_ops,
599};