1/*
2 * Copyright (c) 2019 Interay Solutions B.V.
3 * Copyright (c) 2019 Oane Kingma
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#include <arm/armv7-m.dtsi>
9#include <zephyr/dt-bindings/gpio/gpio.h>
10#include <zephyr/dt-bindings/i2c/i2c.h>
11#include "gpio_gecko.h"
12
13/ {
14	chosen {
15		zephyr,entropy = &trng0;
16		zephyr,flash-controller = &msc;
17	};
18
19	cpus {
20		#address-cells = <1>;
21		#size-cells = <0>;
22
23		cpu0: cpu@0 {
24			compatible = "arm,cortex-m4f";
25			reg = <0>;
26		};
27	};
28
29	sram0: memory@20000000 {
30	       compatible = "mmio-sram";
31	};
32
33	soc {
34		msc: flash-controller@40000000 {
35			compatible = "silabs,gecko-flash-controller";
36			reg = <0x40000000 0x110>;
37			interrupts = <33 0>;
38
39			#address-cells = <1>;
40			#size-cells = <1>;
41
42			flash0: flash@0 {
43				compatible = "soc-nv-flash";
44				write-block-size = <4>;
45				erase-block-size = <4096>;
46			};
47		};
48
49		rtcc0: rtcc@40062000 { /* RTCC0 */
50			compatible = "silabs,gecko-rtcc";
51			reg = <0x40062000 0x184>;
52			interrupts = <31 0>;
53			clock-frequency = <32768>;
54			prescaler = <1>;
55			status = "disabled";
56		};
57
58		uart0: uart@40014000 { /* UART0 */
59			compatible = "silabs,gecko-uart";
60			reg = <0x40014000 0x400>;
61			interrupts = <21 0 22 0>;
62			interrupt-names = "rx", "tx";
63			peripheral-id = <0>;
64			status = "disabled";
65		};
66
67		uart1: uart@40014400 { /* UART1 */
68			compatible = "silabs,gecko-uart";
69			reg = <0x40014400 0x400>;
70			interrupts = <23 0 24 0>;
71			interrupt-names = "rx", "tx";
72			peripheral-id = <1>;
73			status = "disabled";
74		};
75
76		usart0: usart@40010000 { /* USART0 */
77			compatible = "silabs,gecko-usart";
78			reg = <0x40010000 0x400>;
79			interrupts = <6 0 7 0>;
80			interrupt-names = "rx", "tx";
81			peripheral-id = <0>;
82			status = "disabled";
83		};
84
85		usart1: usart@40010400 { /* USART1 */
86			compatible = "silabs,gecko-usart";
87			reg = <0x40010400 0x400>;
88			interrupts = <17 0 18 0>;
89			interrupt-names = "rx", "tx";
90			peripheral-id = <1>;
91			status = "disabled";
92		};
93
94		usart2: usart@40010800 { /* USART2 */
95			compatible = "silabs,gecko-usart";
96			reg = <0x40010800 0x400>;
97			interrupts = <19 0 20 0>;
98			interrupt-names = "rx", "tx";
99			peripheral-id = <2>;
100			status = "disabled";
101		};
102
103		usart3: usart@40010c00 { /* USART3 */
104			compatible = "silabs,gecko-usart";
105			reg = <0x40010c00 0x400>;
106			interrupts = <37 0 38 0>;
107			interrupt-names = "rx", "tx";
108			peripheral-id = <3>;
109			status = "disabled";
110		};
111
112		usart4: usart@40011000 { /* USART4 */
113			compatible = "silabs,gecko-usart";
114			reg = <0x40011000 0x400>;
115			interrupts = <39 0 40 0>;
116			interrupt-names = "rx", "tx";
117			peripheral-id = <4>;
118			status = "disabled";
119		};
120
121		usart5: usart@40011400 { /* USART5 */
122			compatible = "silabs,gecko-usart";
123			reg = <0x40011400 0x400>;
124			interrupts = <50 0 51 0>;
125			interrupt-names = "rx", "tx";
126			peripheral-id = <5>;
127			status = "disabled";
128		};
129
130		leuart0: leuart@4006a000 { /* LEUART0 */
131			compatible = "silabs,gecko-leuart";
132			reg = <0x4006a000 0x400>;
133			interrupts = <25 0>;
134			peripheral-id = <0>;
135			status = "disabled";
136		};
137
138		leuart1: leuart@4006a400 { /* LEUART1 */
139			compatible = "silabs,gecko-leuart";
140			reg = <0x4006a400 0x400>;
141			interrupts = <26 0>;
142			peripheral-id = <1>;
143			status = "disabled";
144		};
145
146		i2c0: i2c@40089000 {
147			compatible = "silabs,gecko-i2c";
148			clock-frequency = <I2C_BITRATE_STANDARD>;
149			#address-cells = <1>;
150			#size-cells = <0>;
151			reg = <0x40089000 0x400>;
152			interrupts = <11 0>;
153			status = "disabled";
154		};
155
156		i2c1: i2c@40089400 {
157			compatible = "silabs,gecko-i2c";
158			clock-frequency = <I2C_BITRATE_STANDARD>;
159			#address-cells = <1>;
160			#size-cells = <0>;
161			reg = <0x40089400 0x400>;
162			interrupts = <12 0>;
163			status = "disabled";
164		};
165
166		i2c2: i2c@40089800 {
167			compatible = "silabs,gecko-i2c";
168			clock-frequency = <I2C_BITRATE_STANDARD>;
169			#address-cells = <1>;
170			#size-cells = <0>;
171			reg = <0x40089800 0x400>;
172			interrupts = <45 0>;
173			status = "disabled";
174		};
175
176		gpio: gpio@40088400 {
177			compatible = "silabs,gecko-gpio";
178			reg = <0x40088400 0xc00>;
179			interrupts = <3 2 13 2>;
180			interrupt-names = "GPIO_EVEN", "GPIO_ODD";
181
182			ranges;
183			#address-cells = <1>;
184			#size-cells = <1>;
185
186			gpioa: gpio@40088000 {
187				compatible = "silabs,gecko-gpio-port";
188				reg = <0x40088000 0x30>;
189				peripheral-id = <0>;
190				gpio-controller;
191				#gpio-cells = <2>;
192				status = "disabled";
193			};
194
195			gpiob: gpio@40088030 {
196				compatible = "silabs,gecko-gpio-port";
197				reg = <0x40088030 0x30>;
198				peripheral-id = <1>;
199				gpio-controller;
200				#gpio-cells = <2>;
201				status = "disabled";
202			};
203
204			gpioc: gpio@40088060 {
205				compatible = "silabs,gecko-gpio-port";
206				reg = <0x40088060 0x30>;
207				peripheral-id = <2>;
208				gpio-controller;
209				#gpio-cells = <2>;
210				status = "disabled";
211			};
212
213			gpiod: gpio@40088090 {
214				compatible = "silabs,gecko-gpio-port";
215				reg = <0x40088090 0x30>;
216				peripheral-id = <3>;
217				gpio-controller;
218				#gpio-cells = <2>;
219				status = "disabled";
220			};
221
222			gpioe: gpio@400880c0 {
223				compatible = "silabs,gecko-gpio-port";
224				reg = <0x400880c0 0x30>;
225				peripheral-id = <4>;
226				gpio-controller;
227				#gpio-cells = <2>;
228				status = "disabled";
229			};
230
231			gpiof: gpio@400880f0 {
232				compatible = "silabs,gecko-gpio-port";
233				reg = <0x400880f0 0x30>;
234				peripheral-id = <5>;
235				gpio-controller;
236				#gpio-cells = <2>;
237				status = "disabled";
238			};
239
240			gpiog: gpio@40088120 {
241				compatible = "silabs,gecko-gpio-port";
242				reg = <0x40088120 0x30>;
243				peripheral-id = <6>;
244				gpio-controller;
245				#gpio-cells = <2>;
246				status = "disabled";
247			};
248
249			gpioh: gpio@40088150 {
250				compatible = "silabs,gecko-gpio-port";
251				reg = <0x40088150 0x30>;
252				peripheral-id = <7>;
253				gpio-controller;
254				#gpio-cells = <2>;
255				status = "disabled";
256			};
257
258			gpioi: gpio@40088180 {
259				compatible = "silabs,gecko-gpio-port";
260				reg = <0x40088180 0x30>;
261				peripheral-id = <8>;
262				gpio-controller;
263				#gpio-cells = <2>;
264				status = "disabled";
265			};
266		};
267
268		trng0: trng@4001d000 {
269			compatible = "silabs,gecko-trng";
270			reg = <0x4001d000 0x400>;
271			interrupts = <66 0>;
272			status = "disabled";
273		};
274
275		wdog0: wdog@40052000 {
276			compatible = "silabs,gecko-wdog";
277			reg = <0x40052000 0x2C>;
278			peripheral-id = <0>;
279			interrupts = <1 0>;
280			status = "disabled";
281		};
282
283		wdog1: wdog@40052400 {
284			compatible = "silabs,gecko-wdog";
285			reg = <0x40052400 0x2C>;
286			peripheral-id = <1>;
287			interrupts = <64 0>;
288			status = "disabled";
289		};
290
291		pinctrl: pin-controller {
292			/* Pin controller is a "virtual" device since SiLabs SoCs do pin
293			 * control in a distributed way (GPIO registers and PSEL
294			 * registers on each peripheral).
295			 */
296			compatible = "silabs,gecko-pinctrl";
297		};
298	};
299};
300
301&nvic {
302	arm,num-irq-priority-bits = <3>;
303};
304