xref: /linux/arch/arm64/boot/dts/rockchip/rk3568-qnap-tsx33.dtsi (revision 0cac5ce06e524755b3dac1e0a060b05992076d93)
1#include <dt-bindings/input/input.h>
2#include <dt-bindings/leds/common.h>
3#include <dt-bindings/gpio/gpio.h>
4#include "rk3568.dtsi"
5
6/ {
7	aliases {
8		mmc0 = &sdhci;
9		rtc0 = &rtc_rv8263;
10	};
11
12	chosen {
13		stdout-path = "serial2:115200n8";
14	};
15
16	keys {
17		compatible = "gpio-keys";
18		pinctrl-0 = <&copy_button_pin>, <&reset_button_pin>;
19		pinctrl-names = "default";
20
21		key-copy {
22			label = "copy";
23			gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
24			linux,code = <KEY_COPY>;
25		};
26
27		key-reset {
28			label = "reset";
29			gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_LOW>;
30			linux,code = <KEY_RESTART>;
31		};
32	};
33
34	leds: leds {
35		compatible = "gpio-leds";
36
37		led-0 {
38			color = <LED_COLOR_ID_GREEN>;
39			function = LED_FUNCTION_DISK;
40			gpios = <&gpio1 RK_PD5 GPIO_ACTIVE_LOW>;
41			label = "hdd1:green:disk";
42			linux,default-trigger = "disk-activity";
43			pinctrl-names = "default";
44			pinctrl-0 = <&hdd1_led_pin>;
45		};
46	};
47
48	dc_12v: regulator-dc-12v {
49		compatible = "regulator-fixed";
50		regulator-name = "dc_12v";
51		regulator-always-on;
52		regulator-boot-on;
53		regulator-min-microvolt = <12000000>;
54		regulator-max-microvolt = <12000000>;
55	};
56
57	vcc3v3_sys: regulator-vcc3v3-sys {
58		compatible = "regulator-fixed";
59		regulator-name = "vcc3v3_sys";
60		regulator-always-on;
61		regulator-boot-on;
62		regulator-min-microvolt = <3300000>;
63		regulator-max-microvolt = <3300000>;
64		vin-supply = <&dc_12v>;
65	};
66
67	vcc5v0_host: regulator-vcc5v0-host {
68		compatible = "regulator-fixed";
69		enable-active-high;
70		pinctrl-names = "default";
71		pinctrl-0 = <&vcc5v0_host_en>;
72		gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
73		regulator-name = "vcc5v0_host";
74		regulator-always-on;
75		regulator-boot-on;
76		regulator-min-microvolt = <5000000>;
77		regulator-max-microvolt = <5000000>;
78		vin-supply = <&vcc5v0_usb>;
79	};
80
81	vcc5v0_otg: regulator-vcc5v0-otg {
82		compatible = "regulator-fixed";
83		enable-active-high;
84		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
85		pinctrl-names = "default";
86		pinctrl-0 = <&vcc5v0_otg_en>;
87		regulator-name = "vcc5v0_otg";
88		regulator-always-on;
89		regulator-boot-on;
90		regulator-min-microvolt = <5000000>;
91		regulator-max-microvolt = <5000000>;
92		vin-supply = <&vcc5v0_usb>;
93	};
94
95	vcc5v0_sys: regulator-vcc5v0-sys {
96		compatible = "regulator-fixed";
97		regulator-name = "vcc5v0_sys";
98		regulator-always-on;
99		regulator-boot-on;
100		regulator-min-microvolt = <5000000>;
101		regulator-max-microvolt = <5000000>;
102		vin-supply = <&dc_12v>;
103	};
104
105	vcc5v0_usb: regulator-vcc5v0-usb {
106		compatible = "regulator-fixed";
107		regulator-name = "vcc5v0_usb";
108		regulator-always-on;
109		regulator-boot-on;
110		regulator-min-microvolt = <5000000>;
111		regulator-max-microvolt = <5000000>;
112		vin-supply = <&dc_12v>;
113	};
114};
115
116/* connected to usb_host0_xhci */
117&combphy0 {
118	status = "okay";
119};
120
121/* connected to sata1 */
122&combphy1 {
123	status = "okay";
124};
125
126&cpu0 {
127	cpu-supply = <&vdd_cpu>;
128};
129
130&cpu1 {
131	cpu-supply = <&vdd_cpu>;
132};
133
134&cpu2 {
135	cpu-supply = <&vdd_cpu>;
136};
137
138&cpu3 {
139	cpu-supply = <&vdd_cpu>;
140};
141
142/*
143 * The MCU can provide system temperature too, but only by polling and of
144 * course also cannot set trip points. So attach to the cpu thermal-zone
145 * instead to control the fan.
146 */
147&cpu_thermal {
148	trips {
149		case_fan0: case-fan0 {
150			hysteresis = <2000>;
151			temperature = <35000>;
152			type = "active";
153		};
154
155		case_fan1: case-fan1 {
156			hysteresis = <2000>;
157			temperature = <45000>;
158			type = "active";
159		};
160
161		case_fan2: case-fan2 {
162			hysteresis = <2000>;
163			temperature = <65000>;
164			type = "active";
165		};
166	};
167
168	cooling-maps {
169		/*
170		 * Always provide some air movement, due to small case
171		 * full of harddrives.
172		 */
173		map1 {
174			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
175			trip = <&case_fan0>;
176		};
177
178		map2 {
179			cooling-device = <&fan 2 3>;
180			trip = <&case_fan1>;
181		};
182
183		map3 {
184			cooling-device = <&fan 4 THERMAL_NO_LIMIT>;
185			trip = <&case_fan2>;
186		};
187	};
188};
189
190&gpu {
191	mali-supply = <&vdd_gpu>;
192	status = "okay";
193};
194
195&i2c0 {
196	status = "okay";
197
198	pmic@20 {
199		compatible = "rockchip,rk809";
200		reg = <0x20>;
201		interrupt-parent = <&gpio0>;
202		interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
203		#clock-cells = <1>;
204		pinctrl-names = "default";
205		pinctrl-0 = <&pmic_int_l>;
206		system-power-controller;
207		vcc1-supply = <&vcc3v3_sys>;
208		vcc2-supply = <&vcc3v3_sys>;
209		vcc3-supply = <&vcc3v3_sys>;
210		vcc4-supply = <&vcc3v3_sys>;
211		vcc5-supply = <&vcc3v3_sys>;
212		vcc6-supply = <&vcc3v3_sys>;
213		vcc7-supply = <&vcc3v3_sys>;
214		vcc8-supply = <&vcc3v3_sys>;
215		vcc9-supply = <&vcc3v3_sys>;
216		wakeup-source;
217
218		regulators {
219			vdd_logic: DCDC_REG1 {
220				regulator-name = "vdd_logic";
221				regulator-always-on;
222				regulator-boot-on;
223				regulator-initial-mode = <0x2>;
224				regulator-min-microvolt = <500000>;
225				regulator-max-microvolt = <1350000>;
226				regulator-ramp-delay = <6001>;
227
228				regulator-state-mem {
229					regulator-off-in-suspend;
230				};
231			};
232
233			vdd_gpu: DCDC_REG2 {
234				regulator-name = "vdd_gpu";
235				regulator-always-on;
236				regulator-initial-mode = <0x2>;
237				regulator-min-microvolt = <500000>;
238				regulator-max-microvolt = <1350000>;
239				regulator-ramp-delay = <6001>;
240
241				regulator-state-mem {
242					regulator-off-in-suspend;
243				};
244			};
245
246			vcc_ddr: DCDC_REG3 {
247				regulator-name = "vcc_ddr";
248				regulator-always-on;
249				regulator-boot-on;
250				regulator-initial-mode = <0x2>;
251
252				regulator-state-mem {
253					regulator-on-in-suspend;
254				};
255			};
256
257			vdd_npu: DCDC_REG4 {
258				regulator-name = "vdd_npu";
259				regulator-initial-mode = <0x2>;
260				regulator-min-microvolt = <500000>;
261				regulator-max-microvolt = <1350000>;
262				regulator-ramp-delay = <6001>;
263
264				regulator-state-mem {
265					regulator-off-in-suspend;
266				};
267			};
268
269			vcc_1v8: DCDC_REG5 {
270				regulator-name = "vcc_1v8";
271				regulator-always-on;
272				regulator-boot-on;
273				regulator-min-microvolt = <1800000>;
274				regulator-max-microvolt = <1800000>;
275
276				regulator-state-mem {
277					regulator-off-in-suspend;
278				};
279			};
280
281			vdda0v9_image: LDO_REG1 {
282				regulator-name = "vdda0v9_image";
283				regulator-always-on;
284				regulator-min-microvolt = <900000>;
285				regulator-max-microvolt = <900000>;
286
287				regulator-state-mem {
288					regulator-off-in-suspend;
289				};
290			};
291
292			vdda_0v9: LDO_REG2 {
293				regulator-name = "vdda_0v9";
294				regulator-always-on;
295				regulator-boot-on;
296				regulator-min-microvolt = <900000>;
297				regulator-max-microvolt = <900000>;
298
299				regulator-state-mem {
300					regulator-off-in-suspend;
301				};
302			};
303
304			vdda0v9_pmu: LDO_REG3 {
305				regulator-name = "vdda0v9_pmu";
306				regulator-always-on;
307				regulator-boot-on;
308				regulator-min-microvolt = <900000>;
309				regulator-max-microvolt = <900000>;
310
311				regulator-state-mem {
312					regulator-on-in-suspend;
313					regulator-suspend-microvolt = <900000>;
314				};
315			};
316
317			vccio_acodec: LDO_REG4 {
318				regulator-name = "vccio_acodec";
319				regulator-always-on;
320				regulator-boot-on;
321				regulator-min-microvolt = <3300000>;
322				regulator-max-microvolt = <3300000>;
323
324				regulator-state-mem {
325					regulator-off-in-suspend;
326				};
327			};
328
329			vccio_sd: LDO_REG5 {
330				regulator-name = "vccio_sd";
331				regulator-min-microvolt = <1800000>;
332				regulator-max-microvolt = <3300000>;
333
334				regulator-state-mem {
335					regulator-off-in-suspend;
336				};
337			};
338
339			vcc3v3_pmu: LDO_REG6 {
340				regulator-name = "vcc3v3_pmu";
341				regulator-always-on;
342				regulator-boot-on;
343				regulator-min-microvolt = <3300000>;
344				regulator-max-microvolt = <3300000>;
345
346				regulator-state-mem {
347					regulator-on-in-suspend;
348					regulator-suspend-microvolt = <3300000>;
349				};
350			};
351
352			vcca_1v8: LDO_REG7 {
353				regulator-name = "vcca_1v8";
354				regulator-always-on;
355				regulator-boot-on;
356				regulator-min-microvolt = <1800000>;
357				regulator-max-microvolt = <1800000>;
358
359				regulator-state-mem {
360					regulator-off-in-suspend;
361				};
362			};
363
364			vcca1v8_pmu: LDO_REG8 {
365				regulator-name = "vcca1v8_pmu";
366				regulator-always-on;
367				regulator-boot-on;
368				regulator-min-microvolt = <1800000>;
369				regulator-max-microvolt = <1800000>;
370
371				regulator-state-mem {
372					regulator-on-in-suspend;
373					regulator-suspend-microvolt = <1800000>;
374				};
375			};
376
377			vcca1v8_image: LDO_REG9 {
378				regulator-name = "vcca1v8_image";
379				regulator-always-on;
380				regulator-min-microvolt = <1800000>;
381				regulator-max-microvolt = <1800000>;
382
383				regulator-state-mem {
384					regulator-off-in-suspend;
385				};
386			};
387
388			vcc_3v3: SWITCH_REG1 {
389				regulator-name = "vcc_3v3";
390				regulator-always-on;
391				regulator-boot-on;
392
393				regulator-state-mem {
394					regulator-off-in-suspend;
395				};
396			};
397
398			vcc3v3_sd: SWITCH_REG2 {
399				regulator-name = "vcc3v3_sd";
400				/*
401				 * turning this off, breaks access to both
402				 * PCIe controllers, refclk generator perhaps
403				 */
404				regulator-always-on;
405				regulator-boot-on;
406
407				regulator-state-mem {
408					regulator-off-in-suspend;
409				};
410			};
411		};
412	};
413
414	vdd_cpu: regulator@40 {
415		compatible = "silergy,syr827";
416		reg = <0x40>;
417		fcs,suspend-voltage-selector = <1>;
418		regulator-name = "vdd_cpu";
419		regulator-always-on;
420		regulator-boot-on;
421		regulator-min-microvolt = <712500>;
422		regulator-max-microvolt = <1390000>;
423		regulator-ramp-delay = <2300>;
424		vin-supply = <&vcc5v0_sys>;
425	};
426};
427
428&i2c1 {
429	status = "okay";
430
431	rtc_rv8263: rtc@51 {
432		compatible = "microcrystal,rv8263";
433		reg = <0x51>;
434		wakeup-source;
435	};
436
437	/* eeprom for vital-product-data on the mainboard */
438	eeprom@54 {
439		compatible = "giantec,gt24c04a", "atmel,24c04";
440		reg = <0x54>;
441		label = "VPD_MB";
442		num-addresses = <2>;
443		pagesize = <16>;
444		read-only;
445	};
446};
447
448&pinctrl {
449	keys {
450		copy_button_pin: copy-button-pin {
451			rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>;
452		};
453
454		reset_button_pin: reset-button-pin {
455			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
456		};
457	};
458
459	leds {
460		hdd1_led_pin: hdd1-led-pin {
461			rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>;
462		};
463	};
464
465	pmic {
466		pmic_int_l: pmic-int-l {
467			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
468		};
469	};
470
471	usb {
472		vcc5v0_host_en: vcc5v0-host-en {
473			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
474		};
475
476		vcc5v0_otg_en: vcc5v0-otg-en {
477			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
478		};
479	};
480};
481
482&pmu_io_domains {
483	vccio4-supply = <&vcc_1v8>;
484	vccio6-supply = <&vcc_1v8>;
485	status = "okay";
486};
487
488&sata1 {
489	status = "okay";
490};
491
492&sdhci {
493	bus-width = <8>;
494	max-frequency = <200000000>;
495	non-removable;
496	pinctrl-names = "default";
497	pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
498	status = "okay";
499};
500
501&tsadc {
502	rockchip,hw-tshut-mode = <1>;
503	rockchip,hw-tshut-polarity = <0>;
504	status = "okay";
505};
506
507/*
508 * Connected to an MCU, that provides access to more LEDs,
509 * buzzer, fan control and more.
510 */
511&uart0 {
512	status = "okay";
513
514	mcu: mcu {
515		fan: fan-0 {
516			#cooling-cells = <2>;
517			cooling-levels = <0 64 89 128 166 204 221 238>;
518		};
519
520		nvmem-layout {
521			compatible = "fixed-layout";
522			#address-cells = <1>;
523			#size-cells = <1>;
524
525			serial-number@0 {
526				reg = <0x0 0x13>;
527			};
528
529			ext-port@22 {
530				reg = <0x22 0x2>;
531			};
532
533			mac0: mac@24 {
534				compatible = "mac-base";
535				reg = <0x24 0x11>;
536				#nvmem-cell-cells = <1>;
537			};
538
539			mac1: mac@35 {
540				compatible = "mac-base";
541				reg = <0x35 0x11>;
542				#nvmem-cell-cells = <1>;
543			};
544
545			mac2: mac@46 {
546				compatible = "mac-base";
547				reg = <0x46 0x11>;
548				#nvmem-cell-cells = <1>;
549			};
550
551			mac3: mac@57 {
552				compatible = "mac-base";
553				reg = <0x57 0x11>;
554				#nvmem-cell-cells = <1>;
555			};
556
557			mac4: mac@68 {
558				compatible = "mac-base";
559				reg = <0x68 0x11>;
560				#nvmem-cell-cells = <1>;
561			};
562
563			mac5: mac@79 {
564				compatible = "mac-base";
565				reg = <0x79 0x11>;
566				#nvmem-cell-cells = <1>;
567			};
568
569			mac6: mac@8a {
570				compatible = "mac-base";
571				reg = <0x8a 0x11>;
572				#nvmem-cell-cells = <1>;
573			};
574
575			mac7: mac@9b {
576				compatible = "mac-base";
577				reg = <0x9b 0x11>;
578				#nvmem-cell-cells = <1>;
579			};
580		};
581	};
582};
583
584/*
585 * Pins available on CN3 connector at TTL voltage level (3V3).
586 * ,_  _.
587 * |1234|  1=TX 2=VCC
588 * `----'  3=RX 4=GND
589 */
590&uart2 {
591	status = "okay";
592};
593
594&usb2phy0 {
595	status = "okay";
596};
597
598/* connected to usb_host0_xhci */
599&usb2phy0_otg {
600	phy-supply = <&vcc5v0_otg>;
601	status = "okay";
602};
603
604/* front port */
605&usb_host0_xhci {
606	dr_mode = "host";
607	status = "okay";
608};
609