1/*
2 * Copyright (c) 2020 TriaGnoSys GmbH
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <silabs/efr32mg21a020f1024im32.dtsi>
9#include <zephyr/dt-bindings/input/input-event-codes.h>
10#include "slwrb4180a-pinctrl.dtsi"
11
12/ {
13	model = "Silicon Labs BRD4180A (Mighty Gecko 21 Radio Board)";
14	compatible = "silabs,slwrb4180a", "silabs,efr32mg21";
15
16	chosen {
17		zephyr,console = &usart0;
18		zephyr,shell-uart = &usart0;
19		zephyr,uart-pipe = &usart0;
20		zephyr,sram = &sram0;
21		zephyr,flash = &flash0;
22		zephyr,code-partition = &slot0_partition;
23	};
24
25	/* These aliases are provided for compatibility with samples */
26	aliases {
27		led0 = &led0;
28		led1 = &led1;
29		sw0 = &button0;
30		sw1 = &button1;
31		watchdog0 = &wdog0;
32	};
33
34	leds {
35		compatible = "gpio-leds";
36		led0: led_0 {
37			gpios = <&gpiob 0 0>;
38			label = "LED 0";
39		};
40		led1: led_1 {
41			gpios = <&gpiob 1 0>;
42			label = "LED 1";
43		};
44	};
45
46	buttons {
47		compatible = "gpio-keys";
48		button0: button_0 {
49			/* gpio flags need validation */
50			gpios = <&gpiod 2 GPIO_ACTIVE_LOW>;
51			label = "User Push Button 0";
52			zephyr,code = <INPUT_KEY_0>;
53		};
54		button1: button_1 {
55			/* gpio flags need validation */
56			gpios = <&gpiod 3 GPIO_ACTIVE_LOW>;
57			label = "User Push Button 1";
58			zephyr,code = <INPUT_KEY_1>;
59		};
60	};
61
62};
63
64&cpu0 {
65	clock-frequency = <76800000>;
66};
67
68&hfxo {
69	status = "okay";
70	ctune = <129>;
71	precision = <50>;
72};
73
74&lfxo {
75	status = "okay";
76	ctune = <79>;
77	precision = <50>;
78};
79
80&hfrcodpll {
81	clock-frequency = <DT_FREQ_K(76800)>;
82	clocks = <&hfxo>;
83	dpll-n = <3839>;
84	dpll-m = <1919>;
85	dpll-edge = "fall";
86	dpll-lock = "phase";
87	dpll-autorecover;
88};
89
90&em23grpaclk {
91	clocks = <&lfxo>;
92};
93
94&em4grpaclk {
95	clocks = <&lfxo>;
96};
97
98&rtccclk {
99	clocks = <&lfxo>;
100};
101
102&wdog0clk {
103	clocks = <&lfxo>;
104};
105
106&wdog1clk {
107	clocks = <&lfxo>;
108};
109
110&usart0 {
111	current-speed = <115200>;
112	pinctrl-0 = <&usart0_default>;
113	pinctrl-names = "default";
114	status = "okay";
115};
116
117&rtcc0 {
118	prescaler = <1>;
119	status = "okay";
120};
121
122&gpio {
123	status = "okay";
124};
125
126&gpioa {
127	status = "okay";
128};
129
130&gpiob {
131	status = "okay";
132};
133
134&gpioc {
135	status = "okay";
136};
137
138&gpiod {
139	status = "okay";
140
141	board-controller-enable {
142		gpio-hog;
143		gpios = <4 GPIO_ACTIVE_HIGH>;
144		output-high;
145	};
146};
147
148&wdog0 {
149	status = "okay";
150};
151
152&flash0 {
153	partitions {
154		compatible = "fixed-partitions";
155		#address-cells = <1>;
156		#size-cells = <1>;
157
158		/* Reserve 48 kB for the bootloader */
159		boot_partition: partition@0 {
160			label = "mcuboot";
161			reg = <0x0 0x0000c000>;
162			read-only;
163		};
164
165		/* Reserve 464 kB for the application in slot 0 */
166		slot0_partition: partition@c000 {
167			label = "image-0";
168			reg = <0x0000c000 0x00074000>;
169		};
170
171		/* Reserve 464 kB for the application in slot 1 */
172		slot1_partition: partition@80000 {
173			label = "image-1";
174			reg = <0x00080000 0x00074000>;
175		};
176
177		/* Reserve 32 kB for the scratch partition */
178		scratch_partition: partition@f4000 {
179			label = "image-scratch";
180			reg = <0x000f4000 0x00008000>;
181		};
182
183		/* Set 16Kb of storage at the end of the 1024Kb of flash */
184		storage_partition: partition@fc000 {
185			label = "storage";
186			reg = <0x000fc000 0x00004000>;
187		};
188
189	};
190};
191