e53f7fa7e090f05b5fb8996db5983fcb8b63b873
[openwrt/staging/wigyori.git] /
1 From 7469ab529bcad50490f6ff651c3e4f03bfa88fe0 Mon Sep 17 00:00:00 2001
2 From: Jagan Teki <jagan@amarulasolutions.com>
3 Date: Thu, 12 Jan 2023 16:29:01 +0530
4 Subject: [PATCH] arm64: dts: rockchip: Add rk3566 based Radxa Compute Module 3
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Radxa Compute Module 3(CM3) is one of the modules from a series
10 System On Module based on the Radxa ROCK 3 series and is compatible
11 with Raspberry Pi CM4 pinout and form factor.
12
13 Specification:
14 - Rockchip RK3566
15 - up to 8GB LPDDR4
16 - up to 128GB high performance eMMC
17 - Optional wireless LAN, 2.4GHz and 5.0GHz IEEE 802.11b/g/n/ac wireless,
18 BT 5.0, BLE with onboard and external antenna.
19 - Gigabit Ethernet PHY
20
21 Radxa CM3 needs to mount on top of this IO board in order to create
22 complete Radxa CM3 IO board platform.
23
24 Since Radxa CM3 is compatible with Raspberry Pi CM4 pinout so it is
25 possible to mount Radxa CM3 on top of the Rasberry Pi CM4 IO board.
26
27 Add support for Radxa CM3.
28
29 Co-developed-by: FUKAUMI Naoki <naoki@radxa.com>
30 Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
31 Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
32 Link: https://lore.kernel.org/r/20230112105902.192852-2-jagan@amarulasolutions.com
33 Signed-off-by: Heiko Stuebner <heiko@sntech.de>
34 ---
35 .../boot/dts/rockchip/rk3566-radxa-cm3.dtsi | 345 ++++++++++++++++++
36 1 file changed, 345 insertions(+)
37 create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-radxa-cm3.dtsi
38
39 --- /dev/null
40 +++ b/arch/arm64/boot/dts/rockchip/rk3566-radxa-cm3.dtsi
41 @@ -0,0 +1,345 @@
42 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
43 +/*
44 + * Copyright (c) 2022 Radxa Limited
45 + * Copyright (c) 2022 Amarula Solutions(India)
46 + */
47 +
48 +#include <dt-bindings/gpio/gpio.h>
49 +#include <dt-bindings/leds/common.h>
50 +
51 +/ {
52 + compatible = "radxa,radxa-cm3", "rockchip,rk3566";
53 +
54 + aliases {
55 + mmc0 = &sdhci;
56 + };
57 +
58 + leds {
59 + compatible = "gpio-leds";
60 +
61 + led-0 {
62 + gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
63 + color = <LED_COLOR_ID_GREEN>;
64 + function = LED_FUNCTION_STATUS;
65 + linux,default-trigger = "timer";
66 + default-state = "on";
67 + pinctrl-names = "default";
68 + pinctrl-0 = <&user_led2>;
69 + };
70 + };
71 +
72 + vcc_sys: vcc-sys-regulator {
73 + compatible = "regulator-fixed";
74 + regulator-name = "vcc_sys";
75 + regulator-always-on;
76 + regulator-boot-on;
77 + regulator-min-microvolt = <5000000>;
78 + regulator-max-microvolt = <5000000>;
79 + };
80 +
81 + vcc_1v8: vcc-1v8-regulator {
82 + compatible = "regulator-fixed";
83 + regulator-name = "vcc_1v8";
84 + regulator-always-on;
85 + regulator-boot-on;
86 + regulator-min-microvolt = <1800000>;
87 + regulator-max-microvolt = <1800000>;
88 + vin-supply = <&vcc_1v8_p>;
89 + };
90 +
91 + vcc_3v3: vcc-3v3-regulator {
92 + compatible = "regulator-fixed";
93 + regulator-name = "vcc_3v3";
94 + regulator-always-on;
95 + regulator-boot-on;
96 + regulator-min-microvolt = <3300000>;
97 + regulator-max-microvolt = <3300000>;
98 + vin-supply = <&vcc3v3_sys>;
99 + };
100 +
101 + vcca_1v8: vcca-1v8-regulator {
102 + compatible = "regulator-fixed";
103 + regulator-name = "vcca_1v8";
104 + regulator-always-on;
105 + regulator-boot-on;
106 + regulator-min-microvolt = <1800000>;
107 + regulator-max-microvolt = <1800000>;
108 + vin-supply = <&vcc_1v8_p>;
109 + };
110 +};
111 +
112 +&cpu0 {
113 + cpu-supply = <&vdd_cpu>;
114 +};
115 +
116 +&cpu1 {
117 + cpu-supply = <&vdd_cpu>;
118 +};
119 +
120 +&cpu2 {
121 + cpu-supply = <&vdd_cpu>;
122 +};
123 +
124 +&cpu3 {
125 + cpu-supply = <&vdd_cpu>;
126 +};
127 +
128 +&gpu {
129 + mali-supply = <&vdd_gpu_npu>;
130 + status = "okay";
131 +};
132 +
133 +&i2c0 {
134 + status = "okay";
135 +
136 + vdd_cpu: regulator@1c {
137 + compatible = "tcs,tcs4525";
138 + reg = <0x1c>;
139 + fcs,suspend-voltage-selector = <1>;
140 + regulator-name = "vdd_cpu";
141 + regulator-always-on;
142 + regulator-boot-on;
143 + regulator-min-microvolt = <712500>;
144 + regulator-max-microvolt = <1390000>;
145 + regulator-ramp-delay = <2300>;
146 + vin-supply = <&vcc_sys>;
147 +
148 + regulator-state-mem {
149 + regulator-off-in-suspend;
150 + };
151 + };
152 +
153 + rk817: pmic@20 {
154 + compatible = "rockchip,rk817";
155 + reg = <0x20>;
156 + #clock-cells = <1>;
157 + clock-output-names = "rk817-clkout1", "rk817-clkout2";
158 + interrupt-parent = <&gpio0>;
159 + interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
160 + pinctrl-names = "default";
161 + pinctrl-0 = <&pmic_int_l>;
162 + rockchip,system-power-controller;
163 + wakeup-source;
164 +
165 + vcc1-supply = <&vcc_sys>;
166 + vcc2-supply = <&vcc_sys>;
167 + vcc3-supply = <&vcc_sys>;
168 + vcc4-supply = <&vcc_sys>;
169 + vcc5-supply = <&vcc_sys>;
170 + vcc6-supply = <&vcc_sys>;
171 + vcc7-supply = <&vcc_sys>;
172 +
173 + regulators {
174 + vdd_logic: DCDC_REG1 {
175 + regulator-name = "vdd_logic";
176 + regulator-always-on;
177 + regulator-boot-on;
178 + regulator-initial-mode = <0x2>;
179 + regulator-min-microvolt = <500000>;
180 + regulator-max-microvolt = <1350000>;
181 + regulator-ramp-delay = <6001>;
182 + regulator-state-mem {
183 + regulator-on-in-suspend;
184 + regulator-suspend-microvolt = <900000>;
185 + };
186 + };
187 +
188 + vdd_gpu_npu: DCDC_REG2 {
189 + regulator-name = "vdd_gpu_npu";
190 + regulator-always-on;
191 + regulator-boot-on;
192 + regulator-initial-mode = <0x2>;
193 + regulator-min-microvolt = <500000>;
194 + regulator-max-microvolt = <1350000>;
195 + regulator-ramp-delay = <6001>;
196 + regulator-state-mem {
197 + regulator-off-in-suspend;
198 + };
199 + };
200 +
201 + vcc_ddr: DCDC_REG3 {
202 + regulator-name = "vcc_ddr";
203 + regulator-always-on;
204 + regulator-boot-on;
205 + regulator-initial-mode = <0x2>;
206 + regulator-state-mem {
207 + regulator-on-in-suspend;
208 + };
209 + };
210 +
211 + vcc3v3_sys: DCDC_REG4 {
212 + regulator-name = "vcc3v3_sys";
213 + regulator-always-on;
214 + regulator-boot-on;
215 + regulator-initial-mode = <0x2>;
216 + regulator-min-microvolt = <3300000>;
217 + regulator-max-microvolt = <3300000>;
218 + regulator-state-mem {
219 + regulator-on-in-suspend;
220 + regulator-suspend-microvolt = <3300000>;
221 + };
222 + };
223 +
224 + vcca1v8_pmu: LDO_REG1 {
225 + regulator-name = "vcca1v8_pmu";
226 + regulator-always-on;
227 + regulator-boot-on;
228 + regulator-min-microvolt = <1800000>;
229 + regulator-max-microvolt = <1800000>;
230 + regulator-state-mem {
231 + regulator-on-in-suspend;
232 + regulator-suspend-microvolt = <1800000>;
233 + };
234 + };
235 +
236 + vdda_0v9: LDO_REG2 {
237 + regulator-name = "vdda_0v9";
238 + regulator-always-on;
239 + regulator-boot-on;
240 + regulator-min-microvolt = <900000>;
241 + regulator-max-microvolt = <900000>;
242 + regulator-state-mem {
243 + regulator-off-in-suspend;
244 + };
245 + };
246 +
247 + vdda0v9_pmu: LDO_REG3 {
248 + regulator-name = "vdda0v9_pmu";
249 + regulator-always-on;
250 + regulator-boot-on;
251 + regulator-min-microvolt = <900000>;
252 + regulator-max-microvolt = <900000>;
253 + regulator-state-mem {
254 + regulator-on-in-suspend;
255 + regulator-suspend-microvolt = <900000>;
256 + };
257 + };
258 +
259 + vccio_acodec: LDO_REG4 {
260 + regulator-name = "vccio_acodec";
261 + regulator-always-on;
262 + regulator-boot-on;
263 + regulator-min-microvolt = <3300000>;
264 + regulator-max-microvolt = <3300000>;
265 + regulator-state-mem {
266 + regulator-off-in-suspend;
267 + };
268 + };
269 +
270 + vccio_sd: LDO_REG5 {
271 + regulator-name = "vccio_sd";
272 + regulator-always-on;
273 + regulator-boot-on;
274 + regulator-min-microvolt = <1800000>;
275 + regulator-max-microvolt = <3300000>;
276 + regulator-state-mem {
277 + regulator-off-in-suspend;
278 + };
279 + };
280 +
281 + vcc3v3_pmu: LDO_REG6 {
282 + regulator-name = "vcc3v3_pmu";
283 + regulator-always-on;
284 + regulator-boot-on;
285 + regulator-min-microvolt = <3300000>;
286 + regulator-max-microvolt = <3300000>;
287 + regulator-state-mem {
288 + regulator-on-in-suspend;
289 + regulator-suspend-microvolt = <3300000>;
290 + };
291 + };
292 +
293 + vcc_1v8_p: LDO_REG7 {
294 + regulator-name = "vcc_1v8_p";
295 + regulator-always-on;
296 + regulator-boot-on;
297 + regulator-min-microvolt = <1800000>;
298 + regulator-max-microvolt = <1800000>;
299 + regulator-state-mem {
300 + regulator-off-in-suspend;
301 + };
302 + };
303 +
304 + vcc1v8_dvp: LDO_REG8 {
305 + regulator-name = "vcc1v8_dvp";
306 + regulator-always-on;
307 + regulator-boot-on;
308 + regulator-min-microvolt = <1800000>;
309 + regulator-max-microvolt = <1800000>;
310 + regulator-state-mem {
311 + regulator-off-in-suspend;
312 + };
313 + };
314 +
315 + vcc2v8_dvp: LDO_REG9 {
316 + regulator-name = "vcc2v8_dvp";
317 + regulator-always-on;
318 + regulator-boot-on;
319 + regulator-min-microvolt = <2800000>;
320 + regulator-max-microvolt = <2800000>;
321 + regulator-state-mem {
322 + regulator-off-in-suspend;
323 + };
324 + };
325 +
326 + };
327 + };
328 +};
329 +
330 +&pinctrl {
331 + pmic {
332 + pmic_int_l: pmic-int-l {
333 + rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
334 + };
335 + };
336 +
337 + leds {
338 + user_led2: user-led2 {
339 + rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
340 + };
341 + };
342 +};
343 +
344 +&pmu_io_domains {
345 + pmuio1-supply = <&vcc3v3_pmu>;
346 + pmuio2-supply = <&vcc_3v3>;
347 + vccio1-supply = <&vccio_acodec>;
348 + vccio2-supply = <&vcc_1v8>;
349 + vccio3-supply = <&vccio_sd>;
350 + vccio4-supply = <&vcc_1v8>;
351 + vccio5-supply = <&vcc_3v3>;
352 + vccio6-supply = <&vcc_3v3>;
353 + vccio7-supply = <&vcc_3v3>;
354 + status = "okay";
355 +};
356 +
357 +&saradc {
358 + vref-supply = <&vcca_1v8>;
359 + status = "okay";
360 +};
361 +
362 +&sdhci {
363 + bus-width = <8>;
364 + max-frequency = <200000000>;
365 + mmc-hs200-1_8v;
366 + non-removable;
367 + pinctrl-names = "default";
368 + pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
369 + vmmc-supply = <&vcc_3v3>;
370 + vqmmc-supply = <&vcc_1v8>;
371 + status = "okay";
372 +};
373 +
374 +&usb2phy0 {
375 + status = "okay";
376 +};
377 +
378 +&usb2phy1 {
379 + status = "okay";
380 +};
381 +
382 +&tsadc {
383 + rockchip,hw-tshut-mode = <1>;
384 + rockchip,hw-tshut-polarity = <0>;
385 + status = "okay";
386 +};