1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd
4 */
5
6/dts-v1/;
7#include <dt-bindings/gpio/gpio.h>
8#include <dt-bindings/input/input.h>
9#include <dt-bindings/pinctrl/rockchip.h>
10#include "px30.dtsi"
11
12/ {
13	model = "Rockchip PX30 EVB";
14	compatible = "rockchip,px30-evb", "rockchip,px30";
15
16	chosen {
17		stdout-path = "serial2:1500000n8";
18	};
19
20	adc-keys {
21		compatible = "adc-keys";
22		io-channels = <&saradc 2>;
23		io-channel-names = "buttons";
24		keyup-threshold-microvolt = <1800000>;
25		poll-interval = <100>;
26
27		esc-key {
28			label = "esc";
29			linux,code = <KEY_ESC>;
30			press-threshold-microvolt = <1310000>;
31		};
32
33		home-key {
34			label = "home";
35			linux,code = <KEY_HOME>;
36			press-threshold-microvolt = <624000>;
37		};
38
39		menu-key {
40			label = "menu";
41			linux,code = <KEY_MENU>;
42			press-threshold-microvolt = <987000>;
43		};
44
45		vol-down-key {
46			label = "volume down";
47			linux,code = <KEY_VOLUMEDOWN>;
48			press-threshold-microvolt = <300000>;
49		};
50
51		vol-up-key {
52			label = "volume up";
53			linux,code = <KEY_VOLUMEUP>;
54			press-threshold-microvolt = <17000>;
55		};
56	};
57
58	backlight: backlight {
59		compatible = "pwm-backlight";
60		pwms = <&pwm1 0 25000 0>;
61	};
62
63	sdio_pwrseq: sdio-pwrseq {
64		compatible = "mmc-pwrseq-simple";
65		pinctrl-names = "default";
66		pinctrl-0 = <&wifi_enable_h>;
67
68		/*
69		 * On the module itself this is one of these (depending
70		 * on the actual card populated):
71		 * - SDIO_RESET_L_WL_REG_ON
72		 * - PDN (power down when low)
73		 */
74		reset-gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>; /* GPIO3_A4 */
75	};
76
77	vcc_phy: vcc-phy-regulator {
78		compatible = "regulator-fixed";
79		regulator-name = "vcc_phy";
80		regulator-always-on;
81		regulator-boot-on;
82	};
83
84	vcc5v0_sys: vccsys {
85		compatible = "regulator-fixed";
86		regulator-name = "vcc5v0_sys";
87		regulator-always-on;
88		regulator-boot-on;
89		regulator-min-microvolt = <5000000>;
90		regulator-max-microvolt = <5000000>;
91	};
92};
93
94&display_subsystem {
95	status = "okay";
96};
97
98&emmc {
99	bus-width = <8>;
100	cap-mmc-highspeed;
101	mmc-hs200-1_8v;
102	non-removable;
103	status = "okay";
104};
105
106&gmac {
107	clock_in_out = "output";
108	phy-supply = <&vcc_phy>;
109	snps,reset-gpio = <&gpio2 13 GPIO_ACTIVE_LOW>;
110	snps,reset-active-low;
111	snps,reset-delays-us = <0 50000 50000>;
112	status = "okay";
113};
114
115&i2c0 {
116	status = "okay";
117};
118
119&i2s1_2ch {
120	status = "okay";
121};
122
123&io_domains {
124	status = "okay";
125};
126
127&pinctrl {
128	headphone {
129		hp_det: hp-det {
130			rockchip,pins =
131				<2 RK_PB0 RK_FUNC_GPIO &pcfg_pull_down>;
132		};
133	};
134
135	pmic {
136		pmic_int: pmic_int {
137			rockchip,pins =
138				<0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>;
139		};
140
141		soc_slppin_gpio: soc_slppin_gpio {
142			rockchip,pins =
143				<0 RK_PA4 RK_FUNC_GPIO &pcfg_output_low>;
144		};
145
146		soc_slppin_slp: soc_slppin_slp {
147			rockchip,pins =
148				<0 RK_PA4 RK_FUNC_1 &pcfg_pull_none>;
149		};
150
151		soc_slppin_rst: soc_slppin_rst {
152			rockchip,pins =
153				<0 RK_PA4 RK_FUNC_2 &pcfg_pull_none>;
154		};
155	};
156
157	sdio-pwrseq {
158		wifi_enable_h: wifi-enable-h {
159			rockchip,pins =
160				<0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
161		};
162	};
163};
164
165&pmu_io_domains {
166	status = "okay";
167};
168
169&pwm1 {
170	status = "okay";
171};
172
173&saradc {
174	status = "okay";
175};
176
177&sdmmc {
178	bus-width = <4>;
179	cap-mmc-highspeed;
180	cap-sd-highspeed;
181	card-detect-delay = <800>;
182	sd-uhs-sdr12;
183	sd-uhs-sdr25;
184	sd-uhs-sdr50;
185	sd-uhs-sdr104;
186	status = "okay";
187};
188
189&sdio {
190	bus-width = <4>;
191	cap-sd-highspeed;
192	keep-power-in-suspend;
193	non-removable;
194	mmc-pwrseq = <&sdio_pwrseq>;
195	sd-uhs-sdr104;
196	status = "okay";
197};
198
199&uart1 {
200	pinctrl-names = "default";
201	pinctrl-0 = <&uart1_xfer &uart1_cts>;
202	status = "okay";
203};
204
205&uart2 {
206	status = "okay";
207};
208
209&usb20_otg {
210	status = "okay";
211};
212
213&usb_host0_ehci {
214	status = "okay";
215};
216
217&usb_host0_ohci {
218	status = "okay";
219};
220
221&vopb {
222	status = "okay";
223};
224
225&vopb_mmu {
226	status = "okay";
227};
228
229&vopl {
230	status = "okay";
231};
232
233&vopl_mmu {
234	status = "okay";
235};
236