1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2020 Aditya Prayoga <aditya@kobol.io>
4 */
5
6/*
7 * The Kobol Helios64 is a board designed to operate as a NAS and optionally
8 * ships with an enclosing that can host five 2.5" hard disks.
9 *
10 * See https://wiki.kobol.io/helios64/intro/ for further details.
11 */
12
13/dts-v1/;
14#include "rk3399.dtsi"
15#include "rk3399-opp.dtsi"
16
17/ {
18	model = "Kobol Helios64";
19	compatible = "kobol,helios64", "rockchip,rk3399";
20
21	aliases {
22		mmc0 = &sdmmc;
23		mmc1 = &sdhci;
24	};
25
26	avdd_0v9_s0: avdd-0v9-s0 {
27		compatible = "regulator-fixed";
28		regulator-name = "avdd_0v9_s0";
29		regulator-always-on;
30		regulator-boot-on;
31		regulator-min-microvolt = <900000>;
32		regulator-max-microvolt = <900000>;
33		vin-supply = <&vcc1v8_sys_s3>;
34	};
35
36	avdd_1v8_s0: avdd-1v8-s0 {
37		compatible = "regulator-fixed";
38		regulator-name = "avdd_1v8_s0";
39		regulator-always-on;
40		regulator-boot-on;
41		regulator-min-microvolt = <1800000>;
42		regulator-max-microvolt = <1800000>;
43		vin-supply = <&vcc3v3_sys_s3>;
44	};
45
46	clkin_gmac: external-gmac-clock {
47		compatible = "fixed-clock";
48		clock-frequency = <125000000>;
49		clock-output-names = "clkin_gmac";
50		#clock-cells = <0>;
51	};
52
53	fan1 {
54		/* fan connected to P7 */
55		compatible = "pwm-fan";
56		pwms = <&pwm0 0 40000 0>;
57		cooling-levels = <0 80 170 255>;
58	};
59
60	fan2 {
61		/* fan connected to P6 */
62		compatible = "pwm-fan";
63		pwms = <&pwm1 0 40000 0>;
64		cooling-levels = <0 80 170 255>;
65	};
66
67	leds {
68		compatible = "gpio-leds";
69		pinctrl-names = "default";
70		pinctrl-0 = <&sys_grn_led_on &sys_red_led_on>;
71
72		led-0 {
73			label = "helios64:green:status";
74			gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
75			default-state = "on";
76		};
77
78		led-1 {
79			label = "helios64:red:fault";
80			gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
81			default-state = "keep";
82		};
83	};
84
85	pcie_power: pcie-power {
86		compatible = "regulator-fixed";
87		enable-active-high;
88		gpio = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;
89		pinctrl-0 = <&pcie_pwr>;
90		pinctrl-names = "default";
91		regulator-boot-on;
92		regulator-name = "pcie_power";
93		startup-delay-us = <10000>;
94		vin-supply = <&vcc5v0_perdev>;
95	};
96
97	vcc1v8_sys_s0: vcc1v8-sys-s0 {
98		compatible = "regulator-fixed";
99		regulator-name = "vcc1v8_sys_s0";
100		regulator-always-on;
101		regulator-boot-on;
102		regulator-min-microvolt = <1800000>;
103		regulator-max-microvolt = <1800000>;
104		vin-supply = <&vcc1v8_sys_s3>;
105	};
106
107	vcc3v0_sd: vcc3v0-sd {
108		compatible = "regulator-fixed";
109		enable-active-high;
110		gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
111		regulator-name = "vcc3v0_sd";
112		regulator-boot-on;
113		regulator-min-microvolt = <3000000>;
114		regulator-max-microvolt = <3000000>;
115		pinctrl-names = "default";
116		pinctrl-0 = <&sdmmc0_pwr_h>;
117		vin-supply = <&vcc3v3_sys_s3>;
118	};
119
120	vcc3v3_sys_s3: vcc_lan: vcc3v3-sys-s3 {
121		compatible = "regulator-fixed";
122		regulator-name = "vcc3v3_sys_s3";
123		regulator-always-on;
124		regulator-boot-on;
125		regulator-min-microvolt = <3300000>;
126		regulator-max-microvolt = <3300000>;
127		vin-supply = <&vcc5v0_sys>;
128
129		regulator-state-mem {
130			regulator-on-in-suspend;
131		};
132	};
133
134	vcc5v0_perdev: vcc5v0-perdev {
135		compatible = "regulator-fixed";
136		regulator-name = "vcc5v0_perdev";
137		regulator-always-on;
138		regulator-boot-on;
139		regulator-min-microvolt = <5000000>;
140		regulator-max-microvolt = <5000000>;
141		vin-supply = <&vcc12v_dcin_bkup>;
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		vin-supply = <&vcc12v_dcin_bkup>;
152
153		regulator-state-mem {
154			regulator-on-in-suspend;
155		};
156	};
157
158	vcc5v0_usb: vcc5v0-usb {
159		compatible = "regulator-fixed";
160		enable-active-high;
161		gpio = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>;
162		pinctrl-names = "default";
163		pinctrl-0 = <&vcc5v0_usb_en>;
164		regulator-name = "vcc5v0_usb";
165		regulator-always-on;
166		regulator-boot-on;
167		regulator-min-microvolt = <5000000>;
168		regulator-max-microvolt = <5000000>;
169		vin-supply = <&vcc5v0_perdev>;
170	};
171
172	vcc12v_dcin: vcc12v-dcin {
173		compatible = "regulator-fixed";
174		regulator-name = "vcc12v_dcin";
175		regulator-always-on;
176		regulator-boot-on;
177		regulator-min-microvolt = <12000000>;
178		regulator-max-microvolt = <12000000>;
179	};
180
181	vcc12v_dcin_bkup: vcc12v-dcin-bkup {
182		compatible = "regulator-fixed";
183		regulator-name = "vcc12v_dcin_bkup";
184		regulator-always-on;
185		regulator-boot-on;
186		regulator-min-microvolt = <12000000>;
187		regulator-max-microvolt = <12000000>;
188		vin-supply = <&vcc12v_dcin>;
189	};
190};
191
192/*
193 * The system doesn't run stable with cpu freq enabled, so disallow the lower
194 * frequencies until this problem is properly understood and resolved.
195 */
196&cluster0_opp {
197	/delete-node/ opp00;
198	/delete-node/ opp01;
199	/delete-node/ opp02;
200	/delete-node/ opp03;
201	/delete-node/ opp04;
202};
203
204&cluster1_opp {
205	/delete-node/ opp00;
206	/delete-node/ opp01;
207	/delete-node/ opp02;
208	/delete-node/ opp03;
209	/delete-node/ opp04;
210	/delete-node/ opp05;
211	/delete-node/ opp06;
212};
213
214&cpu_b0 {
215	cpu-supply = <&vdd_cpu_b>;
216};
217
218&cpu_b1 {
219	cpu-supply = <&vdd_cpu_b>;
220};
221
222&cpu_l0 {
223	cpu-supply = <&vdd_cpu_l>;
224};
225
226&cpu_l1 {
227	cpu-supply = <&vdd_cpu_l>;
228};
229
230&cpu_l2 {
231	cpu-supply = <&vdd_cpu_l>;
232};
233
234&cpu_l3 {
235	cpu-supply = <&vdd_cpu_l>;
236};
237
238&emmc_phy {
239	status = "okay";
240};
241
242&gmac {
243	assigned-clock-parents = <&clkin_gmac>;
244	assigned-clocks = <&cru SCLK_RMII_SRC>;
245	clock_in_out = "input";
246	phy-mode = "rgmii";
247	phy-supply = <&vcc_lan>;
248	pinctrl-names = "default";
249	pinctrl-0 = <&rgmii_pins &gphy_reset>;
250	rx_delay = <0x20>;
251	tx_delay = <0x28>;
252	snps,reset-active-low;
253	snps,reset-delays-us = <0 10000 50000>;
254	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
255	status = "okay";
256};
257
258&i2c0 {
259	clock-frequency = <400000>;
260	i2c-scl-rising-time-ns = <168>;
261	i2c-scl-falling-time-ns = <4>;
262	status = "okay";
263
264	rk808: pmic@1b {
265		compatible = "rockchip,rk808";
266		reg = <0x1b>;
267		interrupt-parent = <&gpio0>;
268		interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
269		clock-output-names = "xin32k", "rk808-clkout2";
270		pinctrl-names = "default";
271		pinctrl-0 = <&pmic_int_l>;
272		vcc1-supply = <&vcc5v0_sys>;
273		vcc2-supply = <&vcc5v0_sys>;
274		vcc3-supply = <&vcc5v0_sys>;
275		vcc4-supply = <&vcc5v0_sys>;
276		vcc6-supply = <&vcc5v0_sys>;
277		vcc7-supply = <&vcc5v0_sys>;
278		vcc8-supply = <&vcc3v3_sys_s3>;
279		vcc9-supply = <&vcc5v0_sys>;
280		vcc10-supply = <&vcc5v0_sys>;
281		vcc11-supply = <&vcc5v0_sys>;
282		vcc12-supply = <&vcc3v3_sys_s3>;
283		vddio-supply = <&vcc3v0_s3>;
284		wakeup-source;
285		#clock-cells = <1>;
286
287		regulators {
288			vdd_cpu_l: DCDC_REG2 {
289				regulator-name = "vdd_cpu_l";
290				regulator-always-on;
291				regulator-boot-on;
292				regulator-min-microvolt = <750000>;
293				regulator-max-microvolt = <1350000>;
294				regulator-ramp-delay = <6001>;
295
296				regulator-state-mem {
297					regulator-off-in-suspend;
298				};
299			};
300
301			vcc1v8_sys_s3: DCDC_REG4 {
302				regulator-name = "vcc1v8_sys_s3";
303				regulator-always-on;
304				regulator-boot-on;
305				regulator-min-microvolt = <1800000>;
306				regulator-max-microvolt = <1800000>;
307
308				regulator-state-mem {
309					regulator-on-in-suspend;
310					regulator-suspend-microvolt = <1800000>;
311				};
312			};
313
314			vcc_sdio_s0: LDO_REG4 {
315				regulator-name = "vcc_sdio_s0";
316				regulator-always-on;
317				regulator-boot-on;
318				regulator-min-microvolt = <1800000>;
319				regulator-max-microvolt = <3000000>;
320
321				regulator-state-mem {
322					regulator-on-in-suspend;
323					regulator-suspend-microvolt = <3000000>;
324				};
325			};
326
327			vcc3v0_s3: LDO_REG8 {
328				regulator-name = "vcc3v0_s3";
329				regulator-always-on;
330				regulator-boot-on;
331				regulator-min-microvolt = <3000000>;
332				regulator-max-microvolt = <3000000>;
333
334				regulator-state-mem {
335					regulator-on-in-suspend;
336					regulator-suspend-microvolt = <3000000>;
337				};
338			};
339		};
340	};
341
342	vdd_cpu_b: regulator@40 {
343		compatible = "silergy,syr827";
344		reg = <0x40>;
345		fcs,suspend-voltage-selector = <1>;
346		regulator-name = "vdd_cpu_b";
347		regulator-always-on;
348		regulator-boot-on;
349		regulator-min-microvolt = <712500>;
350		regulator-max-microvolt = <1500000>;
351		regulator-ramp-delay = <1000>;
352		vin-supply = <&vcc5v0_sys>;
353
354		regulator-state-mem {
355			regulator-off-in-suspend;
356		};
357	};
358};
359
360&i2c2 {
361	clock-frequency = <400000>;
362	i2c-scl-rising-time-ns = <160>;
363	i2c-scl-falling-time-ns = <30>;
364	status = "okay";
365
366	temp@4c {
367		compatible = "national,lm75";
368		reg = <0x4c>;
369	};
370};
371
372&io_domains {
373	audio-supply = <&vcc1v8_sys_s0>;
374	bt656-supply = <&vcc1v8_sys_s0>;
375	gpio1830-supply = <&vcc3v0_s3>;
376	sdmmc-supply = <&vcc_sdio_s0>;
377	status = "okay";
378};
379
380&pcie_phy {
381	status = "okay";
382};
383
384&pcie0 {
385	num-lanes = <2>;
386	status = "okay";
387
388	vpcie12v-supply = <&vcc12v_dcin>;
389	vpcie3v3-supply = <&pcie_power>;
390	vpcie1v8-supply = <&avdd_1v8_s0>;
391	vpcie0v9-supply = <&avdd_0v9_s0>;
392};
393
394&pinctrl {
395	gmac {
396		gphy_reset: gphy-reset {
397			rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_output_low>;
398		};
399	};
400
401	leds {
402		sys_grn_led_on: sys-grn-led-on {
403			rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_down>;
404		};
405
406		sys_red_led_on: sys-red-led-on {
407			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_down>;
408		};
409	};
410
411	pcie {
412		pcie_pwr: pcie-pwr {
413			rockchip,pins =
414				<1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
415		};
416	};
417
418	pmic {
419		pmic_int_l: pmic-int-l {
420			rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
421		};
422	};
423
424	power {
425		vcc5v0_usb_en: vcc5v0-usb-en {
426			rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
427		};
428	};
429
430	vcc3v0-sd {
431		sdmmc0_pwr_h: sdmmc0-pwr-h {
432			rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
433		};
434	};
435};
436
437&pmu_io_domains {
438	pmu1830-supply = <&vcc3v0_s3>;
439	status = "okay";
440};
441
442&pwm0 {
443	/* pwm-fan on P7 */
444	status = "okay";
445};
446
447&pwm1 {
448	/* pwm-fan on P6 */
449	status = "okay";
450};
451
452&sdhci {
453	bus-width = <8>;
454	mmc-hs200-1_8v;
455	non-removable;
456	vqmmc-supply = <&vcc1v8_sys_s0>;
457	status = "okay";
458};
459
460&sdmmc {
461	bus-width = <4>;
462	cap-sd-highspeed;
463	cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
464	disable-wp;
465	pinctrl-names = "default";
466	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
467	vmmc-supply = <&vcc3v0_sd>;
468	vqmmc-supply = <&vcc_sdio_s0>;
469	status = "okay";
470};
471
472&tcphy1 {
473	/* phy for &usbdrd_dwc3_1 */
474	status = "okay";
475};
476
477&u2phy1 {
478	status = "okay";
479
480	otg-port {
481		/* phy for &usbdrd_dwc3_1 */
482		phy-supply = <&vcc5v0_usb>;
483		status = "okay";
484	};
485};
486
487&uart2 {
488	status = "okay";
489};
490
491&usbdrd3_1 {
492	status = "okay";
493
494	usb@fe900000 {
495		dr_mode = "host";
496		status = "okay";
497	};
498};
499