xref: /linux/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2024 Rockchip Electronics Co., Ltd.
4 *
5 */
6
7/dts-v1/;
8
9#include <dt-bindings/leds/common.h>
10#include <dt-bindings/soc/rockchip,vop2.h>
11#include "rk3588-coolpi-cm5.dtsi"
12
13/ {
14	model = "CoolPi CM5 GenBook";
15	compatible = "coolpi,pi-cm5-genbook", "coolpi,pi-cm5", "rockchip,rk3588";
16
17	backlight: backlight {
18		compatible = "pwm-backlight";
19		enable-gpios = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>;
20		pinctrl-names = "default";
21		pinctrl-0 = <&bl_en>;
22		power-supply = <&vcc12v_dcin>;
23		pwms = <&pwm6 0 25000 0>;
24	};
25
26	battery: battery {
27		compatible = "simple-battery";
28		charge-full-design-microamp-hours = <9800000>;
29		voltage-max-design-microvolt = <4350000>;
30		voltage-min-design-microvolt = <3000000>;
31	};
32
33	charger: dc-charger {
34		compatible = "gpio-charger";
35		charger-type = "mains";
36		gpios = <&gpio1 RK_PC0 GPIO_ACTIVE_LOW>;
37	};
38
39	hdmi-con {
40		compatible = "hdmi-connector";
41		type = "a";
42
43		port {
44			hdmi_con_in: endpoint {
45				remote-endpoint = <&hdmi0_out_con>;
46			};
47		};
48	};
49
50	leds: leds {
51		compatible = "gpio-leds";
52
53		heartbeat_led: led-0 {
54			color = <LED_COLOR_ID_GREEN>;
55			function = LED_FUNCTION_STATUS;
56			gpios = <&gpio1 RK_PB0 GPIO_ACTIVE_HIGH>;
57			linux,default-trigger = "heartbeat";
58		};
59
60		wlan_led: led-1 {
61			color = <LED_COLOR_ID_GREEN>;
62			function = LED_FUNCTION_WLAN;
63			gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
64		};
65
66		charging_red: led-2 {
67			function = LED_FUNCTION_CHARGING;
68			color = <LED_COLOR_ID_RED>;
69			gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_HIGH>;
70		};
71	};
72
73	vcc12v_dcin: regulator-vcc12v-dcin {
74		compatible = "regulator-fixed";
75		regulator-name = "vcc12v_dcin";
76		regulator-always-on;
77		regulator-boot-on;
78		regulator-min-microvolt = <12000000>;
79		regulator-max-microvolt = <12000000>;
80	};
81
82	vcc_sys: regulator-vcc-sys {
83		compatible = "regulator-fixed";
84		regulator-name = "vcc_sys";
85		regulator-always-on;
86		regulator-boot-on;
87		regulator-min-microvolt = <7000000>;
88		regulator-max-microvolt = <7000000>;
89		vin-supply = <&vcc12v_dcin>;
90	};
91
92	vcc5v0_sys: regulator-vcc5v0-sys {
93		compatible = "regulator-fixed";
94		regulator-name = "vcc5v0_sys";
95		regulator-always-on;
96		regulator-boot-on;
97		regulator-min-microvolt = <7000000>;
98		regulator-max-microvolt = <7000000>;
99		vin-supply = <&vcc_sys>;
100	};
101
102	vcc3v3_sys: regulator-vcc3v3-sys {
103		compatible = "regulator-fixed";
104		regulator-name = "vcc3v3_sys";
105		regulator-always-on;
106		regulator-boot-on;
107		regulator-min-microvolt = <3300000>;
108		regulator-max-microvolt = <3300000>;
109		vin-supply = <&vcc5v0_sys>;
110	};
111
112	vcc3v3_lcd: regulator-vcc3v3-lcd {
113		compatible = "regulator-fixed";
114		regulator-name = "vcc3v3_lcd";
115		enable-active-high;
116		gpio = <&gpio1 RK_PC4 GPIO_ACTIVE_HIGH>;
117		pinctrl-names = "default";
118		pinctrl-0 = <&lcdpwr_en>;
119		vin-supply = <&vcc3v3_sys>;
120	};
121
122	vcc5v0_usb: regulator-vcc5v0-usb {
123		compatible = "regulator-fixed";
124		regulator-name = "vcc5v0_usb";
125		regulator-boot-on;
126		regulator-always-on;
127		enable-active-high;
128		regulator-min-microvolt = <5000000>;
129		regulator-max-microvolt = <5000000>;
130		gpio = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>;
131		pinctrl-names = "default";
132		pinctrl-0 = <&usb_pwren>;
133		vin-supply = <&vcc_sys>;
134	};
135
136	vcc5v0_usb_host0: vcc5v0_usb30_host: regulator-vcc5v0-usb-host {
137		compatible = "regulator-fixed";
138		regulator-name = "vcc5v0_host";
139		regulator-boot-on;
140		regulator-always-on;
141		enable-active-high;
142		regulator-min-microvolt = <5000000>;
143		regulator-max-microvolt = <5000000>;
144		gpio = <&gpio1 RK_PA7 GPIO_ACTIVE_HIGH>;
145		pinctrl-names = "default";
146		pinctrl-0 = <&usb_host_pwren>;
147		vin-supply = <&vcc5v0_usb>;
148	};
149};
150
151/* HDMI CEC is not used */
152&hdmi0 {
153	pinctrl-0 = <&hdmim0_tx0_hpd &hdmim0_tx0_scl &hdmim0_tx0_sda>;
154	status = "okay";
155};
156
157&hdmi0_in {
158	hdmi0_in_vp0: endpoint {
159		remote-endpoint = <&vp0_out_hdmi0>;
160	};
161};
162
163&hdmi0_out {
164	hdmi0_out_con: endpoint {
165		remote-endpoint = <&hdmi_con_in>;
166	};
167};
168
169&hdptxphy_hdmi0 {
170	status = "okay";
171};
172
173&i2c4 {
174	status = "okay";
175	pinctrl-names = "default";
176	pinctrl-0 = <&i2c4m3_xfer>;
177
178	cw2015@62 {
179		compatible = "cellwise,cw2015";
180		reg = <0x62>;
181
182		cellwise,battery-profile = /bits/ 8 <
183			0x17 0x67 0x69 0x63 0x63 0x62 0x62 0x5F
184			0x52 0x73 0x4C 0x5A 0x5B 0x4B 0x42 0x3A
185			0x33 0x2D 0x29 0x28 0x2E 0x31 0x3C 0x49
186			0x2C 0x2C 0x0C 0xCD 0x30 0x51 0x50 0x66
187			0x74 0x74 0x75 0x78 0x41 0x1B 0x84 0x5F
188			0x0B 0x34 0x1C 0x45 0x89 0x92 0xA0 0x13
189			0x2C 0x55 0xAB 0xCB 0x80 0x5E 0x7B 0xCB
190			0x2F 0x00 0x64 0xA5 0xB5 0x10 0x18 0x21
191			>;
192
193		cellwise,monitor-interval-ms = <3000>;
194		monitored-battery = <&battery>;
195		power-supplies = <&charger>;
196	};
197};
198
199&i2c5 {
200	status = "okay";
201	pinctrl-names = "default";
202	pinctrl-0 = <&i2c5m3_xfer>;
203
204	touchpad: touchpad@2c {
205		compatible = "hid-over-i2c";
206		reg = <0x2c>;
207		interrupt-parent = <&gpio1>;
208		interrupts = <RK_PD6 IRQ_TYPE_LEVEL_LOW>;
209		hid-descr-addr = <0x0020>;
210	};
211};
212
213&gmac0 {
214	status = "disabled";
215};
216
217/* M.2 E-Key */
218&pcie2x1l0 {
219	reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>;
220	vpcie3v3-supply = <&vcc3v3_sys>;
221	pinctrl-names = "default";
222	pinctrl-0 = <&pcie_clkreq &pcie_wake &pcie_rst &wifi_pwron &bt_pwron>;
223	status = "okay";
224};
225
226&pcie2x1l2 {
227	status = "disabled";
228};
229
230&pcie30phy {
231	status = "okay";
232};
233
234/* M.2 M-Key ssd */
235&pcie3x4 {
236	reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;
237	vpcie3v3-supply = <&vcc3v3_sys>;
238	status = "okay";
239};
240
241&pinctrl {
242	lcd {
243		lcdpwr_en: lcdpwr-en {
244			rockchip,pins = <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>;
245		};
246
247		bl_en: bl-en {
248			rockchip,pins = <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
249		};
250	};
251
252	usb {
253		usb_pwren: usb-pwren {
254			rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>;
255		};
256
257		usb_otg_pwren: usb-otg-pwren {
258			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
259		};
260
261		usb_host_pwren: usb-host-pwren {
262			rockchip,pins = <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>;
263		};
264	};
265
266	wifi {
267		bt_pwron: bt-pwron {
268			rockchip,pins = <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
269		};
270
271		pcie_clkreq: pcie-clkreq {
272			rockchip,pins = <4 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
273		};
274
275		pcie_rst: pcie-rst {
276			rockchip,pins = <4 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
277		};
278
279		wifi_pwron: wifi-pwron {
280			rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>;
281		};
282
283		pcie_wake: pcie-wake {
284			rockchip,pins = <4 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
285		};
286	};
287};
288
289&pwm6 {
290	pinctrl-0 = <&pwm6m1_pins>;
291	status = "okay";
292};
293
294&sdmmc {
295	status = "disabled";
296};
297
298&sfc {
299	pinctrl-names = "default";
300	pinctrl-0 = <&fspim2_pins>;
301	status = "okay";
302
303	flash@0 {
304		compatible = "jedec,spi-nor";
305		reg = <0x0>;
306		spi-max-frequency = <100000000>;
307		spi-rx-bus-width = <4>;
308		spi-tx-bus-width = <1>;
309	};
310};
311
312&u2phy0 {
313	status = "okay";
314};
315
316&u2phy0_otg {
317	status = "okay";
318};
319
320&usbdp_phy0 {
321	status = "okay";
322};
323
324&u2phy1 {
325	status = "okay";
326};
327
328&u2phy1_otg {
329	status = "okay";
330};
331
332&u2phy2 {
333	status = "okay";
334};
335
336&u2phy3 {
337	status = "okay";
338};
339
340&u2phy2_host {
341	phy-supply = <&vcc5v0_usb_host0>;
342	status = "okay";
343};
344
345&u2phy3_host {
346	phy-supply = <&vcc5v0_usb>;
347	status = "okay";
348};
349
350&usbdp_phy1 {
351	status = "okay";
352};
353
354/* For Keypad */
355&usb_host0_ehci {
356	status = "okay";
357};
358
359&usb_host0_ohci {
360	status = "okay";
361};
362
363/* Type C port */
364&usb_host0_xhci {
365	dr_mode = "peripheral";
366	maximum-speed = "high-speed";
367	status = "okay";
368};
369
370/* connected to a HUB for camera and BT */
371&usb_host1_ehci {
372	status = "okay";
373};
374
375&usb_host1_ohci {
376	status = "okay";
377};
378
379/* USB A out */
380&usb_host1_xhci {
381	dr_mode = "host";
382	status = "okay";
383};
384
385&vop {
386	status = "okay";
387};
388
389&vop_mmu {
390	status = "okay";
391};
392
393&vp0 {
394	vp0_out_hdmi0: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
395		reg = <ROCKCHIP_VOP2_EP_HDMI0>;
396		remote-endpoint = <&hdmi0_in_vp0>;
397	};
398};
399