1/*
2 * Copyright (c) 2017 Piotr Mienkowski
3 * Copyright (c) 2017 Justin Watson
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#include <arm/armv7-m.dtsi>
9#include <zephyr/dt-bindings/adc/adc.h>
10#include <zephyr/dt-bindings/i2c/i2c.h>
11#include <zephyr/dt-bindings/gpio/gpio.h>
12#include <zephyr/dt-bindings/pwm/pwm.h>
13#include <zephyr/dt-bindings/clock/atmel_sam_pmc.h>
14
15/ {
16	aliases {
17		watchdog0 = &wdt;
18	};
19
20	chosen {
21		zephyr,flash-controller = &eefc;
22	};
23
24	chosen {
25		zephyr,entropy = &trng;
26	};
27
28	cpus {
29		#address-cells = <1>;
30		#size-cells = <0>;
31
32		cpu0: cpu@0 {
33			device_type = "cpu";
34			compatible = "arm,cortex-m7";
35			reg = <0>;
36			#address-cells = <1>;
37			#size-cells = <1>;
38
39			mpu: mpu@e000ed90 {
40				compatible = "arm,armv7m-mpu";
41				reg = <0xe000ed90 0x40>;
42			};
43		};
44	};
45
46	sram0: memory@20400000 {
47		compatible = "mmio-sram";
48	};
49
50	soc {
51		pmc: pmc@400e0600 {
52			compatible = "atmel,sam-pmc";
53			reg = <0x400e0600 0x200>;
54			interrupts = <5 0>;
55			#clock-cells = <2>;
56			status = "okay";
57		};
58
59		supc: supc@400e1810 {
60			compatible = "atmel,sam-supc";
61			reg = <0x400e1810 0x20>;
62			#wakeup-source-id-cells = <1>;
63			status = "okay";
64		};
65
66		eefc: flash-controller@400e0c00 {
67			compatible = "atmel,sam-flash-controller";
68			reg = <0x400e0c00 0x200>;
69			interrupts = <6 0>;
70			clocks = <&pmc PMC_TYPE_PERIPHERAL 6>;
71
72			#address-cells = <1>;
73			#size-cells = <1>;
74			#erase-block-cells = <2>;
75
76			flash0: flash@400000 {
77				compatible = "atmel,sam-flash", "soc-nv-flash";
78				write-block-size = <16>;
79				erase-block-size = <8192>;
80			};
81		};
82
83		wdt: watchdog@400e1850 {
84			compatible = "atmel,sam-watchdog";
85			reg = <0x400e1850 0xc>;
86			interrupts = <4 0>;
87			clocks = <&pmc PMC_TYPE_PERIPHERAL 4>;
88			status = "disabled";
89		};
90
91		twihs0: i2c@40018000 {
92			compatible = "atmel,sam-i2c-twihs";
93			clock-frequency = <I2C_BITRATE_STANDARD>;
94			#address-cells = <1>;
95			#size-cells = <0>;
96			reg = <0x40018000 0x12B>;
97			interrupts = <19 0>;
98			clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
99			status = "disabled";
100		};
101
102		twihs1: i2c@4001c000 {
103			compatible = "atmel,sam-i2c-twihs";
104			clock-frequency = <I2C_BITRATE_STANDARD>;
105			#address-cells = <1>;
106			#size-cells = <0>;
107			reg = <0x4001c000 0x12B>;
108			interrupts = <20 0>;
109			clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
110			status = "disabled";
111		};
112
113		twihs2: i2c@40060000 {
114			compatible = "atmel,sam-i2c-twihs";
115			clock-frequency = <I2C_BITRATE_STANDARD>;
116			#address-cells = <1>;
117			#size-cells = <0>;
118			reg = <0x40060000 0x12B>;
119			interrupts = <41 0>;
120			clocks = <&pmc PMC_TYPE_PERIPHERAL 41>;
121			status = "disabled";
122		};
123
124		spi0: spi@40008000 {
125			compatible = "atmel,sam-spi";
126			#address-cells = <1>;
127			#size-cells = <0>;
128			reg = <0x40008000 0x4000>;
129			interrupts = <21 0>;
130			clocks = <&pmc PMC_TYPE_PERIPHERAL 21>;
131			status = "disabled";
132		};
133
134		spi1: spi@40058000 {
135			compatible = "atmel,sam-spi";
136			#address-cells = <1>;
137			#size-cells = <0>;
138			reg = <0x40058000 0x4000>;
139			interrupts = <42 0>;
140			clocks = <&pmc PMC_TYPE_PERIPHERAL 42>;
141			status = "disabled";
142		};
143
144		uart0: uart@400e0800 {
145			compatible = "atmel,sam-uart";
146			reg = <0x400e0800 0x100>;
147			interrupts = <7 1>;
148			clocks = <&pmc PMC_TYPE_PERIPHERAL 7>;
149			status = "disabled";
150		};
151
152		uart1: uart@400e0a00 {
153			compatible = "atmel,sam-uart";
154			reg = <0x400e0a00 0x100>;
155			interrupts = <8 1>;
156			clocks = <&pmc PMC_TYPE_PERIPHERAL 8>;
157			status = "disabled";
158		};
159
160		uart2: uart@400e1a00 {
161			compatible = "atmel,sam-uart";
162			reg = <0x400e1a00 0x100>;
163			interrupts = <44 1>;
164			clocks = <&pmc PMC_TYPE_PERIPHERAL 44>;
165			status = "disabled";
166		};
167
168		uart3: uart@400e1c00 {
169			compatible = "atmel,sam-uart";
170			reg = <0x400e1c00 0x100>;
171			interrupts = <45 1>;
172			clocks = <&pmc PMC_TYPE_PERIPHERAL 45>;
173			status = "disabled";
174		};
175
176		uart4: uart@400e1e00 {
177			compatible = "atmel,sam-uart";
178			reg = <0x400e1e00 0x100>;
179			interrupts = <46 1>;
180			clocks = <&pmc PMC_TYPE_PERIPHERAL 46>;
181			status = "disabled";
182		};
183
184		usart0: usart@40024000 {
185			compatible = "atmel,sam-usart";
186			reg = <0x40024000 0x100>;
187			interrupts = <13 0>;
188			clocks = <&pmc PMC_TYPE_PERIPHERAL 13>;
189			status = "disabled";
190		};
191
192		usart1: usart@40028000 {
193			compatible = "atmel,sam-usart";
194			reg = <0x40028000 0x100>;
195			interrupts = <14 0>;
196			clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
197			status = "disabled";
198		};
199
200		usart2: usart@4002c000 {
201			compatible = "atmel,sam-usart";
202			reg = <0x4002c000 0x100>;
203			interrupts = <15 0>;
204			clocks = <&pmc PMC_TYPE_PERIPHERAL 15>;
205			status = "disabled";
206		};
207
208		afec0: adc@4003c000 {
209			compatible = "atmel,sam-afec";
210			reg = <0x4003c000 0x100>;
211			interrupts = <29 0>;
212			clocks = <&pmc PMC_TYPE_PERIPHERAL 29>;
213			status = "disabled";
214			#io-channel-cells = <1>;
215		};
216
217		afec1: adc@40064000 {
218			compatible = "atmel,sam-afec";
219			reg = <0x40064000 0x100>;
220			interrupts = <40 0>;
221			clocks = <&pmc PMC_TYPE_PERIPHERAL 40>;
222			status = "disabled";
223			#io-channel-cells = <1>;
224		};
225
226		dacc: dacc@40040000 {
227			compatible = "atmel,sam-dac";
228			reg = <0x40040000 0x100>;
229			interrupts = <30 0>;
230			clocks = <&pmc PMC_TYPE_PERIPHERAL 30>;
231			status = "disabled";
232			#io-channel-cells = <1>;
233		};
234
235		pinctrl: pinctrl@400e0e00 {
236			compatible = "atmel,sam-pinctrl";
237			#address-cells = <1>;
238			#size-cells = <1>;
239			ranges = <0x400e0e00 0x400e0e00 0xa00>;
240
241			pioa: gpio@400e0e00 {
242				compatible = "atmel,sam-gpio";
243				reg = <0x400e0e00 0x190>;
244				interrupts = <10 1>;
245				clocks = <&pmc PMC_TYPE_PERIPHERAL 10>;
246				gpio-controller;
247				#gpio-cells = <2>;
248				#atmel,pin-cells = <2>;
249			};
250
251			piob: gpio@400e1000 {
252				compatible = "atmel,sam-gpio";
253				reg = <0x400e1000 0x190>;
254				interrupts = <11 1>;
255				clocks = <&pmc PMC_TYPE_PERIPHERAL 11>;
256				gpio-controller;
257				#gpio-cells = <2>;
258				#atmel,pin-cells = <2>;
259			};
260
261			pioc: gpio@400e1200 {
262				compatible = "atmel,sam-gpio";
263				reg = <0x400e1200 0x190>;
264				interrupts = <12 1>;
265				clocks = <&pmc PMC_TYPE_PERIPHERAL 12>;
266				gpio-controller;
267				#gpio-cells = <2>;
268				#atmel,pin-cells = <2>;
269			};
270
271			piod: gpio@400e1400 {
272				compatible = "atmel,sam-gpio";
273				reg = <0x400e1400 0x190>;
274				interrupts = <16 1>;
275				clocks = <&pmc PMC_TYPE_PERIPHERAL 16>;
276				gpio-controller;
277				#gpio-cells = <2>;
278				#atmel,pin-cells = <2>;
279			};
280
281			pioe: gpio@400e1600 {
282				compatible = "atmel,sam-gpio";
283				reg = <0x400e1600 0x190>;
284				interrupts = <17 1>;
285				clocks = <&pmc PMC_TYPE_PERIPHERAL 17>;
286				gpio-controller;
287				#gpio-cells = <2>;
288				#atmel,pin-cells = <2>;
289			};
290		};
291
292		pwm0: pwm0@40020000 {
293			compatible = "atmel,sam-pwm";
294			reg = <0x40020000 0x4000>;
295			interrupts = <31 0>;
296			clocks = <&pmc PMC_TYPE_PERIPHERAL 31>;
297			status = "disabled";
298			prescaler = <10>;
299			divider = <1>;
300			#pwm-cells = <3>;
301		};
302
303		pwm1: pwm1@4005c000 {
304			compatible = "atmel,sam-pwm";
305			reg = <0x4005c000 0x4000>;
306			interrupts = <60 0>;
307			clocks = <&pmc PMC_TYPE_PERIPHERAL 60>;
308			status = "disabled";
309			prescaler = <10>;
310			divider = <1>;
311			#pwm-cells = <3>;
312		};
313
314		usbhs: usbd@40038000 {
315			compatible = "atmel,sam-usbhs";
316			#address-cells = <1>;
317			#size-cells = <0>;
318			reg = <0x40038000 0x4000>;
319			interrupts = <34 0>;
320			interrupt-names = "usbhs";
321			maximum-speed = "high-speed";
322			num-bidir-endpoints = <10>;
323			clocks = <&pmc PMC_TYPE_PERIPHERAL 34>;
324			status = "disabled";
325		};
326
327		gmac: ethernet@40050000 {
328			compatible = "atmel,sam-gmac";
329			reg = <0x40050000 0x4000>;
330			clocks = <&pmc PMC_TYPE_PERIPHERAL 39>;
331			interrupts = <39 0>, <66 0>, <67 0>;
332			interrupt-names = "gmac", "q1", "q2";
333			num-queues = <3>;
334			local-mac-address = [00 00 00 00 00 00];
335			status = "disabled";
336		};
337
338		mdio: mdio@40050000 {
339			compatible = "atmel,sam-mdio";
340			reg = <0x40050000 0x4000>;
341			clocks = <&pmc PMC_TYPE_PERIPHERAL 39>;
342			status = "disabled";
343			#address-cells = <1>;
344			#size-cells = <0>;
345		};
346
347		tc0: tc@4000c000 {
348			compatible = "atmel,sam-tc";
349			reg = <0x4000c000 0x100>;
350			interrupts = <23 0
351				      24 0
352				      25 0>;
353			clocks = <&pmc PMC_TYPE_PERIPHERAL 23>,
354				 <&pmc PMC_TYPE_PERIPHERAL 24>,
355				 <&pmc PMC_TYPE_PERIPHERAL 25>;
356			status = "disabled";
357		};
358
359		tc1: tc@40010000 {
360			compatible = "atmel,sam-tc";
361			reg = <0x40010000 0x100>;
362			interrupts = <26 0
363				      27 0
364				      28 0>;
365			clocks = <&pmc PMC_TYPE_PERIPHERAL 26>,
366				 <&pmc PMC_TYPE_PERIPHERAL 27>,
367				 <&pmc PMC_TYPE_PERIPHERAL 28>;
368			status = "disabled";
369		};
370
371		tc2: tc@40014000 {
372			compatible = "atmel,sam-tc";
373			reg = <0x40014000 0x100>;
374			interrupts = <47 0
375				      48 0
376				      49 0>;
377			clocks = <&pmc PMC_TYPE_PERIPHERAL 47>,
378				 <&pmc PMC_TYPE_PERIPHERAL 48>,
379				 <&pmc PMC_TYPE_PERIPHERAL 49>;
380			status = "disabled";
381		};
382
383		tc3: tc@40054000 {
384			compatible = "atmel,sam-tc";
385			reg = <0x40054000 0x100>;
386			interrupts = <50 0
387				      51 0
388				      52 0>;
389			clocks = <&pmc PMC_TYPE_PERIPHERAL 50>,
390				 <&pmc PMC_TYPE_PERIPHERAL 51>,
391				 <&pmc PMC_TYPE_PERIPHERAL 52>;
392			status = "disabled";
393		};
394
395		trng: random@40070000 {
396			compatible = "atmel,sam-trng";
397			reg = <0x40070000 0x4000>;
398			interrupts = <57 0>;
399			clocks = <&pmc PMC_TYPE_PERIPHERAL 57>;
400			status = "okay";
401		};
402
403		xdmac: dma0: dma-controller@40078000 {
404			compatible = "atmel,sam-xdmac";
405			reg = <0x40078000 0x400>;
406			interrupts = <58 0>;
407			clocks = <&pmc PMC_TYPE_PERIPHERAL 58>;
408			#dma-cells = <2>;
409			status = "disabled";
410		};
411
412		ssc: ssc@40004000 {
413			compatible = "atmel,sam-ssc";
414			reg = <0x40004000 0x4000>;
415			interrupts = <22 0>;
416			clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
417			status = "disabled";
418		};
419
420		can0: can@40030000 {
421			compatible = "atmel,sam-can";
422			reg = <0x40030000 0x100>;
423			interrupts = <35 0>, <36 0>;
424			interrupt-names = "int0", "int1";
425			clocks = <&pmc PMC_TYPE_PERIPHERAL 35>;
426			divider = <6>;
427			bosch,mram-cfg = <0x0 28 8 3 3 0 1 1>;
428			sample-point = <875>;
429			sample-point-data = <875>;
430			status = "disabled";
431		};
432
433		can1: can@40034000 {
434			compatible = "atmel,sam-can";
435			reg = <0x40034000 0x100>;
436			interrupts = <37 0>, <38 0>;
437			interrupt-names = "int0", "int1";
438			clocks = <&pmc PMC_TYPE_PERIPHERAL 37>;
439			divider = <6>;
440			bosch,mram-cfg = <0x0 28 8 3 3 0 1 1>;
441			sample-point = <875>;
442			sample-point-data = <875>;
443			status = "disabled";
444		};
445
446		rstc: rstc@400e1800 {
447			compatible = "atmel,sam-rstc";
448			reg = <0x400e1800 0x10>;
449			clocks = <&pmc PMC_TYPE_PERIPHERAL 1>;
450			user-nrst;
451		};
452
453		rtc: rtc@400e1860 {
454			compatible = "atmel,sam-rtc";
455			reg = <0x400e1860 0x100>;
456			interrupts = <2 0>;
457			clocks = <&pmc PMC_TYPE_PERIPHERAL 2>;
458			alarms-count = <1>;
459			status = "disabled";
460		};
461	};
462};
463
464&nvic {
465	arm,num-irq-priority-bits = <3>;
466};
467