xref: /rk3399_rockchip-uboot/arch/arm/dts/rk3399-evb.dts (revision 87e4c6020eff05133e40ab8b7b0e37e6a2be37e4)
1/*
2 * (C) Copyright 2016 Rockchip Electronics Co., Ltd
3 *
4 * SPDX-License-Identifier:     GPL-2.0+
5 */
6
7/dts-v1/;
8#include <dt-bindings/pwm/pwm.h>
9#include <dt-bindings/pinctrl/rockchip.h>
10#include "rk3399.dtsi"
11#include "rk3399-sdram-lpddr3-4GB-1600.dtsi"
12#include "rk3399-u-boot.dtsi"
13#include <linux/media-bus-format.h>
14#include <dt-bindings/input/input.h>
15
16/ {
17	model = "Rockchip RK3399 Evaluation Board";
18	compatible = "rockchip,rk3399-evb", "rockchip,rk3399",
19		     "google,rk3399evb-rev2";
20
21	/* RK3399 evb board */
22	rk_key0 {
23		u-boot,dm-pre-reloc;
24		compatible = "rockchip,key";
25		status = "okay";
26		io-channels = <&saradc 1>;
27
28		vol-up-key0 {
29			u-boot,dm-pre-reloc;
30			linux,code = <KEY_VOLUMEUP>;
31			label = "volume up";
32			rockchip,adc_value = <1>;
33		};
34	};
35
36	/* RK3399PRO evb board */
37	rk_key1 {
38		u-boot,dm-pre-reloc;
39		compatible = "rockchip,key";
40		status = "okay";
41		io-channels = <&saradc 2>;
42
43		vol-up-key1 {
44			u-boot,dm-pre-reloc;
45			linux,code = <KEY_VOLUMEUP>;
46			label = "volume up";
47			rockchip,adc_value = <10>;
48		};
49	};
50
51	vdd_center: vdd-center {
52		compatible = "pwm-regulator";
53		pwms = <&pwm3 0 25000 1>;
54		regulator-name = "vdd_center";
55		regulator-min-microvolt = <800000>;
56		regulator-max-microvolt = <1400000>;
57		regulator-init-microvolt = <950000>;
58		regulator-always-on;
59		regulator-boot-on;
60		status = "okay";
61	};
62
63	vccsys: vccsys {
64		compatible = "regulator-fixed";
65		regulator-name = "vccsys";
66		regulator-boot-on;
67		regulator-always-on;
68	};
69
70	vcc3v3_sys: vcc3v3-sys {
71		compatible = "regulator-fixed";
72		regulator-name = "vcc3v3_sys";
73		regulator-always-on;
74		regulator-boot-on;
75		regulator-min-microvolt = <3300000>;
76		regulator-max-microvolt = <3300000>;
77	};
78
79	vcc_phy: vcc-phy-regulator {
80		compatible = "regulator-fixed";
81		regulator-name = "vcc_phy";
82		regulator-always-on;
83		regulator-boot-on;
84	};
85
86	vcc5v0_host: vcc5v0-host-en {
87		compatible = "regulator-fixed";
88		regulator-name = "vcc5v0_host";
89		gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
90		regulator-min-microvolt = <5000000>;
91		regulator-max-microvolt = <5000000>;
92		regulator-always-on;
93		regulator-boot-on;
94	};
95
96	vcc5v0_typec0: vcc5v0-typec0-en {
97		compatible = "regulator-fixed";
98		regulator-name = "vcc5v0_typec0";
99		gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>;
100	};
101
102	vcc5v0_typec1: vcc5v0-typec1-en {
103		compatible = "regulator-fixed";
104		regulator-name = "vcc5v0_typec1";
105		gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>;
106	};
107
108	clkin_gmac: external-gmac-clock {
109		compatible = "fixed-clock";
110		clock-frequency = <125000000>;
111		clock-output-names = "clkin_gmac";
112		#clock-cells = <0>;
113	};
114
115	backlight: backlight {
116		compatible = "pwm-backlight";
117		power-supply = <&vccsys>;
118		enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
119		brightness-levels = <
120			  0   1   2   3   4   5   6   7
121			  8   9  10  11  12  13  14  15
122			 16  17  18  19  20  21  22  23
123			 24  25  26  27  28  29  30  31
124			 32  33  34  35  36  37  38  39
125			 40  41  42  43  44  45  46  47
126			 48  49  50  51  52  53  54  55
127			 56  57  58  59  60  61  62  63
128			 64  65  66  67  68  69  70  71
129			 72  73  74  75  76  77  78  79
130			 80  81  82  83  84  85  86  87
131			 88  89  90  91  92  93  94  95
132			 96  97  98  99 100 101 102 103
133			104 105 106 107 108 109 110 111
134			112 113 114 115 116 117 118 119
135			120 121 122 123 124 125 126 127
136			128 129 130 131 132 133 134 135
137			136 137 138 139 140 141 142 143
138			144 145 146 147 148 149 150 151
139			152 153 154 155 156 157 158 159
140			160 161 162 163 164 165 166 167
141			168 169 170 171 172 173 174 175
142			176 177 178 179 180 181 182 183
143			184 185 186 187 188 189 190 191
144			192 193 194 195 196 197 198 199
145			200 201 202 203 204 205 206 207
146			208 209 210 211 212 213 214 215
147			216 217 218 219 220 221 222 223
148			224 225 226 227 228 229 230 231
149			232 233 234 235 236 237 238 239
150			240 241 242 243 244 245 246 247
151			248 249 250 251 252 253 254 255>;
152		default-brightness-level = <200>;
153		pwms = <&pwm0 0 25000 0>;
154		pinctrl-names = "default";
155		pinctrl-0 = <&pwm0_pin>;
156		pwm-delay-us = <10000>;
157		status = "disabled";
158	};
159
160	vcc5v0_sys: vcc5v0-sys {
161		compatible = "regulator-fixed";
162		regulator-name = "vcc5v0_sys";
163		regulator-always-on;
164		regulator-boot-on;
165		regulator-min-microvolt = <5000000>;
166		regulator-max-microvolt = <5000000>;
167	};
168
169	vcc_lcd: vcc-lcd {
170		compatible = "regulator-fixed";
171		regulator-name = "vcc_lcd";
172		gpio = <&gpio4 30 GPIO_ACTIVE_HIGH>;
173		startup-delay-us = <20000>;
174		enable-active-high;
175		regulator-min-microvolt = <3300000>;
176		regulator-max-microvolt = <3300000>;
177		regulator-boot-on;
178		vin-supply = <&vcc5v0_sys>;
179	};
180
181	panel: panel {
182		compatible = "simple-panel";
183		backlight = <&backlight>;
184		power-supply = <&vcc_lcd>;
185		enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
186		prepare-delay-ms = <20>;
187		enable-delay-ms = <20>;
188
189		display-timings {
190			native-mode = <&timing0>;
191
192			timing0: timing0 {
193				clock-frequency = <200000000>;
194				hactive = <1536>;
195				vactive = <2048>;
196				hfront-porch = <12>;
197				hsync-len = <16>;
198				hback-porch = <48>;
199				vfront-porch = <8>;
200				vsync-len = <4>;
201				vback-porch = <8>;
202				hsync-active = <0>;
203				vsync-active = <0>;
204				de-active = <0>;
205				pixelclk-active = <0>;
206			};
207		};
208
209		ports {
210			panel_in: endpoint {
211				remote-endpoint = <&edp_out>;
212			};
213		};
214	};
215
216};
217
218&crypto {
219	status = "okay";
220};
221
222&uart2 {
223	status = "okay";
224};
225
226&emmc_phy {
227	status = "okay";
228};
229
230&pwm0 {
231	status = "okay";
232};
233
234&pwm2 {
235	status = "okay";
236};
237
238&pwm3 {
239	status = "okay";
240};
241
242&saradc {
243	status = "okay";
244};
245
246&sdmmc {
247	bus-width = <4>;
248	status = "okay";
249};
250
251&sdhci {
252	bus-width = <8>;
253	mmc-hs400-1_8v;
254	mmc-hs400-enhanced-strobe;
255	non-removable;
256	status = "okay";
257};
258
259&usb_host0_ehci {
260	status = "okay";
261};
262
263&usb_host0_ohci {
264	status = "okay";
265};
266
267&dwc3_typec0 {
268	vbus-supply = <&vcc5v0_typec0>;
269	status = "okay";
270};
271
272&usb_host1_ehci {
273	status = "okay";
274};
275
276&usb_host1_ohci {
277	status = "okay";
278};
279
280&dwc3_typec1 {
281	vbus-supply = <&vcc5v0_typec1>;
282	status = "okay";
283};
284
285&i2c0 {
286	status = "okay";
287	clock-frequency = <400000>;
288	i2c-scl-falling-time-ns = <50>;
289	i2c-scl-rising-time-ns = <100>;
290
291	rk808: pmic@1b {
292		compatible = "rockchip,rk808";
293		clock-output-names = "xin32k", "wifibt_32kin";
294		interrupt-parent = <&gpio0>;
295		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
296		pinctrl-names = "default";
297		pinctrl-0 = <&pmic_int_l>;
298		reg = <0x1b>;
299		rockchip,system-power-controller;
300		#clock-cells = <1>;
301		status = "okay";
302
303		vcc12-supply = <&vcc3v3_sys>;
304
305		regulators {
306			vcc33_lcd: SWITCH_REG2 {
307				regulator-always-on;
308				regulator-boot-on;
309				regulator-name = "vcc33_lcd";
310			};
311		};
312	};
313};
314
315&mipi_dsi {
316	status = "disabled";
317	rockchip,panel = <&panel>;
318	display-timings {
319		timing0 {
320		bits-per-pixel = <24>;
321		clock-frequency = <160000000>;
322		hfront-porch = <120>;
323		hsync-len = <20>;
324		hback-porch = <21>;
325		hactive = <1200>;
326		vfront-porch = <21>;
327		vsync-len = <3>;
328		vback-porch = <18>;
329		vactive = <1920>;
330		hsync-active = <0>;
331		vsync-active = <0>;
332		de-active = <1>;
333		pixelclk-active = <0>;
334		};
335	};
336};
337
338&pinctrl {
339	pmic {
340		pmic_int_l: pmic-int-l {
341			rockchip,pins =
342				<1 21 RK_FUNC_GPIO &pcfg_pull_up>;
343		};
344
345		pmic_dvs2: pmic-dvs2 {
346			rockchip,pins =
347				<1 18 RK_FUNC_GPIO &pcfg_pull_down>;
348		};
349	};
350};
351
352&gmac {
353        phy-supply = <&vcc_phy>;
354	phy-mode = "rgmii";
355	clock_in_out = "input";
356	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
357	snps,reset-active-low;
358	snps,reset-delays-us = <0 10000 50000>;
359	assigned-clocks = <&cru SCLK_RMII_SRC>;
360	assigned-clock-parents = <&clkin_gmac>;
361	pinctrl-names = "default";
362	pinctrl-0 = <&rgmii_pins>;
363	tx_delay = <0x28>;
364	rx_delay = <0x11>;
365	status = "okay";
366};
367
368&backlight {
369	status = "okay";
370	enable-gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>;
371};
372
373&route_edp {
374	status = "okay";
375};
376
377&edp_in_vopl {
378	status = "disabled";
379};
380
381&edp_in_vopb {
382	status = "okay";
383};
384
385&edp {
386	status = "okay";
387	force-hpd;
388
389	ports {
390		port@1 {
391			reg = <1>;
392
393			edp_out: endpoint {
394				remote-endpoint = <&panel_in>;
395			};
396		};
397	};
398};
399
400&vopb {
401	status = "okay";
402};
403