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