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