1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2022 Radxa Limited
4 * Copyright (c) 2022 Amarula Solutions(India)
5 */
6
7/dts-v1/;
8#include <dt-bindings/soc/rockchip,vop2.h>
9#include "rk3566.dtsi"
10#include "rk3566-radxa-cm3.dtsi"
11
12/ {
13	model = "Radxa Compute Module 3(CM3) IO Board";
14	compatible = "radxa,radxa-cm3-io", "radxa,radxa-cm3", "rockchip,rk3566";
15
16	aliases {
17		mmc1 = &sdmmc0;
18	};
19
20	chosen: chosen {
21		stdout-path = "serial2:1500000n8";
22	};
23
24	hdmi-con {
25		compatible = "hdmi-connector";
26		type = "a";
27
28		port {
29			hdmi_con_in: endpoint {
30				remote-endpoint = <&hdmi_out_con>;
31			};
32		};
33	};
34
35	leds {
36		compatible = "gpio-leds";
37
38		led-1 {
39			gpios = <&gpio4 RK_PA4 GPIO_ACTIVE_LOW>;
40			color = <LED_COLOR_ID_GREEN>;
41			function = LED_FUNCTION_ACTIVITY;
42			linux,default-trigger = "heartbeat";
43			pinctrl-names = "default";
44			pinctrl-0 = <&pi_nled_activity>;
45		};
46	};
47
48	vcc5v0_usb30: vcc5v0-usb30-regulator {
49		compatible = "regulator-fixed";
50		regulator-name = "vcc5v0_usb30";
51		enable-active-high;
52		gpio = <&gpio3 RK_PC2 GPIO_ACTIVE_HIGH>;
53		pinctrl-names = "default";
54		pinctrl-0 = <&vcc5v0_usb30_en_h>;
55		regulator-always-on;
56		regulator-min-microvolt = <5000000>;
57		regulator-max-microvolt = <5000000>;
58		vin-supply = <&vcc_sys>;
59	};
60
61	vcca1v8_image: vcca1v8-image-regulator {
62		compatible = "regulator-fixed";
63		regulator-name = "vcca1v8_image";
64		regulator-always-on;
65		regulator-boot-on;
66		regulator-min-microvolt = <1800000>;
67		regulator-max-microvolt = <1800000>;
68		vin-supply = <&vcc_1v8_p>;
69	};
70
71	vdda0v9_image: vdda0v9-image-regulator {
72		compatible = "regulator-fixed";
73		regulator-name = "vcca0v9_image";
74		regulator-always-on;
75		regulator-boot-on;
76		regulator-min-microvolt = <900000>;
77		regulator-max-microvolt = <900000>;
78		vin-supply = <&vdda_0v9>;
79	};
80};
81
82&combphy1 {
83	status = "okay";
84};
85
86&hdmi {
87	avdd-0v9-supply = <&vdda0v9_image>;
88	avdd-1v8-supply = <&vcca1v8_image>;
89	status = "okay";
90};
91
92&hdmi_in {
93	hdmi_in_vp0: endpoint {
94		remote-endpoint = <&vp0_out_hdmi>;
95	};
96};
97
98&hdmi_out {
99	hdmi_out_con: endpoint {
100		remote-endpoint = <&hdmi_con_in>;
101	};
102};
103
104&hdmi_sound {
105	status = "okay";
106};
107
108&pinctrl {
109	leds {
110		pi_nled_activity: pi-nled-activity {
111			rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
112		};
113	};
114
115	sdcard {
116		sdmmc_pwren: sdmmc-pwren {
117			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
118		};
119	};
120
121	usb {
122		vcc5v0_usb30_en_h: vcc5v0-host-en-h {
123			rockchip,pins = <3 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
124		};
125	};
126};
127
128&sdmmc0 {
129	bus-width = <4>;
130	cap-mmc-highspeed;
131	cap-sd-highspeed;
132	disable-wp;
133	vqmmc-supply = <&vccio_sd>;
134	pinctrl-names = "default";
135	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_pwren>;
136	status = "okay";
137};
138
139&uart2 {
140	status = "okay";
141};
142
143&usb2phy0_host {
144	phy-supply = <&vcc5v0_usb30>;
145	status = "okay";
146};
147
148&usb2phy1_host {
149	status = "okay";
150};
151
152&usb2phy1_otg {
153	status = "okay";
154};
155
156&usb_host0_ehci {
157	status = "okay";
158};
159
160&usb_host1_xhci {
161	status = "okay";
162};
163
164&vop {
165	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
166	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
167	status = "okay";
168};
169
170&vop_mmu {
171	status = "okay";
172};
173
174&vp0 {
175	vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
176		reg = <ROCKCHIP_VOP2_EP_HDMI0>;
177		remote-endpoint = <&hdmi_in_vp0>;
178	};
179};
180