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