1/*
2 * Copyright (c) 2019-2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#include "nrf5340dk_common.dtsi"
7#include "nrf5340_cpuapp_common-pinctrl.dtsi"
8#include <zephyr/dt-bindings/input/input-event-codes.h>
9
10/ {
11
12	chosen {
13		zephyr,console = &uart0;
14		zephyr,shell-uart = &uart0;
15		zephyr,uart-mcumgr = &uart0;
16		zephyr,bt-mon-uart = &uart0;
17		zephyr,bt-c2h-uart = &uart0;
18		zephyr,bt-hci = &bt_hci_ipc0;
19		nordic,802154-spinel-ipc = &ipc0;
20		zephyr,ieee802154 = &ieee802154;
21	};
22
23	pwmleds {
24		compatible = "pwm-leds";
25		pwm_led0: pwm_led_0 {
26			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
27		};
28	};
29
30	arduino_adc: analog-connector {
31		compatible = "arduino,uno-adc";
32		#io-channel-cells = <1>;
33		io-channel-map = <0 &adc 0>,	/* A0 = P0.4 = AIN0 */
34				 <1 &adc 1>,	/* A1 = P0.5 = AIN1 */
35				 <2 &adc 2>,	/* A2 = P0.6 = AIN2 */
36				 <3 &adc 3>,	/* A3 = P0.7 = AIN3 */
37				 <4 &adc 4>,	/* A4 = P0.25 = AIN4 */
38				 <5 &adc 5>;	/* A5 = P0.26 = AIN5 */
39	};
40
41	gpio_fwd: nrf-gpio-forwarder {
42		compatible = "nordic,nrf-gpio-forwarder";
43		status = "okay";
44		uart {
45			gpios = <&gpio1 1 0>, <&gpio1 0 0>, <&gpio0 11 0>, <&gpio0 10 0>;
46		};
47	};
48
49	/* These aliases are provided for compatibility with samples */
50	aliases {
51		pwm-led0 = &pwm_led0;
52		watchdog0 = &wdt0;
53	};
54};
55
56&vregmain {
57	regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
58};
59
60&vregradio {
61	regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
62};
63
64&vregh {
65	status = "okay";
66};
67
68&lfxo {
69	load-capacitors = "internal";
70	load-capacitance-picofarad = <7>;
71};
72
73&adc {
74	status = "okay";
75};
76
77&gpiote {
78	status = "okay";
79};
80
81&gpio0 {
82	status = "okay";
83};
84
85&gpio1 {
86	status = "okay";
87};
88
89&i2c1 {
90	compatible = "nordic,nrf-twim";
91	status = "okay";
92	pinctrl-0 = <&i2c1_default>;
93	pinctrl-1 = <&i2c1_sleep>;
94	pinctrl-names = "default", "sleep";
95};
96
97&uart0 {
98	status = "okay";
99	current-speed = <115200>;
100	pinctrl-0 = <&uart0_default>;
101	pinctrl-1 = <&uart0_sleep>;
102	pinctrl-names = "default", "sleep";
103};
104
105&pwm0 {
106	status = "okay";
107	pinctrl-0 = <&pwm0_default>;
108	pinctrl-1 = <&pwm0_sleep>;
109	pinctrl-names = "default", "sleep";
110};
111
112&qspi {
113	status = "okay";
114	pinctrl-0 = <&qspi_default>;
115	pinctrl-1 = <&qspi_sleep>;
116	pinctrl-names = "default", "sleep";
117	mx25r64: mx25r6435f@0 {
118		compatible = "nordic,qspi-nor";
119		reg = <0>;
120		/* MX25R64 supports only pp and pp4io */
121		writeoc = "pp4io";
122		/* MX25R64 supports all readoc options */
123		readoc = "read4io";
124		sck-frequency = <8000000>;
125		jedec-id = [c2 28 17];
126		sfdp-bfp = [
127			e5 20 f1 ff  ff ff ff 03  44 eb 08 6b  08 3b 04 bb
128			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
129			10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
130			30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
131		];
132		size = <67108864>;
133		has-dpd;
134		t-enter-dpd = <10000>;
135		t-exit-dpd = <35000>;
136	};
137};
138
139arduino_serial: &uart1 {
140	compatible = "nordic,nrf-uarte";
141	current-speed = <115200>;
142	pinctrl-0 = <&uart1_default>;
143	pinctrl-1 = <&uart1_sleep>;
144	pinctrl-names = "default", "sleep";
145};
146
147arduino_i2c: &i2c1 {};
148
149arduino_spi: &spi4 {
150	compatible = "nordic,nrf-spim";
151	status = "okay";
152	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
153	pinctrl-0 = <&spi4_default>;
154	pinctrl-1 = <&spi4_sleep>;
155	pinctrl-names = "default", "sleep";
156};
157
158&ieee802154 {
159	status = "okay";
160};
161
162zephyr_udc0: &usbd {
163	compatible = "nordic,nrf-usbd";
164	status = "okay";
165};
166
167/* Include default memory partition configuration file */
168#include <common/nordic/nrf5340_cpuapp_partition.dtsi>
169