1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd
4 *
5 */
6
7/dts-v1/;
8#include <dt-bindings/input/input.h>
9#include "rk3308.dtsi"
10
11/ {
12	model = "Rockchip RK3308 EVB";
13	compatible = "rockchip,rk3308-evb", "rockchip,rk3308";
14
15	chosen {
16		stdout-path = "serial4:1500000n8";
17	};
18
19	adc-keys0 {
20		compatible = "adc-keys";
21		io-channels = <&saradc 0>;
22		io-channel-names = "buttons";
23		poll-interval = <100>;
24		keyup-threshold-microvolt = <1800000>;
25
26		func-key {
27			linux,code = <KEY_FN>;
28			label = "function";
29			press-threshold-microvolt = <18000>;
30		};
31	};
32
33	adc-keys1 {
34		compatible = "adc-keys";
35		io-channels = <&saradc 1>;
36		io-channel-names = "buttons";
37		poll-interval = <100>;
38		keyup-threshold-microvolt = <1800000>;
39
40		esc-key {
41			linux,code = <KEY_MICMUTE>;
42			label = "micmute";
43			press-threshold-microvolt = <1130000>;
44		};
45
46		home-key {
47			linux,code = <KEY_MODE>;
48			label = "mode";
49			press-threshold-microvolt = <901000>;
50		};
51
52		menu-key {
53			linux,code = <KEY_PLAY>;
54			label = "play";
55			press-threshold-microvolt = <624000>;
56		};
57
58		vol-down-key {
59			linux,code = <KEY_VOLUMEDOWN>;
60			label = "volume down";
61			press-threshold-microvolt = <300000>;
62		};
63
64		vol-up-key {
65			linux,code = <KEY_VOLUMEUP>;
66			label = "volume up";
67			press-threshold-microvolt = <18000>;
68		};
69	};
70
71	gpio-keys {
72		compatible = "gpio-keys";
73		autorepeat;
74
75		pinctrl-names = "default";
76		pinctrl-0 = <&pwr_key>;
77
78		power {
79			gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
80			linux,code = <KEY_POWER>;
81			label = "GPIO Key Power";
82			wakeup-source;
83			debounce-interval = <100>;
84		};
85	};
86
87	vcc12v_dcin: vcc12v-dcin {
88		compatible = "regulator-fixed";
89		regulator-name = "vcc12v_dcin";
90		regulator-always-on;
91		regulator-boot-on;
92		regulator-min-microvolt = <12000000>;
93		regulator-max-microvolt = <12000000>;
94	};
95
96	vcc5v0_sys: vcc5v0-sys {
97		compatible = "regulator-fixed";
98		regulator-name = "vcc5v0_sys";
99		regulator-always-on;
100		regulator-boot-on;
101		regulator-min-microvolt = <5000000>;
102		regulator-max-microvolt = <5000000>;
103		vin-supply = <&vcc12v_dcin>;
104	};
105
106	vdd_core: vdd-core {
107		compatible = "pwm-regulator";
108		pwms = <&pwm0 0 5000 1>;
109		regulator-name = "vdd_core";
110		regulator-min-microvolt = <827000>;
111		regulator-max-microvolt = <1340000>;
112		regulator-always-on;
113		regulator-boot-on;
114		regulator-settling-time-up-us = <250>;
115		pwm-supply = <&vcc5v0_sys>;
116	};
117
118	vdd_log: vdd-log {
119		compatible = "regulator-fixed";
120		regulator-name = "vdd_log";
121		regulator-always-on;
122		regulator-boot-on;
123		regulator-min-microvolt = <1050000>;
124		regulator-max-microvolt = <1050000>;
125		vin-supply = <&vcc5v0_sys>;
126	};
127
128	vdd_1v0: vdd-1v0 {
129		compatible = "regulator-fixed";
130		regulator-name = "vdd_1v0";
131		regulator-always-on;
132		regulator-boot-on;
133		regulator-min-microvolt = <1000000>;
134		regulator-max-microvolt = <1000000>;
135		vin-supply = <&vcc5v0_sys>;
136	};
137
138	vccio_sdio: vcc_1v8: vcc-1v8 {
139		compatible = "regulator-fixed";
140		regulator-name = "vcc_1v8";
141		regulator-always-on;
142		regulator-boot-on;
143		regulator-min-microvolt = <1800000>;
144		regulator-max-microvolt = <1800000>;
145		vin-supply = <&vcc_io>;
146	};
147
148	vcc_ddr: vcc-ddr {
149		compatible = "regulator-fixed";
150		regulator-name = "vcc_ddr";
151		regulator-always-on;
152		regulator-boot-on;
153		regulator-min-microvolt = <1500000>;
154		regulator-max-microvolt = <1500000>;
155		vin-supply = <&vcc5v0_sys>;
156	};
157
158	vcc_io: vcc-io {
159		compatible = "regulator-fixed";
160		regulator-name = "vcc_io";
161		regulator-always-on;
162		regulator-boot-on;
163		regulator-min-microvolt = <3300000>;
164		regulator-max-microvolt = <3300000>;
165		vin-supply = <&vcc5v0_sys>;
166	};
167
168	vccio_flash: vccio-flash {
169		compatible = "regulator-fixed";
170		regulator-name = "vccio_flash";
171		regulator-always-on;
172		regulator-boot-on;
173		regulator-min-microvolt = <3300000>;
174		regulator-max-microvolt = <3300000>;
175		vin-supply = <&vcc_io>;
176	};
177
178	vcc5v0_host: vcc5v0-host {
179		compatible = "regulator-fixed";
180		enable-active-high;
181		gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
182		pinctrl-names = "default";
183		pinctrl-0 = <&usb_drv>;
184		regulator-name = "vbus_host";
185		vin-supply = <&vcc5v0_sys>;
186	};
187};
188
189&cpu0 {
190	cpu-supply = <&vdd_core>;
191};
192
193&saradc {
194	status = "okay";
195	vref-supply = <&vcc_1v8>;
196};
197
198&pinctrl {
199	pinctrl-names = "default";
200	pinctrl-0 = <&rtc_32k>;
201
202	buttons {
203		pwr_key: pwr-key {
204			rockchip,pins = <0 RK_PA6 0 &pcfg_pull_up>;
205		};
206	};
207
208	usb {
209		usb_drv: usb-drv {
210			rockchip,pins = <0 RK_PC5 0 &pcfg_pull_none>;
211		};
212	};
213
214	sdio-pwrseq {
215		wifi_enable_h: wifi-enable-h {
216			rockchip,pins = <0 RK_PA2 0 &pcfg_pull_none>;
217		};
218	};
219};
220
221&pwm0 {
222	status = "okay";
223	pinctrl-0 = <&pwm0_pin_pull_down>;
224};
225
226&uart4 {
227	pinctrl-names = "default";
228	pinctrl-0 = <&uart4_xfer>;
229	status = "okay";
230};
231