1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
3/dts-v1/;
4#include <dt-bindings/gpio/gpio.h>
5#include <dt-bindings/leds/common.h>
6#include <dt-bindings/pinctrl/rockchip.h>
7#include <dt-bindings/soc/rockchip,vop2.h>
8#include "rk3566.dtsi"
9
10/ {
11	model = "EmbedFire LubanCat 1";
12	compatible = "embedfire,lubancat-1", "rockchip,rk3566";
13
14	aliases {
15		ethernet0 = &gmac1;
16		mmc0 = &sdmmc0;
17		mmc1 = &sdhci;
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	gpio-leds {
43		compatible = "gpio-leds";
44
45		sys_led: sys-led {
46			label = "sys_led";
47			linux,default-trigger = "heartbeat";
48			default-state = "on";
49			gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_LOW>;
50			pinctrl-names = "default";
51			pinctrl-0 = <&sys_led_pin>;
52		};
53	};
54
55	usb_5v: usb-5v-regulator {
56		compatible = "regulator-fixed";
57		regulator-name = "usb_5v";
58		regulator-always-on;
59		regulator-boot-on;
60		regulator-min-microvolt = <5000000>;
61		regulator-max-microvolt = <5000000>;
62	};
63
64	vcc5v0_sys: vcc5v0-sys-regulator {
65		compatible = "regulator-fixed";
66		regulator-name = "vcc5v0_sys";
67		regulator-always-on;
68		regulator-boot-on;
69		regulator-min-microvolt = <5000000>;
70		regulator-max-microvolt = <5000000>;
71		vin-supply = <&usb_5v>;
72	};
73
74	vcc3v3_sys: vcc3v3-sys-regulator {
75		compatible = "regulator-fixed";
76		regulator-name = "vcc3v3_sys";
77		regulator-always-on;
78		regulator-boot-on;
79		regulator-min-microvolt = <3300000>;
80		regulator-max-microvolt = <3300000>;
81		vin-supply = <&vcc5v0_sys>;
82	};
83
84	vcc3v3_pcie: vcc3v3-pcie-regulator {
85		compatible = "regulator-fixed";
86		regulator-name = "vcc3v3_pcie";
87		regulator-min-microvolt = <3300000>;
88		regulator-max-microvolt = <3300000>;
89		enable-active-high;
90		gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
91		startup-delay-us = <5000>;
92		vin-supply = <&vcc5v0_sys>;
93	};
94
95	vcc5v0_usb20_host: vcc5v0-usb20-host-regulator {
96		compatible = "regulator-fixed";
97		enable-active-high;
98		gpio = <&gpio2 RK_PB6 GPIO_ACTIVE_HIGH>;
99		pinctrl-names = "default";
100		pinctrl-0 = <&vcc5v0_usb20_host_en>;
101		regulator-name = "vcc5v0_usb20_host";
102		regulator-always-on;
103	};
104
105	vcc5v0_usb30_host: vcc5v0-usb30-host-regulator {
106		compatible = "regulator-fixed";
107		enable-active-high;
108		gpio = <&gpio2 RK_PB5 GPIO_ACTIVE_HIGH>;
109		pinctrl-names = "default";
110		pinctrl-0 = <&vcc5v0_usb30_host_en>;
111		regulator-name = "vcc5v0_usb30_host";
112		regulator-always-on;
113	};
114};
115
116&uart2 {
117	status = "okay";
118};
119
120&combphy1 {
121	status = "okay";
122};
123
124&combphy2 {
125	status = "okay";
126};
127
128&cpu0 {
129	cpu-supply = <&vdd_cpu>;
130};
131
132&cpu1 {
133	cpu-supply = <&vdd_cpu>;
134};
135
136&cpu2 {
137	cpu-supply = <&vdd_cpu>;
138};
139
140&cpu3 {
141	cpu-supply = <&vdd_cpu>;
142};
143
144&gpu {
145	mali-supply = <&vdd_gpu>;
146	status = "okay";
147};
148
149&hdmi {
150	avdd-0v9-supply = <&vdda0v9_image>;
151	avdd-1v8-supply = <&vcca1v8_image>;
152	status = "okay";
153};
154
155&hdmi_in {
156	hdmi_in_vp0: endpoint {
157		remote-endpoint = <&vp0_out_hdmi>;
158	};
159};
160
161&hdmi_out {
162	hdmi_out_con: endpoint {
163		remote-endpoint = <&hdmi_con_in>;
164	};
165};
166
167&hdmi_sound {
168	status = "okay";
169};
170
171&i2c0 {
172	status = "okay";
173
174	vdd_cpu: regulator@1c {
175		compatible = "tcs,tcs4525";
176		reg = <0x1c>;
177		fcs,suspend-voltage-selector = <1>;
178		regulator-name = "vdd_cpu";
179		regulator-always-on;
180		regulator-boot-on;
181		regulator-min-microvolt = <800000>;
182		regulator-max-microvolt = <1150000>;
183		regulator-ramp-delay = <2300>;
184		vin-supply = <&vcc5v0_sys>;
185
186		regulator-state-mem {
187			regulator-off-in-suspend;
188		};
189	};
190
191	rk809: pmic@20 {
192		compatible = "rockchip,rk809";
193		reg = <0x20>;
194		interrupt-parent = <&gpio0>;
195		interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
196		clock-output-names = "rk808-clkout1", "rk808-clkout2";
197
198		pinctrl-names = "default";
199		pinctrl-0 = <&pmic_int>;
200		rockchip,system-power-controller;
201		wakeup-source;
202		#clock-cells = <1>;
203
204		vcc1-supply = <&vcc3v3_sys>;
205		vcc2-supply = <&vcc3v3_sys>;
206		vcc3-supply = <&vcc3v3_sys>;
207		vcc4-supply = <&vcc3v3_sys>;
208		vcc5-supply = <&vcc3v3_sys>;
209		vcc6-supply = <&vcc3v3_sys>;
210		vcc7-supply = <&vcc3v3_sys>;
211		vcc8-supply = <&vcc3v3_sys>;
212		vcc9-supply = <&vcc3v3_sys>;
213
214		regulators {
215			vdd_logic: DCDC_REG1 {
216				regulator-name = "vdd_logic";
217				regulator-always-on;
218				regulator-boot-on;
219				regulator-min-microvolt = <500000>;
220				regulator-max-microvolt = <1350000>;
221				regulator-init-microvolt = <900000>;
222				regulator-ramp-delay = <6001>;
223				regulator-initial-mode = <0x2>;
224
225				regulator-state-mem {
226					regulator-off-in-suspend;
227				};
228			};
229
230			vdd_gpu: DCDC_REG2 {
231				regulator-name = "vdd_gpu";
232				regulator-always-on;
233				regulator-boot-on;
234				regulator-min-microvolt = <500000>;
235				regulator-max-microvolt = <1350000>;
236				regulator-init-microvolt = <900000>;
237				regulator-ramp-delay = <6001>;
238				regulator-initial-mode = <0x2>;
239
240				regulator-state-mem {
241					regulator-off-in-suspend;
242				};
243			};
244
245			vcc_ddr: DCDC_REG3 {
246				regulator-name = "vcc_ddr";
247				regulator-always-on;
248				regulator-boot-on;
249				regulator-initial-mode = <0x2>;
250
251				regulator-state-mem {
252					regulator-on-in-suspend;
253				};
254			};
255
256			vdd_npu: DCDC_REG4 {
257				regulator-name = "vdd_npu";
258				regulator-always-on;
259				regulator-boot-on;
260				regulator-min-microvolt = <500000>;
261				regulator-max-microvolt = <1350000>;
262				regulator-init-microvolt = <900000>;
263				regulator-ramp-delay = <6001>;
264				regulator-initial-mode = <0x2>;
265
266				regulator-state-mem {
267					regulator-off-in-suspend;
268				};
269			};
270
271			vcc_1v8: DCDC_REG5 {
272				regulator-name = "vcc_1v8";
273				regulator-always-on;
274				regulator-boot-on;
275				regulator-min-microvolt = <1800000>;
276				regulator-max-microvolt = <1800000>;
277
278				regulator-state-mem {
279					regulator-off-in-suspend;
280				};
281			};
282
283			vdda0v9_image: LDO_REG1 {
284				regulator-name = "vdda0v9_image";
285				regulator-boot-on;
286				regulator-always-on;
287				regulator-min-microvolt = <900000>;
288				regulator-max-microvolt = <900000>;
289
290				regulator-state-mem {
291					regulator-off-in-suspend;
292				};
293			};
294
295			vdda_0v9: LDO_REG2 {
296				regulator-name = "vdda_0v9";
297				regulator-always-on;
298				regulator-boot-on;
299				regulator-min-microvolt = <900000>;
300				regulator-max-microvolt = <900000>;
301
302				regulator-state-mem {
303					regulator-off-in-suspend;
304				};
305			};
306
307			vdda0v9_pmu: LDO_REG3 {
308				regulator-name = "vdda0v9_pmu";
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			vccio_acodec: LDO_REG4 {
321				regulator-name = "vccio_acodec";
322				regulator-always-on;
323				regulator-boot-on;
324				regulator-min-microvolt = <3300000>;
325				regulator-max-microvolt = <3300000>;
326
327				regulator-state-mem {
328					regulator-off-in-suspend;
329				};
330			};
331
332			vccio_sd: LDO_REG5 {
333				regulator-name = "vccio_sd";
334				regulator-always-on;
335				regulator-boot-on;
336				regulator-min-microvolt = <1800000>;
337				regulator-max-microvolt = <3300000>;
338
339				regulator-state-mem {
340					regulator-off-in-suspend;
341				};
342			};
343
344			vcc3v3_pmu: LDO_REG6 {
345				regulator-name = "vcc3v3_pmu";
346				regulator-always-on;
347				regulator-boot-on;
348				regulator-min-microvolt = <3300000>;
349				regulator-max-microvolt = <3300000>;
350
351				regulator-state-mem {
352					regulator-on-in-suspend;
353					regulator-suspend-microvolt = <3300000>;
354				};
355			};
356
357			vcca_1v8: LDO_REG7 {
358				regulator-name = "vcca_1v8";
359				regulator-always-on;
360				regulator-boot-on;
361				regulator-min-microvolt = <1800000>;
362				regulator-max-microvolt = <1800000>;
363
364				regulator-state-mem {
365					regulator-off-in-suspend;
366				};
367			};
368
369			vcca1v8_pmu: LDO_REG8 {
370				regulator-name = "vcca1v8_pmu";
371				regulator-always-on;
372				regulator-boot-on;
373				regulator-min-microvolt = <1800000>;
374				regulator-max-microvolt = <1800000>;
375
376				regulator-state-mem {
377					regulator-on-in-suspend;
378					regulator-suspend-microvolt = <1800000>;
379				};
380			};
381
382			vcca1v8_image: LDO_REG9 {
383				regulator-name = "vcca1v8_image";
384				regulator-always-on;
385				regulator-boot-on;
386				regulator-min-microvolt = <1800000>;
387				regulator-max-microvolt = <1800000>;
388
389				regulator-state-mem {
390					regulator-off-in-suspend;
391				};
392			};
393
394			vcc_3v3: SWITCH_REG1 {
395				regulator-name = "vcc_3v3";
396				regulator-always-on;
397				regulator-boot-on;
398
399				regulator-state-mem {
400					regulator-off-in-suspend;
401				};
402			};
403
404			vcc3v3_sd: SWITCH_REG2 {
405				regulator-name = "vcc3v3_sd";
406				regulator-always-on;
407				regulator-boot-on;
408
409				regulator-state-mem {
410					regulator-off-in-suspend;
411				};
412			};
413		};
414	};
415};
416
417&i2s1_8ch {
418	rockchip,trcm-sync-tx-only;
419	status = "okay";
420};
421
422&gmac1 {
423	phy-mode = "rgmii";
424	clock_in_out = "output";
425	snps,reset-gpio = <&gpio2 RK_PB0 GPIO_ACTIVE_LOW>;
426	snps,reset-active-low;
427	/* Reset time is 75ms, 100ms */
428	snps,reset-delays-us = <0 75000 100000>;
429	assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
430	assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>;
431	assigned-clock-rates = <0>, <125000000>;
432	pinctrl-names = "default";
433	pinctrl-0 = <&gmac1m1_miim
434			&gmac1m1_tx_bus2_level3
435			&gmac1m1_rx_bus2
436			&gmac1m1_rgmii_clk_level2
437			&gmac1m1_rgmii_bus_level3>;
438	tx_delay = <0x1a>;
439	rx_delay = <0x0c>;
440	phy-handle = <&rgmii_phy1>;
441	status = "okay";
442};
443
444&mdio1 {
445	rgmii_phy1: phy@0 {
446		compatible = "ethernet-phy-ieee802.3-c22";
447		reg = <0x0>;
448	};
449};
450
451&pcie2x1 {
452	reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
453	disable-gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
454	vpcie3v3-supply = <&vcc3v3_pcie>;
455	status = "okay";
456};
457
458&pinctrl {
459	leds {
460		sys_led_pin: sys-status-led-pin {
461			rockchip,pins = <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
462		};
463	};
464
465	usb {
466		vcc5v0_usb20_host_en: vcc5v0-usb20-host-en {
467			rockchip,pins = <2 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
468		};
469
470		vcc5v0_usb30_host_en: vcc5v0-usb30-host-en {
471			rockchip,pins = <2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
472		};
473	};
474
475	pmic {
476		pmic_int: pmic_int {
477			rockchip,pins =
478				<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
479		};
480	};
481};
482
483&pmu_io_domains {
484	pmuio2-supply = <&vcc3v3_pmu>;
485	vccio1-supply = <&vccio_acodec>;
486	vccio3-supply = <&vccio_sd>;
487	vccio4-supply = <&vcc_3v3>;
488	vccio5-supply = <&vcc_3v3>;
489	vccio6-supply = <&vcc_1v8>;
490	vccio7-supply = <&vcc_3v3>;
491	status = "okay";
492};
493
494&saradc {
495	vref-supply = <&vcca_1v8>;
496	status = "okay";
497};
498
499&tsadc {
500	rockchip,hw-tshut-mode = <1>;
501	rockchip,hw-tshut-polarity = <0>;
502	status = "okay";
503};
504
505&sdhci {
506	assigned-clocks = <&cru BCLK_EMMC>, <&cru TCLK_EMMC>, <&cru CCLK_EMMC>;
507	assigned-clock-rates = <200000000>, <24000000>, <200000000>;
508	bus-width = <8>;
509	max-frequency = <200000000>;
510	mmc-hs200-1_8v;
511	non-removable;
512	pinctrl-names = "default";
513	pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd>;
514	supports-emmc;
515	status = "okay";
516};
517
518&sdmmc0 {
519	max-frequency = <150000000>;
520	supports-sd;
521	bus-width = <4>;
522	cap-mmc-highspeed;
523	cap-sd-highspeed;
524	disable-wp;
525	sd-uhs-sdr104;
526	vmmc-supply = <&vcc3v3_sd>;
527	vqmmc-supply = <&vccio_sd>;
528	pinctrl-names = "default";
529	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
530	status = "okay";
531};
532
533/* USB OTG/USB Host_1 USB 2.0 Comb */
534&usb2phy0 {
535	status = "okay";
536};
537
538&usb2phy0_host {
539	status = "okay";
540};
541
542&usb2phy0_otg {
543	status = "okay";
544};
545
546&usb_host0_ehci {
547	status = "okay";
548};
549
550&usb_host0_ohci {
551	status = "okay";
552};
553
554/* USB Host_2/USB Host_3 USB 2.0 Comb */
555&usb2phy1 {
556	status = "okay";
557};
558
559&usb2phy1_host {
560	status = "okay";
561};
562
563&usb2phy1_otg {
564	status = "okay";
565};
566
567&usb_host1_ehci {
568	status = "okay";
569};
570
571&usb_host1_ohci {
572	status = "okay";
573};
574
575/* USB3.0 Host */
576&usb_host1_xhci {
577	status = "okay";
578};
579
580&vop {
581	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
582	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
583	status = "okay";
584};
585
586&vop_mmu {
587	status = "okay";
588};
589
590&vp0 {
591	vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
592		reg = <ROCKCHIP_VOP2_EP_HDMI0>;
593		remote-endpoint = <&hdmi_in_vp0>;
594	};
595};
596