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 <zephyr/dt-bindings/gpio/gpio.h>
9#include <zephyr/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			reg = <0x400e0000 0x800>;
31			interrupts = <24 0>;
32
33			#address-cells = <1>;
34			#size-cells = <1>;
35
36			flash0: flash@0 {
37				compatible = "soc-nv-flash";
38				write-block-size = <4>;
39				erase-block-size = <2048>;
40			};
41		};
42
43		usart0: usart@40010000 { /* USART0 */
44			compatible = "silabs,gecko-usart";
45			reg = <0x40010000 0x400>;
46			interrupts = <11 0 12 0>;
47			interrupt-names = "rx", "tx";
48			peripheral-id = <0>;
49			status = "disabled";
50		};
51
52		usart1: usart@40010400 { /* USART1 */
53			compatible = "silabs,gecko-usart";
54			reg = <0x40010400 0x400>;
55			interrupts = <19 0 20 0>;
56			interrupt-names = "rx", "tx";
57			peripheral-id = <1>;
58			status = "disabled";
59		};
60
61		leuart0: leuart@4004a000 { /* LEUART0 */
62			compatible = "silabs,gecko-leuart";
63			reg = <0x4004a000 0x400>;
64			interrupts = <21 0>;
65			peripheral-id = <0>;
66			status = "disabled";
67		};
68
69		i2c0: i2c@4000c000 {
70			compatible = "silabs,gecko-i2c";
71			clock-frequency = <I2C_BITRATE_STANDARD>;
72			#address-cells = <1>;
73			#size-cells = <0>;
74			reg = <0x4000c000 0x400>;
75			interrupts = <16 0>;
76			status = "disabled";
77		};
78
79		rtcc0: rtcc@40042000 {
80			compatible = "silabs,gecko-rtcc";
81			reg = <0x40042000 0x184>;
82			interrupts = <29 0>;
83			clock-frequency = <32768>;
84			prescaler = <1>;
85			status = "disabled";
86		};
87
88		gpio: gpio@4000a400 {
89			compatible = "silabs,gecko-gpio";
90			reg = <0x4000a400 0xf00>;
91			interrupts = <9 2 17 2>;
92			interrupt-names = "GPIO_EVEN", "GPIO_ODD";
93
94			ranges;
95			#address-cells = <1>;
96			#size-cells = <1>;
97
98			gpioa: gpio@4000a000 {
99				compatible = "silabs,gecko-gpio-port";
100				reg = <0x4000a000 0x30>;
101				peripheral-id = <0>;
102				gpio-controller;
103				#gpio-cells = <2>;
104				status = "disabled";
105			};
106
107			gpiob: gpio@4000a030 {
108				compatible = "silabs,gecko-gpio-port";
109				reg = <0x4000a030 0x30>;
110				peripheral-id = <1>;
111				gpio-controller;
112				#gpio-cells = <2>;
113				status = "disabled";
114			};
115
116			gpioc: gpio@4000a060 {
117				compatible = "silabs,gecko-gpio-port";
118				reg = <0x4000a060 0x30>;
119				peripheral-id = <2>;
120				gpio-controller;
121				#gpio-cells = <2>;
122				status = "disabled";
123			};
124
125			gpiod: gpio@4000a090 {
126				compatible = "silabs,gecko-gpio-port";
127				reg = <0x4000a090 0x30>;
128				peripheral-id = <3>;
129				gpio-controller;
130				#gpio-cells = <2>;
131				status = "disabled";
132			};
133
134			gpiof: gpio@4000a0f0 {
135				compatible = "silabs,gecko-gpio-port";
136				reg = <0x4000a0f0 0x30>;
137				peripheral-id = <5>;
138				gpio-controller;
139				#gpio-cells = <2>;
140				status = "disabled";
141			};
142			pinctrl: pin-controller {
143				/* Pin controller is a "virtual" device since SiLabs SoCs do pin
144				 * control in a distributed way (GPIO registers and PSEL
145				 * registers on each peripheral).
146				 */
147				 compatible = "silabs,gecko-pinctrl";
148			};
149		};
150
151                wdog0: wdog@40052000 {
152                        compatible = "silabs,gecko-wdog";
153                        reg = <0x40052000 0x400>;
154                        peripheral-id = <0>;
155                        interrupts = <2 0>;
156                        status = "disabled";
157                };
158	};
159};
160
161&nvic {
162	arm,num-irq-priority-bits = <3>;
163};
164