1/*
2 * Copyright (c) 2023 Fr. Sauter AG
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <silabs/efr32mg24b220f1536im48.dtsi>
9#include <zephyr/dt-bindings/input/input-event-codes.h>
10#include <zephyr/dt-bindings/regulator/silabs_dcdc.h>
11#include "xg24_rb4187c-pinctrl.dtsi"
12
13/ {
14	model = "Silicon Labs BRD4187C (Mighty Gecko 24 Radio Board)";
15	compatible = "silabs,xg24_rb4187c", "silabs,efr32mg24";
16
17	chosen {
18		zephyr,console = &usart0;
19		zephyr,shell-uart = &usart0;
20		zephyr,uart-pipe = &usart0;
21		zephyr,sram = &sram0;
22		zephyr,flash = &flash0;
23		zephyr,code-partition = &slot0_partition;
24		zephyr,bt-hci = &bt_hci_silabs;
25		zephyr,display = &ls0xx_ls013b7dh03;
26	};
27
28	/* These aliases are provided for compatibility with samples */
29	aliases {
30		led0 = &led0;
31		led1 = &led1;
32		sw0 = &button0;
33		sw1 = &button1;
34		watchdog0 = &wdog0;
35		dht0 = &si7021;
36	};
37
38	leds {
39		compatible = "gpio-leds";
40		led0: led_0 {
41			gpios = <&gpiob 2 GPIO_ACTIVE_HIGH>;
42			label = "LED 0";
43		};
44		led1: led_1 {
45			gpios = <&gpiob 4 GPIO_ACTIVE_HIGH>;
46			label = "LED 1";
47		};
48	};
49
50	buttons {
51		compatible = "gpio-keys";
52		button0: button_0 {
53			gpios = <&gpiob 1 GPIO_ACTIVE_LOW>;
54			label = "User Push Button 0";
55			zephyr,code = <INPUT_KEY_0>;
56		};
57		button1: button_1 {
58			gpios = <&gpiob 3 GPIO_ACTIVE_LOW>;
59			label = "User Push Button 1";
60			zephyr,code = <INPUT_KEY_1>;
61		};
62	};
63
64	sensor_enable: sensor_enable {
65		compatible = "regulator-fixed";
66		regulator-name = "sensor_enable";
67		enable-gpios = <&gpiod 3 GPIO_ACTIVE_HIGH>;
68		status = "okay";
69	};
70};
71
72&cpu0 {
73	clock-frequency = <78000000>;
74};
75
76&pstate_em3 {
77	status = "disabled";
78};
79
80&hfxo {
81	status = "okay";
82	ctune = <95>;
83	precision = <50>;
84};
85
86&lfxo {
87	status = "okay";
88	ctune = <44>;
89	precision = <50>;
90};
91
92&hfrcodpll {
93	clock-frequency = <DT_FREQ_M(78)>;
94	clocks = <&hfxo>;
95	dpll-n = <3839>;
96	dpll-m = <1919>;
97	dpll-edge = "fall";
98	dpll-lock = "phase";
99	dpll-autorecover;
100};
101
102&em23grpaclk {
103	clocks = <&lfxo>;
104};
105
106&em4grpaclk {
107	clocks = <&lfxo>;
108};
109
110&sysrtcclk {
111	clocks = <&lfxo>;
112};
113
114&wdog0clk {
115	clocks = <&lfxo>;
116};
117
118&wdog1clk {
119	clocks = <&lfxo>;
120};
121
122&usart0 {
123	current-speed = <115200>;
124	pinctrl-0 = <&usart0_default>;
125	pinctrl-names = "default";
126	status = "okay";
127};
128
129&eusart1 {
130	compatible = "silabs,eusart-spi";
131	pinctrl-0 = <&eusart1_default>;
132	pinctrl-names = "default";
133	clock-frequency = <DT_FREQ_M(10)>;
134	cs-gpios = <&gpioc 8 GPIO_ACTIVE_HIGH>, <&gpioc 4 GPIO_ACTIVE_LOW>;
135	#address-cells = <1>;
136	#size-cells = <0>;
137	status = "okay";
138
139	ls0xx_ls013b7dh03: ls0xx@0 {
140		compatible = "sharp,ls0xx";
141		spi-max-frequency = <DT_FREQ_K(1100)>;
142		reg = <0>;
143		width = <128>;
144		height = <128>;
145		extcomin-gpios = <&gpioc 6 GPIO_ACTIVE_HIGH>;
146		extcomin-frequency = <60>;
147		disp-en-gpios = <&gpioc 9 GPIO_ACTIVE_HIGH>;
148	};
149
150	mx25r80: mx25r8035f@1 {
151		compatible = "jedec,spi-nor";
152		reg = <1>;
153		spi-max-frequency = <DT_FREQ_M(33)>;
154		size = <DT_SIZE_M(8)>;
155		jedec-id = [c2 28 14];
156		has-dpd;
157		dpd-wakeup-sequence = <30000 20 35000>;
158		mxicy,mx25r-power-mode = "low-power";
159		zephyr,pm-device-runtime-auto;
160	};
161};
162
163&i2c0 {
164	pinctrl-0 = <&i2c0_default>;
165	pinctrl-names = "default";
166	status = "okay";
167
168	si7021: si7021@40 {
169		compatible = "silabs,si7006";
170		reg = <0x40>;
171		vin-supply = <&sensor_enable>;
172		status = "okay";
173	};
174};
175
176&gpio {
177	location-swo = <0>;
178	status = "okay";
179};
180
181&gpioa {
182	status = "okay";
183};
184
185&gpiob {
186	status = "okay";
187
188	board-controller-enable {
189		gpio-hog;
190		gpios = <0 GPIO_ACTIVE_HIGH>;
191		output-high;
192	};
193};
194
195&gpioc {
196	status = "okay";
197};
198
199&gpiod {
200	status = "okay";
201};
202
203&wdog0 {
204	status = "okay";
205};
206
207&sysrtc0 {
208	status = "okay";
209};
210
211&se {
212	status = "okay";
213};
214
215&dcdc {
216	status = "okay";
217	regulator-boot-on;
218	regulator-initial-mode = <SILABS_DCDC_MODE_BUCK>;
219	silabs,pfmx-peak-current-milliamp = <100>;
220};
221
222&flash0 {
223	partitions {
224		compatible = "fixed-partitions";
225		#address-cells = <1>;
226		#size-cells = <1>;
227
228		/* Reserve 48 kB for the bootloader */
229		boot_partition: partition@0 {
230			label = "mcuboot";
231			reg = <0x0 DT_SIZE_K(48)>;
232			read-only;
233		};
234
235		/* Reserve 720 kB for the application in slot 0 */
236		slot0_partition: partition@c000 {
237			label = "image-0";
238			reg = <0x0000c000 0x000B4000>;
239		};
240
241		/* Reserve 720 kB for the application in slot 1 */
242		slot1_partition: partition@C0000 {
243			label = "image-1";
244			reg = <0x000C0000 0x000B4000>;
245		};
246
247		/* Reserve 32 kB for the scratch partition */
248		scratch_partition: partition@174000 {
249			label = "image-scratch";
250			reg = <0x00174000 DT_SIZE_K(32)>;
251		};
252
253		/* Set 16 kB of storage at the end of the 1536 kB of flash */
254		storage_partition: partition@17c000 {
255			label = "storage";
256			reg = <0x0017c000 DT_SIZE_K(16)>;
257		};
258	};
259};
260
261&bt_hci_silabs {
262	status = "okay";
263};
264