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 "rk3588s.dtsi"
8
9/ {
10	model = "Radxa ROCK 5 Model A";
11	compatible = "radxa,rock-5a", "rockchip,rk3588s";
12
13	aliases {
14		mmc0 = &sdhci;
15		serial2 = &uart2;
16	};
17
18	chosen {
19		stdout-path = "serial2:1500000n8";
20	};
21
22	vcc12v_dcin: vcc12v-dcin-regulator {
23		compatible = "regulator-fixed";
24		regulator-name = "vcc12v_dcin";
25		regulator-always-on;
26		regulator-boot-on;
27		regulator-min-microvolt = <12000000>;
28		regulator-max-microvolt = <12000000>;
29	};
30
31	vcc5v0_sys: vcc5v0-sys-regulator {
32		compatible = "regulator-fixed";
33		regulator-name = "vcc5v0_sys";
34		regulator-always-on;
35		regulator-boot-on;
36		regulator-min-microvolt = <5000000>;
37		regulator-max-microvolt = <5000000>;
38		vin-supply = <&vcc12v_dcin>;
39	};
40
41	vcc_1v1_nldo_s3: vcc-1v1-nldo-s3-regulator {
42		compatible = "regulator-fixed";
43		regulator-name = "vcc_1v1_nldo_s3";
44		regulator-always-on;
45		regulator-boot-on;
46		regulator-min-microvolt = <1100000>;
47		regulator-max-microvolt = <1100000>;
48		vin-supply = <&vcc5v0_sys>;
49	};
50};
51
52&cpu_b0 {
53	cpu-supply = <&vdd_cpu_big0_s0>;
54};
55
56&cpu_b1 {
57	cpu-supply = <&vdd_cpu_big0_s0>;
58};
59
60&cpu_b2 {
61	cpu-supply = <&vdd_cpu_big1_s0>;
62};
63
64&cpu_b3 {
65	cpu-supply = <&vdd_cpu_big1_s0>;
66};
67
68&cpu_l0 {
69	cpu-supply = <&vdd_cpu_lit_s0>;
70};
71
72&cpu_l1 {
73	cpu-supply = <&vdd_cpu_lit_s0>;
74};
75
76&cpu_l2 {
77	cpu-supply = <&vdd_cpu_lit_s0>;
78};
79
80&cpu_l3 {
81	cpu-supply = <&vdd_cpu_lit_s0>;
82};
83
84&i2c0 {
85	pinctrl-names = "default";
86	pinctrl-0 = <&i2c0m2_xfer>;
87	status = "okay";
88
89	vdd_cpu_big0_s0: regulator@42 {
90		compatible = "rockchip,rk8602";
91		reg = <0x42>;
92		fcs,suspend-voltage-selector = <1>;
93		regulator-name = "vdd_cpu_big0_s0";
94		regulator-always-on;
95		regulator-boot-on;
96		regulator-min-microvolt = <550000>;
97		regulator-max-microvolt = <1050000>;
98		regulator-ramp-delay = <2300>;
99		vin-supply = <&vcc5v0_sys>;
100
101		regulator-state-mem {
102			regulator-off-in-suspend;
103		};
104	};
105
106	vdd_cpu_big1_s0: regulator@43 {
107		compatible = "rockchip,rk8603", "rockchip,rk8602";
108		reg = <0x43>;
109		fcs,suspend-voltage-selector = <1>;
110		regulator-name = "vdd_cpu_big1_s0";
111		regulator-always-on;
112		regulator-boot-on;
113		regulator-min-microvolt = <550000>;
114		regulator-max-microvolt = <1050000>;
115		regulator-ramp-delay = <2300>;
116		vin-supply = <&vcc5v0_sys>;
117
118		regulator-state-mem {
119			regulator-off-in-suspend;
120		};
121	};
122};
123
124&gmac1 {
125	clock_in_out = "output";
126	phy-handle = <&rgmii_phy1>;
127	phy-mode = "rgmii";
128	pinctrl-0 = <&gmac1_miim
129		     &gmac1_tx_bus2
130		     &gmac1_rx_bus2
131		     &gmac1_rgmii_clk
132		     &gmac1_rgmii_bus>;
133	pinctrl-names = "default";
134	tx_delay = <0x3a>;
135	rx_delay = <0x3e>;
136	status = "okay";
137};
138
139&mdio1 {
140	rgmii_phy1: ethernet-phy@1 {
141		/* RTL8211F */
142		compatible = "ethernet-phy-id001c.c916";
143		reg = <0x1>;
144		pinctrl-names = "default";
145		pinctrl-0 = <&rtl8211f_rst>;
146		reset-assert-us = <20000>;
147		reset-deassert-us = <100000>;
148		reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
149	};
150};
151
152&pinctrl {
153	rtl8211f {
154		rtl8211f_rst: rtl8211f-rst {
155			rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
156		};
157	};
158};
159
160&sdhci {
161	bus-width = <8>;
162	no-sdio;
163	no-sd;
164	non-removable;
165	max-frequency = <200000000>;
166	mmc-hs400-1_8v;
167	mmc-hs400-enhanced-strobe;
168	status = "okay";
169};
170
171&spi2 {
172	status = "okay";
173	assigned-clocks = <&cru CLK_SPI2>;
174	assigned-clock-rates = <200000000>;
175	num-cs = <1>;
176	pinctrl-names = "default";
177	pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
178
179	pmic@0 {
180		compatible = "rockchip,rk806";
181		reg = <0x0>;
182		interrupt-parent = <&gpio0>;
183		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
184		pinctrl-names = "default";
185		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
186			    <&rk806_dvs2_null>, <&rk806_dvs3_null>;
187		spi-max-frequency = <1000000>;
188
189		vcc1-supply = <&vcc5v0_sys>;
190		vcc2-supply = <&vcc5v0_sys>;
191		vcc3-supply = <&vcc5v0_sys>;
192		vcc4-supply = <&vcc5v0_sys>;
193		vcc5-supply = <&vcc5v0_sys>;
194		vcc6-supply = <&vcc5v0_sys>;
195		vcc7-supply = <&vcc5v0_sys>;
196		vcc8-supply = <&vcc5v0_sys>;
197		vcc9-supply = <&vcc5v0_sys>;
198		vcc10-supply = <&vcc5v0_sys>;
199		vcc11-supply = <&vcc_2v0_pldo_s3>;
200		vcc12-supply = <&vcc5v0_sys>;
201		vcc13-supply = <&vcc_1v1_nldo_s3>;
202		vcc14-supply = <&vcc_1v1_nldo_s3>;
203		vcca-supply = <&vcc5v0_sys>;
204
205		gpio-controller;
206		#gpio-cells = <2>;
207
208		rk806_dvs1_null: dvs1-null-pins {
209			pins = "gpio_pwrctrl2";
210			function = "pin_fun0";
211		};
212
213		rk806_dvs2_null: dvs2-null-pins {
214			pins = "gpio_pwrctrl2";
215			function = "pin_fun0";
216		};
217
218		rk806_dvs3_null: dvs3-null-pins {
219			pins = "gpio_pwrctrl3";
220			function = "pin_fun0";
221		};
222
223		regulators {
224			vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 {
225				regulator-name = "vdd_gpu_s0";
226				regulator-boot-on;
227				regulator-min-microvolt = <550000>;
228				regulator-max-microvolt = <950000>;
229				regulator-ramp-delay = <12500>;
230				regulator-enable-ramp-delay = <400>;
231
232				regulator-state-mem {
233					regulator-off-in-suspend;
234				};
235			};
236
237			vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 {
238				regulator-name = "vdd_cpu_lit_s0";
239				regulator-always-on;
240				regulator-boot-on;
241				regulator-min-microvolt = <550000>;
242				regulator-max-microvolt = <950000>;
243				regulator-ramp-delay = <12500>;
244
245				regulator-state-mem {
246					regulator-off-in-suspend;
247				};
248			};
249
250			vdd_log_s0: dcdc-reg3 {
251				regulator-name = "vdd_log_s0";
252				regulator-always-on;
253				regulator-boot-on;
254				regulator-min-microvolt = <675000>;
255				regulator-max-microvolt = <750000>;
256				regulator-ramp-delay = <12500>;
257
258				regulator-state-mem {
259					regulator-off-in-suspend;
260					regulator-suspend-microvolt = <750000>;
261				};
262			};
263
264			vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 {
265				regulator-name = "vdd_vdenc_s0";
266				regulator-always-on;
267				regulator-boot-on;
268				regulator-min-microvolt = <550000>;
269				regulator-max-microvolt = <950000>;
270				regulator-ramp-delay = <12500>;
271
272				regulator-state-mem {
273					regulator-off-in-suspend;
274				};
275			};
276
277			vdd_ddr_s0: dcdc-reg5 {
278				regulator-name = "vdd_ddr_s0";
279				regulator-always-on;
280				regulator-boot-on;
281				regulator-min-microvolt = <675000>;
282				regulator-max-microvolt = <900000>;
283				regulator-ramp-delay = <12500>;
284
285				regulator-state-mem {
286					regulator-off-in-suspend;
287					regulator-suspend-microvolt = <850000>;
288				};
289			};
290
291			vdd2_ddr_s3: dcdc-reg6 {
292				regulator-name = "vdd2_ddr_s3";
293				regulator-always-on;
294				regulator-boot-on;
295
296				regulator-state-mem {
297					regulator-on-in-suspend;
298				};
299			};
300
301			vcc_2v0_pldo_s3: dcdc-reg7 {
302				regulator-name = "vdd_2v0_pldo_s3";
303				regulator-always-on;
304				regulator-boot-on;
305				regulator-min-microvolt = <2000000>;
306				regulator-max-microvolt = <2000000>;
307				regulator-ramp-delay = <12500>;
308
309				regulator-state-mem {
310					regulator-on-in-suspend;
311					regulator-suspend-microvolt = <2000000>;
312				};
313			};
314
315			vcc_3v3_s3: dcdc-reg8 {
316				regulator-name = "vcc_3v3_s3";
317				regulator-always-on;
318				regulator-boot-on;
319				regulator-min-microvolt = <3300000>;
320				regulator-max-microvolt = <3300000>;
321
322				regulator-state-mem {
323					regulator-on-in-suspend;
324					regulator-suspend-microvolt = <3300000>;
325				};
326			};
327
328			vddq_ddr_s0: dcdc-reg9 {
329				regulator-name = "vddq_ddr_s0";
330				regulator-always-on;
331				regulator-boot-on;
332
333				regulator-state-mem {
334					regulator-off-in-suspend;
335				};
336			};
337
338			vcc_1v8_s3: dcdc-reg10 {
339				regulator-name = "vcc_1v8_s3";
340				regulator-always-on;
341				regulator-boot-on;
342				regulator-min-microvolt = <1800000>;
343				regulator-max-microvolt = <1800000>;
344
345				regulator-state-mem {
346					regulator-on-in-suspend;
347					regulator-suspend-microvolt = <1800000>;
348				};
349			};
350
351			avcc_1v8_s0: pldo-reg1 {
352				regulator-name = "avcc_1v8_s0";
353				regulator-always-on;
354				regulator-boot-on;
355				regulator-min-microvolt = <1800000>;
356				regulator-max-microvolt = <1800000>;
357
358				regulator-state-mem {
359					regulator-off-in-suspend;
360				};
361			};
362
363			vcc_1v8_s0: pldo-reg2 {
364				regulator-name = "vcc_1v8_s0";
365				regulator-always-on;
366				regulator-boot-on;
367				regulator-min-microvolt = <1800000>;
368				regulator-max-microvolt = <1800000>;
369
370				regulator-state-mem {
371					regulator-off-in-suspend;
372					regulator-suspend-microvolt = <1800000>;
373				};
374			};
375
376			avdd_1v2_s0: pldo-reg3 {
377				regulator-name = "avdd_1v2_s0";
378				regulator-always-on;
379				regulator-boot-on;
380				regulator-min-microvolt = <1200000>;
381				regulator-max-microvolt = <1200000>;
382
383				regulator-state-mem {
384					regulator-off-in-suspend;
385				};
386			};
387
388			vcc_3v3_s0: pldo-reg4 {
389				regulator-name = "vcc_3v3_s0";
390				regulator-always-on;
391				regulator-boot-on;
392				regulator-min-microvolt = <3300000>;
393				regulator-max-microvolt = <3300000>;
394				regulator-ramp-delay = <12500>;
395
396				regulator-state-mem {
397					regulator-off-in-suspend;
398				};
399			};
400
401			vccio_sd_s0: pldo-reg5 {
402				regulator-name = "vccio_sd_s0";
403				regulator-always-on;
404				regulator-boot-on;
405				regulator-min-microvolt = <1800000>;
406				regulator-max-microvolt = <3300000>;
407				regulator-ramp-delay = <12500>;
408
409				regulator-state-mem {
410					regulator-off-in-suspend;
411				};
412			};
413
414			pldo6_s3: pldo-reg6 {
415				regulator-name = "pldo6_s3";
416				regulator-always-on;
417				regulator-boot-on;
418				regulator-min-microvolt = <1800000>;
419				regulator-max-microvolt = <1800000>;
420
421				regulator-state-mem {
422					regulator-on-in-suspend;
423					regulator-suspend-microvolt = <1800000>;
424				};
425			};
426
427			vdd_0v75_s3: nldo-reg1 {
428				regulator-name = "vdd_0v75_s3";
429				regulator-always-on;
430				regulator-boot-on;
431				regulator-min-microvolt = <750000>;
432				regulator-max-microvolt = <750000>;
433
434				regulator-state-mem {
435					regulator-on-in-suspend;
436					regulator-suspend-microvolt = <750000>;
437				};
438			};
439
440			vdd_ddr_pll_s0: nldo-reg2 {
441				regulator-name = "vdd_ddr_pll_s0";
442				regulator-always-on;
443				regulator-boot-on;
444				regulator-min-microvolt = <850000>;
445				regulator-max-microvolt = <850000>;
446
447				regulator-state-mem {
448					regulator-off-in-suspend;
449					regulator-suspend-microvolt = <850000>;
450				};
451			};
452
453			avdd_0v75_s0: nldo-reg3 {
454				regulator-name = "avdd_0v75_s0";
455				regulator-always-on;
456				regulator-boot-on;
457				regulator-min-microvolt = <750000>;
458				regulator-max-microvolt = <750000>;
459
460				regulator-state-mem {
461					regulator-off-in-suspend;
462				};
463			};
464
465			vdd_0v85_s0: nldo-reg4 {
466				regulator-name = "vdd_0v85_s0";
467				regulator-always-on;
468				regulator-boot-on;
469				regulator-min-microvolt = <850000>;
470				regulator-max-microvolt = <850000>;
471
472				regulator-state-mem {
473					regulator-off-in-suspend;
474				};
475			};
476
477			vdd_0v75_s0: nldo-reg5 {
478				regulator-name = "vdd_0v75_s0";
479				regulator-always-on;
480				regulator-boot-on;
481				regulator-min-microvolt = <750000>;
482				regulator-max-microvolt = <750000>;
483
484				regulator-state-mem {
485					regulator-off-in-suspend;
486				};
487			};
488		};
489	};
490};
491
492&uart2 {
493	pinctrl-0 = <&uart2m0_xfer>;
494	status = "okay";
495};
496