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