1/*
2 * Copyright (c) 2017 Piotr Mienkowski
3 * Copyright (c) 2017 Justin Watson
4 * Copyright (c) 2020 Stephanos Ioannidis <root@stephanos.io>
5 * Copyright (c) 2020 Gerson Fernando Budke <nandojve@gmail.com>
6 *
7 * SPDX-License-Identifier: Apache-2.0
8 */
9
10#include "sam_e70_xplained-pinctrl.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	aliases {
15		i2c-0 = &twihs0;
16		i2c-1 = &twihs2;
17		led0 = &green_led;
18		sw0 = &sw0_user_button;
19		watchdog0 = &wdt;
20	};
21
22	chosen {
23		zephyr,console = &usart1;
24		zephyr,shell-uart = &usart1;
25		zephyr,sram = &sram0;
26		zephyr,flash = &flash0;
27		zephyr,code-partition = &slot0_partition;
28		zephyr,canbus = &can0;
29	};
30
31	leds {
32		compatible = "gpio-leds";
33		green_led: led_0 {
34			gpios = <&pioc 8 GPIO_ACTIVE_LOW>;
35			label = "User LED";
36		};
37	};
38
39	gpio_keys {
40		compatible = "gpio-keys";
41
42		/* The switch is labeled SW300 in the schematic, and labeled
43		 * SW0 on the board, and labeld SW1 User Button on docs
44		 */
45		sw0_user_button: button_1 {
46			label = "User Button";
47			gpios = <&pioa 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
48			zephyr,code = <INPUT_KEY_0>;
49		};
50	};
51};
52
53&cpu0 {
54	clock-frequency = <300000000>;
55};
56
57&afec0 {
58	status = "okay";
59
60	pinctrl-0 = <&afec0_default>;
61	pinctrl-names = "default";
62};
63
64&afec1 {
65	status = "okay";
66
67	pinctrl-0 = <&afec1_default>;
68	pinctrl-names = "default";
69};
70
71&dacc {
72	status = "okay";
73};
74
75&twihs0 {
76	status = "okay";
77
78	pinctrl-0 = <&twihs0_default>;
79	pinctrl-names = "default";
80
81	eeprom: eeprom@5f {
82		compatible = "atmel,24mac402";
83		reg = <0x5f>;
84	};
85};
86
87&twihs2 {
88	status = "okay";
89
90	pinctrl-0 = <&twihs2_default>;
91	pinctrl-names = "default";
92};
93
94&spi0 {
95	status = "okay";
96
97	pinctrl-0 = <&spi0_default>;
98	pinctrl-names = "default";
99
100	cs-gpios = <&piod 25 GPIO_ACTIVE_LOW>,
101		   <&piod 27 GPIO_ACTIVE_LOW>;
102
103	dmas = <&xdmac 1 DMA_PERID_SPI0_TX>, <&xdmac 2 DMA_PERID_SPI0_RX>;
104	dma-names = "tx", "rx";
105};
106
107&usart1 {
108	status = "okay";
109	current-speed = <115200>;
110
111	pinctrl-0 = <&usart1_default>;
112	pinctrl-names = "default";
113};
114
115&wdt {
116	status = "okay";
117};
118
119zephyr_udc0: &usbhs {
120	status = "okay";
121};
122
123&gmac {
124	status = "okay";
125
126	pinctrl-0 = <&gmac_rmii>;
127	pinctrl-names = "default";
128
129	mac-eeprom = <&eeprom>;
130	phy-handle = <&phy>;
131};
132
133&mdio {
134	status = "okay";
135
136	pinctrl-0 = <&mdio_default>;
137	pinctrl-names = "default";
138
139	phy: ethernet-phy@0 {
140		compatible = "ethernet-phy";
141		status = "okay";
142		reg = <0>;
143	};
144};
145
146&pwm0 {
147	status = "okay";
148
149	pinctrl-0 = <&pwm_default>;
150	pinctrl-names = "default";
151};
152
153&flash0 {
154	partitions {
155		compatible = "fixed-partitions";
156		#address-cells = <1>;
157		#size-cells = <1>;
158
159		/*
160		 * The first half of sector 0 (64 kbytes)
161		 * is reserved for the bootloader
162		 */
163		boot_partition: partition@0 {
164			label = "mcuboot";
165			reg = <0x0 0x00010000>;
166			read-only;
167		};
168
169		/* From sector 1 to sector 7 (included): slot0 (896 kbytes) */
170		slot0_partition: partition@20000 {
171			label = "image-0";
172			reg = <0x00020000 0x000e0000>;
173		};
174
175		/* From sector 8 to sector 14 (included): slot1 (896 kbytes) */
176		slot1_partition: partition@100000 {
177			label = "image-1";
178			reg = <0x00100000 0x000e0000>;
179		};
180
181		/* Sector 15: scratch (128 kbytes) */
182		scratch_partition: partition@1e0000 {
183			label = "image-scratch";
184			reg = <0x001e0000 0x00020000>;
185		};
186	};
187};
188
189&ssc {
190	status = "okay";
191
192	pinctrl-0 = <&ssc_default>;
193	pinctrl-names = "default";
194
195	dma-names = "rx", "tx";
196	dmas = <&xdmac 22 DMA_PERID_SSC_RX>, <&xdmac 23 DMA_PERID_SSC_TX>;
197};
198
199&xdmac {
200	status = "okay";
201};
202
203&can0 {
204	status = "okay";
205
206	pinctrl-0 = <&can0_default>;
207	pinctrl-names = "default";
208
209	can-transceiver {
210		max-bitrate = <5000000>;
211	};
212};
213
214&tc0 {
215	qdec0: qdec {
216		pinctrl-0 = <&qdec0_default>;
217		pinctrl-names = "default";
218	};
219};
220
221&tc1 {
222	qdec1: qdec {
223		pinctrl-0 = <&qdec1_default>;
224		pinctrl-names = "default";
225	};
226};
227
228&tc2 {
229	qdec2: qdec {
230		pinctrl-0 = <&qdec2_default>;
231		pinctrl-names = "default";
232	};
233};
234
235&tc3 {
236	qdec3: qdec {
237		pinctrl-0 = <&qdec3_default>;
238		pinctrl-names = "default";
239	};
240};
241