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 "rk3528.dtsi"
13
14/ {
15	model = "Radxa E20C";
16	compatible = "radxa,e20c", "rockchip,rk3528";
17
18	aliases {
19		mmc0 = &sdhci;
20	};
21
22	chosen {
23		stdout-path = "serial0:1500000n8";
24	};
25
26	adc-keys {
27		compatible = "adc-keys";
28		io-channels = <&saradc 0>;
29		io-channel-names = "buttons";
30		keyup-threshold-microvolt = <1800000>;
31		poll-interval = <100>;
32
33		button-maskrom {
34			label = "MASKROM";
35			linux,code = <KEY_SETUP>;
36			press-threshold-microvolt = <0>;
37		};
38	};
39
40	gpio-keys {
41		compatible = "gpio-keys";
42		pinctrl-names = "default";
43		pinctrl-0 = <&user_key>;
44
45		button-user {
46			gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
47			label = "USER";
48			linux,code = <BTN_1>;
49			wakeup-source;
50		};
51	};
52
53	leds {
54		compatible = "gpio-leds";
55		pinctrl-names = "default";
56		pinctrl-0 = <&lan_led_g>, <&sys_led_g>, <&wan_led_g>;
57
58		led-lan {
59			color = <LED_COLOR_ID_GREEN>;
60			default-state = "off";
61			function = LED_FUNCTION_LAN;
62			gpios = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>;
63			linux,default-trigger = "netdev";
64		};
65
66		led-sys {
67			color = <LED_COLOR_ID_GREEN>;
68			default-state = "on";
69			function = LED_FUNCTION_HEARTBEAT;
70			gpios = <&gpio4 RK_PC1 GPIO_ACTIVE_LOW>;
71			linux,default-trigger = "heartbeat";
72		};
73
74		led-wan {
75			color = <LED_COLOR_ID_GREEN>;
76			default-state = "off";
77			function = LED_FUNCTION_WAN;
78			gpios = <&gpio4 RK_PC0 GPIO_ACTIVE_HIGH>;
79			linux,default-trigger = "netdev";
80		};
81	};
82
83	vcc_1v8: regulator-1v8-vcc {
84		compatible = "regulator-fixed";
85		regulator-name = "vcc_1v8";
86		regulator-always-on;
87		regulator-boot-on;
88		regulator-min-microvolt = <1800000>;
89		regulator-max-microvolt = <1800000>;
90		vin-supply = <&vcc_3v3>;
91	};
92
93	vcc_3v3: regulator-3v3-vcc {
94		compatible = "regulator-fixed";
95		regulator-name = "vcc_3v3";
96		regulator-always-on;
97		regulator-boot-on;
98		regulator-min-microvolt = <3300000>;
99		regulator-max-microvolt = <3300000>;
100		vin-supply = <&vcc5v0_sys>;
101	};
102
103	vcc5v0_sys: regulator-5v0-vcc-sys {
104		compatible = "regulator-fixed";
105		regulator-name = "vcc5v0_sys";
106		regulator-always-on;
107		regulator-boot-on;
108		regulator-min-microvolt = <5000000>;
109		regulator-max-microvolt = <5000000>;
110	};
111};
112
113&pinctrl {
114	gpio-keys {
115		user_key: user-key {
116			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
117		};
118	};
119
120	leds {
121		lan_led_g: lan-led-g {
122			rockchip,pins = <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
123		};
124
125		sys_led_g: sys-led-g {
126			rockchip,pins = <4 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
127		};
128
129		wan_led_g: wan-led-g {
130			rockchip,pins = <4 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
131		};
132	};
133};
134
135&saradc {
136	vref-supply = <&vcc_1v8>;
137	status = "okay";
138};
139
140&sdhci {
141	bus-width = <8>;
142	cap-mmc-highspeed;
143	no-sd;
144	no-sdio;
145	non-removable;
146	vmmc-supply = <&vcc_3v3>;
147	vqmmc-supply = <&vcc_1v8>;
148	status = "okay";
149};
150
151&uart0 {
152	pinctrl-names = "default";
153	pinctrl-0 = <&uart0m0_xfer>;
154	status = "okay";
155};
156