xref: /freebsd/sys/contrib/device-tree/src/arm64/rockchip/rk3528-radxa-e20c.dts (revision 833e5d42ab135b0238e61c5b3c19b8619677cbfa)
15f62a964SEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0+
25f62a964SEmmanuel Vadot/*
35f62a964SEmmanuel Vadot * Copyright (c) 2020 Rockchip Electronics Co., Ltd
45f62a964SEmmanuel Vadot * Copyright (c) 2024 Radxa Limited
55f62a964SEmmanuel Vadot * Copyright (c) 2024 Yao Zi <ziyao@disroot.org>
65f62a964SEmmanuel Vadot */
75f62a964SEmmanuel Vadot
85f62a964SEmmanuel Vadot/dts-v1/;
98ccc0d23SEmmanuel Vadot
108ccc0d23SEmmanuel Vadot#include <dt-bindings/input/input.h>
118ccc0d23SEmmanuel Vadot#include <dt-bindings/leds/common.h>
12ae5de77eSEmmanuel Vadot#include <dt-bindings/pwm/pwm.h>
135f62a964SEmmanuel Vadot#include "rk3528.dtsi"
145f62a964SEmmanuel Vadot
155f62a964SEmmanuel Vadot/ {
165f62a964SEmmanuel Vadot	model = "Radxa E20C";
175f62a964SEmmanuel Vadot	compatible = "radxa,e20c", "rockchip,rk3528";
185f62a964SEmmanuel Vadot
198ccc0d23SEmmanuel Vadot	aliases {
20ae5de77eSEmmanuel Vadot		ethernet0 = &gmac1;
21ae5de77eSEmmanuel Vadot		i2c1 = &i2c1;
228ccc0d23SEmmanuel Vadot		mmc0 = &sdhci;
23ae5de77eSEmmanuel Vadot		mmc1 = &sdmmc;
24ae5de77eSEmmanuel Vadot		serial0 = &uart0;
258ccc0d23SEmmanuel Vadot	};
268ccc0d23SEmmanuel Vadot
275f62a964SEmmanuel Vadot	chosen {
285f62a964SEmmanuel Vadot		stdout-path = "serial0:1500000n8";
295f62a964SEmmanuel Vadot	};
308ccc0d23SEmmanuel Vadot
318ccc0d23SEmmanuel Vadot	adc-keys {
328ccc0d23SEmmanuel Vadot		compatible = "adc-keys";
338ccc0d23SEmmanuel Vadot		io-channels = <&saradc 0>;
348ccc0d23SEmmanuel Vadot		io-channel-names = "buttons";
358ccc0d23SEmmanuel Vadot		keyup-threshold-microvolt = <1800000>;
368ccc0d23SEmmanuel Vadot		poll-interval = <100>;
378ccc0d23SEmmanuel Vadot
388ccc0d23SEmmanuel Vadot		button-maskrom {
398ccc0d23SEmmanuel Vadot			label = "MASKROM";
408ccc0d23SEmmanuel Vadot			linux,code = <KEY_SETUP>;
418ccc0d23SEmmanuel Vadot			press-threshold-microvolt = <0>;
428ccc0d23SEmmanuel Vadot		};
438ccc0d23SEmmanuel Vadot	};
448ccc0d23SEmmanuel Vadot
458ccc0d23SEmmanuel Vadot	gpio-keys {
468ccc0d23SEmmanuel Vadot		compatible = "gpio-keys";
478ccc0d23SEmmanuel Vadot		pinctrl-names = "default";
488ccc0d23SEmmanuel Vadot		pinctrl-0 = <&user_key>;
498ccc0d23SEmmanuel Vadot
508ccc0d23SEmmanuel Vadot		button-user {
518ccc0d23SEmmanuel Vadot			gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
528ccc0d23SEmmanuel Vadot			label = "USER";
538ccc0d23SEmmanuel Vadot			linux,code = <BTN_1>;
548ccc0d23SEmmanuel Vadot			wakeup-source;
558ccc0d23SEmmanuel Vadot		};
568ccc0d23SEmmanuel Vadot	};
578ccc0d23SEmmanuel Vadot
588ccc0d23SEmmanuel Vadot	leds {
598ccc0d23SEmmanuel Vadot		compatible = "gpio-leds";
608ccc0d23SEmmanuel Vadot		pinctrl-names = "default";
618ccc0d23SEmmanuel Vadot		pinctrl-0 = <&lan_led_g>, <&sys_led_g>, <&wan_led_g>;
628ccc0d23SEmmanuel Vadot
638ccc0d23SEmmanuel Vadot		led-lan {
648ccc0d23SEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
658ccc0d23SEmmanuel Vadot			default-state = "off";
668ccc0d23SEmmanuel Vadot			function = LED_FUNCTION_LAN;
678ccc0d23SEmmanuel Vadot			gpios = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>;
688ccc0d23SEmmanuel Vadot			linux,default-trigger = "netdev";
698ccc0d23SEmmanuel Vadot		};
708ccc0d23SEmmanuel Vadot
718ccc0d23SEmmanuel Vadot		led-sys {
728ccc0d23SEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
738ccc0d23SEmmanuel Vadot			default-state = "on";
748ccc0d23SEmmanuel Vadot			function = LED_FUNCTION_HEARTBEAT;
758ccc0d23SEmmanuel Vadot			gpios = <&gpio4 RK_PC1 GPIO_ACTIVE_LOW>;
768ccc0d23SEmmanuel Vadot			linux,default-trigger = "heartbeat";
778ccc0d23SEmmanuel Vadot		};
788ccc0d23SEmmanuel Vadot
798ccc0d23SEmmanuel Vadot		led-wan {
808ccc0d23SEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
818ccc0d23SEmmanuel Vadot			default-state = "off";
828ccc0d23SEmmanuel Vadot			function = LED_FUNCTION_WAN;
838ccc0d23SEmmanuel Vadot			gpios = <&gpio4 RK_PC0 GPIO_ACTIVE_HIGH>;
848ccc0d23SEmmanuel Vadot			linux,default-trigger = "netdev";
858ccc0d23SEmmanuel Vadot		};
868ccc0d23SEmmanuel Vadot	};
878ccc0d23SEmmanuel Vadot
88ae5de77eSEmmanuel Vadot	vdd_0v9: regulator-0v9-vdd {
89ae5de77eSEmmanuel Vadot		compatible = "regulator-fixed";
90ae5de77eSEmmanuel Vadot		regulator-name = "vdd_0v9";
91ae5de77eSEmmanuel Vadot		regulator-always-on;
92ae5de77eSEmmanuel Vadot		regulator-boot-on;
93ae5de77eSEmmanuel Vadot		regulator-min-microvolt = <900000>;
94ae5de77eSEmmanuel Vadot		regulator-max-microvolt = <900000>;
95ae5de77eSEmmanuel Vadot		vin-supply = <&vcc5v0_sys>;
96ae5de77eSEmmanuel Vadot	};
97ae5de77eSEmmanuel Vadot
98ae5de77eSEmmanuel Vadot	vcc_ddr: regulator-1v1-vcc-ddr {
99ae5de77eSEmmanuel Vadot		compatible = "regulator-fixed";
100ae5de77eSEmmanuel Vadot		regulator-name = "vcc_ddr";
101ae5de77eSEmmanuel Vadot		regulator-always-on;
102ae5de77eSEmmanuel Vadot		regulator-boot-on;
103ae5de77eSEmmanuel Vadot		regulator-min-microvolt = <1100000>;
104ae5de77eSEmmanuel Vadot		regulator-max-microvolt = <1100000>;
105ae5de77eSEmmanuel Vadot		vin-supply = <&vcc5v0_sys>;
106ae5de77eSEmmanuel Vadot	};
107ae5de77eSEmmanuel Vadot
1088ccc0d23SEmmanuel Vadot	vcc_1v8: regulator-1v8-vcc {
1098ccc0d23SEmmanuel Vadot		compatible = "regulator-fixed";
1108ccc0d23SEmmanuel Vadot		regulator-name = "vcc_1v8";
1118ccc0d23SEmmanuel Vadot		regulator-always-on;
1128ccc0d23SEmmanuel Vadot		regulator-boot-on;
1138ccc0d23SEmmanuel Vadot		regulator-min-microvolt = <1800000>;
1148ccc0d23SEmmanuel Vadot		regulator-max-microvolt = <1800000>;
1158ccc0d23SEmmanuel Vadot		vin-supply = <&vcc_3v3>;
1168ccc0d23SEmmanuel Vadot	};
1178ccc0d23SEmmanuel Vadot
1188ccc0d23SEmmanuel Vadot	vcc_3v3: regulator-3v3-vcc {
1198ccc0d23SEmmanuel Vadot		compatible = "regulator-fixed";
1208ccc0d23SEmmanuel Vadot		regulator-name = "vcc_3v3";
1218ccc0d23SEmmanuel Vadot		regulator-always-on;
1228ccc0d23SEmmanuel Vadot		regulator-boot-on;
1238ccc0d23SEmmanuel Vadot		regulator-min-microvolt = <3300000>;
1248ccc0d23SEmmanuel Vadot		regulator-max-microvolt = <3300000>;
1258ccc0d23SEmmanuel Vadot		vin-supply = <&vcc5v0_sys>;
1268ccc0d23SEmmanuel Vadot	};
1278ccc0d23SEmmanuel Vadot
1288ccc0d23SEmmanuel Vadot	vcc5v0_sys: regulator-5v0-vcc-sys {
1298ccc0d23SEmmanuel Vadot		compatible = "regulator-fixed";
1308ccc0d23SEmmanuel Vadot		regulator-name = "vcc5v0_sys";
1318ccc0d23SEmmanuel Vadot		regulator-always-on;
1328ccc0d23SEmmanuel Vadot		regulator-boot-on;
1338ccc0d23SEmmanuel Vadot		regulator-min-microvolt = <5000000>;
1348ccc0d23SEmmanuel Vadot		regulator-max-microvolt = <5000000>;
1358ccc0d23SEmmanuel Vadot	};
136ae5de77eSEmmanuel Vadot
137ae5de77eSEmmanuel Vadot	vccio_sd: regulator-vccio-sd {
138ae5de77eSEmmanuel Vadot		compatible = "regulator-gpio";
139ae5de77eSEmmanuel Vadot		gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;
140ae5de77eSEmmanuel Vadot		pinctrl-names = "default";
141ae5de77eSEmmanuel Vadot		pinctrl-0 = <&sdmmc_vol_ctrl_h>;
142ae5de77eSEmmanuel Vadot		regulator-name = "vccio_sd";
143ae5de77eSEmmanuel Vadot		regulator-min-microvolt = <1800000>;
144ae5de77eSEmmanuel Vadot		regulator-max-microvolt = <3300000>;
145ae5de77eSEmmanuel Vadot		states = <1800000 0x0>, <3300000 0x1>;
146ae5de77eSEmmanuel Vadot		vin-supply = <&vcc5v0_sys>;
147ae5de77eSEmmanuel Vadot	};
148ae5de77eSEmmanuel Vadot
149ae5de77eSEmmanuel Vadot	vdd_arm: regulator-vdd-arm {
150ae5de77eSEmmanuel Vadot		compatible = "pwm-regulator";
151ae5de77eSEmmanuel Vadot		pwms = <&pwm1 0 5000 PWM_POLARITY_INVERTED>;
152ae5de77eSEmmanuel Vadot		pwm-supply = <&vcc5v0_sys>;
153ae5de77eSEmmanuel Vadot		regulator-name = "vdd_arm";
154ae5de77eSEmmanuel Vadot		regulator-always-on;
155ae5de77eSEmmanuel Vadot		regulator-boot-on;
156ae5de77eSEmmanuel Vadot		regulator-min-microvolt = <746000>;
157ae5de77eSEmmanuel Vadot		regulator-max-microvolt = <1201000>;
158ae5de77eSEmmanuel Vadot		regulator-settling-time-up-us = <250>;
159ae5de77eSEmmanuel Vadot	};
160ae5de77eSEmmanuel Vadot
161ae5de77eSEmmanuel Vadot	vdd_logic: regulator-vdd-logic {
162ae5de77eSEmmanuel Vadot		compatible = "pwm-regulator";
163ae5de77eSEmmanuel Vadot		pwms = <&pwm2 0 5000 PWM_POLARITY_INVERTED>;
164ae5de77eSEmmanuel Vadot		pwm-supply = <&vcc5v0_sys>;
165ae5de77eSEmmanuel Vadot		regulator-name = "vdd_logic";
166ae5de77eSEmmanuel Vadot		regulator-always-on;
167ae5de77eSEmmanuel Vadot		regulator-boot-on;
168ae5de77eSEmmanuel Vadot		regulator-min-microvolt = <705000>;
169ae5de77eSEmmanuel Vadot		regulator-max-microvolt = <1006000>;
170ae5de77eSEmmanuel Vadot		regulator-settling-time-up-us = <250>;
171ae5de77eSEmmanuel Vadot	};
172ae5de77eSEmmanuel Vadot};
173ae5de77eSEmmanuel Vadot
174ae5de77eSEmmanuel Vadot&cpu0 {
175ae5de77eSEmmanuel Vadot	cpu-supply = <&vdd_arm>;
176ae5de77eSEmmanuel Vadot};
177ae5de77eSEmmanuel Vadot
178ae5de77eSEmmanuel Vadot&cpu1 {
179ae5de77eSEmmanuel Vadot	cpu-supply = <&vdd_arm>;
180ae5de77eSEmmanuel Vadot};
181ae5de77eSEmmanuel Vadot
182ae5de77eSEmmanuel Vadot&cpu2 {
183ae5de77eSEmmanuel Vadot	cpu-supply = <&vdd_arm>;
184ae5de77eSEmmanuel Vadot};
185ae5de77eSEmmanuel Vadot
186ae5de77eSEmmanuel Vadot&cpu3 {
187ae5de77eSEmmanuel Vadot	cpu-supply = <&vdd_arm>;
188ae5de77eSEmmanuel Vadot};
189ae5de77eSEmmanuel Vadot
190ae5de77eSEmmanuel Vadot&gmac1 {
191ae5de77eSEmmanuel Vadot	clock_in_out = "output";
192ae5de77eSEmmanuel Vadot	phy-handle = <&rgmii_phy>;
193ae5de77eSEmmanuel Vadot	phy-mode = "rgmii-id";
194ae5de77eSEmmanuel Vadot	phy-supply = <&vcc_3v3>;
195ae5de77eSEmmanuel Vadot	pinctrl-names = "default";
196ae5de77eSEmmanuel Vadot	pinctrl-0 = <&rgmii_miim>, <&rgmii_tx_bus2>, <&rgmii_rx_bus2>,
197ae5de77eSEmmanuel Vadot		    <&rgmii_rgmii_clk>, <&rgmii_rgmii_bus>;
198ae5de77eSEmmanuel Vadot	status = "okay";
199ae5de77eSEmmanuel Vadot};
200ae5de77eSEmmanuel Vadot
201*833e5d42SEmmanuel Vadot&gpu {
202*833e5d42SEmmanuel Vadot	mali-supply = <&vdd_logic>;
203*833e5d42SEmmanuel Vadot	status = "okay";
204*833e5d42SEmmanuel Vadot};
205*833e5d42SEmmanuel Vadot
206ae5de77eSEmmanuel Vadot&i2c1 {
207ae5de77eSEmmanuel Vadot	pinctrl-names = "default";
208ae5de77eSEmmanuel Vadot	pinctrl-0 = <&i2c1m0_xfer>;
209ae5de77eSEmmanuel Vadot	status = "okay";
210ae5de77eSEmmanuel Vadot
211ae5de77eSEmmanuel Vadot	eeprom@50 {
212ae5de77eSEmmanuel Vadot		compatible = "belling,bl24c16a", "atmel,24c16";
213ae5de77eSEmmanuel Vadot		reg = <0x50>;
214ae5de77eSEmmanuel Vadot		pagesize = <16>;
215ae5de77eSEmmanuel Vadot		read-only;
216ae5de77eSEmmanuel Vadot		vcc-supply = <&vcc_3v3>;
217ae5de77eSEmmanuel Vadot	};
218ae5de77eSEmmanuel Vadot};
219ae5de77eSEmmanuel Vadot
220ae5de77eSEmmanuel Vadot&mdio1 {
221ae5de77eSEmmanuel Vadot	rgmii_phy: ethernet-phy@1 {
222ae5de77eSEmmanuel Vadot		compatible = "ethernet-phy-ieee802.3-c22";
223ae5de77eSEmmanuel Vadot		reg = <0x1>;
224ae5de77eSEmmanuel Vadot		pinctrl-names = "default";
225ae5de77eSEmmanuel Vadot		pinctrl-0 = <&gmac1_rstn_l>;
226ae5de77eSEmmanuel Vadot		reset-assert-us = <20000>;
227ae5de77eSEmmanuel Vadot		reset-deassert-us = <100000>;
228ae5de77eSEmmanuel Vadot		reset-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_LOW>;
229ae5de77eSEmmanuel Vadot	};
2308ccc0d23SEmmanuel Vadot};
2318ccc0d23SEmmanuel Vadot
2328ccc0d23SEmmanuel Vadot&pinctrl {
233ae5de77eSEmmanuel Vadot	ethernet {
234ae5de77eSEmmanuel Vadot		gmac1_rstn_l: gmac1-rstn-l {
235ae5de77eSEmmanuel Vadot			rockchip,pins = <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
236ae5de77eSEmmanuel Vadot		};
237ae5de77eSEmmanuel Vadot	};
238ae5de77eSEmmanuel Vadot
2398ccc0d23SEmmanuel Vadot	gpio-keys {
2408ccc0d23SEmmanuel Vadot		user_key: user-key {
2418ccc0d23SEmmanuel Vadot			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
2428ccc0d23SEmmanuel Vadot		};
2438ccc0d23SEmmanuel Vadot	};
2448ccc0d23SEmmanuel Vadot
2458ccc0d23SEmmanuel Vadot	leds {
2468ccc0d23SEmmanuel Vadot		lan_led_g: lan-led-g {
2478ccc0d23SEmmanuel Vadot			rockchip,pins = <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
2488ccc0d23SEmmanuel Vadot		};
2498ccc0d23SEmmanuel Vadot
2508ccc0d23SEmmanuel Vadot		sys_led_g: sys-led-g {
2518ccc0d23SEmmanuel Vadot			rockchip,pins = <4 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
2528ccc0d23SEmmanuel Vadot		};
2538ccc0d23SEmmanuel Vadot
2548ccc0d23SEmmanuel Vadot		wan_led_g: wan-led-g {
2558ccc0d23SEmmanuel Vadot			rockchip,pins = <4 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
2568ccc0d23SEmmanuel Vadot		};
2578ccc0d23SEmmanuel Vadot	};
258ae5de77eSEmmanuel Vadot
259ae5de77eSEmmanuel Vadot	sdmmc {
260ae5de77eSEmmanuel Vadot		sdmmc_vol_ctrl_h: sdmmc-vol-ctrl-h {
261ae5de77eSEmmanuel Vadot			rockchip,pins = <4 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
262ae5de77eSEmmanuel Vadot		};
263ae5de77eSEmmanuel Vadot	};
264ae5de77eSEmmanuel Vadot};
265ae5de77eSEmmanuel Vadot
266ae5de77eSEmmanuel Vadot&pwm1 {
267ae5de77eSEmmanuel Vadot	pinctrl-names = "default";
268ae5de77eSEmmanuel Vadot	pinctrl-0 = <&pwm1m0_pins>;
269ae5de77eSEmmanuel Vadot	status = "okay";
270ae5de77eSEmmanuel Vadot};
271ae5de77eSEmmanuel Vadot
272ae5de77eSEmmanuel Vadot&pwm2 {
273ae5de77eSEmmanuel Vadot	pinctrl-names = "default";
274ae5de77eSEmmanuel Vadot	pinctrl-0 = <&pwm2m0_pins>;
275ae5de77eSEmmanuel Vadot	status = "okay";
2768ccc0d23SEmmanuel Vadot};
2778ccc0d23SEmmanuel Vadot
2788ccc0d23SEmmanuel Vadot&saradc {
2798ccc0d23SEmmanuel Vadot	vref-supply = <&vcc_1v8>;
2808ccc0d23SEmmanuel Vadot	status = "okay";
2818ccc0d23SEmmanuel Vadot};
2828ccc0d23SEmmanuel Vadot
2838ccc0d23SEmmanuel Vadot&sdhci {
2848ccc0d23SEmmanuel Vadot	bus-width = <8>;
2858ccc0d23SEmmanuel Vadot	cap-mmc-highspeed;
286*833e5d42SEmmanuel Vadot	mmc-hs200-1_8v;
2878ccc0d23SEmmanuel Vadot	no-sd;
2888ccc0d23SEmmanuel Vadot	no-sdio;
2898ccc0d23SEmmanuel Vadot	non-removable;
2908ccc0d23SEmmanuel Vadot	vmmc-supply = <&vcc_3v3>;
2918ccc0d23SEmmanuel Vadot	vqmmc-supply = <&vcc_1v8>;
2928ccc0d23SEmmanuel Vadot	status = "okay";
2935f62a964SEmmanuel Vadot};
2945f62a964SEmmanuel Vadot
295ae5de77eSEmmanuel Vadot&sdmmc {
296ae5de77eSEmmanuel Vadot	bus-width = <4>;
297ae5de77eSEmmanuel Vadot	cap-mmc-highspeed;
298ae5de77eSEmmanuel Vadot	cap-sd-highspeed;
299ae5de77eSEmmanuel Vadot	disable-wp;
300ae5de77eSEmmanuel Vadot	sd-uhs-sdr104;
301ae5de77eSEmmanuel Vadot	vmmc-supply = <&vcc_3v3>;
302ae5de77eSEmmanuel Vadot	vqmmc-supply = <&vccio_sd>;
303ae5de77eSEmmanuel Vadot	status = "okay";
304ae5de77eSEmmanuel Vadot};
305ae5de77eSEmmanuel Vadot
3065f62a964SEmmanuel Vadot&uart0 {
3078ccc0d23SEmmanuel Vadot	pinctrl-names = "default";
3088ccc0d23SEmmanuel Vadot	pinctrl-0 = <&uart0m0_xfer>;
3095f62a964SEmmanuel Vadot	status = "okay";
3105f62a964SEmmanuel Vadot};
311