1/*
2 * Copyright (c) 2018 Christian Taedcke <hacking@taedcke.com>
3 * Copyright (c) 2019 Lemonbeat GmbH
4 * Copyright (c) 2021 T-Mobile USA, Inc.
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9#include <arm/armv7-m.dtsi>
10#include <zephyr/dt-bindings/adc/adc.h>
11#include <zephyr/dt-bindings/gpio/gpio.h>
12#include <zephyr/dt-bindings/i2c/i2c.h>
13#include <zephyr/dt-bindings/pwm/pwm.h>
14#include "gpio_gecko.h"
15
16/ {
17	chosen {
18		zephyr,entropy = &trng0;
19		zephyr,flash-controller = &msc;
20	};
21
22	cpus {
23		#address-cells = <1>;
24		#size-cells = <0>;
25
26	};
27
28	sram0: memory@20000000 {
29	       compatible = "mmio-sram";
30	};
31
32	soc {
33		msc: flash-controller@400e0000 {
34			compatible = "silabs,gecko-flash-controller";
35			reg = <0x400e0000 0x104>;
36			interrupts = <25 0>;
37
38			#address-cells = <1>;
39			#size-cells = <1>;
40
41			flash0: flash@0 {
42				compatible = "soc-nv-flash";
43				write-block-size = <4>;
44				erase-block-size = <2048>;
45			};
46		};
47
48		usart0: usart@40010000 { /* USART0 */
49			compatible = "silabs,gecko-usart";
50			reg = <0x40010000 0x400>;
51			interrupts = <12 0 13 0>;
52			interrupt-names = "rx", "tx";
53			peripheral-id = <0>;
54			status = "disabled";
55		};
56
57		usart1: usart@40010400 { /* USART1 */
58			compatible = "silabs,gecko-usart";
59			reg = <0x40010400 0x400>;
60			interrupts = <20 0 21 0>;
61			interrupt-names = "rx", "tx";
62			peripheral-id = <1>;
63			status = "disabled";
64		};
65
66		usart2: usart@40010800 { /* USART2 */
67			compatible = "silabs,gecko-usart";
68			reg = <0x40010800 0x400>;
69			interrupts = <40 0 41 0>;
70			interrupt-names = "rx", "tx";
71			peripheral-id = <2>;
72			status = "disabled";
73		};
74
75		usart3: usart@40010c00 { /* USART3 */
76			compatible = "silabs,gecko-usart";
77			reg = <0x40010c00 0x400>;
78			interrupts = <43 0 44 0>;
79			interrupt-names = "rx", "tx";
80			peripheral-id = <3>;
81			status = "disabled";
82		};
83
84		leuart0: leuart@4004a000 { /* LEUART0 */
85			compatible = "silabs,gecko-leuart";
86			reg = <0x4004a000 0x400>;
87			interrupts = <22 0>;
88			peripheral-id = <0>;
89			status = "disabled";
90		};
91
92		i2c0: i2c@4000c000 {
93			compatible = "silabs,gecko-i2c";
94			clock-frequency = <I2C_BITRATE_STANDARD>;
95			#address-cells = <1>;
96			#size-cells = <0>;
97			reg = <0x4000c000 0x400>;
98			interrupts = <17 0>;
99			status = "disabled";
100		};
101
102		i2c1: i2c@4000c400 {
103			compatible = "silabs,gecko-i2c";
104			clock-frequency = <I2C_BITRATE_STANDARD>;
105			#address-cells = <1>;
106			#size-cells = <0>;
107			reg = <0x4000c400 0x400>;
108			interrupts = <42 0>;
109			status = "disabled";
110		};
111
112		rtcc0: rtcc@40042000 {
113			compatible = "silabs,gecko-rtcc";
114			reg = <0x40042000 0x184>;
115			interrupts = <30 0>;
116			clock-frequency = <32768>;
117			prescaler = <1>;
118			status = "disabled";
119		};
120
121		gpio: gpio@4000a400 {
122			compatible = "silabs,gecko-gpio";
123			reg = <0x4000a400 0xf00>;
124			interrupts = <10 2 18 2>;
125			interrupt-names = "GPIO_EVEN", "GPIO_ODD";
126
127			ranges;
128			#address-cells = <1>;
129			#size-cells = <1>;
130
131			gpioa: gpio@4000a000 {
132				compatible = "silabs,gecko-gpio-port";
133				reg = <0x4000a000 0x30>;
134				peripheral-id = <0>;
135				gpio-controller;
136				#gpio-cells = <2>;
137				status = "disabled";
138			};
139
140			gpiob: gpio@4000a030 {
141				compatible = "silabs,gecko-gpio-port";
142				reg = <0x4000a030 0x30>;
143				peripheral-id = <1>;
144				gpio-controller;
145				#gpio-cells = <2>;
146				status = "disabled";
147			};
148
149			gpioc: gpio@4000a060 {
150				compatible = "silabs,gecko-gpio-port";
151				reg = <0x4000a060 0x30>;
152				peripheral-id = <2>;
153				gpio-controller;
154				#gpio-cells = <2>;
155				status = "disabled";
156			};
157
158			gpiod: gpio@4000a090 {
159				compatible = "silabs,gecko-gpio-port";
160				reg = <0x4000a090 0x30>;
161				peripheral-id = <3>;
162				gpio-controller;
163				#gpio-cells = <2>;
164				status = "disabled";
165			};
166
167			gpioe: gpio@4000a0c0 {
168				compatible = "silabs,gecko-gpio-port";
169				reg = <0x4000a0c0 0x30>;
170				peripheral-id = <4>;
171				gpio-controller;
172				#gpio-cells = <2>;
173				status = "disabled";
174			};
175
176			gpiof: gpio@4000a0f0 {
177				compatible = "silabs,gecko-gpio-port";
178				reg = <0x4000a0f0 0x30>;
179				peripheral-id = <5>;
180				gpio-controller;
181				#gpio-cells = <2>;
182				status = "disabled";
183			};
184
185			gpioi: gpio@4000a180 {
186				compatible = "silabs,gecko-gpio-port";
187				reg = <0x4000a180 0x30>;
188				peripheral-id = <8>;
189				gpio-controller;
190				#gpio-cells = <2>;
191				status = "disabled";
192			};
193
194			gpioj: gpio@4000a1b0 {
195				compatible = "silabs,gecko-gpio-port";
196				reg = <0x4000a1b0 0x30>;
197				peripheral-id = <9>;
198				gpio-controller;
199				#gpio-cells = <2>;
200				status = "disabled";
201			};
202
203			gpiok: gpio@4000a1e0 {
204				compatible = "silabs,gecko-gpio-port";
205				reg = <0x4000a1e0 0x30>;
206				peripheral-id = <10>;
207				gpio-controller;
208				#gpio-cells = <2>;
209				status = "disabled";
210			};
211		};
212
213		wdog0: wdog@40052000 {
214			compatible = "silabs,gecko-wdog";
215			reg = <0x40052000 0x2C>;
216			peripheral-id = <0>;
217			interrupts = <2 0>;
218			status = "disabled";
219		};
220
221		wdog1: wdog@40052400 {
222			compatible = "silabs,gecko-wdog";
223			reg = <0x40052400 0x2C>;
224			peripheral-id = <1>;
225			interrupts = <3 0>;
226			status = "disabled";
227		};
228
229		trng0: trng@4001d000 {
230			compatible = "silabs,gecko-trng";
231			reg = <0x4001d000 0x400>;
232			interrupts = <49 0>;
233			status = "disabled";
234		};
235
236		timer0: timer@40018000 {
237			compatible = "silabs,gecko-timers";
238			reg = <0x40018000 0x400>;
239			status = "disabled";
240
241			pwm {
242				compatible = "silabs,gecko-pwm";
243				status = "disabled";
244				#pwm-cells = <3>;
245			};
246		};
247
248		adc0: adc@40002000 {
249			compatible = "silabs,gecko-adc";
250			reg = <0x40002000 0x400>;
251			interrupts = <15 0>;
252			frequency = <16000000>;
253			status = "disabled";
254			#io-channel-cells = <1>;
255		};
256
257		pinctrl: pin-controller {
258			/* Pin controller is a "virtual" device since SiLabs SoCs do pin
259			 * control in a distributed way (GPIO registers and PSEL
260			 * registers on each peripheral).
261			 */
262			compatible = "silabs,gecko-pinctrl";
263		};
264	};
265};
266
267&nvic {
268	arm,num-irq-priority-bits = <3>;
269};
270