1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2016 Fuzhou Rockchip Electronics Co., Ltd
4 */
5
6/dts-v1/;
7#include <dt-bindings/pwm/pwm.h>
8#include "rk3399.dtsi"
9
10/ {
11	model = "Rockchip RK3399 Evaluation Board";
12	compatible = "rockchip,rk3399-evb", "rockchip,rk3399",
13		     "google,rk3399evb-rev2";
14
15	backlight: backlight {
16		compatible = "pwm-backlight";
17		brightness-levels = <
18			  0   1   2   3   4   5   6   7
19			  8   9  10  11  12  13  14  15
20			 16  17  18  19  20  21  22  23
21			 24  25  26  27  28  29  30  31
22			 32  33  34  35  36  37  38  39
23			 40  41  42  43  44  45  46  47
24			 48  49  50  51  52  53  54  55
25			 56  57  58  59  60  61  62  63
26			 64  65  66  67  68  69  70  71
27			 72  73  74  75  76  77  78  79
28			 80  81  82  83  84  85  86  87
29			 88  89  90  91  92  93  94  95
30			 96  97  98  99 100 101 102 103
31			104 105 106 107 108 109 110 111
32			112 113 114 115 116 117 118 119
33			120 121 122 123 124 125 126 127
34			128 129 130 131 132 133 134 135
35			136 137 138 139 140 141 142 143
36			144 145 146 147 148 149 150 151
37			152 153 154 155 156 157 158 159
38			160 161 162 163 164 165 166 167
39			168 169 170 171 172 173 174 175
40			176 177 178 179 180 181 182 183
41			184 185 186 187 188 189 190 191
42			192 193 194 195 196 197 198 199
43			200 201 202 203 204 205 206 207
44			208 209 210 211 212 213 214 215
45			216 217 218 219 220 221 222 223
46			224 225 226 227 228 229 230 231
47			232 233 234 235 236 237 238 239
48			240 241 242 243 244 245 246 247
49			248 249 250 251 252 253 254 255>;
50		default-brightness-level = <200>;
51		enable-gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
52		pwms = <&pwm0 0 25000 0>;
53	};
54
55	clkin_gmac: external-gmac-clock {
56		compatible = "fixed-clock";
57		clock-frequency = <125000000>;
58		clock-output-names = "clkin_gmac";
59		#clock-cells = <0>;
60	};
61
62	vdd_center: vdd-center {
63		compatible = "pwm-regulator";
64		pwms = <&pwm3 0 25000 0>;
65		regulator-name = "vdd_center";
66		regulator-min-microvolt = <800000>;
67		regulator-max-microvolt = <1400000>;
68		regulator-always-on;
69		regulator-boot-on;
70		status = "okay";
71	};
72
73	vcc3v3_sys: vcc3v3-sys {
74		compatible = "regulator-fixed";
75		regulator-name = "vcc3v3_sys";
76		regulator-always-on;
77		regulator-boot-on;
78		regulator-min-microvolt = <3300000>;
79		regulator-max-microvolt = <3300000>;
80	};
81
82	vcc5v0_sys: vcc5v0-sys {
83		compatible = "regulator-fixed";
84		regulator-name = "vcc5v0_sys";
85		regulator-always-on;
86		regulator-boot-on;
87		regulator-min-microvolt = <5000000>;
88		regulator-max-microvolt = <5000000>;
89	};
90
91	vcc5v0_host: vcc5v0-host-regulator {
92		compatible = "regulator-fixed";
93		enable-active-high;
94		gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
95		pinctrl-names = "default";
96		pinctrl-0 = <&vcc5v0_host_en>;
97		regulator-name = "vcc5v0_host";
98		vin-supply = <&vcc5v0_sys>;
99	};
100
101	vcc_phy: vcc-phy-regulator {
102		compatible = "regulator-fixed";
103		regulator-name = "vcc_phy";
104		regulator-always-on;
105		regulator-boot-on;
106	};
107
108	vcc_phy: vcc-phy-regulator {
109		compatible = "regulator-fixed";
110		regulator-name = "vcc_phy";
111		regulator-always-on;
112		regulator-boot-on;
113	};
114
115};
116
117&emmc_phy {
118	status = "okay";
119};
120
121&gmac {
122	assigned-clocks = <&cru SCLK_RMII_SRC>;
123	assigned-clock-parents = <&clkin_gmac>;
124	clock_in_out = "input";
125	phy-supply = <&vcc_phy>;
126	phy-mode = "rgmii";
127	pinctrl-names = "default";
128	pinctrl-0 = <&rgmii_pins>;
129	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
130	snps,reset-active-low;
131	snps,reset-delays-us = <0 10000 50000>;
132	tx_delay = <0x28>;
133	rx_delay = <0x11>;
134	status = "okay";
135};
136
137&i2c0 {
138	status = "okay";
139
140	rk808: pmic@1b {
141		compatible = "rockchip,rk808";
142		reg = <0x1b>;
143		interrupt-parent = <&gpio1>;
144		interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
145		pinctrl-names = "default";
146		pinctrl-0 = <&pmic_int_l>;
147		rockchip,system-power-controller;
148		wakeup-source;
149		#clock-cells = <1>;
150		clock-output-names = "rk808-clkout1", "rk808-clkout2";
151
152		vcc1-supply = <&vcc3v3_sys>;
153		vcc2-supply = <&vcc3v3_sys>;
154		vcc3-supply = <&vcc3v3_sys>;
155		vcc4-supply = <&vcc3v3_sys>;
156		vcc6-supply = <&vcc3v3_sys>;
157		vcc7-supply = <&vcc3v3_sys>;
158		vcc8-supply = <&vcc3v3_sys>;
159		vcc9-supply = <&vcc3v3_sys>;
160		vcc10-supply = <&vcc3v3_sys>;
161		vcc11-supply = <&vcc3v3_sys>;
162		vcc12-supply = <&vcc3v3_sys>;
163		vddio-supply = <&vcc1v8_pmu>;
164
165		regulators {
166			vdd_log: DCDC_REG1 {
167				regulator-name = "vdd_log";
168				regulator-min-microvolt = <750000>;
169				regulator-max-microvolt = <1350000>;
170				regulator-ramp-delay = <6001>;
171				regulator-always-on;
172				regulator-boot-on;
173				regulator-state-mem {
174					regulator-on-in-suspend;
175					regulator-suspend-microvolt = <900000>;
176				};
177			};
178
179			vdd_cpu_l: DCDC_REG2 {
180				regulator-name = "vdd_cpu_l";
181				regulator-min-microvolt = <750000>;
182				regulator-max-microvolt = <1350000>;
183				regulator-ramp-delay = <6001>;
184				regulator-always-on;
185				regulator-boot-on;
186				regulator-state-mem {
187					regulator-off-in-suspend;
188				};
189			};
190
191			vcc_ddr: DCDC_REG3 {
192				regulator-name = "vcc_ddr";
193				regulator-always-on;
194				regulator-boot-on;
195				regulator-state-mem {
196					regulator-on-in-suspend;
197				};
198			};
199
200			vcc_1v8: DCDC_REG4 {
201				regulator-name = "vcc_1v8";
202				regulator-min-microvolt = <1800000>;
203				regulator-max-microvolt = <1800000>;
204				regulator-always-on;
205				regulator-boot-on;
206				regulator-state-mem {
207					regulator-on-in-suspend;
208					regulator-suspend-microvolt = <1800000>;
209				};
210			};
211
212			vcc1v8_dvp: LDO_REG1 {
213				regulator-name = "vcc1v8_dvp";
214				regulator-min-microvolt = <1800000>;
215				regulator-max-microvolt = <1800000>;
216				regulator-always-on;
217				regulator-boot-on;
218				regulator-state-mem {
219					regulator-off-in-suspend;
220				};
221			};
222
223			vcc3v0_tp: LDO_REG2 {
224				regulator-name = "vcc3v0_tp";
225				regulator-min-microvolt = <3000000>;
226				regulator-max-microvolt = <3000000>;
227				regulator-always-on;
228				regulator-boot-on;
229				regulator-state-mem {
230					regulator-off-in-suspend;
231				};
232			};
233
234			vcc1v8_pmu: LDO_REG3 {
235				regulator-name = "vcc1v8_pmu";
236				regulator-min-microvolt = <1800000>;
237				regulator-max-microvolt = <1800000>;
238				regulator-always-on;
239				regulator-boot-on;
240				regulator-state-mem {
241					regulator-on-in-suspend;
242					regulator-suspend-microvolt = <1800000>;
243				};
244			};
245
246			vcc_sd: LDO_REG4 {
247				regulator-name = "vcc_sd";
248				regulator-min-microvolt = <1800000>;
249				regulator-max-microvolt = <3000000>;
250				regulator-always-on;
251				regulator-boot-on;
252				regulator-state-mem {
253					regulator-on-in-suspend;
254					regulator-suspend-microvolt = <3000000>;
255				};
256			};
257
258			vcca3v0_codec: LDO_REG5 {
259				regulator-name = "vcca3v0_codec";
260				regulator-min-microvolt = <3000000>;
261				regulator-max-microvolt = <3000000>;
262				regulator-always-on;
263				regulator-boot-on;
264				regulator-state-mem {
265					regulator-off-in-suspend;
266				};
267			};
268
269			vcc_1v5: LDO_REG6 {
270				regulator-name = "vcc_1v5";
271				regulator-min-microvolt = <1500000>;
272				regulator-max-microvolt = <1500000>;
273				regulator-always-on;
274				regulator-boot-on;
275				regulator-state-mem {
276					regulator-on-in-suspend;
277					regulator-suspend-microvolt = <1500000>;
278				};
279			};
280
281			vcca1v8_codec: LDO_REG7 {
282				regulator-name = "vcca1v8_codec";
283				regulator-min-microvolt = <1800000>;
284				regulator-max-microvolt = <1800000>;
285				regulator-always-on;
286				regulator-boot-on;
287				regulator-state-mem {
288					regulator-off-in-suspend;
289				};
290			};
291
292			vcc_3v0: LDO_REG8 {
293				regulator-name = "vcc_3v0";
294				regulator-min-microvolt = <3000000>;
295				regulator-max-microvolt = <3000000>;
296				regulator-always-on;
297				regulator-boot-on;
298				regulator-state-mem {
299					regulator-on-in-suspend;
300					regulator-suspend-microvolt = <3000000>;
301				};
302			};
303
304			vcc3v3_s3: SWITCH_REG1 {
305				regulator-name = "vcc3v3_s3";
306				regulator-always-on;
307				regulator-boot-on;
308				regulator-state-mem {
309					regulator-on-in-suspend;
310				};
311			};
312
313			vcc3v3_s0: SWITCH_REG2 {
314				regulator-name = "vcc3v3_s0";
315				regulator-always-on;
316				regulator-boot-on;
317				regulator-state-mem {
318					regulator-off-in-suspend;
319				};
320			};
321		};
322	};
323
324	vdd_cpu_b: regulator@40 {
325		compatible = "silergy,syr827";
326		reg = <0x40>;
327		fcs,suspend-voltage-selector = <1>;
328		regulator-name = "vdd_cpu_b";
329		regulator-min-microvolt = <712500>;
330		regulator-max-microvolt = <1500000>;
331		regulator-ramp-delay = <1000>;
332		regulator-always-on;
333		regulator-boot-on;
334		vin-supply = <&vcc5v0_sys>;
335
336		regulator-state-mem {
337			regulator-off-in-suspend;
338		};
339	};
340
341	vdd_gpu: regulator@41 {
342		compatible = "silergy,syr828";
343		reg = <0x41>;
344		fcs,suspend-voltage-selector = <1>;
345		regulator-name = "vdd_gpu";
346		regulator-min-microvolt = <712500>;
347		regulator-max-microvolt = <1500000>;
348		regulator-ramp-delay = <1000>;
349		regulator-always-on;
350		regulator-boot-on;
351		vin-supply = <&vcc5v0_sys>;
352
353		regulator-state-mem {
354			regulator-off-in-suspend;
355		};
356	};
357};
358
359&pwm0 {
360	status = "okay";
361};
362
363&pwm2 {
364	status = "okay";
365};
366
367&pwm3 {
368	status = "okay";
369};
370
371&sdhci {
372	bus-width = <8>;
373	mmc-hs400-1_8v;
374	mmc-hs400-enhanced-strobe;
375	non-removable;
376	status = "okay";
377};
378
379&pcie_phy {
380	status = "disabled";
381};
382
383&pcie0 {
384	ep-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>;
385	num-lanes = <4>;
386	pinctrl-names = "default";
387	pinctrl-0 = <&pcie_clkreqn_cpm>;
388	status = "disabled";
389};
390
391&u2phy0 {
392	status = "okay";
393};
394
395&u2phy0_host {
396	phy-supply = <&vcc5v0_host>;
397	status = "okay";
398};
399
400&u2phy1 {
401	status = "okay";
402};
403
404&u2phy1_host {
405	phy-supply = <&vcc5v0_host>;
406	status = "okay";
407};
408
409&uart2 {
410	status = "okay";
411};
412
413&usb_host0_ehci {
414	status = "okay";
415};
416
417&usb_host0_ohci {
418	status = "okay";
419};
420
421&usb_host1_ehci {
422	status = "okay";
423};
424
425&usb_host1_ohci {
426	status = "okay";
427};
428
429&pinctrl {
430	pmic {
431		pmic_int_l: pmic-int-l {
432			rockchip,pins =
433				<1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
434		};
435	};
436
437	usb2 {
438		vcc5v0_host_en: vcc5v0-host-en {
439			rockchip,pins =
440				<4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
441		};
442	};
443};
444