1/*
2 * Copyright (c) 2023 Antmicro <www.antmicro.com>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <zephyr/dt-bindings/input/input-event-codes.h>
8#include <silabs/gpio_gecko.h>
9
10/ {
11	chosen {
12		zephyr,bt-c2h-uart = &usart1;
13		zephyr,console = &usart1;
14		zephyr,shell-uart = &usart1;
15		zephyr,sram = &sram0;
16		zephyr,flash = &flash0;
17	};
18
19	leds {
20		compatible = "gpio-leds";
21		led0: led_0 {
22			gpios = <&gpiob GECKO_PIN(0) GPIO_ACTIVE_HIGH>;
23			label = "LED 0";
24		};
25	};
26
27	buttons {
28		compatible = "gpio-keys";
29		button0: button_0 {
30			gpios = <&gpiob GECKO_PIN(1) GPIO_ACTIVE_LOW>;
31			label = "User Push Button 0";
32			zephyr,code = <INPUT_KEY_0>;
33		};
34	};
35
36	wake_up_trigger: gpio-wake-up  {
37		compatible = "silabs,gecko-wake-up-trigger";
38		gpios = <&gpioa GECKO_PIN(5) GPIO_ACTIVE_LOW>;
39	};
40
41	/* GPIOs that power up different sensors */
42	sw_sensor_enable: gpio_switch_0 {
43		compatible = "regulator-fixed";
44		status = "okay";
45		regulator-name = "sw_sensor_enable";
46		startup-delay-us = <100000>;
47		/* Always on since sensor drivers won't enable it automatically */
48		regulator-always-on;
49	};
50
51	sw_mic_enable: gpio_switch_1 {
52		compatible = "regulator-fixed";
53		status = "okay";
54		regulator-name = "sw_mic_enable";
55		startup-delay-us = <100000>;
56	};
57
58	sw_imu_enable: gpio_switch_2 {
59		compatible = "regulator-fixed";
60		status = "okay";
61		regulator-name = "sw_imu_enable";
62		startup-delay-us = <100000>;
63	};
64
65};
66
67&cpu0 {
68	clock-frequency = <76800000>;
69};
70
71&pstate_em3 {
72	status = "disabled";
73};
74
75&usart0 {
76	status = "okay";
77	pinctrl-0 = <&usart0_default>;
78	pinctrl-names = "default";
79
80	cs-gpios = <&gpioc 3 GPIO_ACTIVE_LOW>;
81
82	mx25r80: mx25r8035f@0 {
83		compatible = "jedec,spi-nor";
84		reg = <0>;
85		spi-max-frequency = <80000000>;
86		size = <0x800000>;
87		jedec-id = [c2 28 14];
88		sfdp-bfp = [
89			 e5 20 f1 ff  ff ff 7f 00  44 eb 08 6b  08 3b 04 bb
90			 ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
91			 10 d8 00 ff  23 72 f5 00  82 ed 04 b7  44 83 38 44
92			 30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
93		];
94	};
95};
96
97&usart1 {
98	current-speed = <115200>;
99	status = "okay";
100	pinctrl-0 = <&usart1_default>;
101	pinctrl-names = "default";
102};
103
104&wdog0 {
105	status = "okay";
106};
107
108&flash0 {
109	partitions {
110		compatible = "fixed-partitions";
111		#address-cells = <1>;
112		#size-cells = <1>;
113	};
114};
115
116&gpio {
117	location-swo = <0>;
118	status = "okay";
119};
120
121&gpioa {
122	status = "okay";
123};
124
125&gpiob {
126	status = "okay";
127};
128
129&gpioc {
130	status = "okay";
131};
132
133&burtc0 {
134	status = "okay";
135};
136
137&stimer0 {
138	status = "okay";
139};
140
141&trng {
142	status = "okay";
143};
144
145&pinctrl {
146	i2c0_default: i2c0_default {
147		group1 {
148			psels = <GECKO_PSEL(I2C_SDA, D, 2)>,
149				<GECKO_PSEL(I2C_SCL, D, 3)>,
150				<GECKO_LOC(I2C_SDA, 3)>,
151				<GECKO_LOC(I2C_SCL, 3)>;
152		};
153	};
154};
155
156&i2c0 {
157	pinctrl-0 = <&i2c0_default>;
158	pinctrl-names = "default";
159	status = "okay";
160
161	si7210@30 {
162		compatible = "silabs,si7210";
163		status = "okay";
164		reg = <0x30>;
165	};
166};
167
168&adc0 {
169	status = "okay";
170};
171