1/*
2 * Copyright (c) 2021 Laird Connectivity
3 * Copyright (c) 2024 Ezurio
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8/dts-v1/;
9#include <nordic/nrf52840_qiaa.dtsi>
10#include "bt610-pinctrl.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "Ezurio BT610 Sensor";
15	compatible = "ezurio,bt610";
16
17	chosen {
18		zephyr,console = &uart0;
19		zephyr,shell-uart = &uart0;
20		zephyr,uart-mcumgr = &uart0;
21		zephyr,bt-mon-uart = &uart0;
22		zephyr,bt-c2h-uart = &uart0;
23		zephyr,sram = &sram0;
24		zephyr,flash = &flash0;
25		zephyr,code-partition = &slot0_partition;
26		zephyr,ieee802154 = &ieee802154;
27	};
28
29	leds {
30		compatible = "gpio-leds";
31		led1: led_1 {
32			gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
33			label = "Red LED 1";
34		};
35		led2: led_2 {
36			gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
37			label = "Green LED 2";
38		};
39	};
40
41	pwmleds {
42		compatible = "pwm-leds";
43
44		led1pwm: led_1_pwm {
45			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
46			label = "Red PWM LED 1";
47		};
48
49		led2pwm: led_2_pwm {
50			pwms = <&pwm1 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
51			label = "Green PWM LED 2";
52		};
53	};
54
55	buttons {
56		compatible = "gpio-keys";
57		button1: button_1 {
58			gpios = <&gpio0 24 GPIO_PULL_UP>;
59			label = "Boot button switch 1 (SW1)";
60			zephyr,code = <INPUT_KEY_0>;
61		};
62		button2: button_2 {
63			gpios = <&gpio1 1 GPIO_PULL_UP>;
64			label = "Tamper switch 2 (SW2)";
65			zephyr,code = <INPUT_KEY_1>;
66		};
67	};
68
69	/* These aliases are provided for compatibility with samples */
70	aliases {
71		led0 = &led1;
72		led1 = &led2;
73		led0pwm = &led1pwm;
74		led1pwm = &led2pwm;
75		sw0 = &button1;
76		sw1 = &button2;
77		sw2 = &mag1;
78		mcuboot-button0 = &button1;
79		mcuboot-led0 = &led1;
80		watchdog0 = &wdt0;
81	};
82
83	mag1: mag_1 {
84		compatible = "honeywell,sm351lt";
85		gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
86	};
87
88	dinenable1: din_enable_1 {
89		compatible = "regulator-fixed";
90		regulator-name = "din_enable_1";
91		enable-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
92	};
93
94	dinenable2: din_enable_2 {
95		compatible = "regulator-fixed";
96		regulator-name = "din_enable_2";
97		enable-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
98	};
99
100	thermenable: therm_enable {
101		compatible = "regulator-fixed";
102		regulator-name = "therm_enable";
103		enable-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
104	};
105
106	analogenable: analog_enable {
107		compatible = "regulator-fixed";
108		regulator-name = "analog_enable";
109		enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
110	};
111
112	highsupplyenable: high_supply_enable {
113		compatible = "regulator-fixed";
114		regulator-name = "high_supply_enable";
115		enable-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
116	};
117
118	batteryoutputenable: battery_output_enable {
119		compatible = "regulator-fixed";
120		regulator-name = "battery_output_enable";
121		enable-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
122	};
123};
124
125&pwm0 {
126	status = "okay";
127	pinctrl-0 = <&pwm0_default>;
128	pinctrl-1 = <&pwm0_sleep>;
129	pinctrl-names = "default", "sleep";
130};
131
132&pwm1 {
133	status = "okay";
134	pinctrl-0 = <&pwm1_default>;
135	pinctrl-1 = <&pwm1_sleep>;
136	pinctrl-names = "default", "sleep";
137};
138
139&adc {
140	status = "okay";
141};
142
143&gpiote {
144	status = "okay";
145};
146
147&uicr {
148	nfct-pins-as-gpios;
149	gpio-as-nreset;
150};
151
152&gpio0 {
153	status = "okay";
154};
155
156&gpio1 {
157	status = "okay";
158};
159
160&uart0 {
161	compatible = "nordic,nrf-uarte";
162	current-speed = <115200>;
163	status = "okay";
164	pinctrl-0 = <&uart0_default>;
165	pinctrl-1 = <&uart0_sleep>;
166	pinctrl-names = "default", "sleep";
167};
168
169&uart1 {
170	compatible = "nordic,nrf-uarte";
171	current-speed = <115200>;
172	status = "okay";
173	pinctrl-0 = <&uart1_default>;
174	pinctrl-1 = <&uart1_sleep>;
175	pinctrl-names = "default", "sleep";
176};
177
178&i2c0 {
179	compatible = "nordic,nrf-twi";
180	status = "okay";
181
182	pinctrl-0 = <&i2c0_default>;
183	pinctrl-1 = <&i2c0_sleep>;
184	pinctrl-names = "default", "sleep";
185	gpio_exp0: tca9538@70 {
186		compatible = "ti,tca9538";
187		reg = <0x70>;
188		gpio-controller;
189		#gpio-cells = <2>;
190		ngpios = <8>;
191		nint-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
192	};
193};
194
195&spi1 {
196	compatible = "nordic,nrf-spi";
197	status = "okay";
198	cs-gpios = <&gpio0 25 0>,
199		<&gpio0 31 0>;
200	pinctrl-0 = <&spi1_default>;
201	pinctrl-1 = <&spi1_sleep>;
202	pinctrl-names = "default", "sleep";
203};
204
205&qspi {
206	status = "okay";
207	pinctrl-0 = <&qspi_default>;
208	pinctrl-1 = <&qspi_sleep>;
209	pinctrl-names = "default", "sleep";
210	mx25r64: mx25r6435f@0 {
211		compatible = "nordic,qspi-nor";
212		reg = <0>;
213		writeoc = "pp4io";
214		readoc = "read4io";
215		sck-frequency = <8000000>;
216		jedec-id = [c2 28 17];
217		sfdp-bfp = [
218			e5 20 f1 ff  ff ff ff 03  44 eb 08 6b  08 3b 04 bb
219			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
220			10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
221			30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
222		];
223		size = <67108864>;
224		has-dpd;
225		t-enter-dpd = <10000>;
226		t-exit-dpd = <35000>;
227	};
228};
229
230&ieee802154 {
231	status = "okay";
232};
233
234&flash0 {
235	partitions {
236		compatible = "fixed-partitions";
237		#address-cells = <1>;
238		#size-cells = <1>;
239
240		/* 96K */
241		boot_partition: partition@0 {
242			label = "mcuboot";
243			reg = <0x00000000 0x00018000>;
244		};
245		/* 896K */
246		slot0_partition: partition@18000 {
247			label = "image-0";
248			reg = <0x00018000 0x000E0000>;
249		};
250
251		/*
252		 * The flash starting at 0x000f8000 and ending at
253		 * 0x000fffff is reserved for use by the application.
254		 */
255
256		/*
257		 * Storage partition will be used by FCB/NVS
258		 * if enabled. 32K
259		 */
260		storage_partition: partition@f8000 {
261			label = "storage";
262			reg = <0x000f8000 0x00008000>;
263		};
264	};
265};
266
267&mx25r64 {
268	partitions {
269		compatible = "fixed-partitions";
270		#address-cells = <1>;
271		#size-cells = <1>;
272
273		/* 896K */
274		slot1_partition: partition@0 {
275			label = "image-1";
276			reg = <0x00000000 0x000E0000>;
277		};
278		/* 16K */
279		scratch_partition: partition@E0000 {
280			label = "image-scratch";
281			reg = <0x000E0000 0x00004000>;
282		};
283		/* 112K */
284		customer_partition: partition@E4000 {
285			label = "customer-storage";
286			reg = <0x000E4000 0x0001C000>;
287		};
288		/* 7MB */
289		lfs_partition: partition@100000 {
290			label = "lfs_storage";
291			reg = <0x00100000 0x00700000>;
292		};
293	};
294};
295