blob: 018a3a5075c72ed013ea33b7a7a8b16a24675a40 [file] [log] [blame]
Peter Robinson27e1b5e2021-07-22 16:20:43 +01001// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
b.l.huang57649112020-06-01 00:01:28 +08002/*
Peter Robinson27e1b5e2021-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.huang57649112020-06-01 00:01:28 +08008 */
9
10/dts-v1/;
Peter Robinson27e1b5e2021-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.huang57649112020-06-01 00:01:28 +080017#include "rk3328.dtsi"
18
19/ {
Peter Robinson27e1b5e2021-07-22 16:20:43 +010020 model = "Radxa ROCK Pi E";
21 compatible = "radxa,rockpi-e", "rockchip,rk3328";
22
23 aliases {
24 mmc0 = &sdmmc;
25 mmc1 = &emmc;
26 };
b.l.huang57649112020-06-01 00:01:28 +080027
28 chosen {
Peter Robinson27e1b5e2021-07-22 16:20:43 +010029 stdout-path = "serial2:1500000n8";
30 };
31
32 adc-keys {
33 compatible = "adc-keys";
34 io-channels = <&saradc 0>;
35 io-channel-names = "buttons";
36 keyup-threshold-microvolt = <1750000>;
37
38 /* This button is unpopulated out of the factory. */
39 button-recovery {
40 label = "Recovery";
41 linux,code = <KEY_VENDOR>;
42 press-threshold-microvolt = <10000>;
43 };
b.l.huang57649112020-06-01 00:01:28 +080044 };
45
46 gmac_clkin: external-gmac-clock {
Peter Robinson27e1b5e2021-07-22 16:20:43 +010047 compatible = "fixed-clock";
48 clock-frequency = <125000000>;
49 clock-output-names = "gmac_clkin";
50 #clock-cells = <0>;
51 };
52
53 leds {
54 compatible = "gpio-leds";
55 pinctrl-0 = <&led_pin>;
56 pinctrl-names = "default";
57
58 led-0 {
59 color = <LED_COLOR_ID_BLUE>;
60 gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_LOW>;
61 linux,default-trigger = "heartbeat";
62 };
b.l.huang57649112020-06-01 00:01:28 +080063 };
64
65 vcc_sd: sdmmc-regulator {
Peter Robinson27e1b5e2021-07-22 16:20:43 +010066 compatible = "regulator-fixed";
67 gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
68 pinctrl-names = "default";
69 pinctrl-0 = <&sdmmc0m1_pin>;
70 regulator-name = "vcc_sd";
71 regulator-boot-on;
72 vin-supply = <&vcc_io>;
b.l.huang57649112020-06-01 00:01:28 +080073 };
74
Peter Robinson27e1b5e2021-07-22 16:20:43 +010075 vcc_host_5v: vcc-host-5v-regulator {
76 compatible = "regulator-fixed";
77 gpio = <&gpio3 RK_PA7 GPIO_ACTIVE_HIGH>;
78 pinctrl-names = "default";
79 pinctrl-0 = <&usb30_host_drv>;
80 enable-active-high;
81 regulator-name = "vcc_host_5v";
82 regulator-always-on;
83 regulator-boot-on;
84 vin-supply = <&vcc_sys>;
b.l.huang57649112020-06-01 00:01:28 +080085 };
86
87 vcc_sys: vcc-sys {
Peter Robinson27e1b5e2021-07-22 16:20:43 +010088 compatible = "regulator-fixed";
89 regulator-name = "vcc_sys";
90 regulator-always-on;
91 regulator-boot-on;
92 regulator-min-microvolt = <5000000>;
93 regulator-max-microvolt = <5000000>;
b.l.huang57649112020-06-01 00:01:28 +080094 };
Peter Robinson27e1b5e2021-07-22 16:20:43 +010095
96 vcc_wifi: vcc-wifi-regulator {
97 compatible = "regulator-fixed";
98 gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
99 pinctrl-names = "default";
100 pinctrl-0 = <&wifi_en>;
101 regulator-name = "vcc_wifi";
102 regulator-always-on;
103 regulator-boot-on;
104 vin-supply = <&vcc_io>;
105 };
106};
107
108&analog_sound {
109 status = "okay";
110};
111
112&codec {
113 status = "okay";
b.l.huang57649112020-06-01 00:01:28 +0800114};
115
116&cpu0 {
117 cpu-supply = <&vdd_arm>;
118};
119
120&cpu1 {
121 cpu-supply = <&vdd_arm>;
122};
123
124&cpu2 {
125 cpu-supply = <&vdd_arm>;
126};
127
128&cpu3 {
129 cpu-supply = <&vdd_arm>;
130};
131
132&emmc {
133 bus-width = <8>;
134 cap-mmc-highspeed;
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100135 mmc-ddr-1_8v;
b.l.huang57649112020-06-01 00:01:28 +0800136 mmc-hs200-1_8v;
b.l.huang57649112020-06-01 00:01:28 +0800137 non-removable;
b.l.huang57649112020-06-01 00:01:28 +0800138 pinctrl-names = "default";
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100139 pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
b.l.huang57649112020-06-01 00:01:28 +0800140 vmmc-supply = <&vcc_io>;
141 vqmmc-supply = <&vcc18_emmc>;
142 status = "okay";
143};
144
145&gmac2io {
146 assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
147 assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
148 clock_in_out = "input";
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100149 phy-handle = <&rtl8211e>;
b.l.huang57649112020-06-01 00:01:28 +0800150 phy-mode = "rgmii";
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100151 phy-supply = <&vcc_io>;
b.l.huang57649112020-06-01 00:01:28 +0800152 pinctrl-names = "default";
153 pinctrl-0 = <&rgmiim1_pins>;
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100154 snps,aal;
155 snps,rxpbl = <0x4>;
156 snps,txpbl = <0x4>;
b.l.huang57649112020-06-01 00:01:28 +0800157 tx_delay = <0x26>;
158 rx_delay = <0x11>;
159 status = "okay";
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100160
161 mdio {
162 compatible = "snps,dwmac-mdio";
163 #address-cells = <1>;
164 #size-cells = <0>;
165
166 rtl8211e: ethernet-phy@1 {
167 reg = <1>;
168 pinctrl-0 = <&eth_phy_int_pin>, <&eth_phy_reset_pin>;
169 pinctrl-names = "default";
170 interrupt-parent = <&gpio1>;
171 interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
172 reset-assert-us = <10000>;
173 reset-deassert-us = <50000>;
174 reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
175 };
176 };
177};
178
179&gmac2phy {
180 status = "okay";
b.l.huang57649112020-06-01 00:01:28 +0800181};
182
183&i2c1 {
184 status = "okay";
185
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100186 rk805: pmic@18 {
187 compatible = "rockchip,rk805";
188 reg = <0x18>;
189 interrupt-parent = <&gpio2>;
190 interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
191 #clock-cells = <1>;
192 clock-output-names = "xin32k", "rk805-clkout2";
193 gpio-controller;
194 #gpio-cells = <2>;
195 pinctrl-names = "default";
196 pinctrl-0 = <&pmic_int_l>;
197 rockchip,system-power-controller;
198 wakeup-source;
b.l.huang57649112020-06-01 00:01:28 +0800199
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100200 vcc1-supply = <&vcc_sys>;
201 vcc2-supply = <&vcc_sys>;
202 vcc3-supply = <&vcc_sys>;
203 vcc4-supply = <&vcc_sys>;
204 vcc5-supply = <&vcc_io>;
205 vcc6-supply = <&vcc_sys>;
b.l.huang57649112020-06-01 00:01:28 +0800206
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100207 regulators {
208 vdd_log: DCDC_REG1 {
209 regulator-name = "vdd_log";
210 regulator-always-on;
211 regulator-boot-on;
212 regulator-min-microvolt = <712500>;
213 regulator-max-microvolt = <1450000>;
214 regulator-ramp-delay = <12500>;
b.l.huang57649112020-06-01 00:01:28 +0800215
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100216 regulator-state-mem {
217 regulator-on-in-suspend;
218 regulator-suspend-microvolt = <1000000>;
219 };
220 };
b.l.huang57649112020-06-01 00:01:28 +0800221
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100222 vdd_arm: DCDC_REG2 {
223 regulator-name = "vdd_arm";
224 regulator-always-on;
225 regulator-boot-on;
226 regulator-min-microvolt = <712500>;
227 regulator-max-microvolt = <1450000>;
228 regulator-ramp-delay = <12500>;
b.l.huang57649112020-06-01 00:01:28 +0800229
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100230 regulator-state-mem {
231 regulator-on-in-suspend;
232 regulator-suspend-microvolt = <950000>;
233 };
234 };
b.l.huang57649112020-06-01 00:01:28 +0800235
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100236 vcc_ddr: DCDC_REG3 {
237 regulator-name = "vcc_ddr";
238 regulator-always-on;
239 regulator-boot-on;
b.l.huang57649112020-06-01 00:01:28 +0800240
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100241 regulator-state-mem {
242 regulator-on-in-suspend;
243 };
244 };
b.l.huang57649112020-06-01 00:01:28 +0800245
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100246 vcc_io: DCDC_REG4 {
247 regulator-name = "vcc_io";
248 regulator-always-on;
249 regulator-boot-on;
250 regulator-min-microvolt = <3300000>;
251 regulator-max-microvolt = <3300000>;
252
253 regulator-state-mem {
254 regulator-on-in-suspend;
255 regulator-suspend-microvolt = <3300000>;
256 };
257 };
258
259 vcc_18: LDO_REG1 {
260 regulator-name = "vcc_18";
261 regulator-always-on;
262 regulator-boot-on;
263 regulator-min-microvolt = <1800000>;
264 regulator-max-microvolt = <1800000>;
265
266 regulator-state-mem {
267 regulator-on-in-suspend;
268 regulator-suspend-microvolt = <1800000>;
269 };
270 };
271
272 vcc18_emmc: LDO_REG2 {
273 regulator-name = "vcc18_emmc";
274 regulator-always-on;
275 regulator-boot-on;
276 regulator-min-microvolt = <1800000>;
277 regulator-max-microvolt = <1800000>;
278
279 regulator-state-mem {
280 regulator-on-in-suspend;
281 regulator-suspend-microvolt = <1800000>;
282 };
283 };
284
285 vdd_10: LDO_REG3 {
286 regulator-name = "vdd_10";
287 regulator-always-on;
288 regulator-boot-on;
289 regulator-min-microvolt = <1000000>;
290 regulator-max-microvolt = <1000000>;
291
292 regulator-state-mem {
293 regulator-on-in-suspend;
294 regulator-suspend-microvolt = <1000000>;
295 };
296 };
297 };
b.l.huang57649112020-06-01 00:01:28 +0800298 };
299};
300
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100301&i2s1 {
b.l.huang57649112020-06-01 00:01:28 +0800302 status = "okay";
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100303};
b.l.huang57649112020-06-01 00:01:28 +0800304
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100305&io_domains {
306 pmuio-supply = <&vcc_io>;
b.l.huang57649112020-06-01 00:01:28 +0800307 vccio1-supply = <&vcc_io>;
308 vccio2-supply = <&vcc18_emmc>;
309 vccio3-supply = <&vcc_io>;
310 vccio4-supply = <&vcc_io>;
311 vccio5-supply = <&vcc_io>;
312 vccio6-supply = <&vcc_io>;
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100313 status = "okay";
b.l.huang57649112020-06-01 00:01:28 +0800314};
315
316&pinctrl {
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100317 ephy {
318 eth_phy_int_pin: eth-phy-int-pin {
319 rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_down>;
320 };
321
322 eth_phy_reset_pin: eth-phy-reset-pin {
323 rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
324 };
b.l.huang57649112020-06-01 00:01:28 +0800325 };
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100326
327 leds {
328 led_pin: led-pin {
329 rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
330 };
331 };
332
333 pmic {
334 pmic_int_l: pmic-int-l {
335 rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
336 };
337 };
338
339 usb3 {
340 usb30_host_drv: usb30-host-drv {
341 rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
342 };
343 };
344
345 wifi {
346 wifi_en: wifi-en {
347 rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
348 };
b.l.huang57649112020-06-01 00:01:28 +0800349 };
350};
351
352&sdmmc {
353 bus-width = <4>;
b.l.huang57649112020-06-01 00:01:28 +0800354 cap-sd-highspeed;
b.l.huang57649112020-06-01 00:01:28 +0800355 disable-wp;
b.l.huang57649112020-06-01 00:01:28 +0800356 pinctrl-names = "default";
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100357 pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>;
b.l.huang57649112020-06-01 00:01:28 +0800358 vmmc-supply = <&vcc_sd>;
359 status = "okay";
360};
361
362&saradc {
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100363 vref-supply = <&vcc_18>;
364 status = "okay";
365};
366
367&tsadc {
368 status = "okay";
369};
370
371&u2phy {
372 status = "okay";
373};
374
375&u2phy_host {
b.l.huang57649112020-06-01 00:01:28 +0800376 status = "okay";
377};
378
379&uart2 {
380 status = "okay";
381};
382
Peter Robinson27e1b5e2021-07-22 16:20:43 +0100383&usbdrd3 {
384 dr_mode = "host";
b.l.huang57649112020-06-01 00:01:28 +0800385 status = "okay";
386};
387
388&usb_host0_ehci {
389 status = "okay";
390};