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";
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 = <&i2c3m0_xfer>;
452	status = "okay";
453};
454
455&mdio1 {
456	rgmii_phy1: ethernet-phy@0 {
457		compatible = "ethernet-phy-ieee802.3-c22";
458		reg = <0x0>;
459	};
460};
461
462&pcie2x1 {
463	pinctrl-names = "default";
464	pinctrl-0 = <&pcie_reset_h>;
465	reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>;
466	vpcie3v3-supply = <&vcc3v3_pcie>;
467	status = "okay";
468};
469
470&pinctrl {
471	bt {
472		bt_enable_h: bt-enable-h {
473			rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
474		};
475
476		bt_host_wake_l: bt-host-wake-l {
477			rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_down>;
478		};
479
480		bt_wake_l: bt-wake-l {
481			rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>;
482		};
483	};
484
485	leds {
486		user_led_enable_h: user-led-enable-h {
487			rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
488		};
489	};
490
491	pcie {
492		pcie_enable_h: pcie-enable-h {
493			rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
494		};
495
496		pcie_reset_h: pcie-reset-h {
497			rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
498		};
499	};
500
501	pmic {
502		pmic_int: pmic_int {
503			rockchip,pins =
504				<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
505		};
506	};
507
508	sdio-pwrseq {
509		wifi_enable_h: wifi-enable-h {
510			rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
511		};
512	};
513
514	usb {
515		vcc5v0_usb30_host_en_h: vcc5v0-usb30-host-en_h {
516			rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
517		};
518
519		vcc5v0_usb_otg_en_h: vcc5v0-usb-otg-en_h {
520			rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
521		};
522	};
523};
524
525&pmu_io_domains {
526	status = "okay";
527	pmuio1-supply = <&vcc3v3_pmu>;
528	pmuio2-supply = <&vcc3v3_pmu>;
529	vccio1-supply = <&vccio_acodec>;
530	vccio2-supply = <&vcc_1v8>;
531	vccio3-supply = <&vccio_sd>;
532	vccio4-supply = <&vcc_1v8>;
533	vccio5-supply = <&vcc_3v3>;
534	vccio6-supply = <&vcc_1v8>;
535	vccio7-supply = <&vcc_3v3>;
536};
537
538&sdhci {
539	bus-width = <8>;
540	mmc-hs200-1_8v;
541	non-removable;
542	vmmc-supply = <&vcc_3v3>;
543	vqmmc-supply = <&vcc_1v8>;
544	status = "okay";
545};
546
547&sdmmc0 {
548	bus-width = <4>;
549	cap-sd-highspeed;
550	cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
551	disable-wp;
552	pinctrl-names = "default";
553	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
554	sd-uhs-sdr104;
555	vmmc-supply = <&vcc3v3_sd>;
556	vqmmc-supply = <&vccio_sd>;
557	status = "okay";
558};
559
560&sdmmc1 {
561	bus-width = <4>;
562	cap-sd-highspeed;
563	cap-sdio-irq;
564	keep-power-in-suspend;
565	mmc-pwrseq = <&sdio_pwrseq>;
566	vmmc-supply = <&vcc3v3_sys>;
567	vqmmc-supply = <&vcca1v8_pmu>;
568	pinctrl-names = "default";
569	pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>;
570	status = "okay";
571};
572
573&tsadc {
574	status = "okay";
575};
576
577&uart0 {
578	pinctrl-names = "default";
579	pinctrl-0 = <&uart0_xfer>;
580	status = "okay";
581};
582
583&uart1 {
584	pinctrl-names = "default";
585	pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn>;
586	status = "okay";
587	uart-has-rtscts;
588
589	bluetooth {
590		compatible = "brcm,bcm43438-bt";
591		clocks = <&rk809 1>;
592		clock-names = "lpo";
593		device-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
594		host-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>;
595		shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
596		pinctrl-names = "default";
597		pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
598		vbat-supply = <&vcc3v3_sys>;
599		vddio-supply = <&vcca1v8_pmu>;
600	};
601};
602
603&uart2 {
604	status = "okay";
605};
606
607&usb2phy0_host {
608	phy-supply = <&vcc5v0_usb30_host>;
609	status = "okay";
610};
611
612&usb2phy0_otg {
613	phy-supply = <&vcc5v0_usb_otg>;
614	status = "okay";
615};
616
617&usb2phy1_otg {
618	phy-supply = <&vcc5v0_usb30_host>;
619	status = "okay";
620};
621
622&usb2phy0 {
623	status = "okay";
624};
625
626&usb2phy1 {
627	status = "okay";
628};
629
630&usb_host0_xhci {
631	status = "okay";
632};
633
634&usb_host1_xhci {
635	status = "okay";
636};
637
638&usb_host0_ehci {
639	status = "okay";
640};
641
642&usb_host0_ohci {
643	status = "okay";
644};
645
646&vop {
647	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
648	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
649	status = "okay";
650};
651
652&vop_mmu {
653	status = "okay";
654};
655
656&vp0 {
657	vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
658		reg = <ROCKCHIP_VOP2_EP_HDMI0>;
659		remote-endpoint = <&hdmi_in_vp0>;
660	};
661};
662