1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <arm/armv7-m.dtsi>
8#include "nrf_common.dtsi"
9
10/ {
11
12	chosen {
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			swo-ref-frequency = <32000000>;
26		};
27	};
28
29	soc {
30		ficr: ficr@10000000 {
31			compatible = "nordic,nrf-ficr";
32			reg = <0x10000000 0x1000>;
33			status = "okay";
34		};
35
36		uicr: uicr@10001000 {
37			compatible = "nordic,nrf-uicr";
38			reg = <0x10001000 0x1000>;
39			status = "okay";
40		};
41
42		sram0: memory@20000000 {
43			compatible = "mmio-sram";
44		};
45
46		clock: clock@40000000 {
47			compatible = "nordic,nrf-clock";
48			reg = <0x40000000 0x1000>;
49			interrupts = <0 NRF_DEFAULT_IRQ_PRIORITY>;
50			status = "okay";
51			label = "CLOCK";
52		};
53
54		radio: radio@40001000 {
55			compatible = "nordic,nrf-radio";
56			reg = <0x40001000 0x1000>;
57			interrupts = <1 NRF_DEFAULT_IRQ_PRIORITY>;
58			status = "okay";
59			dfe-supported;
60		};
61
62		uart0: uart@40002000 {
63			/* uart can be either UART or UARTE, for the user to pick */
64			/* compatible = "nordic,nrf-uarte" or "nordic,nrf-uart"; */
65			reg = <0x40002000 0x1000>;
66			interrupts = <2 NRF_DEFAULT_IRQ_PRIORITY>;
67			status = "disabled";
68			label = "UART_0";
69		};
70
71		i2c0: i2c@40003000 {
72			/*
73			 * This i2c node can be TWI, TWIM, or TWIS,
74			 * for the user to pick:
75			 * compatible = "nordic,nrf-twi" or
76			 *              "nordic,nrf-twim" or
77			 *              "nordic,nrf-twis".
78			 */
79			#address-cells = <1>;
80			#size-cells = <0>;
81			reg = <0x40003000 0x1000>;
82			clock-frequency = <I2C_BITRATE_STANDARD>;
83			interrupts = <3 NRF_DEFAULT_IRQ_PRIORITY>;
84			status = "disabled";
85			label = "I2C_0";
86		};
87
88		spi0: spi@40003000 {
89			/*
90			 * This spi node can be SPI, SPIM, or SPIS,
91			 * for the user to pick:
92			 * compatible = "nordic,nrf-spi" or
93			 *              "nordic,nrf-spim" or
94			 *              "nordic,nrf-spis".
95			 */
96			#address-cells = <1>;
97			#size-cells = <0>;
98			reg = <0x40003000 0x1000>;
99			interrupts = <3 NRF_DEFAULT_IRQ_PRIORITY>;
100			status = "disabled";
101			label = "SPI_0";
102		};
103
104		i2c1: i2c@40004000 {
105			/*
106			 * This i2c node can be TWI, TWIM, or TWIS,
107			 * for the user to pick:
108			 * compatible = "nordic,nrf-twi" or
109			 *              "nordic,nrf-twim" or
110			 *              "nordic,nrf-twis".
111			 */
112			#address-cells = <1>;
113			#size-cells = <0>;
114			reg = <0x40004000 0x1000>;
115			clock-frequency = <I2C_BITRATE_STANDARD>;
116			interrupts = <4 NRF_DEFAULT_IRQ_PRIORITY>;
117			status = "disabled";
118			label = "I2C_1";
119		};
120
121		spi1: spi@40004000 {
122			/*
123			 * This spi node can be SPI, SPIM, or SPIS,
124			 * for the user to pick:
125			 * compatible = "nordic,nrf-spi" or
126			 *              "nordic,nrf-spim" or
127			 *              "nordic,nrf-spis".
128			 */
129			#address-cells = <1>;
130			#size-cells = <0>;
131			reg = <0x40004000 0x1000>;
132			interrupts = <4 NRF_DEFAULT_IRQ_PRIORITY>;
133			status = "disabled";
134			label = "SPI_1";
135		};
136
137		gpiote: gpiote@40006000 {
138			compatible = "nordic,nrf-gpiote";
139			reg = <0x40006000 0x1000>;
140			interrupts = <6 5>;
141			status = "disabled";
142			label = "GPIOTE_0";
143		};
144
145		timer0: timer@40008000 {
146			compatible = "nordic,nrf-timer";
147			status = "okay";
148			reg = <0x40008000 0x1000>;
149			cc-num = <4>;
150			interrupts = <8 NRF_DEFAULT_IRQ_PRIORITY>;
151			prescaler = <0>;
152			label = "TIMER_0";
153		};
154
155		timer1: timer@40009000 {
156			compatible = "nordic,nrf-timer";
157			status = "okay";
158			reg = <0x40009000 0x1000>;
159			cc-num = <4>;
160			interrupts = <9 NRF_DEFAULT_IRQ_PRIORITY>;
161			prescaler = <0>;
162			label = "TIMER_1";
163		};
164
165		timer2: timer@4000a000 {
166			compatible = "nordic,nrf-timer";
167			status = "okay";
168			reg = <0x4000a000 0x1000>;
169			cc-num = <4>;
170			interrupts = <10 NRF_DEFAULT_IRQ_PRIORITY>;
171			prescaler = <0>;
172			label = "TIMER_2";
173		};
174
175		rtc0: rtc@4000b000 {
176			compatible = "nordic,nrf-rtc";
177			reg = <0x4000b000 0x1000>;
178			cc-num = <3>;
179			interrupts = <11 NRF_DEFAULT_IRQ_PRIORITY>;
180			status = "okay";
181			clock-frequency = <32768>;
182			prescaler = <1>;
183			label = "RTC_0";
184		};
185
186		temp: temp@4000c000 {
187			compatible = "nordic,nrf-temp";
188			reg = <0x4000c000 0x1000>;
189			interrupts = <12 NRF_DEFAULT_IRQ_PRIORITY>;
190			status = "okay";
191			label = "TEMP_0";
192		};
193
194		rng: random@4000d000 {
195			compatible = "nordic,nrf-rng";
196			reg = <0x4000d000 0x1000>;
197			interrupts = <13 NRF_DEFAULT_IRQ_PRIORITY>;
198			status = "okay";
199			label = "RNG";
200		};
201
202		ecb: ecb@4000e000 {
203			compatible = "nordic,nrf-ecb";
204			reg = <0x4000e000 0x1000>;
205			interrupts = <14 NRF_DEFAULT_IRQ_PRIORITY>;
206			status = "okay";
207			label = "ECB";
208		};
209
210		wdt0: wdt: watchdog@40010000 {
211			compatible = "nordic,nrf-watchdog";
212			reg = <0x40010000 0x1000>;
213			interrupts = <16 NRF_DEFAULT_IRQ_PRIORITY>;
214			status = "okay";
215			label = "WDT";
216		};
217
218		rtc1: rtc@40011000 {
219			compatible = "nordic,nrf-rtc";
220			reg = <0x40011000 0x1000>;
221			cc-num = <4>;
222			interrupts = <17 NRF_DEFAULT_IRQ_PRIORITY>;
223			status = "okay";
224			clock-frequency = <32768>;
225			prescaler = <1>;
226			label = "RTC_1";
227		};
228
229		qdec: qdec@40012000 {
230			compatible = "nordic,nrf-qdec";
231			reg = <0x40012000 0x1000>;
232			interrupts = <18 NRF_DEFAULT_IRQ_PRIORITY>;
233			status = "disabled";
234			label = "QDEC";
235		};
236
237		egu0: egu@40014000 {
238			compatible = "nordic,nrf-egu";
239			reg = <0x40014000 0x1000>;
240			interrupts = <20 NRF_DEFAULT_IRQ_PRIORITY>;
241			status = "okay";
242		};
243
244		egu1: egu@40015000 {
245			compatible = "nordic,nrf-egu";
246			reg = <0x40015000 0x1000>;
247			interrupts = <21 NRF_DEFAULT_IRQ_PRIORITY>;
248			status = "okay";
249		};
250
251		egu2: egu@40016000 {
252			compatible = "nordic,nrf-egu";
253			reg = <0x40016000 0x1000>;
254			interrupts = <22 NRF_DEFAULT_IRQ_PRIORITY>;
255			status = "okay";
256		};
257
258		egu3: egu@40017000 {
259			compatible = "nordic,nrf-egu";
260			reg = <0x40017000 0x1000>;
261			interrupts = <23 NRF_DEFAULT_IRQ_PRIORITY>;
262			status = "okay";
263		};
264
265		egu4: egu@40018000 {
266			compatible = "nordic,nrf-egu";
267			reg = <0x40018000 0x1000>;
268			interrupts = <24 NRF_DEFAULT_IRQ_PRIORITY>;
269			status = "okay";
270		};
271
272		egu5: egu@40019000 {
273			compatible = "nordic,nrf-egu";
274			reg = <0x40019000 0x1000>;
275			interrupts = <25 NRF_DEFAULT_IRQ_PRIORITY>;
276			status = "okay";
277		};
278
279		timer3: timer@4001a000 {
280			compatible = "nordic,nrf-timer";
281			status = "okay";
282			reg = <0x4001a000 0x1000>;
283			cc-num = <6>;
284			interrupts = <26 NRF_DEFAULT_IRQ_PRIORITY>;
285			prescaler = <0>;
286			label = "TIMER_3";
287		};
288
289		flash_controller: flash-controller@4001e000 {
290			compatible = "nordic,nrf52-flash-controller";
291			reg = <0x4001e000 0x1000>;
292
293			#address-cells = <1>;
294			#size-cells = <1>;
295
296			label="NRF_FLASH_DRV_NAME";
297
298			flash0: flash@0 {
299				compatible = "soc-nv-flash";
300				label = "NRF_FLASH";
301				erase-block-size = <4096>;
302				write-block-size = <4>;
303			};
304		};
305
306		usbd: usbd@40027000 {
307			compatible = "nordic,nrf-usbd";
308			reg = <0x40027000 0x1000>;
309			interrupts = <39 NRF_DEFAULT_IRQ_PRIORITY>;
310			num-bidir-endpoints = <1>;
311			num-in-endpoints = <7>;
312			num-out-endpoints = <7>;
313			num-isoin-endpoints = <1>;
314			num-isoout-endpoints = <1>;
315			status = "disabled";
316			label = "USBD";
317		};
318
319		gpio0: gpio@50000000 {
320			compatible = "nordic,nrf-gpio";
321			gpio-controller;
322			reg = <0x50000000 0x200
323			       0x50000500 0x300>;
324			#gpio-cells = <2>;
325			label = "GPIO_0";
326			status = "disabled";
327			port = <0>;
328		};
329	};
330
331	sw_pwm: sw-pwm {
332		compatible = "nordic,nrf-sw-pwm";
333		status = "disabled";
334		label = "SW_PWM";
335		generator = <&timer2>;
336		channel-count = <3>;
337		clock-prescaler = <0>;
338		ppi-base = <0>;
339		gpiote-base = <0>;
340		#pwm-cells = <1>;
341	};
342};
343
344&nvic {
345	arm,num-irq-priority-bits = <3>;
346};
347