1/*
2 * Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8
9#include <espressif/esp32s2/esp32s2_wrover_n4r2.dtsi>
10#include "esp32s2_saola-pinctrl.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12#include <zephyr/dt-bindings/input/esp32-touch-sensor-input.h>
13
14/ {
15	model = "esp32s2_saola";
16	compatible = "espressif,esp32s2";
17
18	aliases {
19		sw0 = &user_button;
20		i2c-0 = &i2c0;
21		watchdog0 = &wdt0;
22	};
23
24	chosen {
25		zephyr,sram = &sram0;
26		zephyr,console = &uart0;
27		zephyr,shell-uart = &uart0;
28		zephyr,flash = &flash0;
29		zephyr,code-partition = &slot0_partition;
30	};
31
32	gpio_keys {
33		compatible = "gpio-keys";
34		user_button: user_button {
35			label = "BOOT";
36			gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
37			zephyr,code = <INPUT_KEY_0>;
38		};
39	};
40};
41
42&cpu0 {
43	clock-frequency = <ESP32_CLK_CPU_240M>;
44};
45
46&uart0 {
47	status = "okay";
48	current-speed = <115200>;
49	pinctrl-0 = <&uart0_default>;
50	pinctrl-names = "default";
51};
52
53&gpio0 {
54	status = "okay";
55};
56
57&gpio1 {
58	status = "okay";
59};
60
61&touch {
62	debounce-interval-ms = <30>;
63	href-microvolt = <2700000>;
64	lref-microvolt = <500000>;
65	href-atten-microvolt = <1000000>;
66	filter-mode = <ESP32_TOUCH_FILTER_MODE_IIR_16>;
67	filter-debounce-cnt = <1>;
68	filter-noise-thr = <ESP32_TOUCH_FILTER_NOISE_THR_4_8TH>;
69	filter-jitter-step = <4>;
70	filter-smooth-level = <ESP32_TOUCH_FILTER_SMOOTH_MODE_IIR_2>;
71};
72
73&timer0 {
74	status = "disabled";
75};
76
77&timer1 {
78	status = "disabled";
79};
80
81&timer2 {
82	status = "disabled";
83};
84
85&timer3 {
86	status = "disabled";
87};
88
89&i2c0 {
90	status = "okay";
91	clock-frequency = <I2C_BITRATE_STANDARD>;
92	pinctrl-0 = <&i2c0_default>;
93	pinctrl-names = "default";
94};
95
96&i2c1 {
97	clock-frequency = <I2C_BITRATE_STANDARD>;
98	pinctrl-0 = <&i2c1_default>;
99	pinctrl-names = "default";
100};
101
102&trng0 {
103	status = "okay";
104};
105
106&spi2 {
107	#address-cells = <1>;
108	#size-cells = <0>;
109	status = "okay";
110	pinctrl-0 = <&spim2_default>;
111	pinctrl-names = "default";
112};
113
114&spi3 {
115	#address-cells = <1>;
116	#size-cells = <0>;
117	status = "okay";
118	pinctrl-0 = <&spim3_default>;
119	pinctrl-names = "default";
120};
121
122
123&flash0 {
124	status = "okay";
125
126	partitions {
127		compatible = "fixed-partitions";
128		#address-cells = <1>;
129		#size-cells = <1>;
130
131		/* Reserve 60kB for the bootloader */
132		boot_partition: partition@1000 {
133			label = "mcuboot";
134			reg = <0x00001000 0x0000F000>;
135			read-only;
136		};
137
138		/* Reserve 1024kB for the application in slot 0 */
139		slot0_partition: partition@10000 {
140			label = "image-0";
141			reg = <0x00010000 0x00100000>;
142		};
143
144		/* Reserve 1024kB for the application in slot 1 */
145		slot1_partition: partition@110000 {
146			label = "image-1";
147			reg = <0x00110000 0x00100000>;
148		};
149
150		/* Reserve 256kB for the scratch partition */
151		scratch_partition: partition@210000 {
152			   label = "image-scratch";
153			   reg = <0x00210000 0x00040000>;
154		};
155
156		storage_partition: partition@250000 {
157			label = "storage";
158			reg = <0x00250000 0x00006000>;
159		};
160	};
161};
162
163&wdt0 {
164	status = "okay";
165};
166