1/*
2 * Copyright (c) 2022 Henrik Brix Andersen <henrik@brixandersen.dk>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8
9#include <espressif/esp32/esp32_wrover_e_n4r2.dtsi>
10#include "olimex_esp32_evb-pinctrl.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "Olimex ESP32-EVB";
15	compatible = "olimex,esp32-evb", "espressif,esp32-wroom-32e", "espressif,esp32";
16
17	chosen {
18		zephyr,console = &uart0;
19		zephyr,shell-uart = &uart0;
20		zephyr,sram = &sram0;
21		zephyr,flash = &flash0;
22	};
23
24	aliases {
25		sw0 = &button1;
26		watchdog0 = &wdt0;
27	};
28
29	gpio_keys {
30		compatible = "gpio-keys";
31		button1: button1 {
32			gpios = <&gpio 34 GPIO_ACTIVE_LOW>;
33			label = "BUT1";
34			zephyr,code = <INPUT_KEY_0>;
35		};
36	};
37
38	relay1: relay1 {
39		compatible = "regulator-fixed";
40		enable-gpios = <&gpio 32 GPIO_ACTIVE_HIGH>;
41		regulator-name = "REL1";
42		startup-delay-us = <10000>;
43		off-on-delay-us = <5000>;
44	};
45
46	relay2: relay2 {
47		compatible = "regulator-fixed";
48		enable-gpios = <&gpio 33 GPIO_ACTIVE_HIGH>;
49		regulator-name = "REL2";
50		startup-delay-us = <10000>;
51		off-on-delay-us = <5000>;
52	};
53};
54
55&cpu0 {
56	clock-frequency = <ESP32_CLK_CPU_240M>;
57};
58
59&cpu1 {
60	clock-frequency = <ESP32_CLK_CPU_240M>;
61};
62
63uext_serial: &uart1 {};
64uext_i2c: &i2c0 {};
65uext_spi: &spi2 {};
66
67&uart0 {
68	status = "okay";
69	current-speed = <115200>;
70	pinctrl-0 = <&uart0_default>;
71	pinctrl-names = "default";
72};
73
74&uart1 {
75	status = "okay";
76	current-speed = <115200>;
77	pinctrl-0 = <&uart1_default>;
78	pinctrl-names = "default";
79};
80
81&i2c0 {
82	status = "okay";
83	clock-frequency = <I2C_BITRATE_STANDARD>;
84	sda-gpios = <&gpio0 16 GPIO_OPEN_DRAIN>;
85	scl-gpios = <&gpio0 13 GPIO_OPEN_DRAIN>;
86	pinctrl-0 = <&i2c0_default>;
87	pinctrl-names = "default";
88};
89
90&spi2 {
91	status = "okay";
92	pinctrl-0 = <&spim2_default>;
93	pinctrl-names = "default";
94	#address-cells = <1>;
95	#size-cells = <0>;
96};
97
98&twai {
99	status = "okay";
100	pinctrl-0 = <&twai_default>;
101	pinctrl-names = "default";
102	bus-speed = <125000>;
103
104	can-transceiver {
105		max-bitrate = <1000000>;
106	};
107};
108
109&gpio0 {
110	status = "okay";
111};
112
113&gpio1 {
114	status = "okay";
115};
116
117&timer0 {
118	status = "okay";
119};
120
121&timer1 {
122	status = "okay";
123};
124
125&timer2 {
126	status = "okay";
127};
128
129&timer3 {
130	status = "okay";
131};
132
133&trng0 {
134	status = "okay";
135};
136
137&flash0 {
138	status = "okay";
139	partitions {
140		compatible = "fixed-partitions";
141		#address-cells = <1>;
142		#size-cells = <1>;
143
144		/* Reserve 60kB for the bootloader */
145		boot_partition: partition@1000 {
146			label = "mcuboot";
147			reg = <0x00001000 DT_SIZE_K(60)>;
148			read-only;
149		};
150
151		/* Reserve 1024kB for the application in slot 0 */
152		slot0_partition: partition@10000 {
153			label = "image-0";
154			reg = <0x00010000 DT_SIZE_K(1024)>;
155		};
156
157		/* Reserve 1024kB for the application in slot 1 */
158		slot1_partition: partition@110000 {
159			label = "image-1";
160			reg = <0x00110000 DT_SIZE_K(1024)>;
161		};
162
163		/* Reserve 256kB for the scratch partition */
164		scratch_partition: partition@210000 {
165			   label = "image-scratch";
166			   reg = <0x00210000 DT_SIZE_K(256)>;
167		};
168
169		storage_partition: partition@250000 {
170			label = "storage";
171			reg = <0x00250000 DT_SIZE_K(24)>;
172		};
173	};
174};
175