hc
2025-02-14 bbb9540dc49f70f6b703d1c8d1b85fa5f602d86e
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
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2020 Rockchip Electronics Co., Ltd.
 */
 
/dts-v1/;
#include "rv1126.dtsi"
#include "rv1126-bat-ipc.dtsi"
#include "rv1126-thunder-boot-emmc.dtsi"
#include <dt-bindings/input/input.h>
 
/ {
   model = "Rockchip RV1126 BAT IPC V10 Board";
   compatible = "rockchip,rv1126-bat-ipc-v10", "rockchip,rv1126";
 
   adc-keys {
       compatible = "adc-keys";
       io-channels = <&saradc 0>;
       io-channel-names = "buttons";
       poll-interval = <100>;
       keyup-threshold-microvolt = <1800000>;
 
       recovery {
           label = "Volum_up";
           linux,code = <KEY_VOLUMEUP>;
           press-threshold-microvolt = <0>;
       };
   };
 
   cam_ircut0: cam_ircut {
       status = "okay";
       compatible = "ap1511a,ircut";
       pinctrl-names = "default";
       pinctrl-0 = <&ir_cut_en>;
       ircut-open-gpios = <&gpio2 RK_PD5 GPIO_ACTIVE_HIGH>;
       led-gpios = <&gpio2 RK_PB2 GPIO_ACTIVE_HIGH>;
       rockchip,camera-module-index = <1>;
       rockchip,camera-module-facing = "front";
   };
 
   charger {
       compatible = "gpio-charger";
       pinctrl-names = "default";
       pinctrl-0 = <&charger_io>;
       gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
       charger-type = "usb-dcp";
       charge-status-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_LOW>;
       charge-current-limit-gpios = <&gpio0 RK_PC3 GPIO_ACTIVE_HIGH>,
                        <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>;
       charge-current-limit-mapping = <2000000 0x03>, <500000 0x00>;
       extcon = <&u2phy0>;
   };
 
   gpio-poweroff {
       compatible = "gpio-poweroff";
       gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
       pinctrl-names = "default";
       pinctrl-0 = <&power_hold>;
   };
 
   i2s0_sound: i2s0-sound {
       status = "okay";
       compatible = "simple-audio-card";
       simple-audio-card,format = "i2s";
       simple-audio-card,mclk-fs = <256>;
       simple-audio-card,name = "rockchip,i2s0-sound";
       simple-audio-card,cpu {
           sound-dai = <&i2s0_8ch>;
       };
       simple-audio-card,codec {
           sound-dai = <&es8311>;
       };
   };
 
   leds {
       compatible = "pwm-leds";
       blue {
           label = "blue";
           pwms = <&pwm3 0 50000 0>;
           max-brightness = <255>;
       };
 
       red {
           label = "red";
           pwms = <&pwm2 0 50000 0>;
           max-brightness = <255>;
           linux,default-trigger = "heartbeat";
       };
   };
 
   pir {
       compatible = "aschip,pir";
       pulse-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_LOW>;
   };
 
   vcc1v2_dvdd: vcc1v8_dovdd: vcc2v8_avdd: vcc-camera {
       compatible = "regulator-fixed";
       regulator-name = "vcc_camera";
       regulator-boot-on;
       gpio = <&gpio0 RK_PA7 GPIO_ACTIVE_HIGH>;
       enable-active-high;
   };
 
   vcc_1v8: vcc-1v8 {
       compatible = "regulator-fixed";
       regulator-name = "vcc_1v8";
       regulator-always-on;
       regulator-boot-on;
       regulator-min-microvolt = <1800000>;
       regulator-max-microvolt = <1800000>;
   };
 
   vccio_flash: vccio-flash {
       compatible = "regulator-fixed";
       regulator-name = "vccio_flash";
       regulator-always-on;
       regulator-boot-on;
       regulator-min-microvolt = <1800000>;
       regulator-max-microvolt = <1800000>;
       vin-supply = <&vcc_1v8>;
   };
 
   vccio_sd: vccio-sd {
       compatible = "regulator-gpio";
       regulator-name = "vccio_sd";
       regulator-min-microvolt = <1800000>;
       regulator-max-microvolt = <3300000>;
       gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
       states = <3300000 1
             1800000 0>;
   };
 
   vdd_npu_vepu: vdd-npu-vepu {
       compatible = "pwm-regulator";
       pwms = <&pwm1 0 5000 1>;
       regulator-name = "vdd_npu_vepu";
       regulator-min-microvolt = <720000>;
       regulator-max-microvolt = <1000000>;
       regulator-init-microvolt = <824000>;
       regulator-always-on;
       regulator-boot-on;
       regulator-settling-time-up-us = <250>;
       pwm-supply = <&vcc_3v3>;
   };
 
   wireless-wlan {
       compatible = "wlan-platdata";
       rockchip,grf = <&grf>;
       pinctrl-names = "default";
       pinctrl-0 = <&wifi_wake_host>;
       wifi_chip_type = "ap6203";
       WIFI,poweren_gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
       WIFI,host_wake_irq = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>;
       status = "okay";
   };
};
 
&csi_dphy0 {
   status = "okay";
 
   ports {
       #address-cells = <1>;
       #size-cells = <0>;
       port@0 {
           reg = <0>;
           #address-cells = <1>;
           #size-cells = <0>;
 
           mipi_in_ucam0: endpoint@1 {
               reg = <1>;
               remote-endpoint = <&ucam_out0>;
               data-lanes = <1 2>;
           };
       };
       port@1 {
           reg = <1>;
           #address-cells = <1>;
           #size-cells = <0>;
 
           csidphy0_out: endpoint@0 {
               reg = <0>;
               remote-endpoint = <&isp_in>;
           };
       };
   };
};
 
&emmc {
   bus-width = <8>;
   cap-mmc-highspeed;
   non-removable;
   mmc-hs200-1_8v;
   rockchip,default-sample-phase = <90>;
   no-sdio;
   no-sd;
   /delete-property/ pinctrl-names;
   /delete-property/ pinctrl-0;
   status = "okay";
};
 
&i2c0 {
   status = "okay";
   clock-frequency = <100000>;
 
   CW2015@62 {
       compatible = "cw201x";
       reg = <0x62>;
       bat_low_gpio = <&gpio2 RK_PD7 GPIO_ACTIVE_LOW>;
       bat_config_info = <0x15 0x7E 0x7A 0x6E 0x6A 0x67 0x63 0x62 0x62 0x61 0x5E
                  0x59 0x56 0x57 0x51 0x3C 0x30 0x27 0x29 0x29 0x2E 0x3A
                  0x49 0x57 0x64 0x57 0x0B 0x85 0x30 0x50 0x60 0x67 0x6A
                  0x6C 0x6A 0x6C 0x39 0x14 0x64 0x0E 0x04 0x2A 0x4E 0x81
                  0x8E 0x90 0x90 0x43 0x64 0x83 0x96 0xA5 0x80 0x86 0xAC
                  0xCB 0x2F 0x00 0x64 0xA5 0xB5 0x00 0xF8 0x31>;
       monitor_sec = <5>;
       virtual_power = <0>;
   };
 
   pcf8563: pcf8563@51 {
       compatible = "pcf8563";
       reg = <0x51>;
       interrupt-parent = <&gpio0>;
       interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
       pinctrl-names = "default";
       pinctrl-0 = <&rtc_int>;
       #clock-cells = <0>;
       clock-frequency = <32768>;
       clock-output-names = "xin32k";
   };
};
 
&i2c1 {
   status = "okay";
 
   sc210iot: sc210iot@32 {
       compatible = "smartsens,sc210iot";
       reg = <0x32>;
       clocks = <&cru CLK_MIPICSI_OUT>;
       clock-names = "xvclk";
       power-domains = <&power RV1126_PD_VI>;
       avdd-supply = <&vcc2v8_avdd>;
       dovdd-supply = <&vcc1v8_dovdd>;
       dvdd-supply = <&vcc1v2_dvdd>;
       pwdn-gpios = <&gpio1 RK_PD4 GPIO_ACTIVE_HIGH>;
       reset-gpios = <&gpio1 RK_PD5 GPIO_ACTIVE_LOW>;
       rockchip,camera-module-index = <1>;
       rockchip,camera-module-facing = "front";
       rockchip,camera-module-name = "YT-SC210-V2";
       rockchip,camera-module-lens-name = "M12-30IRC-2MP-F18";
       ir-cut = <&cam_ircut0>;
 
       port {
           ucam_out0: endpoint {
               remote-endpoint = <&mipi_in_ucam0>;
               data-lanes = <1 2>;
           };
       };
   };
};
 
&i2c4 {
   status = "okay";
   clock-frequency = <400000>;
   pinctrl-0 = <&i2c4m1_xfer>;
 
   es8311: es8311@18 {
       compatible = "everest,es8311";
       reg = <0x18>;
       clocks = <&cru MCLK_I2S0_TX_OUT2IO>;
       clock-names = "mclk";
       adc-pga-gain = <6>;  /* 18dB */
       adc-volume = <0xbf>;  /* 0dB */
       dac-volume = <0xbf>;  /* 0dB */
       aec-mode = "dac left, adc right";
       pinctrl-names = "default";
       pinctrl-0 = <&i2s0m0_mclk &spk_ctl>;
       assigned-clocks = <&cru MCLK_I2S0_TX_OUT2IO>;
       assigned-clock-parents = <&cru MCLK_I2S0_TX>;
       spk-ctl-gpios = <&gpio2 RK_PA5 GPIO_ACTIVE_HIGH>;
       #sound-dai-cells = <0>;
   };
};
 
&i2s0_8ch {
   status = "okay";
   #sound-dai-cells = <0>;
   rockchip,clk-trcm = <1>;
   rockchip,i2s-rx-route = <3 0 1 2>;
   pinctrl-0 = <&i2s0m0_sclk_tx
            &i2s0m0_lrck_tx
            &i2s0m0_sdo0
            &i2s0m0_sdo1_sdi3>;
};
 
&isp_reserved {
   size = <0x02400000>;
};
 
&npu {
   npu-supply = <&vdd_npu_vepu>;
};
 
&pinctrl {
   charger {
       /omit-if-no-ref/
       charger_io: charger-io {
           rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>,
                   <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
       };
   };
   es8311 {
       spk_ctl: spk-ctl {
           rockchip,pins = <2 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
       };
   };
   ir-cut {
       /omit-if-no-ref/
       ir_cut_en: ir-cut-en {
           rockchip,pins = <2 RK_PD4 RK_FUNC_GPIO &pcfg_output_low>;
       };
   };
   regulator {
       /omit-if-no-ref/
       power_hold: power-hold {
           rockchip,pins =
               <0 RK_PA0 RK_FUNC_GPIO &pcfg_output_high>;
       };
   };
   rtc {
       /omit-if-no-ref/
       rtc_int: rtc-int {
           rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
       };
   };
   wireless-wlan {
       /omit-if-no-ref/
       wifi_wake_host: wifi-wake-host {
           rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_down>;
       };
   };
};
 
&pmu_io_domains {
   status = "okay";
 
   pmuio0-supply = <&vcc_1v8>;
   pmuio1-supply = <&vcc_3v3>;
   vccio2-supply = <&vccio_sd>;
   vccio3-supply = <&vcc_1v8>;
   vccio4-supply = <&vcc_1v8>;
   vccio5-supply = <&vcc_3v3>;
   vccio7-supply = <&vcc_3v3>;
};
 
&pwm1 {
   status = "okay";
   pinctrl-names = "active";
   pinctrl-0 = <&pwm1m0_pins_pull_down>;
};
 
&pwm2 {
   status = "okay";
   pinctrl-names = "active";
   pinctrl-0 = <&pwm2m1_pins_pull_down>;
};
 
&pwm3 {
   status = "okay";
   pinctrl-names = "active";
   pinctrl-0 = <&pwm3m1_pins_pull_down>;
};
 
&rkisp_thunderboot {
   reg = <0x08000000 (32 * 0x00100000)>;
};
 
&rkisp_vir0 {
   ports {
       port@0 {
           reg = <0>;
           #address-cells = <1>;
           #size-cells = <0>;
 
           isp_in: endpoint@0 {
               reg = <0>;
               remote-endpoint = <&csidphy0_out>;
           };
       };
   };
};
 
&rkvenc {
   venc-supply = <&vdd_npu_vepu>;
};
 
&rkvenc_mmu {
   status = "okay";
};
 
&mpp_srv {
   status = "okay";
};
 
&rockchip_suspend {
   status = "okay";
   rockchip,sleep-debug-en = <1>;
   rockchip,sleep-mode-config = <
       (0
       | RKPM_SLP_ARMOFF
       | RKPM_SLP_PMU_PMUALIVE_32K
       | RKPM_SLP_PMU_DIS_OSC
       )
   >;
};
 
&saradc {
   status = "okay";
   vref-supply = <&vcc_1v8>;
};
 
&sdio {
   max-frequency = <50000000>;
   bus-width = <4>;
   cap-sd-highspeed;
   cap-sdio-irq;
   keep-power-in-suspend;
   rockchip,default-sample-phase = <90>;
   no-sd;
   no-mmc;
   supports-chip-alive;
   logic-remove-card;
   status = "okay";
};
 
&sdmmc {
   bus-width = <4>;
   cap-mmc-highspeed;
   cap-sd-highspeed;
   card-detect-delay = <200>;
   rockchip,default-sample-phase = <90>;
   no-sdio;
   no-mmc;
   sd-uhs-sdr12;
   sd-uhs-sdr25;
   sd-uhs-sdr104;
   vqmmc-supply = <&vccio_sd>;
   status = "okay";
};
 
&u2phy0 {
   vup-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_LOW>;
};