1/*
2 * BMD-340-EVAL board configuration
3 * Copyright (c) 2021 u-blox AG
4 * Copyright (c) 2021 Linumiz
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9/dts-v1/;
10#include <nordic/nrf52840_qiaa.dtsi>
11#include <nordic/nrf52840_partition.dtsi>
12#include "ubx_bmd345eval_nrf52840-pinctrl.dtsi"
13#include <zephyr/dt-bindings/input/input-event-codes.h>
14
15/ {
16	model = "u-blox BMD-345-EVAL EVK nRF52840";
17	compatible = "u-blox,ubx-bmd345eval-nrf52840";
18
19	chosen {
20		zephyr,console = &uart0;
21		zephyr,shell-uart = &uart0;
22		zephyr,uart-mcumgr = &uart0;
23		zephyr,bt-mon-uart = &uart0;
24		zephyr,bt-c2h-uart = &uart0;
25		zephyr,ieee802154 = &ieee802154;
26	};
27
28	leds {
29		compatible = "gpio-leds";
30		led0: led_0 {
31			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
32			label = "Red LED 0";
33		};
34		led1: led_1 {
35			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
36			label = "Red LED 1";
37		};
38		led2: led_2 {
39			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
40			label = "Green LED 2";
41		};
42		led3: led_3 {
43			gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
44			label = "Green LED 3";
45		};
46	};
47
48	pwmleds {
49		compatible = "pwm-leds";
50		pwm_led0: pwm_led_0 {
51			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
52		};
53	};
54
55	buttons {
56		compatible = "gpio-keys";
57		button0: button_0 {
58			gpios = <&gpio0 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
59			label = "Push button switch 0";
60			zephyr,code = <INPUT_KEY_0>;
61		};
62		button1: button_1 {
63			gpios = <&gpio0 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
64			label = "Push button switch 1";
65			zephyr,code = <INPUT_KEY_1>;
66		};
67		button2: button_2 {
68			gpios = <&gpio0 24 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
69			label = "Push button switch 2";
70			zephyr,code = <INPUT_KEY_2>;
71		};
72		button3: button_3 {
73			gpios = <&gpio0 25 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
74			label = "Push button switch 3";
75			zephyr,code = <INPUT_KEY_3>;
76		};
77	};
78
79	arduino_header: connector {
80		compatible = "arduino-header-r3";
81		#gpio-cells = <2>;
82		gpio-map-mask = <0xffffffff 0xffffffc0>;
83		gpio-map-pass-thru = <0 0x3f>;
84		gpio-map = <0 0 &gpio0 3 0>,    /* A0 */
85			<1 0 &gpio0 4 0>,    /* A1 */
86			<2 0 &gpio0 28 0>,   /* A2 */
87			<3 0 &gpio0 29 0>,   /* A3 */
88			<4 0 &gpio0 30 0>,   /* A4 */
89			<5 0 &gpio0 31 0>,   /* A5 */
90			<6 0 &gpio1 1 0>,    /* D0 */
91			/* not present */    /* D1 */
92			<8 0 &gpio1 3 0>,    /* D2 */
93			/* not present */    /* D3 */
94			/* not present */    /* D4 */
95			/* not present */    /* D5 */
96			<12 0 &gpio1 7 0>,   /* D6 */
97			<13 0 &gpio1 8 0>,   /* D7 */
98			<14 0 &gpio1 10 0>,  /* D8 */
99			<15 0 &gpio1 11 0>,  /* D9 */
100			<16 0 &gpio1 12 0>,  /* D10 */
101			<17 0 &gpio1 13 0>,  /* D11 */
102			<18 0 &gpio1 14 0>,  /* D12 */
103			<19 0 &gpio1 15 0>,  /* D13 */
104			<20 0 &gpio0 26 0>,  /* D14 */
105			<21 0 &gpio0 27 0>;  /* D15 */
106	};
107
108	arduino_adc: analog-connector {
109		compatible = "arduino,uno-adc";
110		#io-channel-cells = <1>;
111		io-channel-map = <0 &adc 1>,    /* A0 = P0.3 = AIN1 */
112			<1 &adc 2>,    /* A1 = P0.4 = AIN2 */
113			<2 &adc 4>,    /* A2 = P0.28 = AIN4 */
114			<3 &adc 5>,    /* A3 = P0.29 = AIN5 */
115			<4 &adc 6>,    /* A4 = P0.30 = AIN6 */
116			<5 &adc 7>;    /* A5 = P0.31 = AIN7 */
117	};
118
119	nrf_radio_fem: fem {
120		compatible = "generic-fem-two-ctrl-pins";
121		ctx-gpios = <&gpio1 5 0>;
122		ctx-settle-time-us = <1>;
123		crx-gpios = <&gpio1 6 0>;
124		crx-settle-time-us = <1>;
125	};
126
127	/* These aliases are provided for compatibility with samples */
128	aliases {
129		led0 = &led0;
130		led1 = &led1;
131		led2 = &led2;
132		led3 = &led3;
133		pwm-led0 = &pwm_led0;
134		sw0 = &button0;
135		sw1 = &button1;
136		sw2 = &button2;
137		sw3 = &button3;
138		bootloader-led0 = &led0;
139		mcuboot-button0 = &button0;
140		mcuboot-led0 = &led0;
141		watchdog0 = &wdt0;
142	};
143};
144
145&radio {
146	fem = <&nrf_radio_fem>;
147};
148
149&adc {
150	status = "okay";
151};
152
153&uicr {
154	gpio-as-nreset;
155};
156
157&gpiote {
158	status = "okay";
159};
160
161&gpio0 {
162	status = "okay";
163};
164
165&gpio1 {
166	status = "okay";
167
168	fem-pins {
169		gpio-hog;
170		/* A_SEL, MODE pins */
171		gpios = <2 GPIO_ACTIVE_HIGH>, <4 GPIO_ACTIVE_HIGH>;
172		output-low;
173	};
174};
175
176&uart0 {
177	compatible = "nordic,nrf-uarte";
178	status = "okay";
179	current-speed = <115200>;
180	pinctrl-0 = <&uart0_default>;
181	pinctrl-1 = <&uart0_sleep>;
182	pinctrl-names = "default", "sleep";
183};
184
185arduino_i2c: &i2c0 {
186	compatible = "nordic,nrf-twi";
187	status = "okay";
188	pinctrl-0 = <&i2c0_default>;
189	pinctrl-1 = <&i2c0_sleep>;
190	pinctrl-names = "default", "sleep";
191};
192
193&i2c1 {
194	compatible = "nordic,nrf-twi";
195	/* Cannot be used together with spi1. */
196	/* status = "okay"; */
197	pinctrl-0 = <&i2c1_default>;
198	pinctrl-1 = <&i2c1_sleep>;
199	pinctrl-names = "default", "sleep";
200};
201
202&pwm0 {
203	status = "okay";
204	pinctrl-0 = <&pwm0_default>;
205	pinctrl-1 = <&pwm0_sleep>;
206	pinctrl-names = "default", "sleep";
207};
208
209&spi0 {
210	compatible = "nordic,nrf-spi";
211	/* Cannot be used together with i2c0. */
212	/* status = "okay"; */
213	pinctrl-0 = <&spi0_default>;
214	pinctrl-1 = <&spi0_sleep>;
215	pinctrl-names = "default", "sleep";
216};
217
218&spi1 {
219	compatible = "nordic,nrf-spi";
220	status = "okay";
221	pinctrl-0 = <&spi1_default>;
222	pinctrl-1 = <&spi1_sleep>;
223	pinctrl-names = "default", "sleep";
224};
225
226&spi2 {
227	compatible = "nordic,nrf-spi";
228	status = "disabled";
229	pinctrl-0 = <&spi2_default>;
230	pinctrl-1 = <&spi2_sleep>;
231	pinctrl-names = "default", "sleep";
232};
233
234arduino_spi: &spi3 {
235	status = "okay";
236	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
237	pinctrl-0 = <&spi3_default>;
238	pinctrl-1 = <&spi3_sleep>;
239	pinctrl-names = "default", "sleep";
240};
241
242&qspi {
243	status = "okay";
244	pinctrl-0 = <&qspi_default>;
245	pinctrl-1 = <&qspi_sleep>;
246	pinctrl-names = "default", "sleep";
247	mx25r64: mx25r6435f@0 {
248		compatible = "nordic,qspi-nor";
249		reg = <0>;
250		/* MX25R64 supports only pp and pp4io */
251		writeoc = "pp4io";
252		/* MX25R64 supports all readoc options */
253		readoc = "read4io";
254		sck-frequency = <8000000>;
255		jedec-id = [c2 28 17];
256		sfdp-bfp = [
257			e5 20 f1 ff  ff ff ff 03
258			44 eb 08 6b  08 3b 04 bb
259			ee ff ff ff  ff ff 00 ff
260			ff ff 00 ff  0c 20 0f 52
261			10 d8 00 ff  23 72 f5 00
262			82 ed 04 cc  44 83 68 44
263			30 b0 30 b0  f7 c4 d5 5c
264			00 be 29 ff  f0 d0 ff ff
265		];
266		size = <67108864>;
267		has-dpd;
268		t-enter-dpd = <10000>;
269		t-exit-dpd = <35000>;
270	};
271};
272
273&ieee802154 {
274	status = "okay";
275};
276
277zephyr_udc0: &usbd {
278	compatible = "nordic,nrf-usbd";
279	status = "okay";
280};
281