blob: 3cda6c627b681e7b470643372148651878e38165 [file] [log] [blame]
Peter Robinson7715db32021-07-22 16:20:43 +01001// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
b.l.huang89473d92020-06-01 00:01:28 +08002/*
Peter Robinson7715db32021-07-22 16:20:43 +01003 * (C) Copyright 2020 Chen-Yu Tsai <wens@csie.org>
4 *
5 * Based on ./rk3328-rock64.dts, which is
6 *
7 * Copyright (c) 2017 PINE64
b.l.huang89473d92020-06-01 00:01:28 +08008 */
9
10/dts-v1/;
Peter Robinson7715db32021-07-22 16:20:43 +010011
12#include <dt-bindings/gpio/gpio.h>
13#include <dt-bindings/input/input.h>
14#include <dt-bindings/leds/common.h>
15#include <dt-bindings/pinctrl/rockchip.h>
16
b.l.huang89473d92020-06-01 00:01:28 +080017#include "rk3328.dtsi"
18
19/ {
Peter Robinson7715db32021-07-22 16:20:43 +010020 model = "Radxa ROCK Pi E";
21 compatible = "radxa,rockpi-e", "rockchip,rk3328";
22
23 aliases {
Jonas Karlmanb74552c2024-02-17 00:22:37 +000024 ethernet0 = &gmac2io;
25 ethernet1 = &gmac2phy;
Peter Robinson7715db32021-07-22 16:20:43 +010026 mmc0 = &sdmmc;
27 mmc1 = &emmc;
28 };
b.l.huang89473d92020-06-01 00:01:28 +080029
30 chosen {
Peter Robinson7715db32021-07-22 16:20:43 +010031 stdout-path = "serial2:1500000n8";
32 };
33
34 adc-keys {
35 compatible = "adc-keys";
36 io-channels = <&saradc 0>;
37 io-channel-names = "buttons";
38 keyup-threshold-microvolt = <1750000>;
39
40 /* This button is unpopulated out of the factory. */
41 button-recovery {
42 label = "Recovery";
43 linux,code = <KEY_VENDOR>;
44 press-threshold-microvolt = <10000>;
45 };
b.l.huang89473d92020-06-01 00:01:28 +080046 };
47
48 gmac_clkin: external-gmac-clock {
Peter Robinson7715db32021-07-22 16:20:43 +010049 compatible = "fixed-clock";
50 clock-frequency = <125000000>;
51 clock-output-names = "gmac_clkin";
52 #clock-cells = <0>;
53 };
54
55 leds {
56 compatible = "gpio-leds";
57 pinctrl-0 = <&led_pin>;
58 pinctrl-names = "default";
59
60 led-0 {
61 color = <LED_COLOR_ID_BLUE>;
62 gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_LOW>;
63 linux,default-trigger = "heartbeat";
64 };
b.l.huang89473d92020-06-01 00:01:28 +080065 };
66
67 vcc_sd: sdmmc-regulator {
Peter Robinson7715db32021-07-22 16:20:43 +010068 compatible = "regulator-fixed";
69 gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
70 pinctrl-names = "default";
71 pinctrl-0 = <&sdmmc0m1_pin>;
72 regulator-name = "vcc_sd";
73 regulator-boot-on;
74 vin-supply = <&vcc_io>;
b.l.huang89473d92020-06-01 00:01:28 +080075 };
76
Peter Robinson7715db32021-07-22 16:20:43 +010077 vcc_host_5v: vcc-host-5v-regulator {
78 compatible = "regulator-fixed";
79 gpio = <&gpio3 RK_PA7 GPIO_ACTIVE_HIGH>;
80 pinctrl-names = "default";
81 pinctrl-0 = <&usb30_host_drv>;
82 enable-active-high;
83 regulator-name = "vcc_host_5v";
84 regulator-always-on;
85 regulator-boot-on;
86 vin-supply = <&vcc_sys>;
b.l.huang89473d92020-06-01 00:01:28 +080087 };
88
89 vcc_sys: vcc-sys {
Peter Robinson7715db32021-07-22 16:20:43 +010090 compatible = "regulator-fixed";
91 regulator-name = "vcc_sys";
92 regulator-always-on;
93 regulator-boot-on;
94 regulator-min-microvolt = <5000000>;
95 regulator-max-microvolt = <5000000>;
96 };
97
98 vcc_wifi: vcc-wifi-regulator {
99 compatible = "regulator-fixed";
100 gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
101 pinctrl-names = "default";
102 pinctrl-0 = <&wifi_en>;
103 regulator-name = "vcc_wifi";
104 regulator-always-on;
105 regulator-boot-on;
106 vin-supply = <&vcc_io>;
b.l.huang89473d92020-06-01 00:01:28 +0800107 };
108};
109
Peter Robinson7715db32021-07-22 16:20:43 +0100110&analog_sound {
111 status = "okay";
112};
113
114&codec {
115 status = "okay";
116};
117
b.l.huang89473d92020-06-01 00:01:28 +0800118&cpu0 {
119 cpu-supply = <&vdd_arm>;
120};
121
122&cpu1 {
123 cpu-supply = <&vdd_arm>;
124};
125
126&cpu2 {
127 cpu-supply = <&vdd_arm>;
128};
129
130&cpu3 {
131 cpu-supply = <&vdd_arm>;
132};
133
134&emmc {
135 bus-width = <8>;
136 cap-mmc-highspeed;
Peter Robinson7715db32021-07-22 16:20:43 +0100137 mmc-ddr-1_8v;
b.l.huang89473d92020-06-01 00:01:28 +0800138 mmc-hs200-1_8v;
b.l.huang89473d92020-06-01 00:01:28 +0800139 non-removable;
b.l.huang89473d92020-06-01 00:01:28 +0800140 pinctrl-names = "default";
Peter Robinson7715db32021-07-22 16:20:43 +0100141 pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
b.l.huang89473d92020-06-01 00:01:28 +0800142 vmmc-supply = <&vcc_io>;
143 vqmmc-supply = <&vcc18_emmc>;
144 status = "okay";
145};
146
147&gmac2io {
148 assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
149 assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
150 clock_in_out = "input";
Peter Robinson7715db32021-07-22 16:20:43 +0100151 phy-handle = <&rtl8211e>;
b.l.huang89473d92020-06-01 00:01:28 +0800152 phy-mode = "rgmii";
Peter Robinson7715db32021-07-22 16:20:43 +0100153 phy-supply = <&vcc_io>;
b.l.huang89473d92020-06-01 00:01:28 +0800154 pinctrl-names = "default";
155 pinctrl-0 = <&rgmiim1_pins>;
Peter Robinson7715db32021-07-22 16:20:43 +0100156 snps,aal;
157 snps,rxpbl = <0x4>;
158 snps,txpbl = <0x4>;
b.l.huang89473d92020-06-01 00:01:28 +0800159 tx_delay = <0x26>;
160 rx_delay = <0x11>;
161 status = "okay";
Peter Robinson7715db32021-07-22 16:20:43 +0100162
163 mdio {
164 compatible = "snps,dwmac-mdio";
165 #address-cells = <1>;
166 #size-cells = <0>;
167
168 rtl8211e: ethernet-phy@1 {
169 reg = <1>;
170 pinctrl-0 = <&eth_phy_int_pin>, <&eth_phy_reset_pin>;
171 pinctrl-names = "default";
172 interrupt-parent = <&gpio1>;
173 interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
174 reset-assert-us = <10000>;
175 reset-deassert-us = <50000>;
176 reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
177 };
178 };
b.l.huang89473d92020-06-01 00:01:28 +0800179};
180
Peter Robinson7715db32021-07-22 16:20:43 +0100181&gmac2phy {
b.l.huang89473d92020-06-01 00:01:28 +0800182 status = "okay";
Peter Robinson7715db32021-07-22 16:20:43 +0100183};
b.l.huang89473d92020-06-01 00:01:28 +0800184
Jonas Karlmanb74552c2024-02-17 00:22:37 +0000185&gpio0 {
186 gpio-line-names =
187 /* GPIO0_A0 - A7 */
188 "", "", "", "", "", "", "", "",
189 /* GPIO0_B0 - B7 */
190 "", "", "", "", "", "", "", "",
191 /* GPIO0_C0 - C7 */
192 "", "", "", "", "", "", "", "",
193 /* GPIO0_D0 - D7 */
194 "", "", "", "pin-15 [GPIO0_D3]", "", "", "", "";
195};
196
197&gpio1 {
198 gpio-line-names =
199 /* GPIO1_A0 - A7 */
200 "", "", "", "", "", "", "", "",
201 /* GPIO1_B0 - B7 */
202 "", "", "", "", "", "", "", "",
203 /* GPIO1_C0 - C7 */
204 "", "", "", "", "", "", "", "",
205 /* GPIO1_D0 - D7 */
206 "", "", "", "", "pin-07 [GPIO1_D4]", "", "", "";
207};
208
209&gpio2 {
210 gpio-line-names =
211 /* GPIO2_A0 - A7 */
212 "pin-08 [GPIO2_A0]", "pin-10 [GPIO2_A1]", "pin-11 [GPIO2_A2]",
213 "pin-13 [GPIO2-A3]", "pin-27 [GPIO2_A4]", "pin-28 [GPIO2_A5]",
214 "pin-33 [GPIO2_A6]", "",
215 /* GPIO2_B0 - B7 */
216 "", "", "", "", "pin-26 [GPIO2_B4]", "", "", "pin-36 [GPIO2_B7]",
217 /* GPIO2_C0 - C7 */
218 "pin-32 [GPIO2_C0]", "pin-35 [GPIO2_C1]", "pin-12 [GPIO2_C2]",
219 "pin-38 [GPIO2_C3]", "pin-29 [GPIO2_C4]", "pin-31 [GPIO2_C5]",
220 "pin-37 [GPIO2_C6]", "pin-40 [GPIO2_C7]",
221 /* GPIO2_D0 - D7 */
222 "", "", "", "", "", "", "", "";
223};
224
225&gpio3 {
226 gpio-line-names =
227 /* GPIO3_A0 - A7 */
228 "pin-23 [GPIO3_A0]", "pin-19 [GPIO3_A1]", "pin-21 [GPIO3_A2]",
229 "", "pin-03 [GPIO3_A4]", "", "pin-05 [GPIO3_A6]", "",
230 /* GPIO3_B0 - B7 */
231 "pin-24 [GPIO3_B0]", "", "", "", "", "", "", "",
232 /* GPIO3_C0 - C7 */
233 "", "", "", "", "", "", "", "",
234 /* GPIO3_D0 - D7 */
235 "", "", "", "", "", "", "", "";
236};
237
Peter Robinson7715db32021-07-22 16:20:43 +0100238&i2c1 {
b.l.huang89473d92020-06-01 00:01:28 +0800239 status = "okay";
b.l.huang89473d92020-06-01 00:01:28 +0800240
Peter Robinson7715db32021-07-22 16:20:43 +0100241 rk805: pmic@18 {
242 compatible = "rockchip,rk805";
243 reg = <0x18>;
244 interrupt-parent = <&gpio2>;
245 interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
246 #clock-cells = <1>;
247 clock-output-names = "xin32k", "rk805-clkout2";
248 gpio-controller;
249 #gpio-cells = <2>;
250 pinctrl-names = "default";
251 pinctrl-0 = <&pmic_int_l>;
252 rockchip,system-power-controller;
253 wakeup-source;
b.l.huang89473d92020-06-01 00:01:28 +0800254
Peter Robinson7715db32021-07-22 16:20:43 +0100255 vcc1-supply = <&vcc_sys>;
256 vcc2-supply = <&vcc_sys>;
257 vcc3-supply = <&vcc_sys>;
258 vcc4-supply = <&vcc_sys>;
259 vcc5-supply = <&vcc_io>;
260 vcc6-supply = <&vcc_sys>;
b.l.huang89473d92020-06-01 00:01:28 +0800261
Peter Robinson7715db32021-07-22 16:20:43 +0100262 regulators {
263 vdd_log: DCDC_REG1 {
264 regulator-name = "vdd_log";
265 regulator-always-on;
266 regulator-boot-on;
267 regulator-min-microvolt = <712500>;
268 regulator-max-microvolt = <1450000>;
269 regulator-ramp-delay = <12500>;
b.l.huang89473d92020-06-01 00:01:28 +0800270
Peter Robinson7715db32021-07-22 16:20:43 +0100271 regulator-state-mem {
272 regulator-on-in-suspend;
273 regulator-suspend-microvolt = <1000000>;
274 };
275 };
b.l.huang89473d92020-06-01 00:01:28 +0800276
Peter Robinson7715db32021-07-22 16:20:43 +0100277 vdd_arm: DCDC_REG2 {
278 regulator-name = "vdd_arm";
279 regulator-always-on;
280 regulator-boot-on;
281 regulator-min-microvolt = <712500>;
282 regulator-max-microvolt = <1450000>;
283 regulator-ramp-delay = <12500>;
b.l.huang89473d92020-06-01 00:01:28 +0800284
Peter Robinson7715db32021-07-22 16:20:43 +0100285 regulator-state-mem {
286 regulator-on-in-suspend;
287 regulator-suspend-microvolt = <950000>;
288 };
289 };
b.l.huang89473d92020-06-01 00:01:28 +0800290
Peter Robinson7715db32021-07-22 16:20:43 +0100291 vcc_ddr: DCDC_REG3 {
292 regulator-name = "vcc_ddr";
293 regulator-always-on;
294 regulator-boot-on;
b.l.huang89473d92020-06-01 00:01:28 +0800295
Peter Robinson7715db32021-07-22 16:20:43 +0100296 regulator-state-mem {
297 regulator-on-in-suspend;
298 };
299 };
300
301 vcc_io: DCDC_REG4 {
302 regulator-name = "vcc_io";
303 regulator-always-on;
304 regulator-boot-on;
305 regulator-min-microvolt = <3300000>;
306 regulator-max-microvolt = <3300000>;
307
308 regulator-state-mem {
309 regulator-on-in-suspend;
310 regulator-suspend-microvolt = <3300000>;
311 };
312 };
313
314 vcc_18: LDO_REG1 {
315 regulator-name = "vcc_18";
316 regulator-always-on;
317 regulator-boot-on;
318 regulator-min-microvolt = <1800000>;
319 regulator-max-microvolt = <1800000>;
320
321 regulator-state-mem {
322 regulator-on-in-suspend;
323 regulator-suspend-microvolt = <1800000>;
324 };
325 };
326
327 vcc18_emmc: LDO_REG2 {
328 regulator-name = "vcc18_emmc";
329 regulator-always-on;
330 regulator-boot-on;
331 regulator-min-microvolt = <1800000>;
332 regulator-max-microvolt = <1800000>;
333
334 regulator-state-mem {
335 regulator-on-in-suspend;
336 regulator-suspend-microvolt = <1800000>;
337 };
338 };
339
340 vdd_10: LDO_REG3 {
341 regulator-name = "vdd_10";
342 regulator-always-on;
343 regulator-boot-on;
344 regulator-min-microvolt = <1000000>;
345 regulator-max-microvolt = <1000000>;
346
347 regulator-state-mem {
348 regulator-on-in-suspend;
349 regulator-suspend-microvolt = <1000000>;
350 };
351 };
352 };
b.l.huang89473d92020-06-01 00:01:28 +0800353 };
354};
355
Peter Robinson7715db32021-07-22 16:20:43 +0100356&i2s1 {
b.l.huang89473d92020-06-01 00:01:28 +0800357 status = "okay";
Peter Robinson7715db32021-07-22 16:20:43 +0100358};
b.l.huang89473d92020-06-01 00:01:28 +0800359
Peter Robinson7715db32021-07-22 16:20:43 +0100360&io_domains {
361 pmuio-supply = <&vcc_io>;
b.l.huang89473d92020-06-01 00:01:28 +0800362 vccio1-supply = <&vcc_io>;
363 vccio2-supply = <&vcc18_emmc>;
364 vccio3-supply = <&vcc_io>;
365 vccio4-supply = <&vcc_io>;
366 vccio5-supply = <&vcc_io>;
367 vccio6-supply = <&vcc_io>;
Peter Robinson7715db32021-07-22 16:20:43 +0100368 status = "okay";
b.l.huang89473d92020-06-01 00:01:28 +0800369};
370
371&pinctrl {
Peter Robinson7715db32021-07-22 16:20:43 +0100372 ephy {
373 eth_phy_int_pin: eth-phy-int-pin {
374 rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_down>;
375 };
376
377 eth_phy_reset_pin: eth-phy-reset-pin {
378 rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
379 };
380 };
381
382 leds {
383 led_pin: led-pin {
384 rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
385 };
386 };
387
b.l.huang89473d92020-06-01 00:01:28 +0800388 pmic {
Peter Robinson7715db32021-07-22 16:20:43 +0100389 pmic_int_l: pmic-int-l {
390 rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
391 };
b.l.huang89473d92020-06-01 00:01:28 +0800392 };
Peter Robinson7715db32021-07-22 16:20:43 +0100393
394 usb3 {
395 usb30_host_drv: usb30-host-drv {
396 rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
397 };
398 };
399
400 wifi {
401 wifi_en: wifi-en {
402 rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
403 };
b.l.huang89473d92020-06-01 00:01:28 +0800404 };
405};
406
407&sdmmc {
408 bus-width = <4>;
b.l.huang89473d92020-06-01 00:01:28 +0800409 cap-sd-highspeed;
b.l.huang89473d92020-06-01 00:01:28 +0800410 disable-wp;
b.l.huang89473d92020-06-01 00:01:28 +0800411 pinctrl-names = "default";
Peter Robinson7715db32021-07-22 16:20:43 +0100412 pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>;
b.l.huang89473d92020-06-01 00:01:28 +0800413 vmmc-supply = <&vcc_sd>;
414 status = "okay";
415};
416
417&saradc {
Peter Robinson7715db32021-07-22 16:20:43 +0100418 vref-supply = <&vcc_18>;
b.l.huang89473d92020-06-01 00:01:28 +0800419 status = "okay";
420};
421
Peter Robinson7715db32021-07-22 16:20:43 +0100422&tsadc {
b.l.huang89473d92020-06-01 00:01:28 +0800423 status = "okay";
424};
425
Peter Robinson7715db32021-07-22 16:20:43 +0100426&u2phy {
b.l.huang89473d92020-06-01 00:01:28 +0800427 status = "okay";
428};
429
Peter Robinson7715db32021-07-22 16:20:43 +0100430&u2phy_host {
431 status = "okay";
432};
433
434&uart2 {
b.l.huang89473d92020-06-01 00:01:28 +0800435 status = "okay";
436};
437
Peter Robinson7715db32021-07-22 16:20:43 +0100438&usbdrd3 {
439 dr_mode = "host";
440 status = "okay";
441};
442
443&usb_host0_ehci {
b.l.huang89473d92020-06-01 00:01:28 +0800444 status = "okay";
445};