1/*
2 * Copyright (c) 2019 Yannis Damigos
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6/dts-v1/;
7
8#include <espressif/esp32/esp32_wrover_e_n16r4.dtsi>
9#include "odroid_go-pinctrl.dtsi"
10#include <espressif/partitions_0x1000_amp.dtsi>
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "ODROID-GO Game Kit PROCPU";
15	compatible = "hardkernel,odroid_go", "espressif,esp32";
16
17	chosen {
18		zephyr,sram = &sram1;
19		zephyr,console = &uart0;
20		zephyr,shell-uart = &uart0;
21		zephyr,flash = &flash0;
22		zephyr,code-partition = &slot0_partition;
23		zephyr,display = &ili9341;
24		zephyr,bt-hci = &esp32_bt_hci;
25	};
26
27	leds {
28		compatible = "gpio-leds";
29		blue_led: led {
30			gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
31			label = "Status Led";
32		};
33	};
34
35	gpio_keys {
36		compatible = "gpio-keys";
37		menu_button: menu_button {
38			label = "Menu";
39			gpios = <&gpio0 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
40			zephyr,code = <INPUT_KEY_MENU>;
41		};
42		volume_button: volume_button {
43			label = "Volume";
44			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
45			zephyr,code = <INPUT_KEY_0>;
46		};
47		select_button: select_button {
48			label = "Select";
49			gpios = <&gpio0 27 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
50			zephyr,code = <INPUT_BTN_SELECT>;
51		};
52		a_button: a_button {
53			label = "A";
54			gpios = <&gpio1 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
55			zephyr,code = <INPUT_KEY_A>;
56		};
57		b_button: b_button {
58			label = "B";
59			gpios = <&gpio1 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
60			zephyr,code = <INPUT_KEY_B>;
61		};
62		start_button: start_button {
63			label = "Start";
64			gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
65			zephyr,code = <INPUT_BTN_START>;
66		};
67	};
68
69	lcd_backlight_en {
70		compatible = "regulator-fixed";
71		regulator-name = "lcd_backlight_enable";
72		enable-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
73		regulator-boot-on;
74	};
75
76	aliases {
77		uart-0 = &uart0;
78		led0 = &blue_led;
79		sw0 = &menu_button;
80		watchdog0 = &wdt0;
81		sdhc0 = &sd0;
82	};
83
84	mipi_dbi {
85		compatible = "zephyr,mipi-dbi-spi";
86		dc-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;
87		spi-dev = <&spi3>;
88		write-only;
89		#address-cells = <1>;
90		#size-cells = <0>;
91
92		ili9341: ili9341@0 {
93			compatible = "ilitek,ili9341";
94			mipi-max-frequency = <25000000>;
95			pixel-format = <0>;
96			reg = <0>;
97			rotation = <270>;
98			width = <320>;
99			height = <240>;
100		};
101	};
102};
103
104&uart0 {
105	status = "okay";
106	current-speed = <115200>;
107	pinctrl-0 = <&uart0_default>;
108	pinctrl-names = "default";
109};
110
111&gpio0 {
112	status = "okay";
113
114	blue-led-disable {
115		gpio-hog;
116		gpios = <2 GPIO_ACTIVE_HIGH>;
117		output-low;
118	};
119};
120
121&gpio1 {
122	status = "okay";
123};
124
125&i2c0 {
126	status = "okay";
127	clock-frequency = <I2C_BITRATE_FAST>;
128	sda-gpios = <&gpio0 4 GPIO_OPEN_DRAIN>;
129	scl-gpios = <&gpio0 15 GPIO_OPEN_DRAIN>;
130	pinctrl-0 = <&i2c0_default>;
131	pinctrl-names = "default";
132};
133
134&spi3 {
135	#address-cells = <1>;
136	#size-cells = <0>;
137	status = "okay";
138	pinctrl-0 = <&spim3_default>;
139	pinctrl-names = "default";
140
141	sd0: sd@1 {
142		compatible = "zephyr,sdhc-spi-slot";
143		reg = <1>;
144		status = "okay";
145		mmc {
146			compatible = "zephyr,sdmmc-disk";
147			disk-name = "SD";
148			status = "okay";
149		};
150		spi-max-frequency = <20000000>;
151	};
152};
153
154&timer0 {
155	status = "okay";
156};
157
158&timer1 {
159	status = "okay";
160};
161
162&timer2 {
163	status = "okay";
164};
165
166&timer3 {
167	status = "okay";
168};
169
170&trng0 {
171	status = "okay";
172};
173
174&esp32_bt_hci {
175	status = "okay";
176};
177