xref: /linux/arch/arm64/boot/dts/rockchip/rk3528-radxa-e20c.dts (revision ab93e0dd72c37d378dd936f031ffb83ff2bd87ce)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (c) 2020 Rockchip Electronics Co., Ltd
4 * Copyright (c) 2024 Radxa Limited
5 * Copyright (c) 2024 Yao Zi <ziyao@disroot.org>
6 */
7
8/dts-v1/;
9
10#include <dt-bindings/input/input.h>
11#include <dt-bindings/leds/common.h>
12#include <dt-bindings/pwm/pwm.h>
13#include "rk3528.dtsi"
14
15/ {
16	model = "Radxa E20C";
17	compatible = "radxa,e20c", "rockchip,rk3528";
18
19	aliases {
20		ethernet0 = &gmac1;
21		i2c1 = &i2c1;
22		mmc0 = &sdhci;
23		mmc1 = &sdmmc;
24		serial0 = &uart0;
25	};
26
27	chosen {
28		stdout-path = "serial0:1500000n8";
29	};
30
31	adc-keys {
32		compatible = "adc-keys";
33		io-channels = <&saradc 0>;
34		io-channel-names = "buttons";
35		keyup-threshold-microvolt = <1800000>;
36		poll-interval = <100>;
37
38		button-maskrom {
39			label = "MASKROM";
40			linux,code = <KEY_SETUP>;
41			press-threshold-microvolt = <0>;
42		};
43	};
44
45	gpio-keys {
46		compatible = "gpio-keys";
47		pinctrl-names = "default";
48		pinctrl-0 = <&user_key>;
49
50		button-user {
51			gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
52			label = "USER";
53			linux,code = <BTN_1>;
54			wakeup-source;
55		};
56	};
57
58	leds {
59		compatible = "gpio-leds";
60		pinctrl-names = "default";
61		pinctrl-0 = <&lan_led_g>, <&sys_led_g>, <&wan_led_g>;
62
63		led-lan {
64			color = <LED_COLOR_ID_GREEN>;
65			default-state = "off";
66			function = LED_FUNCTION_LAN;
67			gpios = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>;
68			linux,default-trigger = "netdev";
69		};
70
71		led-sys {
72			color = <LED_COLOR_ID_GREEN>;
73			default-state = "on";
74			function = LED_FUNCTION_HEARTBEAT;
75			gpios = <&gpio4 RK_PC1 GPIO_ACTIVE_LOW>;
76			linux,default-trigger = "heartbeat";
77		};
78
79		led-wan {
80			color = <LED_COLOR_ID_GREEN>;
81			default-state = "off";
82			function = LED_FUNCTION_WAN;
83			gpios = <&gpio4 RK_PC0 GPIO_ACTIVE_HIGH>;
84			linux,default-trigger = "netdev";
85		};
86	};
87
88	vdd_0v9: regulator-0v9-vdd {
89		compatible = "regulator-fixed";
90		regulator-name = "vdd_0v9";
91		regulator-always-on;
92		regulator-boot-on;
93		regulator-min-microvolt = <900000>;
94		regulator-max-microvolt = <900000>;
95		vin-supply = <&vcc5v0_sys>;
96	};
97
98	vcc_ddr: regulator-1v1-vcc-ddr {
99		compatible = "regulator-fixed";
100		regulator-name = "vcc_ddr";
101		regulator-always-on;
102		regulator-boot-on;
103		regulator-min-microvolt = <1100000>;
104		regulator-max-microvolt = <1100000>;
105		vin-supply = <&vcc5v0_sys>;
106	};
107
108	vcc_1v8: regulator-1v8-vcc {
109		compatible = "regulator-fixed";
110		regulator-name = "vcc_1v8";
111		regulator-always-on;
112		regulator-boot-on;
113		regulator-min-microvolt = <1800000>;
114		regulator-max-microvolt = <1800000>;
115		vin-supply = <&vcc_3v3>;
116	};
117
118	vcc_3v3: regulator-3v3-vcc {
119		compatible = "regulator-fixed";
120		regulator-name = "vcc_3v3";
121		regulator-always-on;
122		regulator-boot-on;
123		regulator-min-microvolt = <3300000>;
124		regulator-max-microvolt = <3300000>;
125		vin-supply = <&vcc5v0_sys>;
126	};
127
128	vcc5v0_sys: regulator-5v0-vcc-sys {
129		compatible = "regulator-fixed";
130		regulator-name = "vcc5v0_sys";
131		regulator-always-on;
132		regulator-boot-on;
133		regulator-min-microvolt = <5000000>;
134		regulator-max-microvolt = <5000000>;
135	};
136
137	vccio_sd: regulator-vccio-sd {
138		compatible = "regulator-gpio";
139		gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;
140		pinctrl-names = "default";
141		pinctrl-0 = <&sdmmc_vol_ctrl_h>;
142		regulator-name = "vccio_sd";
143		regulator-min-microvolt = <1800000>;
144		regulator-max-microvolt = <3300000>;
145		states = <1800000 0x0>, <3300000 0x1>;
146		vin-supply = <&vcc5v0_sys>;
147	};
148
149	vdd_arm: regulator-vdd-arm {
150		compatible = "pwm-regulator";
151		pwms = <&pwm1 0 5000 PWM_POLARITY_INVERTED>;
152		pwm-supply = <&vcc5v0_sys>;
153		regulator-name = "vdd_arm";
154		regulator-always-on;
155		regulator-boot-on;
156		regulator-min-microvolt = <746000>;
157		regulator-max-microvolt = <1201000>;
158		regulator-settling-time-up-us = <250>;
159	};
160
161	vdd_logic: regulator-vdd-logic {
162		compatible = "pwm-regulator";
163		pwms = <&pwm2 0 5000 PWM_POLARITY_INVERTED>;
164		pwm-supply = <&vcc5v0_sys>;
165		regulator-name = "vdd_logic";
166		regulator-always-on;
167		regulator-boot-on;
168		regulator-min-microvolt = <705000>;
169		regulator-max-microvolt = <1006000>;
170		regulator-settling-time-up-us = <250>;
171	};
172};
173
174&cpu0 {
175	cpu-supply = <&vdd_arm>;
176};
177
178&cpu1 {
179	cpu-supply = <&vdd_arm>;
180};
181
182&cpu2 {
183	cpu-supply = <&vdd_arm>;
184};
185
186&cpu3 {
187	cpu-supply = <&vdd_arm>;
188};
189
190&gmac1 {
191	clock_in_out = "output";
192	phy-handle = <&rgmii_phy>;
193	phy-mode = "rgmii-id";
194	phy-supply = <&vcc_3v3>;
195	pinctrl-names = "default";
196	pinctrl-0 = <&rgmii_miim>, <&rgmii_tx_bus2>, <&rgmii_rx_bus2>,
197		    <&rgmii_rgmii_clk>, <&rgmii_rgmii_bus>;
198	status = "okay";
199};
200
201&gpu {
202	mali-supply = <&vdd_logic>;
203	status = "okay";
204};
205
206&i2c1 {
207	pinctrl-names = "default";
208	pinctrl-0 = <&i2c1m0_xfer>;
209	status = "okay";
210
211	eeprom@50 {
212		compatible = "belling,bl24c16a", "atmel,24c16";
213		reg = <0x50>;
214		pagesize = <16>;
215		read-only;
216		vcc-supply = <&vcc_3v3>;
217	};
218};
219
220&mdio1 {
221	rgmii_phy: ethernet-phy@1 {
222		compatible = "ethernet-phy-ieee802.3-c22";
223		reg = <0x1>;
224		pinctrl-names = "default";
225		pinctrl-0 = <&gmac1_rstn_l>;
226		reset-assert-us = <20000>;
227		reset-deassert-us = <100000>;
228		reset-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_LOW>;
229	};
230};
231
232&pinctrl {
233	ethernet {
234		gmac1_rstn_l: gmac1-rstn-l {
235			rockchip,pins = <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
236		};
237	};
238
239	gpio-keys {
240		user_key: user-key {
241			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
242		};
243	};
244
245	leds {
246		lan_led_g: lan-led-g {
247			rockchip,pins = <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
248		};
249
250		sys_led_g: sys-led-g {
251			rockchip,pins = <4 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
252		};
253
254		wan_led_g: wan-led-g {
255			rockchip,pins = <4 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
256		};
257	};
258
259	sdmmc {
260		sdmmc_vol_ctrl_h: sdmmc-vol-ctrl-h {
261			rockchip,pins = <4 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
262		};
263	};
264};
265
266&pwm1 {
267	pinctrl-names = "default";
268	pinctrl-0 = <&pwm1m0_pins>;
269	status = "okay";
270};
271
272&pwm2 {
273	pinctrl-names = "default";
274	pinctrl-0 = <&pwm2m0_pins>;
275	status = "okay";
276};
277
278&saradc {
279	vref-supply = <&vcc_1v8>;
280	status = "okay";
281};
282
283&sdhci {
284	bus-width = <8>;
285	cap-mmc-highspeed;
286	mmc-hs200-1_8v;
287	no-sd;
288	no-sdio;
289	non-removable;
290	vmmc-supply = <&vcc_3v3>;
291	vqmmc-supply = <&vcc_1v8>;
292	status = "okay";
293};
294
295&sdmmc {
296	bus-width = <4>;
297	cap-mmc-highspeed;
298	cap-sd-highspeed;
299	disable-wp;
300	sd-uhs-sdr104;
301	vmmc-supply = <&vcc_3v3>;
302	vqmmc-supply = <&vccio_sd>;
303	status = "okay";
304};
305
306&uart0 {
307	pinctrl-names = "default";
308	pinctrl-0 = <&uart0m0_xfer>;
309	status = "okay";
310};
311