1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <arm/armv7-m.dtsi>
8#include <nordic/nrf_common.dtsi>
9
10/ {
11	chosen {
12		zephyr,bt-hci = &bt_hci_controller;
13		zephyr,entropy = &rng;
14		zephyr,flash-controller = &flash_controller;
15	};
16
17	cpus {
18		#address-cells = <1>;
19		#size-cells = <0>;
20
21		cpu@0 {
22			device_type = "cpu";
23			compatible = "arm,cortex-m4";
24			reg = <0>;
25			#address-cells = <1>;
26			#size-cells = <1>;
27
28			itm: itm@e0000000 {
29				compatible = "arm,armv7m-itm";
30				reg = <0xe0000000 0x1000>;
31				swo-ref-frequency = <32000000>;
32			};
33		};
34	};
35
36	soc {
37		ficr: ficr@10000000 {
38			compatible = "nordic,nrf-ficr";
39			reg = <0x10000000 0x1000>;
40			#nordic,ficr-cells = <1>;
41			status = "okay";
42		};
43
44		uicr: uicr@10001000 {
45			compatible = "nordic,nrf-uicr";
46			reg = <0x10001000 0x1000>;
47			status = "okay";
48		};
49
50		sram0: memory@20000000 {
51			compatible = "mmio-sram";
52		};
53
54		clock: clock@40000000 {
55			compatible = "nordic,nrf-clock";
56			reg = <0x40000000 0x1000>;
57			interrupts = <0 NRF_DEFAULT_IRQ_PRIORITY>;
58			status = "okay";
59		};
60
61		power: power@40000000 {
62			compatible = "nordic,nrf-power";
63			reg = <0x40000000 0x1000>;
64			interrupts = <0 NRF_DEFAULT_IRQ_PRIORITY>;
65			status = "okay";
66			#address-cells = <1>;
67			#size-cells = <1>;
68
69			gpregret1: gpregret1@4000051c {
70				#address-cells = <1>;
71				#size-cells = <1>;
72				compatible = "nordic,nrf-gpregret";
73				reg = <0x4000051c 0x1>;
74				status = "okay";
75			};
76
77			gpregret2: gpregret2@40000520 {
78				#address-cells = <1>;
79				#size-cells = <1>;
80				compatible = "nordic,nrf-gpregret";
81				reg = <0x40000520 0x1>;
82				status = "okay";
83			};
84		};
85
86		bprot: bprot@40000000 {
87			compatible = "nordic,nrf-bprot";
88			reg = <0x40000000 0x1000>;
89			status = "okay";
90		};
91
92		radio: radio@40001000 {
93			compatible = "nordic,nrf-radio";
94			reg = <0x40001000 0x1000>;
95			interrupts = <1 NRF_DEFAULT_IRQ_PRIORITY>;
96			status = "okay";
97			dfe-supported;
98			ieee802154-supported;
99			ble-2mbps-supported;
100			ble-coded-phy-supported;
101
102			ieee802154: ieee802154 {
103				compatible = "nordic,nrf-ieee802154";
104				status = "disabled";
105			};
106
107			/* Note: In the nRF Connect SDK the SoftDevice Controller
108			 * is added and set as the default Bluetooth Controller.
109			 */
110			bt_hci_controller: bt_hci_controller {
111				compatible = "zephyr,bt-hci-ll-sw-split";
112				status = "okay";
113			};
114		};
115
116		uart0: uart@40002000 {
117			/* uart can be either UART or UARTE, for the user to pick */
118			/* compatible = "nordic,nrf-uarte" or "nordic,nrf-uart"; */
119			compatible = "nordic,nrf-uarte";
120			reg = <0x40002000 0x1000>;
121			interrupts = <2 NRF_DEFAULT_IRQ_PRIORITY>;
122			status = "disabled";
123		};
124
125		i2c0: i2c@40003000 {
126			/*
127			 * This i2c node can be TWI, TWIM, or TWIS,
128			 * for the user to pick:
129			 * compatible = "nordic,nrf-twi" or
130			 *              "nordic,nrf-twim" or
131			 *              "nordic,nrf-twis".
132			 */
133			compatible = "nordic,nrf-twim";
134			#address-cells = <1>;
135			#size-cells = <0>;
136			reg = <0x40003000 0x1000>;
137			clock-frequency = <I2C_BITRATE_STANDARD>;
138			interrupts = <3 NRF_DEFAULT_IRQ_PRIORITY>;
139			easydma-maxcnt-bits = <14>;
140			status = "disabled";
141		};
142
143		spi1: spi@40003000 {
144		/* cannot be used with i2c0 */
145			/*
146			 * This spi node can be SPI, SPIM, or SPIS,
147			 * for the user to pick:
148			 * compatible = "nordic,nrf-spi" or
149			 *              "nordic,nrf-spim" or
150			 *              "nordic,nrf-spis".
151			 */
152			compatible = "nordic,nrf-spim";
153			#address-cells = <1>;
154			#size-cells = <0>;
155			reg = <0x40003000 0x1000>;
156			interrupts = <3 NRF_DEFAULT_IRQ_PRIORITY>;
157			max-frequency = <DT_FREQ_M(8)>;
158			easydma-maxcnt-bits = <14>;
159			status = "disabled";
160		};
161
162		spi0: spi@40004000 {
163			/*
164			 * This spi node can be SPI, SPIM, or SPIS,
165			 * for the user to pick:
166			 * compatible = "nordic,nrf-spi" or
167			 *              "nordic,nrf-spim" or
168			 *              "nordic,nrf-spis".
169			 */
170			compatible = "nordic,nrf-spim";
171			#address-cells = <1>;
172			#size-cells = <0>;
173			reg = <0x40004000 0x1000>;
174			interrupts = <4 NRF_DEFAULT_IRQ_PRIORITY>;
175			max-frequency = <DT_FREQ_M(8)>;
176			easydma-maxcnt-bits = <14>;
177			status = "disabled";
178		};
179
180		gpiote: gpiote0: gpiote@40006000 {
181			compatible = "nordic,nrf-gpiote";
182			reg = <0x40006000 0x1000>;
183			interrupts = <6 5>;
184			status = "disabled";
185			instance = <0>;
186		};
187
188		adc: adc@40007000 {
189			compatible = "nordic,nrf-saadc";
190			reg = <0x40007000 0x1000>;
191			interrupts = <7 NRF_DEFAULT_IRQ_PRIORITY>;
192			status = "disabled";
193			#io-channel-cells = <1>;
194		};
195
196		timer0: timer@40008000 {
197			compatible = "nordic,nrf-timer";
198			status = "disabled";
199			reg = <0x40008000 0x1000>;
200			cc-num = <4>;
201			max-bit-width = <32>;
202			interrupts = <8 NRF_DEFAULT_IRQ_PRIORITY>;
203			prescaler = <0>;
204		};
205
206		timer1: timer@40009000 {
207			compatible = "nordic,nrf-timer";
208			status = "disabled";
209			reg = <0x40009000 0x1000>;
210			cc-num = <4>;
211			max-bit-width = <32>;
212			interrupts = <9 NRF_DEFAULT_IRQ_PRIORITY>;
213			prescaler = <0>;
214		};
215
216		timer2: timer@4000a000 {
217			compatible = "nordic,nrf-timer";
218			status = "disabled";
219			reg = <0x4000a000 0x1000>;
220			cc-num = <4>;
221			max-bit-width = <32>;
222			interrupts = <10 NRF_DEFAULT_IRQ_PRIORITY>;
223			prescaler = <0>;
224		};
225
226		rtc0: rtc@4000b000 {
227			compatible = "nordic,nrf-rtc";
228			reg = <0x4000b000 0x1000>;
229			cc-num = <3>;
230			interrupts = <11 NRF_DEFAULT_IRQ_PRIORITY>;
231			status = "disabled";
232			clock-frequency = <32768>;
233			prescaler = <1>;
234		};
235
236		temp: temp@4000c000 {
237			compatible = "nordic,nrf-temp";
238			reg = <0x4000c000 0x1000>;
239			interrupts = <12 NRF_DEFAULT_IRQ_PRIORITY>;
240			status = "okay";
241		};
242
243		rng: random@4000d000 {
244			compatible = "nordic,nrf-rng";
245			reg = <0x4000d000 0x1000>;
246			interrupts = <13 NRF_DEFAULT_IRQ_PRIORITY>;
247			status = "okay";
248		};
249
250		ecb: ecb@4000e000 {
251			compatible = "nordic,nrf-ecb";
252			reg = <0x4000e000 0x1000>;
253			interrupts = <14 NRF_DEFAULT_IRQ_PRIORITY>;
254			status = "okay";
255		};
256
257		ccm: ccm@4000f000 {
258			compatible = "nordic,nrf-ccm";
259			reg = <0x4000f000 0x1000>;
260			interrupts = <15 NRF_DEFAULT_IRQ_PRIORITY>;
261			length-field-length-8-bits;
262			status = "okay";
263		};
264
265		wdt: wdt0: watchdog@40010000 {
266			compatible = "nordic,nrf-wdt";
267			reg = <0x40010000 0x1000>;
268			interrupts = <16 NRF_DEFAULT_IRQ_PRIORITY>;
269			status = "okay";
270		};
271
272		rtc1: rtc@40011000 {
273			compatible = "nordic,nrf-rtc";
274			reg = <0x40011000 0x1000>;
275			cc-num = <4>;
276			interrupts = <17 NRF_DEFAULT_IRQ_PRIORITY>;
277			status = "disabled";
278			clock-frequency = <32768>;
279			prescaler = <1>;
280		};
281
282		qdec: qdec0: qdec@40012000 {
283			compatible = "nordic,nrf-qdec";
284			reg = <0x40012000 0x1000>;
285			interrupts = <18 NRF_DEFAULT_IRQ_PRIORITY>;
286			status = "disabled";
287		};
288
289		comp: comparator@40013000 {
290			compatible = "nordic,nrf-comp";
291			reg = <0x40013000 0x1000>;
292			interrupts = <19 NRF_DEFAULT_IRQ_PRIORITY>;
293			status = "disabled";
294			#io-channel-cells = <1>;
295		};
296
297		egu0: swi0: egu@40014000 {
298			compatible = "nordic,nrf-egu", "nordic,nrf-swi";
299			reg = <0x40014000 0x1000>;
300			interrupts = <20 NRF_DEFAULT_IRQ_PRIORITY>;
301			status = "okay";
302		};
303
304		egu1: swi1: egu@40015000 {
305			compatible = "nordic,nrf-egu", "nordic,nrf-swi";
306			reg = <0x40015000 0x1000>;
307			interrupts = <21 NRF_DEFAULT_IRQ_PRIORITY>;
308			status = "okay";
309		};
310
311		swi2: swi@40016000 {
312			compatible = "nordic,nrf-swi";
313			reg = <0x40016000 0x1000>;
314			interrupts = <22 NRF_DEFAULT_IRQ_PRIORITY>;
315			status = "okay";
316		};
317
318		swi3: swi@40017000 {
319			compatible = "nordic,nrf-swi";
320			reg = <0x40017000 0x1000>;
321			interrupts = <23 NRF_DEFAULT_IRQ_PRIORITY>;
322			status = "okay";
323		};
324
325		swi4: swi@40018000 {
326			compatible = "nordic,nrf-swi";
327			reg = <0x40018000 0x1000>;
328			interrupts = <24 NRF_DEFAULT_IRQ_PRIORITY>;
329			status = "okay";
330		};
331
332		swi5: swi@40019000 {
333			compatible = "nordic,nrf-swi";
334			reg = <0x40019000 0x1000>;
335			interrupts = <25 NRF_DEFAULT_IRQ_PRIORITY>;
336			status = "okay";
337		};
338
339		pwm0: pwm@4001c000 {
340			compatible = "nordic,nrf-pwm";
341			reg = <0x4001c000 0x1000>;
342			interrupts = <28 NRF_DEFAULT_IRQ_PRIORITY>;
343			status = "disabled";
344			#pwm-cells = <3>;
345		};
346
347		pdm0: pdm@4001d000 {
348			compatible = "nordic,nrf-pdm";
349			reg = <0x4001d000 0x1000>;
350			interrupts = <29 NRF_DEFAULT_IRQ_PRIORITY>;
351			status = "disabled";
352		};
353
354		flash_controller: flash-controller@4001e000 {
355			compatible = "nordic,nrf52-flash-controller";
356			reg = <0x4001e000 0x1000>;
357			partial-erase;
358
359			#address-cells = <1>;
360			#size-cells = <1>;
361
362
363			flash0: flash@0 {
364				compatible = "soc-nv-flash";
365				erase-block-size = <4096>;
366				write-block-size = <4>;
367			};
368		};
369
370		ppi: ppi@4001f000 {
371			compatible = "nordic,nrf-ppi";
372			reg = <0x4001f000 0x1000>;
373			status = "okay";
374		};
375
376		gpio0: gpio@50000000 {
377			compatible = "nordic,nrf-gpio";
378			gpio-controller;
379			/* This way of addressing is used to be compatible */
380			/* with nrf52840.dtsi */
381			reg = <0x50000000 0x200
382			       0x50000500 0x300>;
383			#gpio-cells = <2>;
384			status = "disabled";
385			port = <0>;
386			gpiote-instance = <&gpiote>;
387		};
388	};
389};
390
391&nvic {
392	arm,num-irq-priority-bits = <3>;
393};
394
395&systick {
396	/* Use RTC for system clock, instead of SysTick. */
397	status = "disabled";
398};
399