1/*
2 * Copyright (c) 2024 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#include "nrf5340_cpuapp_common_pinctrl.dtsi"
7#include <zephyr/dt-bindings/input/input-event-codes.h>
8
9/ {
10	chosen {
11		zephyr,console = &uart0;
12		zephyr,shell-uart = &uart0;
13		zephyr,uart-mcumgr = &uart0;
14		zephyr,bt-mon-uart = &uart0;
15		zephyr,bt-c2h-uart = &uart0;
16		zephyr,bt-hci = &bt_hci_ipc0;
17		nordic,802154-spinel-ipc = &ipc0;
18		zephyr,ieee802154 = &ieee802154;
19	};
20
21	leds {
22		compatible = "gpio-leds";
23		led0: led_0 {
24			gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
25			label = "Green LED 0";
26		};
27		led1: led_1 {
28			gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
29			label = "Green LED 1";
30		};
31	};
32
33	pwmleds {
34		compatible = "pwm-leds";
35		pwm_led0: pwm_led_0 {
36			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
37		};
38	};
39
40	buttons {
41		compatible = "gpio-keys";
42		button0: button_0 {
43			gpios = <&gpio1 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
44			label = "Push button 1";
45			zephyr,code = <INPUT_KEY_0>;
46		};
47		button1: button_1 {
48			gpios = <&gpio1 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
49			label = "Push button 2";
50			zephyr,code = <INPUT_KEY_1>;
51		};
52	};
53
54	arduino_header: connector {
55		compatible = "arduino-header-r3";
56		#gpio-cells = <2>;
57		gpio-map-mask = <0xffffffff 0xffffffc0>;
58		gpio-map-pass-thru = <0 0x3f>;
59		gpio-map = <0 0 &gpio0 4 0>,	/* A0 */
60			   <1 0 &gpio0 5 0>,	/* A1 */
61			   <2 0 &gpio0 6 0>,	/* A2 */
62			   <3 0 &gpio0 7 0>,	/* A3 */
63			   <4 0 &gpio0 25 0>,	/* A4 */
64			   <5 0 &gpio0 26 0>,	/* A5 */
65			   <6 0 &gpio1 0 0>,	/* D0 */
66			   <7 0 &gpio1 1 0>,	/* D1 */
67			   <8 0 &gpio1 4 0>,	/* D2 */
68			   <9 0 &gpio1 5 0>,	/* D3 */
69			   <10 0 &gpio1 6 0>,	/* D4 */
70			   <11 0 &gpio1 7 0>,	/* D5 */
71			   <12 0 &gpio1 8 0>,	/* D6 */
72			   <13 0 &gpio1 9 0>,	/* D7 */
73			   <14 0 &gpio1 10 0>,	/* D8 */
74			   <15 0 &gpio1 11 0>,	/* D9 */
75			   <16 0 &gpio1 12 0>,	/* D10 */
76			   <17 0 &gpio1 13 0>,	/* D11 */
77			   <18 0 &gpio1 14 0>,	/* D12 */
78			   <19 0 &gpio1 15 0>,	/* D13 */
79			   <20 0 &gpio1 2 0>,	/* D14 */
80			   <21 0 &gpio1 3 0>;	/* D15 */
81	};
82
83	arduino_adc: analog-connector {
84		compatible = "arduino,uno-adc";
85		#io-channel-cells = <1>;
86		io-channel-map = <0 &adc 0>,	/* A0 = P0.4 = AIN0 */
87				 <1 &adc 1>,	/* A1 = P0.5 = AIN1 */
88				 <2 &adc 2>,	/* A2 = P0.6 = AIN2 */
89				 <3 &adc 3>,	/* A3 = P0.7 = AIN3 */
90				 <4 &adc 4>,	/* A4 = P0.25 = AIN4 */
91				 <5 &adc 5>;	/* A5 = P0.26 = AIN5 */
92	};
93
94	gpio_fwd: nrf-gpio-forwarder {
95		compatible = "nordic,nrf-gpio-forwarder";
96		status = "okay";
97		uart {
98			gpios = <&gpio1 1 0>, <&gpio1 0 0>, <&gpio1 5 0>, <&gpio1 4 0>;
99		};
100	};
101
102	/* These aliases are provided for compatibility with samples */
103	aliases {
104		led0 = &led0;
105		led1 = &led1;
106		pwm-led0 = &pwm_led0;
107		sw0 = &button0;
108		sw1 = &button1;
109		bootloader-led0 = &led0;
110		mcuboot-button0 = &button0;
111		mcuboot-led0 = &led0;
112		watchdog0 = &wdt0;
113	};
114
115	nrf_radio_coex: coex {
116		status = "okay";
117		compatible = "nordic,nrf7002-coex";
118		req-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
119		status0-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
120		grant-gpios = <&gpio0 24 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>;
121		swctrl1-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
122	};
123};
124
125&vregmain {
126	regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
127};
128
129&vregradio {
130	regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
131};
132
133&vregh {
134	status = "okay";
135};
136
137&adc {
138	status = "okay";
139};
140
141&gpiote {
142	status = "okay";
143};
144
145&gpio0 {
146	status = "okay";
147};
148
149&gpio1 {
150	status = "okay";
151};
152
153arduino_i2c: &i2c1 {
154	compatible = "nordic,nrf-twim";
155	status = "okay";
156	pinctrl-0 = <&i2c1_default>;
157	pinctrl-1 = <&i2c1_sleep>;
158	pinctrl-names = "default", "sleep";
159};
160
161&uart0 {
162	status = "okay";
163	current-speed = <115200>;
164	pinctrl-0 = <&uart0_default>;
165	pinctrl-1 = <&uart0_sleep>;
166	pinctrl-names = "default", "sleep";
167};
168
169&pwm0 {
170	status = "okay";
171	pinctrl-0 = <&pwm0_default>;
172	pinctrl-1 = <&pwm0_sleep>;
173	pinctrl-names = "default", "sleep";
174};
175
176&spi4 {
177	compatible = "nordic,nrf-spim";
178	status = "okay";
179	pinctrl-0 = <&spi4_default>;
180	pinctrl-1 = <&spi4_sleep>;
181	pinctrl-names = "default", "sleep";
182	cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
183	mx25r64: mx25r6435f@0 {
184		compatible = "jedec,spi-nor";
185		reg = <0>;
186		spi-max-frequency = <33000000>;
187		jedec-id = [c2 28 17];
188		sfdp-bfp = [
189			e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb
190			ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52
191			10 d8 00 ff 23 72 f5 00 82 ed 04 cc 44 83 68 44
192			30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff
193		];
194		size = <67108864>;
195		has-dpd;
196		t-enter-dpd = <10000>;
197		t-exit-dpd = <5000>;
198	};
199};
200
201&qspi {
202	status = "okay";
203	pinctrl-0 = <&qspi_default>;
204	pinctrl-1 = <&qspi_sleep>;
205	pinctrl-names = "default", "sleep";
206};
207
208arduino_serial: &uart1 {
209	compatible = "nordic,nrf-uarte";
210	current-speed = <115200>;
211	pinctrl-0 = <&uart1_default>;
212	pinctrl-1 = <&uart1_sleep>;
213	pinctrl-names = "default", "sleep";
214};
215
216arduino_spi: &spi3 {
217	compatible = "nordic,nrf-spim";
218	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
219	pinctrl-0 = <&spi3_default>;
220	pinctrl-1 = <&spi3_sleep>;
221	pinctrl-names = "default", "sleep";
222};
223
224&ieee802154 {
225	status = "okay";
226};
227
228zephyr_udc0: &usbd {
229	compatible = "nordic,nrf-usbd";
230	status = "okay";
231};
232
233/* Include default memory partition configuration file */
234#include <common/nordic/nrf5340_cpuapp_partition.dtsi>
235