1/*
2 * at91-sama5d27_som1_ek.dts - Device Tree file for SAMA5D27-SOM1-EK board
3 *
4 *  Copyright (c) 2017, Microchip Technology Inc.
5 *                2016 Nicolas Ferre <[email protected]>
6 *                2017 Cristian Birsan <[email protected]>
7 *                2017 Claudiu Beznea <[email protected]>
8 *
9 * This file is dual-licensed: you can use it either under the terms
10 * of the GPL or the X11 license, at your option. Note that this dual
11 * licensing only applies to this file, and not this project as a
12 * whole.
13 *
14 *  a) This file is free software; you can redistribute it and/or
15 *     modify it under the terms of the GNU General Public License as
16 *     published by the Free Software Foundation; either version 2 of the
17 *     License, or (at your option) any later version.
18 *
19 *     This file is distributed in the hope that it will be useful,
20 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 *     GNU General Public License for more details.
23 *
24 * Or, alternatively,
25 *
26 *  b) Permission is hereby granted, free of charge, to any person
27 *     obtaining a copy of this software and associated documentation
28 *     files (the "Software"), to deal in the Software without
29 *     restriction, including without limitation the rights to use,
30 *     copy, modify, merge, publish, distribute, sublicense, and/or
31 *     sell copies of the Software, and to permit persons to whom the
32 *     Software is furnished to do so, subject to the following
33 *     conditions:
34 *
35 *     The above copyright notice and this permission notice shall be
36 *     included in all copies or substantial portions of the Software.
37 *
38 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
40 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
42 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
43 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
45 *     OTHER DEALINGS IN THE SOFTWARE.
46 */
47/dts-v1/;
48#include "at91-sama5d27_som1.dtsi"
49#include <dt-bindings/mfd/atmel-flexcom.h>
50#include <dt-bindings/gpio/gpio.h>
51
52/ {
53	model = "Atmel SAMA5D27 SOM1 EK";
54	compatible = "atmel,sama5d27-som1-ek", "atmel,sama5d27-som1", "atmel,sama5d27", "atmel,sama5d2", "atmel,sama5";
55
56	aliases {
57		serial0 = &uart1;	/* DBGU */
58		serial1 = &uart4;	/* mikro BUS 1 */
59		serial2 = &uart2;	/* mikro BUS 2 */
60		i2c1	= &i2c1;
61		i2c2	= &i2c2;
62	};
63
64	chosen {
65		stdout-path = "serial0:115200n8";
66	};
67
68	ahb {
69		usb0: gadget@300000 {
70			atmel,vbus-gpio = <&pioA PIN_PD20 GPIO_ACTIVE_HIGH>;
71			pinctrl-names = "default";
72			pinctrl-0 = <&pinctrl_usba_vbus>;
73			status = "okay";
74		};
75
76		usb1: ohci@400000 {
77			num-ports = <3>;
78			atmel,vbus-gpio = <0 /* &pioA PIN_PD20 GPIO_ACTIVE_HIGH */
79					   &pioA PIN_PA27 GPIO_ACTIVE_HIGH
80					   0
81					  >;
82			pinctrl-names = "default";
83			pinctrl-0 = <&pinctrl_usb_default>;
84			status = "okay";
85		};
86
87		usb2: ehci@500000 {
88			status = "okay";
89		};
90
91		sdmmc0: sdio-host@a0000000 {
92			bus-width = <8>;
93			pinctrl-names = "default";
94			pinctrl-0 = <&pinctrl_sdmmc0_default>;
95			status = "okay";
96		};
97
98		sdmmc1: sdio-host@b0000000 {
99			bus-width = <4>;
100			pinctrl-names = "default";
101			pinctrl-0 = <&pinctrl_sdmmc1_default>;
102			status = "okay";
103		};
104
105		apb {
106			isc: isc@f0008000 {
107				pinctrl-names = "default";
108				pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>;
109				status = "okay";
110			};
111
112			qspi1: spi@f0024000 {
113				status = "okay";
114			};
115
116			spi0: spi@f8000000 {
117				pinctrl-names = "default";
118				pinctrl-0 = <&pinctrl_spi0_default>;
119				status = "okay";
120			};
121
122			macb0: ethernet@f8008000 {
123				status = "okay";
124			};
125
126			tcb0: timer@f800c000 {
127				timer0: timer@0 {
128					compatible = "atmel,tcb-timer";
129					reg = <0>;
130				};
131
132				timer1: timer@1 {
133					compatible = "atmel,tcb-timer";
134					reg = <1>;
135				};
136			};
137
138			uart1: serial@f8020000 {
139				pinctrl-names = "default";
140				pinctrl-0 = <&pinctrl_uart1_default>;
141				atmel,use-dma-rx;
142				atmel,use-dma-tx;
143				status = "okay";
144			};
145
146			uart2: serial@f8024000 {
147				pinctrl-names = "default";
148				pinctrl-0 = <&pinctrl_mikrobus2_uart>;
149				atmel,use-dma-rx;
150				atmel,use-dma-tx;
151				status = "okay";
152			};
153
154			pwm0: pwm@f802c000 {
155				pinctrl-names = "default";
156				pinctrl-0 = <&pinctrl_mikrobus1_pwm &pinctrl_mikrobus2_pwm>;
157				status = "disabled"; /* Conflict with leds. */
158			};
159
160			flx1: flexcom@f8038000 {
161				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
162				status = "okay";
163
164				i2c2: i2c@600 {
165					compatible = "atmel,sama5d2-i2c";
166					reg = <0x600 0x200>;
167					interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>;
168					dmas = <0>, <0>;
169					dma-names = "tx", "rx";
170					#address-cells = <1>;
171					#size-cells = <0>;
172					clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
173					pinctrl-names = "default";
174					pinctrl-0 = <&pinctrl_mikrobus_i2c>;
175					atmel,fifo-size = <16>;
176					status = "okay";
177				};
178			};
179
180			shdwc@f8048010 {
181				atmel,shdwc-debouncer = <976>;
182				atmel,wakeup-rtc-timer;
183
184				input@0 {
185					reg = <0>;
186					atmel,wakeup-type = "low";
187				};
188			};
189
190			watchdog@f8048040 {
191				status = "okay";
192			};
193
194			uart3: serial@fc008000 {
195				atmel,use-dma-rx;
196				atmel,use-dma-tx;
197				pinctrl-names = "default";
198				pinctrl-0 = <&pinctrl_uart3_default>;
199				status = "disabled"; /* Conflict with isc. */
200			};
201
202			uart4: serial@fc00c000 {
203				atmel,use-dma-rx;
204				atmel,use-dma-tx;
205				pinctrl-names = "default";
206				pinctrl-0 = <&pinctrl_mikrobus1_uart>;
207				status = "okay";
208			};
209
210			flx3: flexcom@fc014000 {
211				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
212				status = "disabled";
213
214				uart7: serial@200 {
215					compatible = "atmel,at91sam9260-usart";
216					reg = <0x200 0x200>;
217					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
218					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
219					clock-names = "usart";
220					pinctrl-names = "default";
221					pinctrl-0 = <&pinctrl_flx3_default>;
222					atmel,fifo-size = <32>;
223					status = "disabled"; /* Conflict with isc. */
224				};
225
226				spi2: spi@400 {
227					compatible = "atmel,at91rm9200-spi";
228					reg = <0x400 0x200>;
229					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
230					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
231					clock-names = "spi_clk";
232					pinctrl-names = "default";
233					pinctrl-0 = <&pinctrl_flx3_default>;
234					atmel,fifo-size = <16>;
235					status = "disabled"; /* Conflict with isc. */
236				};
237			};
238
239			flx4: flexcom@fc018000 {
240				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
241				status = "okay";
242
243				uart6: serial@200 {
244					compatible = "atmel,at91sam9260-usart";
245					reg = <0x200 0x200>;
246					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
247					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
248					clock-names = "usart";
249					pinctrl-names = "default";
250					pinctrl-0 = <&pinctrl_flx4_default>;
251					atmel,fifo-size = <32>;
252					status = "disabled"; /* Conflict with spi3 and i2c3. */
253				};
254
255				spi3: spi@400 {
256					compatible = "atmel,at91rm9200-spi";
257					reg = <0x400 0x200>;
258					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
259					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
260					clock-names = "spi_clk";
261					pinctrl-names = "default";
262					pinctrl-0 = <&pinctrl_mikrobus_spi &pinctrl_mikrobus1_spi_cs &pinctrl_mikrobus2_spi_cs>;
263					atmel,fifo-size = <16>;
264					status = "okay"; /* Conflict with uart6 and i2c3. */
265				};
266
267				i2c3: i2c@600 {
268					compatible = "atmel,sama5d2-i2c";
269					reg = <0x600 0x200>;
270					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
271					dmas = <0>, <0>;
272					dma-names = "tx", "rx";
273					#address-cells = <1>;
274					#size-cells = <0>;
275					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
276					pinctrl-names = "default";
277					pinctrl-0 = <&pinctrl_flx4_default>;
278					atmel,fifo-size = <16>;
279					status = "disabled"; /* Conflict with uart6 and spi3. */
280				};
281			};
282
283			i2c1: i2c@fc028000 {
284				dmas = <0>, <0>;
285				pinctrl-names = "default";
286				pinctrl-0 = <&pinctrl_i2c1_default>;
287				status = "okay";
288			};
289
290			adc: adc@fc030000 {
291				vddana-supply = <&vddana>;
292				vref-supply = <&advref>;
293
294				status = "disabled";
295			};
296
297			pinctrl@fc038000 {
298
299				pinctrl_can1_default: can1_default {
300					pinmux = <PIN_PC26__CANTX1>,
301						 <PIN_PC27__CANRX1>;
302					bias-disable;
303				};
304
305				pinctrl_flx3_default: flx3_default {
306					pinmux = <PIN_PC20__FLEXCOM3_IO0>,
307						 <PIN_PC19__FLEXCOM3_IO1>,
308						 <PIN_PC18__FLEXCOM3_IO2>,
309						 <PIN_PC21__FLEXCOM3_IO3>,
310						 <PIN_PC22__FLEXCOM3_IO4>;
311					bias-disable;
312				};
313
314				pinctrl_i2c1_default: i2c1_default {
315					pinmux = <PIN_PD4__TWD1>,
316						 <PIN_PD5__TWCK1>;
317					bias-disable;
318				};
319
320				pinctrl_isc_base: isc_base {
321					pinmux = <PIN_PC21__ISC_PCK>,
322						 <PIN_PC22__ISC_VSYNC>,
323						 <PIN_PC23__ISC_HSYNC>,
324						 <PIN_PC24__ISC_MCK>;
325					bias-disable;
326				};
327
328				pinctrl_isc_data_8bit: isc_data_8bit {
329					pinmux = <PIN_PC20__ISC_D11>,
330						 <PIN_PC19__ISC_D10>,
331						 <PIN_PC18__ISC_D9>,
332						 <PIN_PC17__ISC_D8>,
333						 <PIN_PC16__ISC_D7>,
334						 <PIN_PC15__ISC_D6>,
335						 <PIN_PC14__ISC_D5>,
336						 <PIN_PC13__ISC_D4>;
337					bias-disable;
338				};
339
340				pinctrl_isc_data_9_10: isc_data_9_10 {
341					pinmux = <PIN_PC12__ISC_D3>,
342						 <PIN_PC11__ISC_D2>;
343					bias-disable;
344				};
345
346				pinctrl_isc_data_11_12: isc_data_11_12 {
347					pinmux = <PIN_PC10__ISC_D1>,
348						 <PIN_PC9__ISC_D0>;
349					bias-disable;
350				};
351
352				pinctrl_key_gpio_default: key_gpio_default {
353					pinmux = <PIN_PA29__GPIO>;
354					bias-pull-up;
355				};
356
357				pinctrl_led_gpio_default: led_gpio_default {
358					pinmux = <PIN_PA10__GPIO>,
359						 <PIN_PB1__GPIO>,
360						 <PIN_PA31__GPIO>;
361					bias-pull-up;
362				};
363
364				pinctrl_sdmmc0_default: sdmmc0_default {
365					cmd_data {
366						pinmux = <PIN_PA1__SDMMC0_CMD>,
367							 <PIN_PA2__SDMMC0_DAT0>,
368							 <PIN_PA3__SDMMC0_DAT1>,
369							 <PIN_PA4__SDMMC0_DAT2>,
370							 <PIN_PA5__SDMMC0_DAT3>,
371							 <PIN_PA6__SDMMC0_DAT4>,
372							 <PIN_PA7__SDMMC0_DAT5>,
373							 <PIN_PA8__SDMMC0_DAT6>,
374							 <PIN_PA9__SDMMC0_DAT7>;
375						bias-disable;
376					};
377
378					ck_cd_vddsel {
379						pinmux = <PIN_PA0__SDMMC0_CK>,
380							 <PIN_PA11__SDMMC0_VDDSEL>,
381							 <PIN_PA13__SDMMC0_CD>;
382						bias-disable;
383					};
384				};
385
386				pinctrl_sdmmc1_default: sdmmc1_default {
387					cmd_data {
388						pinmux = <PIN_PA28__SDMMC1_CMD>,
389							 <PIN_PA18__SDMMC1_DAT0>,
390							 <PIN_PA19__SDMMC1_DAT1>,
391							 <PIN_PA20__SDMMC1_DAT2>,
392							 <PIN_PA21__SDMMC1_DAT3>;
393						bias-disable;
394					};
395
396					conf-ck_cd {
397						pinmux = <PIN_PA22__SDMMC1_CK>,
398							 <PIN_PA30__SDMMC1_CD>;
399						bias-disable;
400					};
401				};
402
403				pinctrl_spi0_default: spi0_default {
404					pinmux = <PIN_PA14__SPI0_SPCK>,
405						 <PIN_PA15__SPI0_MOSI>,
406						 <PIN_PA16__SPI0_MISO>,
407						 <PIN_PA17__SPI0_NPCS0>;
408					bias-disable;
409				};
410
411				pinctrl_uart1_default: uart1_default {
412					pinmux = <PIN_PD2__URXD1>,
413						 <PIN_PD3__UTXD1>;
414					bias-disable;
415				};
416
417				pinctrl_uart3_default: uart3_default {
418					pinmux = <PIN_PC12__URXD3>,
419						 <PIN_PC13__UTXD3>;
420					bias-disable;
421				};
422
423				pinctrl_usb_default: usb_default {
424					pinmux = <PIN_PA27__GPIO>,
425						 <PIN_PD19__GPIO>;
426					bias-disable;
427				};
428
429				pinctrl_usba_vbus: usba_vbus {
430					pinmux = <PIN_PD20__GPIO>;
431					bias-disable;
432				};
433
434				pinctrl_mikrobus1_an: mikrobus1_an {
435					pinmux = <PIN_PD25__GPIO>;
436					bias-disable;
437				};
438
439				pinctrl_mikrobus2_an: mikrobus2_an {
440					pinmux = <PIN_PD26__GPIO>;
441					bias-disable;
442				};
443
444				pinctrl_mikrobus1_rst: mikrobus1_rst {
445					pinmux = <PIN_PB2__GPIO>;
446					bias-disable;
447				};
448
449				pinctrl_mikrobus2_rst: mikrobus2_rst {
450					pinmux = <PIN_PA26__GPIO>;
451					bias-disable;
452				};
453
454				pinctrl_mikrobus1_spi_cs: mikrobus1_spi_cs {
455					pinmux = <PIN_PD0__FLEXCOM4_IO4>;
456					bias-disable;
457				};
458
459				pinctrl_mikrobus2_spi_cs: mikrobus2_spi_cs {
460					pinmux = <PIN_PC31__FLEXCOM4_IO3>;
461					bias-disable;
462				};
463
464				pinctrl_mikrobus_spi: mikrobus_spi {
465					pinmux = <PIN_PC28__FLEXCOM4_IO0>,
466						 <PIN_PC29__FLEXCOM4_IO1>,
467						 <PIN_PC30__FLEXCOM4_IO2>;
468					bias-disable;
469				};
470
471				pinctrl_mikrobus1_pwm: mikrobus1_pwm {
472					pinmux = <PIN_PB1__PWML1>;
473					bias-disable;
474				};
475
476				pinctrl_mikrobus2_pwm: mikrobus2_pwm {
477					pinmux = <PIN_PA31__PWML0>;
478					bias-disable;
479				};
480
481				pinctrl_mikrobus1_int: mikrobus1_int {
482					pinmux = <PIN_PB0__GPIO>;
483					bias-disable;
484				};
485
486				pinctrl_mikrobus2_int: mikrobus2_int {
487					pinmux = <PIN_PA25__GPIO>;
488					bias-disable;
489				};
490
491				pinctrl_mikrobus1_uart: mikrobus1_uart {
492					pinmux = <PIN_PB3__URXD4>,
493						 <PIN_PB4__UTXD4>;
494					bias-disable;
495				};
496
497				pinctrl_mikrobus2_uart: mikrobus2_uart {
498					pinmux = <PIN_PD23__URXD2>,
499						 <PIN_PD24__UTXD2>;
500					bias-disable;
501				};
502
503				pinctrl_mikrobus_i2c: mikrobus1_i2c {
504					pinmux = <PIN_PA24__FLEXCOM1_IO0>,
505						 <PIN_PA23__FLEXCOM1_IO1>;
506					bias-disable;
507				};
508
509				pinctrl_flx4_default: flx4_uart_default {
510					pinmux = <PIN_PC28__FLEXCOM4_IO0>,
511						 <PIN_PC29__FLEXCOM4_IO1>,
512						 <PIN_PC30__FLEXCOM4_IO2>,
513						 <PIN_PC31__FLEXCOM4_IO3>,
514						 <PIN_PD0__FLEXCOM4_IO4>;
515					bias-disable;
516				};
517			};
518
519			can1: can@fc050000 {
520				pinctrl-names = "default";
521				pinctrl-0 = <&pinctrl_can1_default>;
522				status = "okay";
523			};
524		};
525	};
526
527	gpio_keys {
528		compatible = "gpio-keys";
529
530		pinctrl-names = "default";
531		pinctrl-0 = <&pinctrl_key_gpio_default>;
532
533		pb4 {
534			label = "USER";
535			gpios = <&pioA PIN_PA29 GPIO_ACTIVE_LOW>;
536			linux,code = <0x104>;
537			wakeup-source;
538		};
539	};
540
541	leds {
542		compatible = "gpio-leds";
543		pinctrl-names = "default";
544		pinctrl-0 = <&pinctrl_led_gpio_default>;
545		status = "okay"; /* Conflict with pwm0. */
546
547		red {
548			label = "red";
549			gpios = <&pioA PIN_PA10 GPIO_ACTIVE_HIGH>;
550		};
551
552		green {
553			label = "green";
554			gpios = <&pioA PIN_PB1 GPIO_ACTIVE_HIGH>;
555		};
556
557		blue {
558			label = "blue";
559			gpios = <&pioA PIN_PA31 GPIO_ACTIVE_HIGH>;
560			linux,default-trigger = "heartbeat";
561		};
562	};
563
564	vddin_3v3: fixed-regulator-vddin_3v3 {
565		compatible = "regulator-fixed";
566
567		regulator-name = "VDDIN_3V3";
568		regulator-min-microvolt = <3300000>;
569		regulator-max-microvolt = <3300000>;
570		regulator-always-on;
571		regulator-boot-on;
572		status = "okay";
573	};
574
575	vddana: fixed-regulator-vddana {
576		compatible = "regulator-fixed";
577
578		regulator-name = "VDDANA";
579		regulator-min-microvolt = <3300000>;
580		regulator-max-microvolt = <3300000>;
581		regulator-always-on;
582		regulator-boot-on;
583		vin-supply = <&vddin_3v3>;
584		status = "okay";
585	};
586
587	advref: fixed-regulator-advref {
588		compatible = "regulator-fixed";
589
590		regulator-name = "advref";
591		regulator-min-microvolt = <3300000>;
592		regulator-max-microvolt = <3300000>;
593		regulator-always-on;
594		regulator-boot-on;
595		vin-supply = <&vddana>;
596		status = "okay";
597	};
598};
599