1/*
2 * Copyright (c) 2021 Rafael Dias Menezes <rdmeneze@gmail.com>
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	};
22
23	sram0: memory@20000000 {
24	       compatible = "mmio-sram";
25	};
26
27	soc {
28		msc: flash-controller@400e0000 {
29			compatible = "silabs,gecko-flash-controller";
30			label = "FLASH_CTRL";
31			reg = <0x400e0000 0x800>;
32			interrupts = <24 0>;
33
34			#address-cells = <1>;
35			#size-cells = <1>;
36
37			flash0: flash@0 {
38				compatible = "soc-nv-flash";
39				label = "FLASH_0";
40				write-block-size = <4>;
41				erase-block-size = <2048>;
42			};
43		};
44
45		usart0: usart@40010000 { /* USART0 */
46			compatible = "silabs,gecko-usart";
47			reg = <0x40010000 0x400>;
48			interrupts = <11 0 12 0>;
49			interrupt-names = "rx", "tx";
50			peripheral-id = <0>;
51			status = "disabled";
52			label = "USART_0";
53		};
54
55		usart1: usart@40010400 { /* USART1 */
56			compatible = "silabs,gecko-usart";
57			reg = <0x40010400 0x400>;
58			interrupts = <19 0 20 0>;
59			interrupt-names = "rx", "tx";
60			peripheral-id = <1>;
61			status = "disabled";
62			label = "USART_1";
63		};
64
65		leuart0: leuart@4004a000 { /* LEUART0 */
66			compatible = "silabs,gecko-leuart";
67			reg = <0x4004a000 0x400>;
68			interrupts = <21 0>;
69			peripheral-id = <0>;
70			status = "disabled";
71			label = "LEUART_0";
72		};
73
74		i2c0: i2c@4000c000 {
75			compatible = "silabs,gecko-i2c";
76			clock-frequency = <I2C_BITRATE_STANDARD>;
77			#address-cells = <1>;
78			#size-cells = <0>;
79			reg = <0x4000c000 0x400>;
80			interrupts = <16 0>;
81			label = "I2C_0";
82			status = "disabled";
83		};
84
85		rtcc0: rtcc@40042000 {
86			compatible = "silabs,gecko-rtcc";
87			reg = <0x40042000 0x184>;
88			interrupts = <29 0>;
89			clock-frequency = <32768>;
90			prescaler = <1>;
91			status = "disabled";
92			label = "RTCC_0";
93		};
94
95		gpio: gpio@4000a400 {
96			compatible = "silabs,gecko-gpio";
97			reg = <0x4000a400 0xf00>;
98			interrupts = <9 2 17 2>;
99			interrupt-names = "GPIO_EVEN", "GPIO_ODD";
100			label = "GPIO";
101
102			ranges;
103			#address-cells = <1>;
104			#size-cells = <1>;
105
106			gpioa: gpio@4000a000 {
107				compatible = "silabs,gecko-gpio-port";
108				reg = <0x4000a000 0x30>;
109				peripheral-id = <0>;
110				label = "GPIO_A";
111				gpio-controller;
112				#gpio-cells = <2>;
113				status = "disabled";
114			};
115
116			gpiob: gpio@4000a030 {
117				compatible = "silabs,gecko-gpio-port";
118				reg = <0x4000a030 0x30>;
119				peripheral-id = <1>;
120				label = "GPIO_B";
121				gpio-controller;
122				#gpio-cells = <2>;
123				status = "disabled";
124			};
125
126			gpioc: gpio@4000a060 {
127				compatible = "silabs,gecko-gpio-port";
128				reg = <0x4000a060 0x30>;
129				peripheral-id = <2>;
130				label = "GPIO_C";
131				gpio-controller;
132				#gpio-cells = <2>;
133				status = "disabled";
134			};
135
136			gpiod: gpio@4000a090 {
137				compatible = "silabs,gecko-gpio-port";
138				reg = <0x4000a090 0x30>;
139				peripheral-id = <3>;
140				label = "GPIO_D";
141				gpio-controller;
142				#gpio-cells = <2>;
143				status = "disabled";
144			};
145
146			gpiof: gpio@4000a0f0 {
147				compatible = "silabs,gecko-gpio-port";
148				reg = <0x4000a0f0 0x30>;
149				peripheral-id = <5>;
150				label = "GPIO_F";
151				gpio-controller;
152				#gpio-cells = <2>;
153				status = "disabled";
154			};
155		};
156
157                wdog0: wdog@40052000 {
158                        compatible = "silabs,gecko-wdog";
159                        reg = <0x40052000 0x400>;
160                        peripheral-id = <0>;
161                        label = "WDOG0";
162                        interrupts = <2 0>;
163                        status = "disabled";
164                };
165	};
166};
167
168&nvic {
169	arm,num-irq-priority-bits = <3>;
170};
171