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/leds/common.h>
7#include <dt-bindings/pinctrl/rockchip.h>
8#include "rk3588s.dtsi"
9
10/ {
11	model = "Radxa ROCK 5 Model A";
12	compatible = "radxa,rock-5a", "rockchip,rk3588s";
13
14	aliases {
15		mmc0 = &sdhci;
16		serial2 = &uart2;
17	};
18
19	analog-sound {
20		compatible = "audio-graph-card";
21		label = "rk3588-es8316";
22
23		widgets = "Microphone", "Mic Jack",
24			  "Headphone", "Headphones";
25
26		routing = "MIC2", "Mic Jack",
27			  "Headphones", "HPOL",
28			  "Headphones", "HPOR";
29
30		dais = <&i2s0_8ch_p0>;
31	};
32
33	chosen {
34		stdout-path = "serial2:1500000n8";
35	};
36
37	leds {
38		compatible = "gpio-leds";
39		pinctrl-names = "default";
40		pinctrl-0 = <&io_led>;
41
42		io-led {
43			color = <LED_COLOR_ID_BLUE>;
44			function = LED_FUNCTION_STATUS;
45			gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>;
46			linux,default-trigger = "heartbeat";
47		};
48	};
49
50	fan: pwm-fan {
51		compatible = "pwm-fan";
52		cooling-levels = <0 95 145 195 255>;
53		fan-supply = <&vcc_5v0>;
54		pwms = <&pwm3 0 50000 0>;
55		#cooling-cells = <2>;
56	};
57
58	vcc12v_dcin: vcc12v-dcin-regulator {
59		compatible = "regulator-fixed";
60		regulator-name = "vcc12v_dcin";
61		regulator-always-on;
62		regulator-boot-on;
63		regulator-min-microvolt = <12000000>;
64		regulator-max-microvolt = <12000000>;
65	};
66
67	vcc5v0_sys: vcc5v0-sys-regulator {
68		compatible = "regulator-fixed";
69		regulator-name = "vcc5v0_sys";
70		regulator-always-on;
71		regulator-boot-on;
72		regulator-min-microvolt = <5000000>;
73		regulator-max-microvolt = <5000000>;
74		vin-supply = <&vcc12v_dcin>;
75	};
76
77	vcc_5v0: vcc-5v0-regulator {
78		compatible = "regulator-fixed";
79		regulator-name = "vcc_5v0";
80		regulator-min-microvolt = <5000000>;
81		regulator-max-microvolt = <5000000>;
82		regulator-boot-on;
83		regulator-always-on;
84		enable-active-high;
85		gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>;
86		pinctrl-names = "default";
87		pinctrl-0 = <&vcc_5v0_en>;
88		vin-supply = <&vcc5v0_sys>;
89	};
90
91	vcc_1v1_nldo_s3: vcc-1v1-nldo-s3-regulator {
92		compatible = "regulator-fixed";
93		regulator-name = "vcc_1v1_nldo_s3";
94		regulator-always-on;
95		regulator-boot-on;
96		regulator-min-microvolt = <1100000>;
97		regulator-max-microvolt = <1100000>;
98		vin-supply = <&vcc5v0_sys>;
99	};
100};
101
102&cpu_b0 {
103	cpu-supply = <&vdd_cpu_big0_s0>;
104};
105
106&cpu_b1 {
107	cpu-supply = <&vdd_cpu_big0_s0>;
108};
109
110&cpu_b2 {
111	cpu-supply = <&vdd_cpu_big1_s0>;
112};
113
114&cpu_b3 {
115	cpu-supply = <&vdd_cpu_big1_s0>;
116};
117
118&cpu_l0 {
119	cpu-supply = <&vdd_cpu_lit_s0>;
120};
121
122&cpu_l1 {
123	cpu-supply = <&vdd_cpu_lit_s0>;
124};
125
126&cpu_l2 {
127	cpu-supply = <&vdd_cpu_lit_s0>;
128};
129
130&cpu_l3 {
131	cpu-supply = <&vdd_cpu_lit_s0>;
132};
133
134&i2c0 {
135	pinctrl-names = "default";
136	pinctrl-0 = <&i2c0m2_xfer>;
137	status = "okay";
138
139	vdd_cpu_big0_s0: regulator@42 {
140		compatible = "rockchip,rk8602";
141		reg = <0x42>;
142		fcs,suspend-voltage-selector = <1>;
143		regulator-name = "vdd_cpu_big0_s0";
144		regulator-always-on;
145		regulator-boot-on;
146		regulator-min-microvolt = <550000>;
147		regulator-max-microvolt = <1050000>;
148		regulator-ramp-delay = <2300>;
149		vin-supply = <&vcc5v0_sys>;
150
151		regulator-state-mem {
152			regulator-off-in-suspend;
153		};
154	};
155
156	vdd_cpu_big1_s0: regulator@43 {
157		compatible = "rockchip,rk8603", "rockchip,rk8602";
158		reg = <0x43>;
159		fcs,suspend-voltage-selector = <1>;
160		regulator-name = "vdd_cpu_big1_s0";
161		regulator-always-on;
162		regulator-boot-on;
163		regulator-min-microvolt = <550000>;
164		regulator-max-microvolt = <1050000>;
165		regulator-ramp-delay = <2300>;
166		vin-supply = <&vcc5v0_sys>;
167
168		regulator-state-mem {
169			regulator-off-in-suspend;
170		};
171	};
172};
173
174&i2c2 {
175	status = "okay";
176
177	vdd_npu_s0: regulator@42 {
178		compatible = "rockchip,rk8602";
179		reg = <0x42>;
180		fcs,suspend-voltage-selector = <1>;
181		regulator-name = "vdd_npu_s0";
182		regulator-always-on;
183		regulator-boot-on;
184		regulator-min-microvolt = <550000>;
185		regulator-max-microvolt = <950000>;
186		regulator-ramp-delay = <2300>;
187		vin-supply = <&vcc5v0_sys>;
188
189		regulator-state-mem {
190			regulator-off-in-suspend;
191		};
192	};
193
194	eeprom: eeprom@50 {
195		compatible = "belling,bl24c16a", "atmel,24c16";
196		reg = <0x50>;
197		pagesize = <16>;
198	};
199};
200
201&i2c3 {
202	status = "okay";
203};
204
205&i2c5 {
206	status = "okay";
207	pinctrl-names = "default";
208	pinctrl-0 = <&i2c5m2_xfer>;
209};
210
211&i2c7 {
212	status = "okay";
213
214	es8316: audio-codec@11 {
215		compatible = "everest,es8316";
216		reg = <0x11>;
217		clocks = <&cru I2S0_8CH_MCLKOUT>;
218		clock-names = "mclk";
219		assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
220		assigned-clock-rates = <12288000>;
221		#sound-dai-cells = <0>;
222
223		port {
224			es8316_p0_0: endpoint {
225				remote-endpoint = <&i2s0_8ch_p0_0>;
226			};
227		};
228	};
229};
230
231&i2s0_8ch {
232	pinctrl-names = "default";
233	pinctrl-0 = <&i2s0_lrck
234		     &i2s0_mclk
235		     &i2s0_sclk
236		     &i2s0_sdi0
237		     &i2s0_sdo0>;
238	status = "okay";
239
240	i2s0_8ch_p0: port {
241		i2s0_8ch_p0_0: endpoint {
242			dai-format = "i2s";
243			mclk-fs = <256>;
244			remote-endpoint = <&es8316_p0_0>;
245		};
246	};
247};
248
249&gmac1 {
250	clock_in_out = "output";
251	phy-handle = <&rgmii_phy1>;
252	phy-mode = "rgmii";
253	pinctrl-0 = <&gmac1_miim
254		     &gmac1_tx_bus2
255		     &gmac1_rx_bus2
256		     &gmac1_rgmii_clk
257		     &gmac1_rgmii_bus>;
258	pinctrl-names = "default";
259	tx_delay = <0x3a>;
260	rx_delay = <0x3e>;
261	status = "okay";
262};
263
264&mdio1 {
265	rgmii_phy1: ethernet-phy@1 {
266		/* RTL8211F */
267		compatible = "ethernet-phy-id001c.c916";
268		reg = <0x1>;
269		pinctrl-names = "default";
270		pinctrl-0 = <&rtl8211f_rst>;
271		reset-assert-us = <20000>;
272		reset-deassert-us = <100000>;
273		reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
274	};
275};
276
277&pinctrl {
278	leds {
279		io_led: io-led {
280			rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
281		};
282	};
283
284	power {
285		vcc_5v0_en: vcc-5v0-en {
286			rockchip,pins = <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
287		};
288	};
289
290	rtl8211f {
291		rtl8211f_rst: rtl8211f-rst {
292			rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
293		};
294	};
295};
296
297&pwm3 {
298	pinctrl-names = "default";
299	pinctrl-0 = <&pwm3m1_pins>;
300	status = "okay";
301};
302
303&saradc {
304	vref-supply = <&avcc_1v8_s0>;
305	status = "okay";
306};
307
308&sdhci {
309	bus-width = <8>;
310	no-sdio;
311	no-sd;
312	non-removable;
313	max-frequency = <200000000>;
314	mmc-hs400-1_8v;
315	mmc-hs400-enhanced-strobe;
316	status = "okay";
317};
318
319&sdmmc {
320	bus-width = <4>;
321	cap-mmc-highspeed;
322	cap-sd-highspeed;
323	disable-wp;
324	max-frequency = <150000000>;
325	no-sdio;
326	no-mmc;
327	sd-uhs-sdr104;
328	vmmc-supply = <&vcc_3v3_s0>;
329	vqmmc-supply = <&vccio_sd_s0>;
330	status = "okay";
331};
332
333&spi2 {
334	status = "okay";
335	assigned-clocks = <&cru CLK_SPI2>;
336	assigned-clock-rates = <200000000>;
337	num-cs = <1>;
338	pinctrl-names = "default";
339	pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
340
341	pmic@0 {
342		compatible = "rockchip,rk806";
343		reg = <0x0>;
344		interrupt-parent = <&gpio0>;
345		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
346		pinctrl-names = "default";
347		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
348			    <&rk806_dvs2_null>, <&rk806_dvs3_null>;
349		spi-max-frequency = <1000000>;
350
351		vcc1-supply = <&vcc5v0_sys>;
352		vcc2-supply = <&vcc5v0_sys>;
353		vcc3-supply = <&vcc5v0_sys>;
354		vcc4-supply = <&vcc5v0_sys>;
355		vcc5-supply = <&vcc5v0_sys>;
356		vcc6-supply = <&vcc5v0_sys>;
357		vcc7-supply = <&vcc5v0_sys>;
358		vcc8-supply = <&vcc5v0_sys>;
359		vcc9-supply = <&vcc5v0_sys>;
360		vcc10-supply = <&vcc5v0_sys>;
361		vcc11-supply = <&vcc_2v0_pldo_s3>;
362		vcc12-supply = <&vcc5v0_sys>;
363		vcc13-supply = <&vcc_1v1_nldo_s3>;
364		vcc14-supply = <&vcc_1v1_nldo_s3>;
365		vcca-supply = <&vcc5v0_sys>;
366
367		gpio-controller;
368		#gpio-cells = <2>;
369
370		rk806_dvs1_null: dvs1-null-pins {
371			pins = "gpio_pwrctrl2";
372			function = "pin_fun0";
373		};
374
375		rk806_dvs2_null: dvs2-null-pins {
376			pins = "gpio_pwrctrl2";
377			function = "pin_fun0";
378		};
379
380		rk806_dvs3_null: dvs3-null-pins {
381			pins = "gpio_pwrctrl3";
382			function = "pin_fun0";
383		};
384
385		regulators {
386			vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 {
387				regulator-name = "vdd_gpu_s0";
388				regulator-boot-on;
389				regulator-min-microvolt = <550000>;
390				regulator-max-microvolt = <950000>;
391				regulator-ramp-delay = <12500>;
392				regulator-enable-ramp-delay = <400>;
393
394				regulator-state-mem {
395					regulator-off-in-suspend;
396				};
397			};
398
399			vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 {
400				regulator-name = "vdd_cpu_lit_s0";
401				regulator-always-on;
402				regulator-boot-on;
403				regulator-min-microvolt = <550000>;
404				regulator-max-microvolt = <950000>;
405				regulator-ramp-delay = <12500>;
406
407				regulator-state-mem {
408					regulator-off-in-suspend;
409				};
410			};
411
412			vdd_log_s0: dcdc-reg3 {
413				regulator-name = "vdd_log_s0";
414				regulator-always-on;
415				regulator-boot-on;
416				regulator-min-microvolt = <675000>;
417				regulator-max-microvolt = <750000>;
418				regulator-ramp-delay = <12500>;
419
420				regulator-state-mem {
421					regulator-off-in-suspend;
422					regulator-suspend-microvolt = <750000>;
423				};
424			};
425
426			vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 {
427				regulator-name = "vdd_vdenc_s0";
428				regulator-always-on;
429				regulator-boot-on;
430				regulator-min-microvolt = <550000>;
431				regulator-max-microvolt = <950000>;
432				regulator-ramp-delay = <12500>;
433
434				regulator-state-mem {
435					regulator-off-in-suspend;
436				};
437			};
438
439			vdd_ddr_s0: dcdc-reg5 {
440				regulator-name = "vdd_ddr_s0";
441				regulator-always-on;
442				regulator-boot-on;
443				regulator-min-microvolt = <675000>;
444				regulator-max-microvolt = <900000>;
445				regulator-ramp-delay = <12500>;
446
447				regulator-state-mem {
448					regulator-off-in-suspend;
449					regulator-suspend-microvolt = <850000>;
450				};
451			};
452
453			vdd2_ddr_s3: dcdc-reg6 {
454				regulator-name = "vdd2_ddr_s3";
455				regulator-always-on;
456				regulator-boot-on;
457
458				regulator-state-mem {
459					regulator-on-in-suspend;
460				};
461			};
462
463			vcc_2v0_pldo_s3: dcdc-reg7 {
464				regulator-name = "vdd_2v0_pldo_s3";
465				regulator-always-on;
466				regulator-boot-on;
467				regulator-min-microvolt = <2000000>;
468				regulator-max-microvolt = <2000000>;
469				regulator-ramp-delay = <12500>;
470
471				regulator-state-mem {
472					regulator-on-in-suspend;
473					regulator-suspend-microvolt = <2000000>;
474				};
475			};
476
477			vcc_3v3_s3: dcdc-reg8 {
478				regulator-name = "vcc_3v3_s3";
479				regulator-always-on;
480				regulator-boot-on;
481				regulator-min-microvolt = <3300000>;
482				regulator-max-microvolt = <3300000>;
483
484				regulator-state-mem {
485					regulator-on-in-suspend;
486					regulator-suspend-microvolt = <3300000>;
487				};
488			};
489
490			vddq_ddr_s0: dcdc-reg9 {
491				regulator-name = "vddq_ddr_s0";
492				regulator-always-on;
493				regulator-boot-on;
494
495				regulator-state-mem {
496					regulator-off-in-suspend;
497				};
498			};
499
500			vcc_1v8_s3: dcdc-reg10 {
501				regulator-name = "vcc_1v8_s3";
502				regulator-always-on;
503				regulator-boot-on;
504				regulator-min-microvolt = <1800000>;
505				regulator-max-microvolt = <1800000>;
506
507				regulator-state-mem {
508					regulator-on-in-suspend;
509					regulator-suspend-microvolt = <1800000>;
510				};
511			};
512
513			avcc_1v8_s0: pldo-reg1 {
514				regulator-name = "avcc_1v8_s0";
515				regulator-always-on;
516				regulator-boot-on;
517				regulator-min-microvolt = <1800000>;
518				regulator-max-microvolt = <1800000>;
519
520				regulator-state-mem {
521					regulator-off-in-suspend;
522				};
523			};
524
525			vcc_1v8_s0: pldo-reg2 {
526				regulator-name = "vcc_1v8_s0";
527				regulator-always-on;
528				regulator-boot-on;
529				regulator-min-microvolt = <1800000>;
530				regulator-max-microvolt = <1800000>;
531
532				regulator-state-mem {
533					regulator-off-in-suspend;
534					regulator-suspend-microvolt = <1800000>;
535				};
536			};
537
538			avdd_1v2_s0: pldo-reg3 {
539				regulator-name = "avdd_1v2_s0";
540				regulator-always-on;
541				regulator-boot-on;
542				regulator-min-microvolt = <1200000>;
543				regulator-max-microvolt = <1200000>;
544
545				regulator-state-mem {
546					regulator-off-in-suspend;
547				};
548			};
549
550			vcc_3v3_s0: pldo-reg4 {
551				regulator-name = "vcc_3v3_s0";
552				regulator-always-on;
553				regulator-boot-on;
554				regulator-min-microvolt = <3300000>;
555				regulator-max-microvolt = <3300000>;
556				regulator-ramp-delay = <12500>;
557
558				regulator-state-mem {
559					regulator-off-in-suspend;
560				};
561			};
562
563			vccio_sd_s0: pldo-reg5 {
564				regulator-name = "vccio_sd_s0";
565				regulator-always-on;
566				regulator-boot-on;
567				regulator-min-microvolt = <1800000>;
568				regulator-max-microvolt = <3300000>;
569				regulator-ramp-delay = <12500>;
570
571				regulator-state-mem {
572					regulator-off-in-suspend;
573				};
574			};
575
576			pldo6_s3: pldo-reg6 {
577				regulator-name = "pldo6_s3";
578				regulator-always-on;
579				regulator-boot-on;
580				regulator-min-microvolt = <1800000>;
581				regulator-max-microvolt = <1800000>;
582
583				regulator-state-mem {
584					regulator-on-in-suspend;
585					regulator-suspend-microvolt = <1800000>;
586				};
587			};
588
589			vdd_0v75_s3: nldo-reg1 {
590				regulator-name = "vdd_0v75_s3";
591				regulator-always-on;
592				regulator-boot-on;
593				regulator-min-microvolt = <750000>;
594				regulator-max-microvolt = <750000>;
595
596				regulator-state-mem {
597					regulator-on-in-suspend;
598					regulator-suspend-microvolt = <750000>;
599				};
600			};
601
602			vdd_ddr_pll_s0: nldo-reg2 {
603				regulator-name = "vdd_ddr_pll_s0";
604				regulator-always-on;
605				regulator-boot-on;
606				regulator-min-microvolt = <850000>;
607				regulator-max-microvolt = <850000>;
608
609				regulator-state-mem {
610					regulator-off-in-suspend;
611					regulator-suspend-microvolt = <850000>;
612				};
613			};
614
615			avdd_0v75_s0: nldo-reg3 {
616				regulator-name = "avdd_0v75_s0";
617				regulator-always-on;
618				regulator-boot-on;
619				regulator-min-microvolt = <750000>;
620				regulator-max-microvolt = <750000>;
621
622				regulator-state-mem {
623					regulator-off-in-suspend;
624				};
625			};
626
627			vdd_0v85_s0: nldo-reg4 {
628				regulator-name = "vdd_0v85_s0";
629				regulator-always-on;
630				regulator-boot-on;
631				regulator-min-microvolt = <850000>;
632				regulator-max-microvolt = <850000>;
633
634				regulator-state-mem {
635					regulator-off-in-suspend;
636				};
637			};
638
639			vdd_0v75_s0: nldo-reg5 {
640				regulator-name = "vdd_0v75_s0";
641				regulator-always-on;
642				regulator-boot-on;
643				regulator-min-microvolt = <750000>;
644				regulator-max-microvolt = <750000>;
645
646				regulator-state-mem {
647					regulator-off-in-suspend;
648				};
649			};
650		};
651	};
652};
653
654&uart2 {
655	pinctrl-0 = <&uart2m0_xfer>;
656	status = "okay";
657};
658