1/*
2 * Copyright (c) 2020 Piotr Mienkowski
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <arm/armv7-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			compatible = "arm,cortex-m4f";
23			reg = <0>;
24		};
25	};
26
27	sram0: memory@20000000 {
28		compatible = "mmio-sram";
29	};
30
31	soc {
32		msc: flash-controller@400e0000 {
33			compatible = "silabs,gecko-flash-controller";
34			label = "FLASH_CTRL";
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				label = "FLASH_0";
44				write-block-size = <4>;
45				erase-block-size = <2048>;
46			};
47		};
48
49		usart0: usart@40010000 { /* USART0 */
50			compatible = "silabs,gecko-usart";
51			reg = <0x40010000 0x400>;
52			interrupts = <12 0>, <13 0>;
53			interrupt-names = "rx", "tx";
54			peripheral-id = <0>;
55			status = "disabled";
56			label = "USART_0";
57		};
58
59		usart1: usart@40010400 { /* USART1 */
60			compatible = "silabs,gecko-usart";
61			reg = <0x40010400 0x400>;
62			interrupts = <20 0>, <21 0>;
63			interrupt-names = "rx", "tx";
64			peripheral-id = <1>;
65			status = "disabled";
66			label = "USART_1";
67		};
68
69		usart2: usart@40010800 { /* USART2 */
70			compatible = "silabs,gecko-usart";
71			reg = <0x40010800 0x400>;
72			interrupts = <38 0>, <39 0>;
73			interrupt-names = "rx", "tx";
74			peripheral-id = <2>;
75			status = "disabled";
76			label = "USART_2";
77		};
78
79		leuart0: leuart@4004a000 { /* LEUART0 */
80			compatible = "silabs,gecko-leuart";
81			reg = <0x4004a000 0x400>;
82			interrupts = <22 0>;
83			peripheral-id = <0>;
84			status = "disabled";
85			label = "LEUART_0";
86		};
87
88		i2c0: i2c@4000c000 {
89			compatible = "silabs,gecko-i2c";
90			clock-frequency = <I2C_BITRATE_STANDARD>;
91			#address-cells = <1>;
92			#size-cells = <0>;
93			reg = <0x4000c000 0x400>;
94			interrupts = <17 0>;
95			label = "I2C_0";
96			status = "disabled";
97		};
98
99		i2c1: i2c@4000c400 {
100			compatible = "silabs,gecko-i2c";
101			clock-frequency = <I2C_BITRATE_STANDARD>;
102			#address-cells = <1>;
103			#size-cells = <0>;
104			reg = <0x4000c400 0x400>;
105			interrupts = <40 0>;
106			label = "I2C_1";
107			status = "disabled";
108		};
109
110		rtcc0: rtcc@40042000 {
111			compatible = "silabs,gecko-rtcc";
112			reg = <0x40042000 0x184>;
113			interrupts = <31 0>;
114			clock-frequency = <32768>;
115			prescaler = <1>;
116			status = "disabled";
117			label = "RTCC_0";
118		};
119
120		gpio: gpio@4000a400 {
121			compatible = "silabs,gecko-gpio";
122			reg = <0x4000a400 0xc00>;
123			interrupts = <10 2 18 2>;
124			interrupt-names = "GPIO_EVEN", "GPIO_ODD";
125			label = "GPIO";
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				label = "GPIO_A";
136				gpio-controller;
137				#gpio-cells = <2>;
138				status = "disabled";
139			};
140
141			gpiob: gpio@4000a030 {
142				compatible = "silabs,gecko-gpio-port";
143				reg = <0x4000a030 0x30>;
144				peripheral-id = <1>;
145				label = "GPIO_B";
146				gpio-controller;
147				#gpio-cells = <2>;
148				status = "disabled";
149			};
150
151			gpioc: gpio@4000a060 {
152				compatible = "silabs,gecko-gpio-port";
153				reg = <0x4000a060 0x30>;
154				peripheral-id = <2>;
155				label = "GPIO_C";
156				gpio-controller;
157				#gpio-cells = <2>;
158				status = "disabled";
159			};
160
161			gpiod: gpio@4000a090 {
162				compatible = "silabs,gecko-gpio-port";
163				reg = <0x4000a090 0x30>;
164				peripheral-id = <3>;
165				label = "GPIO_D";
166				gpio-controller;
167				#gpio-cells = <2>;
168				status = "disabled";
169			};
170
171			gpiof: gpio@4000a0f0 {
172				compatible = "silabs,gecko-gpio-port";
173				reg = <0x4000a0f0 0x30>;
174				peripheral-id = <5>;
175				label = "GPIO_F";
176				gpio-controller;
177				#gpio-cells = <2>;
178				status = "disabled";
179			};
180		};
181
182		wdog0: wdog@40052000 {
183			compatible = "silabs,gecko-wdog";
184			reg = <0x40052000 0x2C>;
185			peripheral-id = <0>;
186			label = "WDOG0";
187			interrupts = <2 0>;
188			status = "disabled";
189		};
190
191		wdog1: wdog@40052400 {
192			compatible = "silabs,gecko-wdog";
193			reg = <0x40052400 0x2C>;
194			peripheral-id = <1>;
195			label = "WDOG1";
196			interrupts = <3 0>;
197			status = "disabled";
198		};
199	};
200};
201
202&nvic {
203	arm,num-irq-priority-bits = <3>;
204};
205