1/*
2 * Copyright (c) 2020 TriaGnoSys GmbH
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <arm/armv8-m.dtsi>
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/i2c/i2c.h>
10#include "gpio_gecko.h"
11
12/ {
13	chosen {
14		zephyr,flash-controller = &msc;
15	};
16
17	cpus {
18		#address-cells = <1>;
19		#size-cells = <0>;
20
21		cpu0: cpu@0 {
22			device_type = "cpu";
23			compatible = "arm,cortex-m33f";
24			reg = <0>;
25			#address-cells = <1>;
26			#size-cells = <1>;
27
28			mpu: mpu@e000ed90 {
29				compatible = "arm,armv8m-mpu";
30				reg = <0xe000ed90 0x40>;
31				arm,num-mpu-regions = <16>;
32			};
33		};
34	};
35
36	sram0: memory@20000000 {
37		device_type = "memory";
38		compatible = "mmio-sram";
39	};
40
41	soc {
42		msc: flash-controller@40030000 {
43			compatible = "silabs,gecko-flash-controller";
44			label = "FLASH_CTRL";
45			reg = <0x40030000 0x31a4>;
46			interrupts = <51 0>;
47
48			#address-cells = <1>;
49			#size-cells = <1>;
50
51			flash0: flash@0 {
52				compatible = "soc-nv-flash";
53				label = "FLASH_0";
54				write-block-size = <4>;
55				erase-block-size = <8192>;
56			};
57		};
58
59		usart0: usart@40058000 { /* USART0 */
60			compatible = "silabs,gecko-usart";
61			reg = <0x40058000 0x400>;
62			interrupts = <11 0>, <12 0>;
63			interrupt-names = "rx", "tx";
64			peripheral-id = <0>;
65			status = "disabled";
66			label = "USART_0";
67		};
68
69		usart1: usart@4005c000 { /* USART1 */
70			compatible = "silabs,gecko-usart";
71			reg = <0x4005c000 0x400>;
72			interrupts = <13 0>, <14 0>;
73			interrupt-names = "rx", "tx";
74			peripheral-id = <1>;
75			status = "disabled";
76			label = "USART_1";
77		};
78
79		usart2: usart@40060000 { /* USART2 */
80			compatible = "silabs,gecko-usart";
81			reg = <0x40060000 0x400>;
82			interrupts = <15 0>, <16 0>;
83			interrupt-names = "rx", "tx";
84			peripheral-id = <2>;
85			status = "disabled";
86			label = "USART_2";
87		};
88
89		i2c0: i2c@4a010000 {
90			compatible = "silabs,gecko-i2c";
91			clock-frequency = <I2C_BITRATE_STANDARD>;
92			#address-cells = <1>;
93			#size-cells = <0>;
94			reg = <0x4a010000 0x400>;
95			interrupts = <27 0>;
96			label = "I2C_0";
97			status = "disabled";
98		};
99
100		i2c1: i2c@40068000 {
101			compatible = "silabs,gecko-i2c";
102			clock-frequency = <I2C_BITRATE_STANDARD>;
103			#address-cells = <1>;
104			#size-cells = <0>;
105			reg = <0x40068000 0x400>;
106			interrupts = <28 0>;
107			label = "I2C_1";
108			status = "disabled";
109		};
110
111		rtcc0: rtcc@48000000 {
112			compatible = "silabs,gecko-rtcc";
113			reg = <0x48000000 0x400>;
114			interrupts = <10 0>;
115			clock-frequency = <32768>;
116			prescaler = <1>;
117			status = "disabled";
118			label = "RTCC_0";
119		};
120
121		gpio: gpio@4003c300 {
122			compatible = "silabs,gecko-gpio";
123			reg = <0x4003c300 0x3c00>;
124			interrupts = <26 2>, <25 2>;
125			interrupt-names = "GPIO_EVEN", "GPIO_ODD";
126			label = "GPIO";
127
128			ranges;
129			#address-cells = <1>;
130			#size-cells = <1>;
131
132			gpioa: gpio@4003c000 {
133				compatible = "silabs,gecko-gpio-port";
134				reg = <0x4003c000 0x30>;
135				peripheral-id = <0>;
136				label = "GPIO_A";
137				gpio-controller;
138				#gpio-cells = <2>;
139				status = "disabled";
140			};
141
142			gpiob: gpio@4003c030 {
143				compatible = "silabs,gecko-gpio-port";
144				reg = <0x4003c030 0x30>;
145				peripheral-id = <1>;
146				label = "GPIO_B";
147				gpio-controller;
148				#gpio-cells = <2>;
149				status = "disabled";
150			};
151
152			gpioc: gpio@4003c060 {
153				compatible = "silabs,gecko-gpio-port";
154				reg = <0x4003c060 0x30>;
155				peripheral-id = <2>;
156				label = "GPIO_C";
157				gpio-controller;
158				#gpio-cells = <2>;
159				status = "disabled";
160			};
161
162			gpiod: gpio@4003c090 {
163				compatible = "silabs,gecko-gpio-port";
164				reg = <0x4003c090 0x30>;
165				peripheral-id = <3>;
166				label = "GPIO_D";
167				gpio-controller;
168				#gpio-cells = <2>;
169				status = "disabled";
170			};
171		};
172
173		wdog0: wdog@4a018000 {
174			compatible = "silabs,gecko-wdog";
175			reg = <0x4a018000 0x2C>;
176			peripheral-id = <0>;
177			label = "WDOG0";
178			interrupts = <43 0>;
179			status = "disabled";
180		};
181
182		wdog1: wdog@4a01c000 {
183			compatible = "silabs,gecko-wdog";
184			reg = <0x4a01c000 0x2C>;
185			peripheral-id = <1>;
186			label = "WDOG1";
187			interrupts = <44 0>;
188			status = "disabled";
189		};
190	};
191};
192
193&nvic {
194	arm,num-irq-priority-bits = <4>;
195};
196