1/*
2 * Copyright (c) 2021 Guillaume Paquet <guillaume.paquet@smile.fr>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <nordic/nrf52840_qiaa.dtsi>
9#include <zephyr/dt-bindings/lora/sx126x.h>
10#include "rak4631_nrf52840-pinctrl.dtsi"
11
12/ {
13	model = "RAKWireless RAK4631 WisBlock LPWAN Module with a Nordic NRF52840 SoC";
14	compatible = "nordic,rak4631_nrf52840";
15
16	chosen {
17		zephyr,console = &uart1;
18		zephyr,shell-uart = &uart1;
19		zephyr,uart-mcumgr = &uart1;
20		zephyr,bt-mon-uart = &uart1;
21		zephyr,bt-c2h-uart = &uart1;
22		zephyr,sram = &sram0;
23		zephyr,flash = &flash0;
24		zephyr,code-partition = &slot0_partition;
25	};
26
27	leds {
28		compatible = "gpio-leds";
29		blue_led: led_2 {
30			gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
31			label = "Blue LED";
32		};
33		green_led: led_1 {
34			gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
35			label = "Green LED";
36		};
37	};
38
39	/* Declaration of aliases */
40	aliases {
41		led0 = &blue_led;
42		lora0 = &lora;
43		watchdog0 = &wdt0;
44	};
45};
46
47&adc {
48	status = "okay";
49};
50
51&gpiote {
52	status = "okay";
53};
54
55&gpio0 {
56	status = "okay";
57};
58
59&gpio1 {
60	status = "okay";
61};
62
63&uart0 {
64	compatible = "nordic,nrf-uart";
65	status = "okay";
66	current-speed = <115200>;
67	pinctrl-0 = <&uart0_default>;
68	pinctrl-1 = <&uart0_sleep>;
69	pinctrl-names = "default", "sleep";
70};
71
72&uart1 {
73	compatible = "nordic,nrf-uarte";
74	current-speed = <115200>;
75	status = "okay";
76	pinctrl-0 = <&uart1_default>;
77	pinctrl-1 = <&uart1_sleep>;
78	pinctrl-names = "default", "sleep";
79};
80
81&i2c0 {
82	compatible = "nordic,nrf-twi";
83	status = "okay";
84	pinctrl-0 = <&i2c0_default>;
85	pinctrl-1 = <&i2c0_sleep>;
86	pinctrl-names = "default", "sleep";
87};
88
89&i2c1 {
90	compatible = "nordic,nrf-twi";
91	/* Cannot be used together with spi1. */
92	/* status = "okay"; */
93	pinctrl-0 = <&i2c1_default>;
94	pinctrl-1 = <&i2c1_sleep>;
95	pinctrl-names = "default", "sleep";
96};
97
98&spi1 {
99	compatible = "nordic,nrf-spi";
100	status = "okay";
101	cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
102
103	pinctrl-0 = <&spi1_default>;
104	pinctrl-1 = <&spi1_sleep>;
105	pinctrl-names = "default", "sleep";
106	lora: lora@0 {
107		compatible = "semtech,sx1262";
108		reg = <0>;
109		reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
110		busy-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
111		tx-enable-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
112		rx-enable-gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
113		dio1-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
114		dio2-tx-enable;
115		dio3-tcxo-voltage = <SX126X_DIO3_TCXO_3V3>;
116		tcxo-power-startup-delay-ms = <5>;
117		spi-max-frequency = <1000000>;
118	};
119};
120
121&qspi {
122	status = "okay";
123	pinctrl-0 = <&qspi_default>;
124	pinctrl-1 = <&qspi_sleep>;
125	pinctrl-names = "default", "sleep";
126};
127
128&flash0 {
129
130	partitions {
131		compatible = "fixed-partitions";
132		#address-cells = <1>;
133		#size-cells = <1>;
134
135		boot_partition: partition@0 {
136			label = "mcuboot";
137			reg = <0x00000000 0x0000C000>;
138		};
139		slot0_partition: partition@c000 {
140			label = "image-0";
141			reg = <0x0000C000 0x00067000>;
142		};
143		slot1_partition: partition@73000 {
144			label = "image-1";
145			reg = <0x00073000 0x00067000>;
146		};
147		scratch_partition: partition@da000 {
148			label = "image-scratch";
149			reg = <0x000da000 0x0001e000>;
150		};
151
152		/*
153		 * The flash starting at 0x000f8000 and ending at
154		 * 0x000fffff is reserved for use by the application.
155		 */
156
157		/*
158		 * Storage partition will be used by FCB/LittleFS/NVS
159		 * if enabled.
160		 */
161		storage_partition: partition@f8000 {
162			label = "storage";
163			reg = <0x000f8000 0x00008000>;
164		};
165	};
166};
167
168zephyr_udc0: &usbd {
169	compatible = "nordic,nrf-usbd";
170	status = "okay";
171};
172