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