1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
3/dts-v1/;
4
5#include <dt-bindings/gpio/gpio.h>
6#include <dt-bindings/pinctrl/rockchip.h>
7#include <dt-bindings/soc/rockchip,vop2.h>
8#include "rk3566.dtsi"
9
10/ {
11	model = "Firefly Station M2";
12	compatible = "firefly,rk3566-roc-pc", "rockchip,rk3566";
13
14	aliases {
15		mmc0 = &sdmmc0;
16		mmc1 = &sdhci;
17		mmc2 = &sdmmc1;
18	};
19
20	chosen: chosen {
21		stdout-path = "serial2:1500000n8";
22	};
23
24	gmac1_clkin: external-gmac1-clock {
25		compatible = "fixed-clock";
26		clock-frequency = <125000000>;
27		clock-output-names = "gmac1_clkin";
28		#clock-cells = <0>;
29	};
30
31	hdmi-con {
32		compatible = "hdmi-connector";
33		type = "a";
34
35		port {
36			hdmi_con_in: endpoint {
37				remote-endpoint = <&hdmi_out_con>;
38			};
39		};
40	};
41
42	leds {
43		compatible = "gpio-leds";
44
45		led-user {
46			label = "user-led";
47			default-state = "on";
48			gpios = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
49			linux,default-trigger = "heartbeat";
50			pinctrl-names = "default";
51			pinctrl-0 = <&user_led_enable_h>;
52			retain-state-suspended;
53		};
54	};
55
56	sdio_pwrseq: sdio-pwrseq {
57		status = "okay";
58		compatible = "mmc-pwrseq-simple";
59		clocks = <&rk809 1>;
60		clock-names = "ext_clock";
61		pinctrl-names = "default";
62		pinctrl-0 = <&wifi_enable_h>;
63		reset-gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>;
64	};
65
66	usb_5v: usb-5v-regulator {
67		compatible = "regulator-fixed";
68		regulator-name = "usb_5v";
69		regulator-always-on;
70		regulator-boot-on;
71		regulator-min-microvolt = <5000000>;
72		regulator-max-microvolt = <5000000>;
73	};
74
75	vcc5v0_sys: vcc5v0-sys-regulator {
76		compatible = "regulator-fixed";
77		regulator-name = "vcc5v0_sys";
78		regulator-always-on;
79		regulator-boot-on;
80		regulator-min-microvolt = <5000000>;
81		regulator-max-microvolt = <5000000>;
82		vin-supply = <&usb_5v>;
83	};
84
85	vcc3v3_pcie: vcc3v3-pcie-regulator {
86		compatible = "regulator-fixed";
87		enable-active-high;
88		gpio = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>;
89		pinctrl-names = "default";
90		pinctrl-0 = <&pcie_enable_h>;
91		regulator-name = "vcc3v3_pcie";
92		regulator-min-microvolt = <3300000>;
93		regulator-max-microvolt = <3300000>;
94		vin-supply = <&vcc5v0_sys>;
95	};
96
97	vcc3v3_sys: vcc3v3-sys-regulator {
98		compatible = "regulator-fixed";
99		regulator-name = "vcc3v3_sys";
100		regulator-min-microvolt = <3300000>;
101		regulator-max-microvolt = <3300000>;
102		regulator-always-on;
103		vin-supply = <&vcc5v0_sys>;
104	};
105
106	vcc5v0_usb30_host: vcc5v0-usb30-host-regulator {
107		compatible = "regulator-fixed";
108		regulator-name = "vcc5v0_usb30_host";
109		enable-active-high;
110		gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
111		pinctrl-names = "default";
112		pinctrl-0 = <&vcc5v0_usb30_host_en_h>;
113		regulator-always-on;
114		regulator-min-microvolt = <5000000>;
115		regulator-max-microvolt = <5000000>;
116		vin-supply = <&vcc5v0_sys>;
117	};
118
119	vcc5v0_usb_otg: vcc5v0-usb-otg-regulator {
120		compatible = "regulator-fixed";
121		regulator-name = "vcc5v0_usb_otg";
122		enable-active-high;
123		gpio = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>;
124		pinctrl-names = "default";
125		pinctrl-0 = <&vcc5v0_usb_otg_en_h>;
126		regulator-always-on;
127		regulator-min-microvolt = <5000000>;
128		regulator-max-microvolt = <5000000>;
129		vin-supply = <&vcc5v0_sys>;
130	};
131};
132
133&combphy1 {
134	status = "okay";
135};
136
137&combphy2 {
138	status = "okay";
139};
140
141&cpu0 {
142	cpu-supply = <&vdd_cpu>;
143};
144
145&cpu1 {
146	cpu-supply = <&vdd_cpu>;
147};
148
149&cpu2 {
150	cpu-supply = <&vdd_cpu>;
151};
152
153&cpu3 {
154	cpu-supply = <&vdd_cpu>;
155};
156
157&gmac1 {
158	assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>;
159	assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>, <&gmac1_clkin>;
160	clock_in_out = "input";
161	phy-mode = "rgmii-id";
162	phy-supply = <&vcc_3v3>;
163	pinctrl-names = "default";
164	pinctrl-0 = <&gmac1m0_miim
165		     &gmac1m0_tx_bus2
166		     &gmac1m0_rx_bus2
167		     &gmac1m0_rgmii_clk
168		     &gmac1m0_clkinout
169		     &gmac1m0_rgmii_bus>;
170	snps,reset-gpio = <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>;
171	snps,reset-active-low;
172	/* Reset time is 20ms, 100ms for rtl8211f */
173	snps,reset-delays-us = <0 20000 100000>;
174	tx_delay = <0x4f>;
175	rx_delay = <0x24>;
176	phy-handle = <&rgmii_phy1>;
177	status = "okay";
178};
179
180&gpu {
181	mali-supply = <&vdd_gpu>;
182	status = "okay";
183};
184
185&hdmi {
186	avdd-0v9-supply = <&vdda0v9_image>;
187	avdd-1v8-supply = <&vcca1v8_image>;
188	status = "okay";
189};
190
191&hdmi_in {
192	hdmi_in_vp0: endpoint {
193		remote-endpoint = <&vp0_out_hdmi>;
194	};
195};
196
197&hdmi_out {
198	hdmi_out_con: endpoint {
199		remote-endpoint = <&hdmi_con_in>;
200	};
201};
202
203&i2c0 {
204	status = "okay";
205
206	vdd_cpu: regulator@1c {
207		compatible = "tcs,tcs4525";
208		reg = <0x1c>;
209		fcs,suspend-voltage-selector = <1>;
210		regulator-name = "vdd_cpu";
211		regulator-min-microvolt = <800000>;
212		regulator-max-microvolt = <1150000>;
213		regulator-ramp-delay = <2300>;
214		regulator-always-on;
215		regulator-boot-on;
216		vin-supply = <&vcc5v0_sys>;
217
218		regulator-state-mem {
219			regulator-off-in-suspend;
220		};
221	};
222
223	rk809: pmic@20 {
224		compatible = "rockchip,rk809";
225		reg = <0x20>;
226		interrupt-parent = <&gpio0>;
227		interrupts = <RK_PA7 IRQ_TYPE_LEVEL_LOW>;
228		clock-output-names = "rk808-clkout1", "rk808-clkout2";
229
230		pinctrl-names = "default";
231		pinctrl-0 = <&pmic_int>;
232		rockchip,system-power-controller;
233		wakeup-source;
234		#clock-cells = <1>;
235
236		vcc1-supply = <&vcc3v3_sys>;
237		vcc2-supply = <&vcc3v3_sys>;
238		vcc3-supply = <&vcc3v3_sys>;
239		vcc4-supply = <&vcc3v3_sys>;
240		vcc5-supply = <&vcc3v3_sys>;
241		vcc6-supply = <&vcc3v3_sys>;
242		vcc7-supply = <&vcc3v3_sys>;
243		vcc8-supply = <&vcc3v3_sys>;
244		vcc9-supply = <&vcc3v3_sys>;
245
246		regulators {
247			vdd_log: DCDC_REG1 {
248				regulator-name = "vdd_log";
249				regulator-always-on;
250				regulator-boot-on;
251				regulator-min-microvolt = <500000>;
252				regulator-max-microvolt = <1350000>;
253				regulator-init-microvolt = <900000>;
254				regulator-ramp-delay = <6001>;
255
256				regulator-state-mem {
257					regulator-on-in-suspend;
258					regulator-suspend-microvolt = <900000>;
259				};
260			};
261
262			vdd_gpu: DCDC_REG2 {
263				regulator-name = "vdd_gpu";
264				regulator-min-microvolt = <900000>;
265				regulator-max-microvolt = <1350000>;
266				regulator-init-microvolt = <900000>;
267				regulator-ramp-delay = <6001>;
268
269				regulator-state-mem {
270					regulator-off-in-suspend;
271					regulator-suspend-microvolt = <900000>;
272				};
273			};
274
275			vcc_ddr: DCDC_REG3 {
276				regulator-name = "vcc_ddr";
277				regulator-always-on;
278				regulator-boot-on;
279				regulator-min-microvolt = <1100000>;
280				regulator-max-microvolt = <1100000>;
281				regulator-initial-mode = <0x2>;
282				regulator-state-mem {
283					regulator-on-in-suspend;
284				};
285			};
286
287			vdd_npu: DCDC_REG4 {
288				regulator-name = "vdd_npu";
289				regulator-min-microvolt = <900000>;
290				regulator-max-microvolt = <1350000>;
291				regulator-initial-mode = <0x2>;
292				regulator-state-mem {
293					regulator-off-in-suspend;
294				};
295			};
296
297			vcc_1v8: DCDC_REG5 {
298				regulator-name = "vcc_1v8";
299				regulator-always-on;
300				regulator-boot-on;
301				regulator-min-microvolt = <1800000>;
302				regulator-max-microvolt = <1800000>;
303
304				regulator-state-mem {
305					regulator-on-in-suspend;
306					regulator-suspend-microvolt = <1800000>;
307				};
308			};
309
310			vdda0v9_image: LDO_REG1 {
311				regulator-name = "vdda0v9_image";
312				regulator-always-on;
313				regulator-boot-on;
314				regulator-min-microvolt = <900000>;
315				regulator-max-microvolt = <900000>;
316
317				regulator-state-mem {
318					regulator-on-in-suspend;
319					regulator-suspend-microvolt = <900000>;
320				};
321			};
322
323			vdda_0v9: LDO_REG2 {
324				regulator-name = "vdda_0v9";
325				regulator-always-on;
326				regulator-boot-on;
327				regulator-min-microvolt = <900000>;
328				regulator-max-microvolt = <900000>;
329
330				regulator-state-mem {
331					regulator-on-in-suspend;
332					regulator-suspend-microvolt = <900000>;
333				};
334			};
335
336			vdda0v9_pmu: LDO_REG3 {
337				regulator-name = "vdda0v9_pmu";
338				regulator-always-on;
339				regulator-boot-on;
340				regulator-min-microvolt = <900000>;
341				regulator-max-microvolt = <900000>;
342				regulator-state-mem {
343					regulator-on-in-suspend;
344					regulator-suspend-microvolt = <900000>;
345				};
346			};
347
348			vccio_acodec: LDO_REG4 {
349				regulator-name = "vccio_acodec";
350				regulator-always-on;
351				regulator-boot-on;
352				regulator-min-microvolt = <3300000>;
353				regulator-max-microvolt = <3300000>;
354
355				regulator-state-mem {
356					regulator-on-in-suspend;
357					regulator-suspend-microvolt = <3300000>;
358
359				};
360			};
361
362			vccio_sd: LDO_REG5 {
363				regulator-name = "vccio_sd";
364				regulator-always-on;
365				regulator-boot-on;
366				regulator-min-microvolt = <1800000>;
367				regulator-max-microvolt = <3300000>;
368
369				regulator-state-mem {
370					regulator-on-in-suspend;
371					regulator-suspend-microvolt = <3300000>;
372				};
373			};
374
375			vcc3v3_pmu: LDO_REG6 {
376				regulator-name = "vcc3v3_pmu";
377				regulator-always-on;
378				regulator-boot-on;
379				regulator-min-microvolt = <3300000>;
380				regulator-max-microvolt = <3300000>;
381
382				regulator-state-mem {
383					regulator-on-in-suspend;
384					regulator-suspend-microvolt = <3300000>;
385				};
386			};
387
388			vcca_1v8: LDO_REG7 {
389				regulator-name = "vcca_1v8";
390				regulator-always-on;
391				regulator-boot-on;
392				regulator-min-microvolt = <1800000>;
393				regulator-max-microvolt = <1800000>;
394
395				regulator-state-mem {
396					regulator-on-in-suspend;
397					regulator-suspend-microvolt = <1800000>;
398				};
399			};
400
401			vcca1v8_pmu: LDO_REG8 {
402				regulator-name = "vcca1v8_pmu";
403				regulator-always-on;
404				regulator-boot-on;
405				regulator-min-microvolt = <1800000>;
406				regulator-max-microvolt = <1800000>;
407
408				regulator-state-mem {
409					regulator-on-in-suspend;
410					regulator-suspend-microvolt = <1800000>;
411				};
412			};
413
414			vcca1v8_image: LDO_REG9 {
415				regulator-name = "vcca1v8_image";
416				regulator-always-on;
417				regulator-boot-on;
418				regulator-min-microvolt = <1800000>;
419				regulator-max-microvolt = <1800000>;
420
421				regulator-state-mem {
422					regulator-on-in-suspend;
423					regulator-suspend-microvolt = <1800000>;
424				};
425			};
426
427			vcc_3v3: SWITCH_REG1 {
428				regulator-boot-on;
429				regulator-name = "vcc3v3";
430			};
431
432			vcc3v3_sd: SWITCH_REG2 {
433				regulator-name = "vcc3v3_sd";
434				regulator-always-on;
435				regulator-boot-on;
436			};
437		};
438	};
439};
440
441&i2c1 {
442	status = "okay";
443};
444
445&i2c2 {
446	status = "okay";
447};
448
449&i2c3 {
450	pinctrl-names = "default";
451	pinctrl-0 = <&i2c3m1_xfer>;
452	status = "okay";
453};
454
455&i2c5 {
456	status = "okay";
457};
458
459&mdio1 {
460	rgmii_phy1: ethernet-phy@0 {
461		compatible = "ethernet-phy-ieee802.3-c22";
462		reg = <0x0>;
463	};
464};
465
466&pcie2x1 {
467	pinctrl-names = "default";
468	pinctrl-0 = <&pcie_reset_h>;
469	reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>;
470	vpcie3v3-supply = <&vcc3v3_pcie>;
471	status = "okay";
472};
473
474&pinctrl {
475	bt {
476		bt_enable_h: bt-enable-h {
477			rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
478		};
479
480		bt_host_wake_l: bt-host-wake-l {
481			rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_down>;
482		};
483
484		bt_wake_l: bt-wake-l {
485			rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>;
486		};
487	};
488
489	leds {
490		user_led_enable_h: user-led-enable-h {
491			rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
492		};
493	};
494
495	pcie {
496		pcie_enable_h: pcie-enable-h {
497			rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
498		};
499
500		pcie_reset_h: pcie-reset-h {
501			rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
502		};
503	};
504
505	pmic {
506		pmic_int: pmic_int {
507			rockchip,pins =
508				<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
509		};
510	};
511
512	sdio-pwrseq {
513		wifi_enable_h: wifi-enable-h {
514			rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
515		};
516	};
517
518	usb {
519		vcc5v0_usb30_host_en_h: vcc5v0-usb30-host-en_h {
520			rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
521		};
522
523		vcc5v0_usb_otg_en_h: vcc5v0-usb-otg-en_h {
524			rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
525		};
526	};
527};
528
529&pmu_io_domains {
530	status = "okay";
531	pmuio1-supply = <&vcc3v3_pmu>;
532	pmuio2-supply = <&vcc3v3_pmu>;
533	vccio1-supply = <&vccio_acodec>;
534	vccio2-supply = <&vcc_1v8>;
535	vccio3-supply = <&vccio_sd>;
536	vccio4-supply = <&vcc_1v8>;
537	vccio5-supply = <&vcc_3v3>;
538	vccio6-supply = <&vcc_1v8>;
539	vccio7-supply = <&vcc_3v3>;
540};
541
542&sdhci {
543	bus-width = <8>;
544	mmc-hs200-1_8v;
545	non-removable;
546	vmmc-supply = <&vcc_3v3>;
547	vqmmc-supply = <&vcc_1v8>;
548	status = "okay";
549};
550
551&sdmmc0 {
552	bus-width = <4>;
553	cap-sd-highspeed;
554	cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
555	disable-wp;
556	pinctrl-names = "default";
557	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
558	sd-uhs-sdr104;
559	vmmc-supply = <&vcc3v3_sd>;
560	vqmmc-supply = <&vccio_sd>;
561	status = "okay";
562};
563
564&sdmmc1 {
565	bus-width = <4>;
566	cap-sd-highspeed;
567	cap-sdio-irq;
568	keep-power-in-suspend;
569	mmc-pwrseq = <&sdio_pwrseq>;
570	vmmc-supply = <&vcc3v3_sys>;
571	vqmmc-supply = <&vcca1v8_pmu>;
572	pinctrl-names = "default";
573	pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>;
574	status = "okay";
575};
576
577&tsadc {
578	status = "okay";
579};
580
581&uart0 {
582	pinctrl-names = "default";
583	pinctrl-0 = <&uart0_xfer>;
584	status = "okay";
585};
586
587&uart1 {
588	pinctrl-names = "default";
589	pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn>;
590	status = "okay";
591	uart-has-rtscts;
592
593	bluetooth {
594		compatible = "brcm,bcm43438-bt";
595		clocks = <&rk809 1>;
596		clock-names = "lpo";
597		device-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
598		host-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>;
599		shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
600		pinctrl-names = "default";
601		pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
602		vbat-supply = <&vcc3v3_sys>;
603		vddio-supply = <&vcca1v8_pmu>;
604	};
605};
606
607&uart2 {
608	status = "okay";
609};
610
611&usb2phy0_host {
612	phy-supply = <&vcc5v0_usb30_host>;
613	status = "okay";
614};
615
616&usb2phy0_otg {
617	phy-supply = <&vcc5v0_usb_otg>;
618	status = "okay";
619};
620
621&usb2phy1_otg {
622	phy-supply = <&vcc5v0_usb30_host>;
623	status = "okay";
624};
625
626&usb2phy0 {
627	status = "okay";
628};
629
630&usb2phy1 {
631	status = "okay";
632};
633
634&usb_host0_xhci {
635	status = "okay";
636};
637
638&usb_host1_xhci {
639	status = "okay";
640};
641
642&usb_host0_ehci {
643	status = "okay";
644};
645
646&usb_host0_ohci {
647	status = "okay";
648};
649
650&vop {
651	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
652	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
653	status = "okay";
654};
655
656&vop_mmu {
657	status = "okay";
658};
659
660&vp0 {
661	vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
662		reg = <ROCKCHIP_VOP2_EP_HDMI0>;
663		remote-endpoint = <&hdmi_in_vp0>;
664	};
665};
666