xref: /linux/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-cm5-base.dts (revision c17ee635fd3a482b2ad2bf5e269755c2eae5f25e)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
3/dts-v1/;
4
5#include <dt-bindings/gpio/gpio.h>
6#include <dt-bindings/input/input.h>
7#include <dt-bindings/interrupt-controller/irq.h>
8#include <dt-bindings/leds/common.h>
9#include <dt-bindings/pinctrl/rockchip.h>
10#include <dt-bindings/pwm/pwm.h>
11#include <dt-bindings/soc/rockchip,vop2.h>
12
13#include "rk3588s-orangepi-cm5.dtsi"
14
15/ {
16	model = "Xunlong Orange Pi CM5 Base";
17	compatible = "xunlong,orangepi-cm5-base", "xunlong,orangepi-cm5", "rockchip,rk3588s";
18
19	aliases {
20		ethernet0 = &gmac1;
21		mmc1 = &sdmmc;
22	};
23
24	chosen {
25		stdout-path = "serial2:1500000n8";
26	};
27
28	gpio-keys {
29		compatible = "gpio-keys";
30		pinctrl-names = "default";
31		pinctrl-0 = <&key1_pin>;
32
33		button {
34			debounce-interval = <50>;
35			gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_LOW>;
36			label = "USERKEY";
37			linux,code = <BTN_MISC>;
38			wakeup-source;
39		};
40	};
41
42	hdmi0-con {
43		compatible = "hdmi-connector";
44		type = "a";
45
46		port {
47			hdmi0_con_in: endpoint {
48				remote-endpoint = <&hdmi0_out_con>;
49			};
50		};
51	};
52
53	pwm-leds {
54		compatible = "pwm-leds";
55
56		led-1 {
57			color = <LED_COLOR_ID_RED>;
58			function = LED_FUNCTION_STATUS;
59			linux,default-trigger = "heartbeat";
60			max-brightness = <255>;
61			pwms = <&pwm2 0 25000 0>;
62		};
63
64		led-2 {
65			color = <LED_COLOR_ID_GREEN>;
66			function = LED_FUNCTION_WAN;
67			max-brightness = <255>;
68			pwms = <&pwm4 0 25000 PWM_POLARITY_INVERTED>;
69		};
70
71		led-3 {
72			color = <LED_COLOR_ID_GREEN>;
73			function = LED_FUNCTION_LAN;
74			function-enumerator = <0>;
75			max-brightness = <255>;
76			pwms = <&pwm5 0 25000 PWM_POLARITY_INVERTED>;
77		};
78
79		led-4 {
80			color = <LED_COLOR_ID_GREEN>;
81			function = LED_FUNCTION_LAN;
82			function-enumerator = <1>;
83			max-brightness = <255>;
84			pwms = <&pwm6 0 25000 0>;
85		};
86	};
87
88	vbus_5v0: regulator-vbus-5v0 {
89		compatible = "regulator-fixed";
90		enable-active-high;
91		gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
92		pinctrl-names = "default";
93		pinctrl-0 = <&vbus_5v0_en_pin>;
94		regulator-name = "vbus_5v0";
95		regulator-min-microvolt = <5000000>;
96		regulator-max-microvolt = <5000000>;
97		vin-supply = <&vcc5v0_sys>;
98	};
99
100	vcc_3v3: regulator-vcc-3v3 {
101		compatible = "regulator-fixed";
102		enable-active-high;
103		gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>;
104		pinctrl-names = "default";
105		pinctrl-0 = <&vcc_3v3_en_pin>;
106		regulator-name = "vcc_3v3";
107		regulator-min-microvolt = <3300000>;
108		regulator-max-microvolt = <3300000>;
109		startup-delay-us = <50000>;
110		vin-supply = <&vcc5v0_sys>;
111	};
112
113	vcc5v0_sys: regulator-vcc-5v0 {
114		compatible = "regulator-fixed";
115		regulator-name = "vcc5v0_sys";
116		regulator-always-on;
117		regulator-boot-on;
118		regulator-min-microvolt = <5000000>;
119		regulator-max-microvolt = <5000000>;
120	};
121};
122
123&combphy0_ps {
124	status = "okay";
125};
126
127&combphy2_psu {
128	status = "okay";
129};
130
131&gmac1 {
132	clock_in_out = "output";
133	phy-handle = <&rgmii_phy>;
134	phy-mode = "rgmii-id";
135	phy-supply = <&vcc_3v3>;
136	pinctrl-names = "default";
137	pinctrl-0 = <&gmac1_miim
138		     &gmac1_rx_bus2
139		     &gmac1_tx_bus2
140		     &gmac1_rgmii_clk
141		     &gmac1_rgmii_bus>;
142	status = "okay";
143};
144
145&hdmi0 {
146	pinctrl-names = "default";
147	pinctrl-0 = <&hdmim0_tx0_cec &hdmim0_tx0_hpd
148		     &hdmim0_tx0_scl &hdmim0_tx0_sda
149		     &hdmi_frl_pin>;
150	status = "okay";
151};
152
153&hdmi0_in {
154	hdmi0_in_vp0: endpoint {
155		remote-endpoint = <&vp0_out_hdmi0>;
156	};
157};
158
159&hdmi0_out {
160	hdmi0_out_con: endpoint {
161		remote-endpoint = <&hdmi0_con_in>;
162	};
163};
164
165&hdmi0_sound {
166	status = "okay";
167};
168
169&hdptxphy0 {
170	status = "okay";
171};
172
173&i2c1 {
174	pinctrl-0 = <&i2c1m2_xfer>;
175	status = "okay";
176
177	rtc@51 {
178		compatible = "haoyu,hym8563";
179		reg = <0x51>;
180		#clock-cells = <0>;
181		clock-output-names = "hym8563";
182		interrupt-parent = <&gpio0>;
183		interrupts = <RK_PB0 IRQ_TYPE_LEVEL_LOW>;
184		pinctrl-names = "default";
185		pinctrl-0 = <&rtc_int_pin>;
186		wakeup-source;
187	};
188};
189
190&i2s5_8ch {
191	status = "okay";
192};
193
194&mdio1 {
195	rgmii_phy: ethernet-phy@1 {
196		/* YT8531C */
197		compatible = "ethernet-phy-ieee802.3-c22";
198		reg = <0x1>;
199		pinctrl-names = "default";
200		pinctrl-0 = <&rgmii_phy_pin>;
201		reset-assert-us = <20000>;
202		reset-deassert-us = <100000>;
203		reset-gpios = <&gpio1 RK_PC1 GPIO_ACTIVE_LOW>;
204	};
205};
206
207&pcie2x1l1 {
208	reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>;
209	vpcie3v3-supply = <&vcc_3v3>;
210	status = "okay";
211};
212
213&pcie2x1l2 {
214	reset-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>;
215	vpcie3v3-supply = <&vcc_3v3>;
216	status = "okay";
217};
218
219&pinctrl {
220	camera {
221		cam1_reset_pin: cam1-reset-pin {
222			rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
223		};
224		cam2_reset_pin: cam2-reset-pin {
225			rockchip,pins = <1 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
226		};
227		cam3_reset_pin: cam3-reset-pin {
228			rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
229		};
230		cam4_reset_pin: cam4-reset-pin {
231			rockchip,pins = <1 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
232		};
233	};
234
235	ethernet {
236		rgmii_phy_pin: rgmii-phy-pin {
237			rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
238		};
239	};
240
241	gpio-key {
242		key1_pin: key1-pin {
243			rockchip,pins = <3 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
244		};
245	};
246
247	hdmi {
248		hdmi_frl_pin: hdmi-frl-pin {
249			rockchip,pins = <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
250		};
251	};
252
253	power {
254		vcc_3v3_en_pin: vcc-3v3-en-pin {
255			rockchip,pins = <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_down>;
256		};
257	};
258
259	rtc {
260		rtc_int_pin: rtc-int-pin {
261			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
262		};
263	};
264
265	usb {
266		vbus_5v0_en_pin: vbus-5v0-en-pin {
267			rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
268		};
269	};
270};
271
272&pwm2 {
273	status = "okay";
274};
275
276&pwm4 {
277	status = "okay";
278};
279
280&pwm5 {
281	pinctrl-0 = <&pwm5m1_pins>;
282	status = "okay";
283};
284
285&pwm6 {
286	status = "okay";
287};
288
289&sdmmc {
290	bus-width = <4>;
291	cap-sd-highspeed;
292	disable-wp;
293	max-frequency = <150000000>;
294	no-mmc;
295	no-sdio;
296	sd-uhs-sdr104;
297	vmmc-supply = <&vcc_3v3_s3>;
298	vqmmc-supply = <&vccio_sd_s0>;
299	status = "okay";
300};
301
302&u2phy0 {
303	status = "okay";
304};
305
306&u2phy0_otg {
307	phy-supply = <&vbus_5v0>;
308	status = "okay";
309};
310
311&u2phy2 {
312	status = "okay";
313};
314
315&u2phy2_host {
316	phy-supply = <&vbus_5v0>;
317	status = "okay";
318};
319
320&uart2 {
321	pinctrl-0 = <&uart2m0_xfer>;
322	status = "okay";
323};
324
325&usb_host0_ehci {
326	status = "okay";
327};
328
329&usb_host0_ohci {
330	status = "okay";
331};
332
333&usb_host0_xhci {
334	dr_mode = "host";
335	status = "okay";
336};
337
338&usbdp_phy0 {
339	status = "okay";
340};
341
342&vop {
343	status = "okay";
344};
345
346&vop_mmu {
347	status = "okay";
348};
349
350&vp0 {
351	vp0_out_hdmi0: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
352		reg = <ROCKCHIP_VOP2_EP_HDMI0>;
353		remote-endpoint = <&hdmi0_in_vp0>;
354	};
355};
356