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,sram = &sram0;
20		zephyr,flash = &flash0;
21		zephyr,code-partition = &slot0_partition;
22	};
23
24	/* These aliases are provided for compatibility with samples */
25	aliases {
26		led0 = &led0;
27		led1 = &led1;
28		sw0 = &button0;
29		sw1 = &button1;
30		watchdog0 = &wdog0;
31	};
32
33	leds {
34		compatible = "gpio-leds";
35		led0: led_0 {
36			gpios = <&gpiob 0 0>;
37			label = "LED 0";
38		};
39		led1: led_1 {
40			gpios = <&gpiob 1 0>;
41			label = "LED 1";
42		};
43	};
44
45	buttons {
46		compatible = "gpio-keys";
47		button0: button_0 {
48			/* gpio flags need validation */
49			gpios = <&gpiod 2 GPIO_ACTIVE_LOW>;
50			label = "User Push Button 0";
51			zephyr,code = <INPUT_KEY_0>;
52		};
53		button1: button_1 {
54			/* gpio flags need validation */
55			gpios = <&gpiod 3 GPIO_ACTIVE_LOW>;
56			label = "User Push Button 1";
57			zephyr,code = <INPUT_KEY_1>;
58		};
59	};
60
61};
62
63&cpu0 {
64	clock-frequency = <38400000>;
65};
66
67&usart0 {
68	current-speed = <115200>;
69	pinctrl-0 = <&usart0_default>;
70	pinctrl-names = "default";
71	status = "okay";
72};
73
74&rtcc0 {
75	prescaler = <1>;
76	status = "okay";
77};
78
79&gpio {
80	status = "okay";
81};
82
83&gpioa {
84	status = "okay";
85};
86
87&gpiob {
88	status = "okay";
89};
90
91&gpioc {
92	status = "okay";
93};
94
95&gpiod {
96	status = "okay";
97
98	board-controller-enable {
99		gpio-hog;
100		gpios = <4 GPIO_ACTIVE_HIGH>;
101		output-high;
102	};
103};
104
105&wdog0 {
106	status = "okay";
107};
108
109&flash0 {
110	partitions {
111		compatible = "fixed-partitions";
112		#address-cells = <1>;
113		#size-cells = <1>;
114
115		/* Reserve 48 kB for the bootloader */
116		boot_partition: partition@0 {
117			label = "mcuboot";
118			reg = <0x0 0x0000c000>;
119			read-only;
120		};
121
122		/* Reserve 464 kB for the application in slot 0 */
123		slot0_partition: partition@c000 {
124			label = "image-0";
125			reg = <0x0000c000 0x00074000>;
126		};
127
128		/* Reserve 464 kB for the application in slot 1 */
129		slot1_partition: partition@80000 {
130			label = "image-1";
131			reg = <0x00080000 0x00074000>;
132		};
133
134		/* Reserve 32 kB for the scratch partition */
135		scratch_partition: partition@f4000 {
136			label = "image-scratch";
137			reg = <0x000f4000 0x00008000>;
138		};
139
140		/* Set 16Kb of storage at the end of the 1024Kb of flash */
141		storage_partition: partition@fc000 {
142			label = "storage";
143			reg = <0x000fc000 0x00004000>;
144		};
145
146	};
147};
148