kernel: bump 4.9 to 4.9.102 for 18.06
[oweals/openwrt.git] / target / linux / at91 / patches-4.9 / 104-ARM-at91-build-dtb-for-sama5d27-SOM1-Ek.patch
1 --- a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
2 +++ b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt
3 @@ -35,7 +35,12 @@ right representation of the pin.
4  Optional properties:
5  - GENERIC_PINCONFIG: generic pinconfig options to use, bias-disable,
6  bias-pull-down, bias-pull-up, drive-open-drain, input-schmitt-enable,
7 -input-debounce, output-low, output-high.
8 +input-debounce, output-low, output-high, drive-strength.
9 +
10 +Concerning the drive-strength property, the values accepted are
11 +ATMEL_PIO_DRVSTR_LO, ATMEL_PIO_DRVSTR_ME, ATMEL_PIO_DRVSTR_HI. The current
12 +depends on VDDIOP. You can find the details in the DC Characteristics table
13 +from the datasheet.
14  
15  Example:
16  
17 --- a/arch/arm/boot/dts/Makefile
18 +++ b/arch/arm/boot/dts/Makefile
19 @@ -49,6 +49,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \
20         wb45n.dtb
21  dtb-$(CONFIG_SOC_SAM_V7) += \
22         at91-kizbox2.dtb \
23 +       at91-sama5d27_som1_ek.dtb \
24         at91-sama5d2_xplained.dtb \
25         at91-sama5d3_xplained.dtb \
26         sama5d31ek.dtb \
27 --- /dev/null
28 +++ b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
29 @@ -0,0 +1,175 @@
30 +/*
31 + * at91-sama5d27_som1.dtsi - Device Tree file for SAMA5D27 SoM1 board
32 + *
33 + *  Copyright (c) 2017, Microchip Technology Inc.
34 + *                2017 Cristian Birsan <cristian.birsan@microchip.com>
35 + *                2017 Claudiu Beznea <claudiu.beznea@microchip.com>
36 + *
37 + * This file is dual-licensed: you can use it either under the terms
38 + * of the GPL or the X11 license, at your option. Note that this dual
39 + * licensing only applies to this file, and not this project as a
40 + * whole.
41 + *
42 + *  a) This file is free software; you can redistribute it and/or
43 + *     modify it under the terms of the GNU General Public License as
44 + *     published by the Free Software Foundation; either version 2 of the
45 + *     License, or (at your option) any later version.
46 + *
47 + *     This file is distributed in the hope that it will be useful,
48 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
49 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
50 + *     GNU General Public License for more details.
51 + *
52 + * Or, alternatively,
53 + *
54 + *  b) Permission is hereby granted, free of charge, to any person
55 + *     obtaining a copy of this software and associated documentation
56 + *     files (the "Software"), to deal in the Software without
57 + *     restriction, including without limitation the rights to use,
58 + *     copy, modify, merge, publish, distribute, sublicense, and/or
59 + *     sell copies of the Software, and to permit persons to whom the
60 + *     Software is furnished to do so, subject to the following
61 + *     conditions:
62 + *
63 + *     The above copyright notice and this permission notice shall be
64 + *     included in all copies or substantial portions of the Software.
65 + *
66 + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
67 + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
68 + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
69 + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
70 + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
71 + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
72 + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
73 + *     OTHER DEALINGS IN THE SOFTWARE.
74 + */
75 +#include "sama5d2.dtsi"
76 +#include "sama5d2-pinfunc.h"
77 +
78 +/ {
79 +       model = "Atmel SAMA5D27 SoM1";
80 +       compatible = "atmel,sama5d27-som1", "atmel,sama5d27", "atmel,sama5d2", "atmel,sama5";
81 +
82 +       clocks {
83 +               slow_xtal {
84 +                       clock-frequency = <32768>;
85 +               };
86 +
87 +               main_xtal {
88 +                       clock-frequency = <24000000>;
89 +               };
90 +       };
91 +
92 +       ahb {
93 +               apb {
94 +                       qspi1: spi@f0024000 {
95 +                               pinctrl-names = "default";
96 +                               pinctrl-0 = <&pinctrl_qspi1_default>;
97 +
98 +                               flash@0 {
99 +                                       #address-cells = <1>;
100 +                                       #size-cells = <1>;
101 +                                       compatible = "jedec,spi-nor";
102 +                                       reg = <0>;
103 +                                       spi-max-frequency = <80000000>;
104 +                                       m25p,fast-read;
105 +
106 +                                       at91bootstrap@00000000 {
107 +                                               label = "at91bootstrap";
108 +                                               reg = <0x00000000 0x00010000>;
109 +                                       };
110 +
111 +                                       bootloader@00010000 {
112 +                                               label = "bootloader";
113 +                                               reg = <0x00010000 0x000a0000>;
114 +                                       };
115 +
116 +                                       bootloaderenv@000b0000 {
117 +                                               label = "bootloader env";
118 +                                               reg = <0x000b0000 0x00010000>;
119 +                                       };
120 +
121 +                                       dtb@000c0000 {
122 +                                               label = "device tree";
123 +                                               reg = <0x000c0000 0x0020000>;
124 +                                       };
125 +
126 +                                       kernel@000e0000 {
127 +                                               label = "kernel";
128 +                                               reg = <0x000e0000 0x0400000>;
129 +                                       };
130 +                               };
131 +                       };
132 +
133 +                       macb0: ethernet@f8008000 {
134 +                               pinctrl-names = "default";
135 +                               pinctrl-0 = <&pinctrl_macb0_default>;
136 +                               phy-mode = "rmii";
137 +
138 +                               ethernet-phy@0 {
139 +                                       reg = <0x0>;
140 +                                       interrupt-parent = <&pioA>;
141 +                                       interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>;
142 +                                       pinctrl-names = "default";
143 +                                       pinctrl-0 = <&pinctrl_macb0_phy_irq>;
144 +                               };
145 +                       };
146 +
147 +                       i2c0: i2c@f8028000 {
148 +                               dmas = <0>, <0>;
149 +                               pinctrl-names = "default";
150 +                               pinctrl-0 = <&pinctrl_i2c0_default>;
151 +                               status = "okay";
152 +
153 +                               at24@50 {
154 +                                       compatible = "24c02";
155 +                                       reg = <0x50>;
156 +                                       pagesize = <8>;
157 +                               };
158 +                       };
159 +
160 +                       pinctrl@fc038000 {
161 +                               pinctrl_i2c0_default: i2c0_default {
162 +                                       pinmux = <PIN_PD21__TWD0>,
163 +                                                <PIN_PD22__TWCK0>;
164 +                                       bias-disable;
165 +                               };
166 +
167 +                               pinctrl_qspi1_default: qspi1_default {
168 +                                       sck_cs {
169 +                                               pinmux = <PIN_PB5__QSPI1_SCK>,
170 +                                                        <PIN_PB6__QSPI1_CS>;
171 +                                               bias-disable;
172 +                                       };
173 +
174 +                                       data {
175 +                                               pinmux = <PIN_PB7__QSPI1_IO0>,
176 +                                                        <PIN_PB8__QSPI1_IO1>,
177 +                                                        <PIN_PB9__QSPI1_IO2>,
178 +                                                        <PIN_PB10__QSPI1_IO3>;
179 +                                               bias-pull-up;
180 +                                       };
181 +                               };
182 +
183 +                               pinctrl_macb0_default: macb0_default {
184 +                                       pinmux = <PIN_PD9__GTXCK>,
185 +                                                <PIN_PD10__GTXEN>,
186 +                                                <PIN_PD11__GRXDV>,
187 +                                                <PIN_PD12__GRXER>,
188 +                                                <PIN_PD13__GRX0>,
189 +                                                <PIN_PD14__GRX1>,
190 +                                                <PIN_PD15__GTX0>,
191 +                                                <PIN_PD16__GTX1>,
192 +                                                <PIN_PD17__GMDC>,
193 +                                                <PIN_PD18__GMDIO>;
194 +                                       bias-disable;
195 +                               };
196 +
197 +                               pinctrl_macb0_phy_irq: macb0_phy_irq {
198 +                                       pinmux = <PIN_PD31__GPIO>;
199 +                                       bias-disable;
200 +                               };
201 +                       };
202 +               };
203 +       };
204 +};
205 --- /dev/null
206 +++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
207 @@ -0,0 +1,53 @@
208 +/*
209 + * at91-sama5d27_som1_ek.dts - Device Tree file for SAMA5D27-SOM1-EK board
210 + *
211 + *  Copyright (c) 2017, Microchip Technology Inc.
212 + *                2016 Nicolas Ferre <nicolas.ferre@atmel.com>
213 + *                2017 Cristian Birsan <cristian.birsan@microchip.com>
214 + *                2017 Claudiu Beznea <claudiu.beznea@microchip.com>
215 + *
216 + * This file is dual-licensed: you can use it either under the terms
217 + * of the GPL or the X11 license, at your option. Note that this dual
218 + * licensing only applies to this file, and not this project as a
219 + * whole.
220 + *
221 + *  a) This file is free software; you can redistribute it and/or
222 + *     modify it under the terms of the GNU General Public License as
223 + *     published by the Free Software Foundation; either version 2 of the
224 + *     License, or (at your option) any later version.
225 + *
226 + *     This file is distributed in the hope that it will be useful,
227 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
228 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
229 + *     GNU General Public License for more details.
230 + *
231 + * Or, alternatively,
232 + *
233 + *  b) Permission is hereby granted, free of charge, to any person
234 + *     obtaining a copy of this software and associated documentation
235 + *     files (the "Software"), to deal in the Software without
236 + *     restriction, including without limitation the rights to use,
237 + *     copy, modify, merge, publish, distribute, sublicense, and/or
238 + *     sell copies of the Software, and to permit persons to whom the
239 + *     Software is furnished to do so, subject to the following
240 + *     conditions:
241 + *
242 + *     The above copyright notice and this permission notice shall be
243 + *     included in all copies or substantial portions of the Software.
244 + *
245 + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
246 + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
247 + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
248 + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
249 + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
250 + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
251 + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
252 + *     OTHER DEALINGS IN THE SOFTWARE.
253 + */
254 +/dts-v1/;
255 +#include "at91-sama5d27_som1_ek_common.dtsi"
256 +
257 +/ {
258 +       model = "Atmel SAMA5D27 SOM1 EK";
259 +       compatible = "atmel,sama5d27-som1-ek", "atmel,sama5d27-som1", "atmel,sama5d27", "atmel,sama5d2", "atmel,sama5";
260 +};
261 --- /dev/null
262 +++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek_common.dtsi
263 @@ -0,0 +1,619 @@
264 +/*
265 + * at91-sama5d27_som1_ek_common.dtsi - Device Tree file for SAMA5D27-SOM1-EK board
266 + *
267 + *  Copyright (c) 2017, Microchip Technology Inc.
268 + *                2016 Nicolas Ferre <nicolas.ferre@atmel.com>
269 + *                2017 Cristian Birsan <cristian.birsan@microchip.com>
270 + *                2017 Claudiu Beznea <claudiu.beznea@microchip.com>
271 + *
272 + * This file is dual-licensed: you can use it either under the terms
273 + * of the GPL or the X11 license, at your option. Note that this dual
274 + * licensing only applies to this file, and not this project as a
275 + * whole.
276 + *
277 + *  a) This file is free software; you can redistribute it and/or
278 + *     modify it under the terms of the GNU General Public License as
279 + *     published by the Free Software Foundation; either version 2 of the
280 + *     License, or (at your option) any later version.
281 + *
282 + *     This file is distributed in the hope that it will be useful,
283 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
284 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
285 + *     GNU General Public License for more details.
286 + *
287 + * Or, alternatively,
288 + *
289 + *  b) Permission is hereby granted, free of charge, to any person
290 + *     obtaining a copy of this software and associated documentation
291 + *     files (the "Software"), to deal in the Software without
292 + *     restriction, including without limitation the rights to use,
293 + *     copy, modify, merge, publish, distribute, sublicense, and/or
294 + *     sell copies of the Software, and to permit persons to whom the
295 + *     Software is furnished to do so, subject to the following
296 + *     conditions:
297 + *
298 + *     The above copyright notice and this permission notice shall be
299 + *     included in all copies or substantial portions of the Software.
300 + *
301 + *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
302 + *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
303 + *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
304 + *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
305 + *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
306 + *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
307 + *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
308 + *     OTHER DEALINGS IN THE SOFTWARE.
309 + */
310 +#include "at91-sama5d27_som1.dtsi"
311 +#include <dt-bindings/mfd/atmel-flexcom.h>
312 +#include <dt-bindings/gpio/gpio.h>
313 +#include <dt-bindings/pinctrl/at91.h>
314 +
315 +/ {
316 +       model = "Atmel SAMA5D27 SOM1 EK";
317 +       compatible = "atmel,sama5d27-som1-ek", "atmel,sama5d27-som1", "atmel,sama5d27", "atmel,sama5d2", "atmel,sama5";
318 +
319 +       aliases {
320 +               serial0 = &uart1;       /* DBGU */
321 +               serial1 = &uart4;       /* mikro BUS 1 */
322 +               serial2 = &uart2;       /* mikro BUS 2 */
323 +               i2c1    = &i2c1;
324 +               i2c2    = &i2c2;
325 +       };
326 +
327 +       chosen {
328 +               stdout-path = "serial0:115200n8";
329 +       };
330 +
331 +       ahb {
332 +               usb0: gadget@00300000 {
333 +                       atmel,vbus-gpio = <&pioA PIN_PD20 GPIO_ACTIVE_HIGH>;
334 +                       pinctrl-names = "default";
335 +                       pinctrl-0 = <&pinctrl_usba_vbus>;
336 +                       status = "okay";
337 +               };
338 +
339 +               usb1: ohci@00400000 {
340 +                       num-ports = <3>;
341 +                       atmel,vbus-gpio = <0 /* &pioA PIN_PD20 GPIO_ACTIVE_HIGH */
342 +                                          &pioA PIN_PA27 GPIO_ACTIVE_HIGH
343 +                                          0
344 +                                         >;
345 +                       pinctrl-names = "default";
346 +                       pinctrl-0 = <&pinctrl_usb_default>;
347 +                       status = "okay";
348 +               };
349 +
350 +               usb2: ehci@00500000 {
351 +                       status = "okay";
352 +               };
353 +
354 +               sdmmc0: sdio-host@a0000000 {
355 +                       bus-width = <8>;
356 +                       pinctrl-names = "default";
357 +                       pinctrl-0 = <&pinctrl_sdmmc0_default>;
358 +                       status = "okay";
359 +               };
360 +
361 +               sdmmc1: sdio-host@b0000000 {
362 +                       bus-width = <4>;
363 +                       pinctrl-names = "default";
364 +                       pinctrl-0 = <&pinctrl_sdmmc1_default>;
365 +                       status = "okay";
366 +               };
367 +
368 +               apb {
369 +                       hlcdc: hlcdc@f0000000 {
370 +                               status = "disabled";
371 +
372 +                               hlcdc-display-controller {
373 +                                       pinctrl-names = "default";
374 +                                       pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_rgb>;
375 +                               };
376 +
377 +                               hlcdc_pwm: hlcdc-pwm {
378 +                                       pinctrl-names = "default";
379 +                                       pinctrl-0 = <&pinctrl_lcd_pwm>;
380 +                               };
381 +                       };
382 +
383 +                       pmc: pmc@f0014000 {
384 +                               pmc_fast_restart {
385 +                                       compatible = "atmel,sama5d2-pmc-fast-startup";
386 +                                       #address-cells = <1>;
387 +                                       #size-cells = <0>;
388 +
389 +                                       atmel,wakeup-rtc-timer;
390 +
391 +                                       wkpin: input@0 {
392 +                                               reg = <0>;
393 +                                       };
394 +
395 +                                       gmac_wol: input@10 {
396 +                                               reg = <10>;
397 +                                               atmel,wakeup-active-high;
398 +                                       };
399 +                               };
400 +                       };
401 +
402 +                       isc: isc@f0008000 {
403 +                               pinctrl-names = "default";
404 +                               pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>;
405 +                               status = "okay";
406 +                       };
407 +
408 +                       qspi1: spi@f0024000 {
409 +                               status = "okay";
410 +                       };
411 +
412 +                       spi0: spi@f8000000 {
413 +                               pinctrl-names = "default";
414 +                               pinctrl-0 = <&pinctrl_spi0_default>;
415 +                               status = "okay";
416 +                       };
417 +
418 +                       macb0: ethernet@f8008000 {
419 +                               status = "okay";
420 +                       };
421 +
422 +                       uart1: serial@f8020000 {
423 +                               pinctrl-names = "default";
424 +                               pinctrl-0 = <&pinctrl_uart1_default>;
425 +                               atmel,use-dma-rx;
426 +                               atmel,use-dma-tx;
427 +                               status = "okay";
428 +                       };
429 +
430 +                       uart2: serial@f8024000 {
431 +                               pinctrl-names = "default";
432 +                               pinctrl-0 = <&pinctrl_mikrobus2_uart>;
433 +                               atmel,use-dma-rx;
434 +                               atmel,use-dma-tx;
435 +                               status = "okay";
436 +                       };
437 +
438 +                       pwm0: pwm@f802c000 {
439 +                               pinctrl-names = "default";
440 +                               pinctrl-0 = <&pinctrl_mikrobus1_pwm &pinctrl_mikrobus2_pwm>;
441 +                               status = "disabled"; /* Conflict with leds. */
442 +                       };
443 +
444 +                       flx1: flexcom@f8038000 {
445 +                               atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
446 +                               status = "okay";
447 +
448 +                               i2c2: i2c@600 {
449 +                                       compatible = "atmel,sama5d2-i2c";
450 +                                       reg = <0x600 0x200>;
451 +                                       interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>;
452 +                                       dmas = <0>, <0>;
453 +                                       dma-names = "tx", "rx";
454 +                                       #address-cells = <1>;
455 +                                       #size-cells = <0>;
456 +                                       clocks = <&flx1_clk>;
457 +                                       pinctrl-names = "default";
458 +                                       pinctrl-0 = <&pinctrl_mikrobus_i2c>;
459 +                                       atmel,fifo-size = <16>;
460 +                                       status = "okay";
461 +                               };
462 +                       };
463 +
464 +                       shdwc@f8048010 {
465 +                               atmel,shdwc-debouncer = <976>;
466 +                               atmel,wakeup-rtc-timer;
467 +
468 +                               input@0 {
469 +                                       reg = <0>;
470 +                                       atmel,wakeup-type = "low";
471 +                               };
472 +                       };
473 +
474 +                       watchdog@f8048040 {
475 +                               status = "okay";
476 +                       };
477 +
478 +                       uart3: serial@fc008000 {
479 +                               atmel,use-dma-rx;
480 +                               atmel,use-dma-tx;
481 +                               pinctrl-names = "default";
482 +                               pinctrl-0 = <&pinctrl_uart3_default>;
483 +                               status = "disabled"; /* Conflict with isc. */
484 +                       };
485 +
486 +                       uart4: serial@fc00c000 {
487 +                               atmel,use-dma-rx;
488 +                               atmel,use-dma-tx;
489 +                               pinctrl-names = "default";
490 +                               pinctrl-0 = <&pinctrl_mikrobus1_uart>;
491 +                               status = "okay";
492 +                       };
493 +
494 +                       flx3: flexcom@fc014000 {
495 +                               atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
496 +                               status = "disabled";
497 +
498 +                               uart7: serial@200 {
499 +                                       compatible = "atmel,at91sam9260-usart";
500 +                                       reg = <0x200 0x200>;
501 +                                       interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
502 +                                       clocks = <&flx3_clk>;
503 +                                       clock-names = "usart";
504 +                                       pinctrl-names = "default";
505 +                                       pinctrl-0 = <&pinctrl_flx3_default>;
506 +                                       atmel,fifo-size = <32>;
507 +                                       status = "disabled"; /* Conflict with isc. */
508 +                               };
509 +
510 +                               spi2: spi@400 {
511 +                                       compatible = "atmel,at91rm9200-spi";
512 +                                       reg = <0x400 0x200>;
513 +                                       interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
514 +                                       clocks = <&flx3_clk>;
515 +                                       clock-names = "spi_clk";
516 +                                       pinctrl-names = "default";
517 +                                       pinctrl-0 = <&pinctrl_flx3_default>;
518 +                                       atmel,fifo-size = <16>;
519 +                                       status = "disabled"; /* Conflict with isc. */
520 +                               };
521 +                       };
522 +
523 +                       flx4: flexcom@fc018000 {
524 +                               atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
525 +                               status = "okay";
526 +
527 +                               uart6: serial@200 {
528 +                                       compatible = "atmel,at91sam9260-usart";
529 +                                       reg = <0x200 0x200>;
530 +                                       interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
531 +                                       clocks = <&flx4_clk>;
532 +                                       clock-names = "usart";
533 +                                       pinctrl-names = "default";
534 +                                       pinctrl-0 = <&pinctrl_flx4_default>;
535 +                                       atmel,fifo-size = <32>;
536 +                                       status = "disabled"; /* Conflict with spi3 and i2c3. */
537 +                               };
538 +
539 +                               spi3: spi@400 {
540 +                                       compatible = "atmel,at91rm9200-spi";
541 +                                       reg = <0x400 0x200>;
542 +                                       interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
543 +                                       clocks = <&flx4_clk>;
544 +                                       clock-names = "spi_clk";
545 +                                       pinctrl-names = "default";
546 +                                       pinctrl-0 = <&pinctrl_mikrobus_spi &pinctrl_mikrobus1_spi_cs &pinctrl_mikrobus2_spi_cs>;
547 +                                       atmel,fifo-size = <16>;
548 +                                       status = "okay";
549 +                               };
550 +
551 +                               i2c3: i2c@600 {
552 +                                       compatible = "atmel,sama5d2-i2c";
553 +                                       reg = <0x600 0x200>;
554 +                                       interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
555 +                                       dmas = <0>, <0>;
556 +                                       dma-names = "tx", "rx";
557 +                                       #address-cells = <1>;
558 +                                       #size-cells = <0>;
559 +                                       clocks = <&flx4_clk>;
560 +                                       pinctrl-names = "default";
561 +                                       pinctrl-0 = <&pinctrl_flx4_default>;
562 +                                       atmel,fifo-size = <16>;
563 +                                       status = "disabled"; /* Conflict with uart6 and spi3. */
564 +                               };
565 +                       };
566 +
567 +                       i2c1: i2c@fc028000 {
568 +                               dmas = <0>, <0>;
569 +                               pinctrl-names = "default";
570 +                               pinctrl-0 = <&pinctrl_i2c1_default>;
571 +                               status = "okay";
572 +                       };
573 +
574 +                       pinctrl@fc038000 {
575 +
576 +                               pinctrl_lcd_base: pinctrl_lcd_base {
577 +                                       pinmux = <PIN_PC5__LCDVSYNC>,
578 +                                                <PIN_PC6__LCDHSYNC>,
579 +                                                <PIN_PC8__LCDDEN>,
580 +                                                <PIN_PC7__LCDPCK>;
581 +                                       bias-disable;
582 +                                       drive-strength = <ATMEL_PIO_DRVSTR_ME>;
583 +                               };
584 +
585 +                               pinctrl_lcd_rgb: pinctrl_lcd_rgb {
586 +                                       pinmux = <PIN_PB11__LCDDAT0>,
587 +                                                <PIN_PB12__LCDDAT1>,
588 +                                                <PIN_PB13__LCDDAT2>,
589 +                                                <PIN_PB14__LCDDAT3>,
590 +                                                <PIN_PB15__LCDDAT4>,
591 +                                                <PIN_PB16__LCDDAT5>,
592 +                                                <PIN_PB17__LCDDAT6>,
593 +                                                <PIN_PB18__LCDDAT7>,
594 +                                                <PIN_PB19__LCDDAT8>,
595 +                                                <PIN_PB20__LCDDAT9>,
596 +                                                <PIN_PB21__LCDDAT10>,
597 +                                                <PIN_PB22__LCDDAT11>,
598 +                                                <PIN_PB23__LCDDAT12>,
599 +                                                <PIN_PB24__LCDDAT13>,
600 +                                                <PIN_PB25__LCDDAT14>,
601 +                                                <PIN_PB26__LCDDAT15>,
602 +                                                <PIN_PB27__LCDDAT16>,
603 +                                                <PIN_PB28__LCDDAT17>,
604 +                                                <PIN_PB29__LCDDAT18>,
605 +                                                <PIN_PB30__LCDDAT19>,
606 +                                                <PIN_PB31__LCDDAT20>,
607 +                                                <PIN_PC0__LCDDAT21>,
608 +                                                <PIN_PC1__LCDDAT22>,
609 +                                                <PIN_PC2__LCDDAT23>;
610 +                                       bias-disable;
611 +                               };
612 +
613 +                               pinctrl_lcd_pwm: pinctrl_lcd_pwm {
614 +                                       pinmux = <PIN_PC3__LCDPWM>;
615 +                                       bias-disable;
616 +                               };
617 +
618 +                               pinctrl_can1_default: can1_default {
619 +                                       pinmux = <PIN_PC26__CANTX1>,
620 +                                                <PIN_PC27__CANRX1>;
621 +                                       bias-disable;
622 +                               };
623 +
624 +                               pinctrl_flx3_default: flx3_default {
625 +                                       pinmux = <PIN_PC20__FLEXCOM3_IO0>,
626 +                                                <PIN_PC19__FLEXCOM3_IO1>,
627 +                                                <PIN_PC18__FLEXCOM3_IO2>,
628 +                                                <PIN_PC21__FLEXCOM3_IO3>,
629 +                                                <PIN_PC22__FLEXCOM3_IO4>;
630 +                                       bias-disable;
631 +                               };
632 +
633 +                               pinctrl_i2c1_default: i2c1_default {
634 +                                       pinmux = <PIN_PD4__TWD1>,
635 +                                                <PIN_PD5__TWCK1>;
636 +                                       bias-disable;
637 +                               };
638 +
639 +                               pinctrl_isc_base: isc_base {
640 +                                       pinmux = <PIN_PC21__ISC_PCK>,
641 +                                                <PIN_PC22__ISC_VSYNC>,
642 +                                                <PIN_PC23__ISC_HSYNC>,
643 +                                                <PIN_PC24__ISC_MCK>;
644 +                                       bias-disable;
645 +                               };
646 +
647 +                               pinctrl_isc_data_8bit: isc_data_8bit {
648 +                                       pinmux = <PIN_PC20__ISC_D11>,
649 +                                                <PIN_PC19__ISC_D10>,
650 +                                                <PIN_PC18__ISC_D9>,
651 +                                                <PIN_PC17__ISC_D8>,
652 +                                                <PIN_PC16__ISC_D7>,
653 +                                                <PIN_PC15__ISC_D6>,
654 +                                                <PIN_PC14__ISC_D5>,
655 +                                                <PIN_PC13__ISC_D4>;
656 +                                       bias-disable;
657 +                               };
658 +
659 +                               pinctrl_isc_data_9_10: isc_data_9_10 {
660 +                                       pinmux = <PIN_PC12__ISC_D3>,
661 +                                                <PIN_PC11__ISC_D2>;
662 +                                       bias-disable;
663 +                               };
664 +
665 +                               pinctrl_isc_data_11_12: isc_data_11_12 {
666 +                                       pinmux = <PIN_PC10__ISC_D1>,
667 +                                                <PIN_PC9__ISC_D0>;
668 +                                       bias-disable;
669 +                               };
670 +
671 +                               pinctrl_key_gpio_default: key_gpio_default {
672 +                                       pinmux = <PIN_PA29__GPIO>;
673 +                                       bias-pull-up;
674 +                               };
675 +
676 +                               pinctrl_led_gpio_default: led_gpio_default {
677 +                                       pinmux = <PIN_PA10__GPIO>,
678 +                                                <PIN_PB1__GPIO>,
679 +                                                <PIN_PA31__GPIO>;
680 +                                       bias-pull-up;
681 +                               };
682 +
683 +                               pinctrl_sdmmc0_default: sdmmc0_default {
684 +                                       cmd_data {
685 +                                               pinmux = <PIN_PA1__SDMMC0_CMD>,
686 +                                                        <PIN_PA2__SDMMC0_DAT0>,
687 +                                                        <PIN_PA3__SDMMC0_DAT1>,
688 +                                                        <PIN_PA4__SDMMC0_DAT2>,
689 +                                                        <PIN_PA5__SDMMC0_DAT3>,
690 +                                                        <PIN_PA6__SDMMC0_DAT4>,
691 +                                                        <PIN_PA7__SDMMC0_DAT5>,
692 +                                                        <PIN_PA8__SDMMC0_DAT6>,
693 +                                                        <PIN_PA9__SDMMC0_DAT7>;
694 +                                               bias-disable;
695 +                                       };
696 +
697 +                                       ck_cd_vddsel {
698 +                                               pinmux = <PIN_PA0__SDMMC0_CK>,
699 +                                                        <PIN_PA11__SDMMC0_VDDSEL>,
700 +                                                        <PIN_PA13__SDMMC0_CD>;
701 +                                               bias-disable;
702 +                                       };
703 +                               };
704 +
705 +                               pinctrl_sdmmc1_default: sdmmc1_default {
706 +                                       cmd_data {
707 +                                               pinmux = <PIN_PA28__SDMMC1_CMD>,
708 +                                                        <PIN_PA18__SDMMC1_DAT0>,
709 +                                                        <PIN_PA19__SDMMC1_DAT1>,
710 +                                                        <PIN_PA20__SDMMC1_DAT2>,
711 +                                                        <PIN_PA21__SDMMC1_DAT3>;
712 +                                               bias-disable;
713 +                                       };
714 +
715 +                                       conf-ck_cd {
716 +                                               pinmux = <PIN_PA22__SDMMC1_CK>,
717 +                                                        <PIN_PA30__SDMMC1_CD>;
718 +                                               bias-disable;
719 +                                       };
720 +                               };
721 +
722 +                               pinctrl_spi0_default: spi0_default {
723 +                                       pinmux = <PIN_PA14__SPI0_SPCK>,
724 +                                                <PIN_PA15__SPI0_MOSI>,
725 +                                                <PIN_PA16__SPI0_MISO>,
726 +                                                <PIN_PA17__SPI0_NPCS0>;
727 +                                       bias-disable;
728 +                               };
729 +
730 +                               pinctrl_uart1_default: uart1_default {
731 +                                       pinmux = <PIN_PD2__URXD1>,
732 +                                                <PIN_PD3__UTXD1>;
733 +                                       bias-disable;
734 +                               };
735 +
736 +                               pinctrl_uart3_default: uart3_default {
737 +                                       pinmux = <PIN_PC12__URXD3>,
738 +                                                <PIN_PC13__UTXD3>;
739 +                                       bias-disable;
740 +                               };
741 +
742 +                               pinctrl_usb_default: usb_default {
743 +                                       pinmux = <PIN_PA27__GPIO>,
744 +                                                <PIN_PD19__GPIO>;
745 +                                       bias-disable;
746 +                               };
747 +
748 +                               pinctrl_usba_vbus: usba_vbus {
749 +                                       pinmux = <PIN_PD20__GPIO>;
750 +                                       bias-disable;
751 +                               };
752 +
753 +                               pinctrl_mikrobus1_an: mikrobus1_an {
754 +                                       pinmux = <PIN_PD25__GPIO>;
755 +                                       bias-disable;
756 +                               };
757 +
758 +                               pinctrl_mikrobus2_an: mikrobus2_an {
759 +                                       pinmux = <PIN_PD26__GPIO>;
760 +                                       bias-disable;
761 +                               };
762 +
763 +                               pinctrl_mikrobus1_rst: mikrobus1_rst {
764 +                                       pinmux = <PIN_PB2__GPIO>;
765 +                                       bias-disable;
766 +                               };
767 +
768 +                               pinctrl_mikrobus2_rst: mikrobus2_rst {
769 +                                       pinmux = <PIN_PA26__GPIO>;
770 +                                       bias-disable;
771 +                               };
772 +
773 +                               pinctrl_mikrobus1_spi_cs: mikrobus1_spi_cs {
774 +                                       pinmux = <PIN_PD0__FLEXCOM4_IO4>;
775 +                                       bias-disable;
776 +                               };
777 +
778 +                               pinctrl_mikrobus2_spi_cs: mikrobus2_spi_cs {
779 +                                       pinmux = <PIN_PC31__FLEXCOM4_IO3>;
780 +                                       bias-disable;
781 +                               };
782 +
783 +                               pinctrl_mikrobus_spi: mikrobus_spi {
784 +                                       pinmux = <PIN_PC28__FLEXCOM4_IO0>,
785 +                                                <PIN_PC29__FLEXCOM4_IO1>,
786 +                                                <PIN_PC30__FLEXCOM4_IO2>;
787 +                                       bias-disable;
788 +                               };
789 +
790 +                               pinctrl_mikrobus1_pwm: mikrobus1_pwm {
791 +                                       pinmux = <PIN_PB1__PWML1>;
792 +                                       bias-disable;
793 +                               };
794 +
795 +                               pinctrl_mikrobus2_pwm: mikrobus2_pwm {
796 +                                       pinmux = <PIN_PA31__PWML0>;
797 +                                       bias-disable;
798 +                               };
799 +
800 +                               pinctrl_mikrobus1_int: mikrobus1_int {
801 +                                       pinmux = <PIN_PB0__GPIO>;
802 +                                       bias-disable;
803 +                               };
804 +
805 +                               pinctrl_mikrobus2_int: mikrobus2_int {
806 +                                       pinmux = <PIN_PA25__GPIO>;
807 +                                       bias-disable;
808 +                               };
809 +
810 +                               pinctrl_mikrobus1_uart: mikrobus1_uart {
811 +                                       pinmux = <PIN_PB3__URXD4>,
812 +                                                <PIN_PB4__UTXD4>;
813 +                                       bias-disable;
814 +                               };
815 +
816 +                               pinctrl_mikrobus2_uart: mikrobus2_uart {
817 +                                       pinmux = <PIN_PD23__URXD2>,
818 +                                                <PIN_PD24__UTXD2>;
819 +                                       bias-disable;
820 +                               };
821 +
822 +                               pinctrl_mikrobus_i2c: mikrobus1_i2c {
823 +                                       pinmux = <PIN_PA24__FLEXCOM1_IO0>,
824 +                                                <PIN_PA23__FLEXCOM1_IO1>;
825 +                                       bias-disable;
826 +                               };
827 +
828 +                               pinctrl_flx4_default: flx4_uart_default {
829 +                                       pinmux = <PIN_PC28__FLEXCOM4_IO0>,
830 +                                                <PIN_PC29__FLEXCOM4_IO1>,
831 +                                                <PIN_PC30__FLEXCOM4_IO2>,
832 +                                                <PIN_PC31__FLEXCOM4_IO3>,
833 +                                                <PIN_PD0__FLEXCOM4_IO4>;
834 +                                       bias-disable;
835 +                               };
836 +                       };
837 +
838 +                       can1: can@fc050000 {
839 +                               pinctrl-names = "default";
840 +                               pinctrl-0 = <&pinctrl_can1_default>;
841 +                               status = "okay";
842 +                       };
843 +               };
844 +       };
845 +
846 +       gpio_keys {
847 +               compatible = "gpio-keys";
848 +
849 +               pinctrl-names = "default";
850 +               pinctrl-0 = <&pinctrl_key_gpio_default>;
851 +
852 +               pb4 {
853 +                       label = "USER";
854 +                       gpios = <&pioA PIN_PA29 GPIO_ACTIVE_LOW>;
855 +                       linux,code = <0x104>;
856 +                       wakeup-source;
857 +               };
858 +       };
859 +
860 +       leds {
861 +               compatible = "gpio-leds";
862 +               pinctrl-names = "default";
863 +               pinctrl-0 = <&pinctrl_led_gpio_default>;
864 +               status = "okay"; /* Conflict with pwm0. */
865 +
866 +               red {
867 +                       label = "red";
868 +                       gpios = <&pioA PIN_PA10 GPIO_ACTIVE_HIGH>;
869 +               };
870 +
871 +               green {
872 +                       label = "green";
873 +                       gpios = <&pioA PIN_PB1 GPIO_ACTIVE_HIGH>;
874 +               };
875 +
876 +               blue {
877 +                       label = "blue";
878 +                       gpios = <&pioA PIN_PA31 GPIO_ACTIVE_HIGH>;
879 +                       linux,default-trigger = "heartbeat";
880 +               };
881 +       };
882 +};
883 --- a/include/dt-bindings/pinctrl/at91.h
884 +++ b/include/dt-bindings/pinctrl/at91.h
885 @@ -37,4 +37,8 @@
886  #define AT91_PERIPH_C          3
887  #define AT91_PERIPH_D          4
888  
889 +#define ATMEL_PIO_DRVSTR_LO    1
890 +#define ATMEL_PIO_DRVSTR_ME    2
891 +#define ATMEL_PIO_DRVSTR_HI    3
892 +
893  #endif /* __DT_BINDINGS_AT91_PINCTRL_H__ */