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&i2c3 {
194	status = "okay";
195};
196
197&i2c5 {
198	status = "okay";
199	pinctrl-names = "default";
200	pinctrl-0 = <&i2c5m2_xfer>;
201};
202
203&i2c7 {
204	status = "okay";
205
206	es8316: audio-codec@11 {
207		compatible = "everest,es8316";
208		reg = <0x11>;
209		clocks = <&cru I2S0_8CH_MCLKOUT>;
210		clock-names = "mclk";
211		assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
212		assigned-clock-rates = <12288000>;
213		#sound-dai-cells = <0>;
214
215		port {
216			es8316_p0_0: endpoint {
217				remote-endpoint = <&i2s0_8ch_p0_0>;
218			};
219		};
220	};
221};
222
223&i2s0_8ch {
224	pinctrl-names = "default";
225	pinctrl-0 = <&i2s0_lrck
226		     &i2s0_mclk
227		     &i2s0_sclk
228		     &i2s0_sdi0
229		     &i2s0_sdo0>;
230	status = "okay";
231
232	i2s0_8ch_p0: port {
233		i2s0_8ch_p0_0: endpoint {
234			dai-format = "i2s";
235			mclk-fs = <256>;
236			remote-endpoint = <&es8316_p0_0>;
237		};
238	};
239};
240
241&gmac1 {
242	clock_in_out = "output";
243	phy-handle = <&rgmii_phy1>;
244	phy-mode = "rgmii";
245	pinctrl-0 = <&gmac1_miim
246		     &gmac1_tx_bus2
247		     &gmac1_rx_bus2
248		     &gmac1_rgmii_clk
249		     &gmac1_rgmii_bus>;
250	pinctrl-names = "default";
251	tx_delay = <0x3a>;
252	rx_delay = <0x3e>;
253	status = "okay";
254};
255
256&mdio1 {
257	rgmii_phy1: ethernet-phy@1 {
258		/* RTL8211F */
259		compatible = "ethernet-phy-id001c.c916";
260		reg = <0x1>;
261		pinctrl-names = "default";
262		pinctrl-0 = <&rtl8211f_rst>;
263		reset-assert-us = <20000>;
264		reset-deassert-us = <100000>;
265		reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
266	};
267};
268
269&pinctrl {
270	leds {
271		io_led: io-led {
272			rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
273		};
274	};
275
276	power {
277		vcc_5v0_en: vcc-5v0-en {
278			rockchip,pins = <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
279		};
280	};
281
282	rtl8211f {
283		rtl8211f_rst: rtl8211f-rst {
284			rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
285		};
286	};
287};
288
289&sdhci {
290	bus-width = <8>;
291	no-sdio;
292	no-sd;
293	non-removable;
294	max-frequency = <200000000>;
295	mmc-hs400-1_8v;
296	mmc-hs400-enhanced-strobe;
297	status = "okay";
298};
299
300&sdmmc {
301	bus-width = <4>;
302	cap-mmc-highspeed;
303	cap-sd-highspeed;
304	disable-wp;
305	max-frequency = <150000000>;
306	no-sdio;
307	no-mmc;
308	sd-uhs-sdr104;
309	vmmc-supply = <&vcc_3v3_s0>;
310	vqmmc-supply = <&vccio_sd_s0>;
311	status = "okay";
312};
313
314&spi2 {
315	status = "okay";
316	assigned-clocks = <&cru CLK_SPI2>;
317	assigned-clock-rates = <200000000>;
318	num-cs = <1>;
319	pinctrl-names = "default";
320	pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
321
322	pmic@0 {
323		compatible = "rockchip,rk806";
324		reg = <0x0>;
325		interrupt-parent = <&gpio0>;
326		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
327		pinctrl-names = "default";
328		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
329			    <&rk806_dvs2_null>, <&rk806_dvs3_null>;
330		spi-max-frequency = <1000000>;
331
332		vcc1-supply = <&vcc5v0_sys>;
333		vcc2-supply = <&vcc5v0_sys>;
334		vcc3-supply = <&vcc5v0_sys>;
335		vcc4-supply = <&vcc5v0_sys>;
336		vcc5-supply = <&vcc5v0_sys>;
337		vcc6-supply = <&vcc5v0_sys>;
338		vcc7-supply = <&vcc5v0_sys>;
339		vcc8-supply = <&vcc5v0_sys>;
340		vcc9-supply = <&vcc5v0_sys>;
341		vcc10-supply = <&vcc5v0_sys>;
342		vcc11-supply = <&vcc_2v0_pldo_s3>;
343		vcc12-supply = <&vcc5v0_sys>;
344		vcc13-supply = <&vcc_1v1_nldo_s3>;
345		vcc14-supply = <&vcc_1v1_nldo_s3>;
346		vcca-supply = <&vcc5v0_sys>;
347
348		gpio-controller;
349		#gpio-cells = <2>;
350
351		rk806_dvs1_null: dvs1-null-pins {
352			pins = "gpio_pwrctrl2";
353			function = "pin_fun0";
354		};
355
356		rk806_dvs2_null: dvs2-null-pins {
357			pins = "gpio_pwrctrl2";
358			function = "pin_fun0";
359		};
360
361		rk806_dvs3_null: dvs3-null-pins {
362			pins = "gpio_pwrctrl3";
363			function = "pin_fun0";
364		};
365
366		regulators {
367			vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 {
368				regulator-name = "vdd_gpu_s0";
369				regulator-boot-on;
370				regulator-min-microvolt = <550000>;
371				regulator-max-microvolt = <950000>;
372				regulator-ramp-delay = <12500>;
373				regulator-enable-ramp-delay = <400>;
374
375				regulator-state-mem {
376					regulator-off-in-suspend;
377				};
378			};
379
380			vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 {
381				regulator-name = "vdd_cpu_lit_s0";
382				regulator-always-on;
383				regulator-boot-on;
384				regulator-min-microvolt = <550000>;
385				regulator-max-microvolt = <950000>;
386				regulator-ramp-delay = <12500>;
387
388				regulator-state-mem {
389					regulator-off-in-suspend;
390				};
391			};
392
393			vdd_log_s0: dcdc-reg3 {
394				regulator-name = "vdd_log_s0";
395				regulator-always-on;
396				regulator-boot-on;
397				regulator-min-microvolt = <675000>;
398				regulator-max-microvolt = <750000>;
399				regulator-ramp-delay = <12500>;
400
401				regulator-state-mem {
402					regulator-off-in-suspend;
403					regulator-suspend-microvolt = <750000>;
404				};
405			};
406
407			vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 {
408				regulator-name = "vdd_vdenc_s0";
409				regulator-always-on;
410				regulator-boot-on;
411				regulator-min-microvolt = <550000>;
412				regulator-max-microvolt = <950000>;
413				regulator-ramp-delay = <12500>;
414
415				regulator-state-mem {
416					regulator-off-in-suspend;
417				};
418			};
419
420			vdd_ddr_s0: dcdc-reg5 {
421				regulator-name = "vdd_ddr_s0";
422				regulator-always-on;
423				regulator-boot-on;
424				regulator-min-microvolt = <675000>;
425				regulator-max-microvolt = <900000>;
426				regulator-ramp-delay = <12500>;
427
428				regulator-state-mem {
429					regulator-off-in-suspend;
430					regulator-suspend-microvolt = <850000>;
431				};
432			};
433
434			vdd2_ddr_s3: dcdc-reg6 {
435				regulator-name = "vdd2_ddr_s3";
436				regulator-always-on;
437				regulator-boot-on;
438
439				regulator-state-mem {
440					regulator-on-in-suspend;
441				};
442			};
443
444			vcc_2v0_pldo_s3: dcdc-reg7 {
445				regulator-name = "vdd_2v0_pldo_s3";
446				regulator-always-on;
447				regulator-boot-on;
448				regulator-min-microvolt = <2000000>;
449				regulator-max-microvolt = <2000000>;
450				regulator-ramp-delay = <12500>;
451
452				regulator-state-mem {
453					regulator-on-in-suspend;
454					regulator-suspend-microvolt = <2000000>;
455				};
456			};
457
458			vcc_3v3_s3: dcdc-reg8 {
459				regulator-name = "vcc_3v3_s3";
460				regulator-always-on;
461				regulator-boot-on;
462				regulator-min-microvolt = <3300000>;
463				regulator-max-microvolt = <3300000>;
464
465				regulator-state-mem {
466					regulator-on-in-suspend;
467					regulator-suspend-microvolt = <3300000>;
468				};
469			};
470
471			vddq_ddr_s0: dcdc-reg9 {
472				regulator-name = "vddq_ddr_s0";
473				regulator-always-on;
474				regulator-boot-on;
475
476				regulator-state-mem {
477					regulator-off-in-suspend;
478				};
479			};
480
481			vcc_1v8_s3: dcdc-reg10 {
482				regulator-name = "vcc_1v8_s3";
483				regulator-always-on;
484				regulator-boot-on;
485				regulator-min-microvolt = <1800000>;
486				regulator-max-microvolt = <1800000>;
487
488				regulator-state-mem {
489					regulator-on-in-suspend;
490					regulator-suspend-microvolt = <1800000>;
491				};
492			};
493
494			avcc_1v8_s0: pldo-reg1 {
495				regulator-name = "avcc_1v8_s0";
496				regulator-always-on;
497				regulator-boot-on;
498				regulator-min-microvolt = <1800000>;
499				regulator-max-microvolt = <1800000>;
500
501				regulator-state-mem {
502					regulator-off-in-suspend;
503				};
504			};
505
506			vcc_1v8_s0: pldo-reg2 {
507				regulator-name = "vcc_1v8_s0";
508				regulator-always-on;
509				regulator-boot-on;
510				regulator-min-microvolt = <1800000>;
511				regulator-max-microvolt = <1800000>;
512
513				regulator-state-mem {
514					regulator-off-in-suspend;
515					regulator-suspend-microvolt = <1800000>;
516				};
517			};
518
519			avdd_1v2_s0: pldo-reg3 {
520				regulator-name = "avdd_1v2_s0";
521				regulator-always-on;
522				regulator-boot-on;
523				regulator-min-microvolt = <1200000>;
524				regulator-max-microvolt = <1200000>;
525
526				regulator-state-mem {
527					regulator-off-in-suspend;
528				};
529			};
530
531			vcc_3v3_s0: pldo-reg4 {
532				regulator-name = "vcc_3v3_s0";
533				regulator-always-on;
534				regulator-boot-on;
535				regulator-min-microvolt = <3300000>;
536				regulator-max-microvolt = <3300000>;
537				regulator-ramp-delay = <12500>;
538
539				regulator-state-mem {
540					regulator-off-in-suspend;
541				};
542			};
543
544			vccio_sd_s0: pldo-reg5 {
545				regulator-name = "vccio_sd_s0";
546				regulator-always-on;
547				regulator-boot-on;
548				regulator-min-microvolt = <1800000>;
549				regulator-max-microvolt = <3300000>;
550				regulator-ramp-delay = <12500>;
551
552				regulator-state-mem {
553					regulator-off-in-suspend;
554				};
555			};
556
557			pldo6_s3: pldo-reg6 {
558				regulator-name = "pldo6_s3";
559				regulator-always-on;
560				regulator-boot-on;
561				regulator-min-microvolt = <1800000>;
562				regulator-max-microvolt = <1800000>;
563
564				regulator-state-mem {
565					regulator-on-in-suspend;
566					regulator-suspend-microvolt = <1800000>;
567				};
568			};
569
570			vdd_0v75_s3: nldo-reg1 {
571				regulator-name = "vdd_0v75_s3";
572				regulator-always-on;
573				regulator-boot-on;
574				regulator-min-microvolt = <750000>;
575				regulator-max-microvolt = <750000>;
576
577				regulator-state-mem {
578					regulator-on-in-suspend;
579					regulator-suspend-microvolt = <750000>;
580				};
581			};
582
583			vdd_ddr_pll_s0: nldo-reg2 {
584				regulator-name = "vdd_ddr_pll_s0";
585				regulator-always-on;
586				regulator-boot-on;
587				regulator-min-microvolt = <850000>;
588				regulator-max-microvolt = <850000>;
589
590				regulator-state-mem {
591					regulator-off-in-suspend;
592					regulator-suspend-microvolt = <850000>;
593				};
594			};
595
596			avdd_0v75_s0: nldo-reg3 {
597				regulator-name = "avdd_0v75_s0";
598				regulator-always-on;
599				regulator-boot-on;
600				regulator-min-microvolt = <750000>;
601				regulator-max-microvolt = <750000>;
602
603				regulator-state-mem {
604					regulator-off-in-suspend;
605				};
606			};
607
608			vdd_0v85_s0: nldo-reg4 {
609				regulator-name = "vdd_0v85_s0";
610				regulator-always-on;
611				regulator-boot-on;
612				regulator-min-microvolt = <850000>;
613				regulator-max-microvolt = <850000>;
614
615				regulator-state-mem {
616					regulator-off-in-suspend;
617				};
618			};
619
620			vdd_0v75_s0: nldo-reg5 {
621				regulator-name = "vdd_0v75_s0";
622				regulator-always-on;
623				regulator-boot-on;
624				regulator-min-microvolt = <750000>;
625				regulator-max-microvolt = <750000>;
626
627				regulator-state-mem {
628					regulator-off-in-suspend;
629				};
630			};
631		};
632	};
633};
634
635&uart2 {
636	pinctrl-0 = <&uart2m0_xfer>;
637	status = "okay";
638};
639