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