hc
2024-05-11 645e752c5a84baeb21015cdc85fc05b7d16312c8
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
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2023 Rockchip Electronics Co., Ltd.
 *
 */
#include <dt-bindings/display/media-bus-format.h>
 
/ {
   max96712_dphy0_osc0: max96712-dphy0-oscillator@0 {
       compatible = "fixed-clock";
       #clock-cells = <1>;
       clock-frequency = <25000000>;
       clock-output-names = "max96712-dphy0-osc0";
   };
 
   max96712_dphy0_vcc1v2: max96712-dphy0-vcc1v2 {
       compatible = "regulator-fixed";
       regulator-name = "max96712_dphy0_vcc1v2";
       regulator-boot-on;
       regulator-always-on;
       regulator-min-microvolt = <1200000>;
       regulator-max-microvolt = <1200000>;
       startup-delay-us = <850>;
       vin-supply = <&vcc5v0_sys>;
   };
 
   max96712_dphy0_vcc1v8: max96712-dphy0-vcc1v8 {
       compatible = "regulator-fixed";
       regulator-name = "max96712_dphy0_vcc1v8";
       regulator-boot-on;
       regulator-always-on;
       regulator-min-microvolt = <1800000>;
       regulator-max-microvolt = <1800000>;
       startup-delay-us = <200>;
       vin-supply = <&vcc_3v3_s3>;
   };
 
   max96712_dphy0_poc: max96712-dphy0-poc {
       compatible = "regulator-fixed";
       regulator-name = "max96712_dphy0_poc";
       regulator-boot-on;
       regulator-always-on;
       regulator-min-microvolt = <12000000>;
       regulator-max-microvolt = <12000000>;
       enable-active-high;
       gpio = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>;
       startup-delay-us = <1050>;
       off-on-delay-us = <515000>;
       vin-supply = <&vcc12v_dcin>;
   };
};
 
&csi2_dphy0_hw {
   status = "okay";
};
 
&csi2_dphy0 {
   status = "okay";
 
   ports {
       #address-cells = <1>;
       #size-cells = <0>;
       port@0 {
           reg = <0>;
           #address-cells = <1>;
           #size-cells = <0>;
 
           mipi_dphy0_in_max96712: endpoint@1 {
               reg = <1>;
               remote-endpoint = <&max96712_dphy0_out>;
               data-lanes = <1 2 3 4>;
           };
       };
       port@1 {
           reg = <1>;
           #address-cells = <1>;
           #size-cells = <0>;
 
           csidphy0_out: endpoint@0 {
               reg = <0>;
               remote-endpoint = <&mipi2_csi2_input>;
           };
       };
   };
};
 
&i2c7 {
   status = "okay";
   pinctrl-names = "default";
   pinctrl-0 = <&i2c7m3_xfer>;
 
   max96712_dphy0: max96712@29 {
       compatible = "maxim4c,max96712";
       status = "okay";
       reg = <0x29>;
       clock-names = "xvclk";
       clocks = <&max96712_dphy0_osc0 0>;
       pinctrl-names = "default";
       pinctrl-0 = <&max96712_dphy0_pwdn>, <&max96712_dphy0_errb>, <&max96712_dphy0_lock>;
       power-domains = <&power RK3588_PD_VI>;
       rockchip,grf = <&sys_grf>;
       pwdn-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>;
       lock-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_HIGH>;
       vcc1v2-supply = <&max96712_dphy0_vcc1v2>;
       vcc1v8-supply = <&max96712_dphy0_vcc1v8>;
       poc-supply = <&max96712_dphy0_poc>;
 
       rockchip,camera-module-index = <0>;
       rockchip,camera-module-facing = "back";
       rockchip,camera-module-name = "max96712";
       rockchip,camera-module-lens-name = "max96712";
 
       port {
           max96712_dphy0_out: endpoint {
               remote-endpoint = <&mipi_dphy0_in_max96712>;
               data-lanes = <1 2 3 4>;
           };
       };
 
       /* support mode config start */
       support-mode-config {
           status = "okay";
 
           bus-format = <MEDIA_BUS_FMT_UYVY8_2X8>;
           sensor-width = <1280>;
           sensor-height = <800>;
           max-fps-numerator = <10000>;
           max-fps-denominator = <300000>;
           bpp = <16>;
           link-freq-idx = <20>;
           vc-array = <0x10 0x20 0x40 0x80>; // VC0~3: bit4~7
       };
       /* support mode config end */
 
       /* serdes local device start */
       serdes-local-device {
           status = "okay";
 
           /* GMSL LINK config start */
           gmsl-links {
               status = "okay";
 
               link-vdd-ldo1-en = <1>;
               link-vdd-ldo2-en = <1>;
 
               // Link A: link-id = 0
               gmsl-link-config-0 {
                   status = "okay";
                   link-id = <0>; // Link ID: 0/1/2/3
 
                   link-type = <0>;
                   link-rx-rate = <0>;
                   link-tx-rate = <0>;
 
                   port {
                       max96712_dphy0_link0_in: endpoint {
                           remote-endpoint = <&max96712_dphy0_remote0_out>;
                       };
                   };
 
                   link-init-sequence {
                       seq-item-size = <5>; // reg-addr-len + reg-val-len * 2 + 1
                       reg-addr-len = <2>; // 1: 8bits, 2: 16bits
                       reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
                       // reg_addr reg_val val_mask delay
                       init-sequence = [
                           14 D1 03 00 00 // VGAHiGain
                           14 45 00 00 00 // Disable SSC
                           0B 06 ef 00 00 // HIM on
                           0B 07 84 00 00 // Enable HVEN and DBL
                           0B 0F 01 00 00 // Disable processing DE signals
                       ];
                   };
               };
 
               // Link B: link-id = 1
               gmsl-link-config-1 {
                   status = "okay";
                   link-id = <1>; // Link ID: 0/1/2/3
 
                   link-type = <0>;
                   link-rx-rate = <0>;
                   link-tx-rate = <0>;
 
                   port {
                       max96712_dphy0_link1_in: endpoint {
                           remote-endpoint = <&max96712_dphy0_remote1_out>;
                       };
                   };
 
                   link-init-sequence {
                       seq-item-size = <5>; // reg-addr-len + reg-val-len * 2 + 1
                       reg-addr-len = <2>; // 1: 8bits, 2: 16bits
                       reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
                       // reg_addr reg_val val_mask delay
                       init-sequence = [
                           15 D1 03 00 00 // VGAHiGain
                           15 45 00 00 00 // Disable SSC
                           0C 06 ef 00 00 // HIM on
                           0C 07 84 00 00 // Enable HVEN and DBL
                           0C 0F 01 00 00 // Disable processing DE signals
                       ];
                   };
               };
 
               // Link C: link-id = 2
               gmsl-link-config-2 {
                   status = "okay";
                   link-id = <2>; // Link ID: 0/1/2/3
 
                   link-type = <0>;
                   link-rx-rate = <0>;
                   link-tx-rate = <0>;
 
                   port {
                       max96712_dphy0_link2_in: endpoint {
                           remote-endpoint = <&max96712_dphy0_remote2_out>;
                       };
                   };
 
                   link-init-sequence {
                       seq-item-size = <5>; // reg-addr-len + reg-val-len * 2 + 1
                       reg-addr-len = <2>; // 1: 8bits, 2: 16bits
                       reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
                       // reg_addr reg_val val_mask delay
                       init-sequence = [
                           16 D1 03 00 00 // VGAHiGain
                           16 45 00 00 00 // Disable SSC
                           0D 06 ef 00 00 // HIM on
                           0D 07 84 00 00 // Enable HVEN and DBL
                           0D 0F 01 00 00 // Disable processing DE signals
                       ];
                   };
               };
 
               // Link D: link-id = 3
               gmsl-link-config-3 {
                   status = "okay";
                   link-id = <3>; // Link ID: 0/1/2/3
 
                   link-type = <0>;
                   link-rx-rate = <0>;
                   link-tx-rate = <0>;
 
                   port {
                       max96712_dphy0_link3_in: endpoint {
                           remote-endpoint = <&max96712_dphy0_remote3_out>;
                       };
                   };
 
                   link-init-sequence {
                       seq-item-size = <5>; // reg-addr-len + reg-val-len * 2 + 1
                       reg-addr-len = <2>; // 1: 8bits, 2: 16bits
                       reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
                       // reg_addr reg_val val_mask delay
                       init-sequence = [
                           17 D1 03 00 00 // VGAHiGain
                           17 45 00 00 00 // Disable SSC
                           0E 06 ef 00 00 // HIM on
                           0E 07 84 00 00 // Enable HVEN and DBL
                           0E 0F 01 00 00 // Disable processing DE signals
                       ];
                   };
               };
           };
           /* GMSL LINK config end */
 
           /* VIDEO PIPE config start */
           video-pipes {
               status = "okay";
 
               // Video Pipe 0
               video-pipe-config-0 {
                   status = "okay";
                   pipe-id = <0>; // Video Pipe ID: 0/1/2/3/4/5/6/7
 
                   pipe-idx = <0>; // Video Pipe X/Y/Z/U: 0/1/2/3
                   link-idx = <0>; // Link A/B/C/D: 0/1/2/3
 
                   pipe-init-sequence {
                       seq-item-size = <5>; // reg-addr-len + reg-val-len * 2 + 1
                       reg-addr-len = <2>; // 1: 8bits, 2: 16bits
                       reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
                       // reg_addr reg_val val_mask delay
                       init-sequence = [
                           // Send YUV422, FS, and FE from Video Pipe 0 to Controller 1
                           09 0B 07 00 00 // Enable 0/1/2 SRC/DST Mappings
                           09 2D 15 00 00 // SRC/DST 0/1/2 -> CSI2 Controller 1;
                           // For the following MSB 2 bits = VC, LSB 6 bits = DT
                           09 0D 1e 00 00 // SRC0 VC = 0, DT = YUV422 8bit
                           09 0E 1e 00 00 // DST0 VC = 0, DT = YUV422 8bit
                           09 0F 00 00 00 // SRC1 VC = 0, DT = Frame Start
                           09 10 00 00 00 // DST1 VC = 0, DT = Frame Start
                           09 11 01 00 00 // SRC2 VC = 0, DT = Frame End
                           09 12 01 00 00 // DST2 VC = 0, DT = Frame End
                       ];
                   };
               };
 
               // Video Pipe 1
               video-pipe-config-1 {
                   status = "okay";
                   pipe-id = <1>; // Video Pipe 1: pipe-id = 1
 
                   pipe-idx = <0>; // Video Pipe X/Y/Z/U: 0/1/2/3
                   link-idx = <1>; // Link A/B/C/D: 0/1/2/3
 
                   pipe-init-sequence {
                       seq-item-size = <5>; // reg-addr-len + reg-val-len * 2 + 1
                       reg-addr-len = <2>; // 1: 8bits, 2: 16bits
                       reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
                       // reg_addr reg_val val_mask delay
                       init-sequence = [
                           // Send YUV422, FS, and FE from Video Pipe 1 to Controller 1
                           09 4B 07 00 00 // Enable 0/1/2 SRC/DST Mappings
                           09 6D 15 00 00 // SRC/DST 0/1/2 -> CSI2 Controller 1;
                           // For the following MSB 2 bits = VC, LSB 6 bits = DT
                           09 4D 1e 00 00 // SRC0 VC = 0, DT = YUV422 8bit
                           09 4E 5e 00 00 // DST0 VC = 1, DT = YUV422 8bit
                           09 4F 00 00 00 // SRC1 VC = 0, DT = Frame Start
                           09 50 40 00 00 // DST1 VC = 1, DT = Frame Start
                           09 51 01 00 00 // SRC2 VC = 0, DT = Frame End
                           09 52 41 00 00 // DST2 VC = 1, DT = Frame End
                       ];
                   };
               };
 
               // Video Pipe 2
               video-pipe-config-2 {
                   status = "okay";
                   pipe-id = <2>; // Video Pipe ID: 0/1/2/3/4/5/6/7
 
                   pipe-idx = <0>; // Video Pipe X/Y/Z/U: 0/1/2/3
                   link-idx = <2>; // Link A/B/C/D: 0/1/2/3
 
                   pipe-init-sequence {
                       seq-item-size = <5>; // reg-addr-len + reg-val-len * 2 + 1
                       reg-addr-len = <2>; // 1: 8bits, 2: 16bits
                       reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
                       // reg_addr reg_val val_mask delay
                       init-sequence = [
                           // Send YUV422, FS, and FE from Video Pipe 2 to Controller 1
                           09 8B 07 00 00 // Enable 0/1/2 SRC/DST Mappings
                           09 AD 15 00 00 // SRC/DST 0/1/2 -> CSI2 Controller 1;
                           // For the following MSB 2 bits = VC, LSB 6 bits = DT
                           09 8D 1e 00 00 // SRC0 VC = 0, DT = YUV422 8bit
                           09 8E 9e 00 00 // DST0 VC = 2, DT = YUV422 8bit
                           09 8F 00 00 00 // SRC1 VC = 0, DT = Frame Start
                           09 90 80 00 00 // DST1 VC = 2, DT = Frame Start
                           09 91 01 00 00 // SRC2 VC = 0, DT = Frame End
                           09 92 81 00 00 // DST2 VC = 2, DT = Frame End
                       ];
                   };
               };
 
               // Video Pipe 3
               video-pipe-config-3 {
                   status = "okay";
                   pipe-id = <3>; // Video Pipe ID: 0/1/2/3/4/5/6/7
 
                   pipe-idx = <0>; // Video Pipe X/Y/Z/U: 0/1/2/3
                   link-idx = <3>; // Link A/B/C/D: 0/1/2/3
 
                   pipe-init-sequence {
                       seq-item-size = <5>; // reg-addr-len + reg-val-len * 2 + 1
                       reg-addr-len = <2>; // 1: 8bits, 2: 16bits
                       reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
                       // reg_addr reg_val val_mask delay
                       init-sequence = [
                           // Send YUV422, FS, and FE from Video Pipe 3 to Controller 1
                           09 CB 07 00 00 // Enable 0/1/2 SRC/DST Mappings
                           09 ED 15 00 00 // SRC/DST 0/1/2 -> CSI2 Controller 1;
                           // For the following MSB 2 bits = VC, LSB 6 bits = DT
                           09 CD 1e 00 00 // SRC0 VC = 0, DT = YUV422 8bit
                           09 CE de 00 00 // DST0 VC = 3, DT = YUV422 8bit
                           09 CF 00 00 00 // SRC1 VC = 0, DT = Frame Start
                           09 D0 c0 00 00 // DST1 VC = 3, DT = Frame Start
                           09 D1 01 00 00 // SRC2 VC = 0, DT = Frame End
                           09 D2 c1 00 00 // DST2 VC = 3, DT = Frame End
                       ];
                   };
               };
 
               // Software override for parallel mode
               parallel-mode-config {
                   status = "okay";
 
                   parallel-init-sequence {
                       seq-item-size = <5>; // reg-addr-len + reg-val-len * 2 + 1
                       reg-addr-len = <2>; // 1: 8bits, 2: 16bits
                       reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
                       // reg_addr reg_val val_mask delay
                       init-sequence = [
                           // Enable software override for all pipes since GMSL1 data is parallel mode, bpp=8, dt=0x1e(yuv-8)
                           04 1A f0 00 00 // pipe 0/1/2/3: Enable YUV8-/10-bit mux mode
                           04 0B 40 00 00 // pipe 0 bpp=0x08: Datatypes = 0x2A, 0x10-12, 0x31-37
                           04 0C 00 00 00 // pipe 0 and 1 VC software override: 0x00
                           04 0D 00 00 00 // pipe 2 and 3 VC software override: 0x00
                           04 0E 5e 00 00 // pipe 0 DT=0x1E: YUV422 8-bit
                           04 0F 7e 00 00 // pipe 1 DT=0x1E: YUV422 8-bit
                           04 10 7a 00 00 // pipe 2 DT=0x1E, pipe 3 DT=0x1E: YUV422 8-bit
                           04 11 48 00 00 // pipe 1 bpp=0x08: Datatypes = 0x2A, 0x10-12, 0x31-37
                           04 12 20 00 00 // pipe 2 bpp=0x08, pipe 3 bpp=0x08: Datatypes = 0x2A, 0x10-12, 0x31-37
                           04 15 c0 c0 00 // pipe 0/1 enable software overide
                           04 18 c0 c0 00 // pipe 2/3 enable software overide
                       ];
                   };
               };
           };
           /* VIDEO PIPE config end */
 
           /* MIPI TXPHY config start */
           mipi-txphys {
               status = "okay";
 
               phy-mode = <0>;
               phy-force-clock-out = <1>;
               phy-force-clk0-en = <1>;
               phy-force-clk3-en = <0>;
 
               // MIPI TXPHY A: phy-id = 0
               mipi-txphy-config-0 {
                   status = "okay";
                   phy-id = <0>; // MIPI TXPHY ID: 0/1/2/3
 
                   phy-type = <0>;
                   auto-deskew = <0x80>;
                   data-lane-num = <4>;
                   data-lane-map = <0x4>;
                   vc-ext-en = <0>;
               };
 
               // MIPI TXPHY B: phy-id = 1
               mipi-txphy-config-1 {
                   status = "okay";
                   phy-id = <1>; // MIPI TXPHY ID: 0/1/2/3
 
                   phy-type = <0>;
                   auto-deskew = <0x80>;
                   data-lane-num = <4>;
                   data-lane-map = <0xe>;
                   vc-ext-en = <0>;
               };
           };
           /* MIPI TXPHY config end */
 
           /* local device extra init sequence */
           extra-init-sequence {
               status = "disabled";
 
               seq-item-size = <5>; // reg-addr-len + reg-val-len * 2 + 1
               reg-addr-len = <2>; // 1: 8bits, 2: 16bits
               reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
               // reg_addr reg_val val_mask delay
               init-sequence = [
                   // common init sequence such as fsync / gpio and so on
               ];
           };
       };
       /* serdes local device end */
 
       /* serdes remote device start */
       serdes-remote-device-0 {
           compatible = "maxim4c,link0,max96715";
           status = "okay";
 
           remote-id = <0>; // Same as Link ID: 0/1/2/3
 
           // Serializer i2c 7bit address remap
           ser-i2c-addr-def = <0x40>;
           ser-i2c-addr-map = <0x41>; // 0: disable remap
 
           port {
               max96712_dphy0_remote0_out: endpoint {
                   remote-endpoint = <&max96712_dphy0_link0_in>;
               };
           };
 
           remote-init-sequence {
               seq-item-size = <4>; // reg-addr-len + reg-val-len * 2 + 1
               reg-addr-len = <1>; // 1: 8bits, 2: 16bits
               reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
               // reg_addr reg_val val_mask delay
               init-sequence = [
                   07 84 00 00
                   67 c4 00 00
                   0F bf 00 00
                   3F 08 00 00
                   40 2d 00 00
                   20 10 00 00
                   21 11 00 00
                   22 12 00 00
                   23 13 00 00
                   24 14 00 00
                   25 15 00 00
                   26 16 00 00
                   27 17 00 00
                   30 00 00 00
                   31 01 00 00
                   32 02 00 00
                   33 03 00 00
                   34 04 00 00
                   35 05 00 00
                   36 06 00 00
                   37 07 00 00
               ];
           };
       };
 
       serdes-remote-device-1 {
           compatible = "maxim4c,link1,max96715";
           status = "okay";
 
           remote-id = <1>; // Same as Link ID: 0/1/2/3
 
           // Serializer i2c 7bit address remap
           ser-i2c-addr-def = <0x40>;
           ser-i2c-addr-map = <0x42>; // 0: disable remap
 
           port {
               max96712_dphy0_remote1_out: endpoint {
                   remote-endpoint = <&max96712_dphy0_link1_in>;
               };
           };
 
           remote-init-sequence {
               seq-item-size = <4>; // reg-addr-len + reg-val-len * 2 + 1
               reg-addr-len = <1>; // 1: 8bits, 2: 16bits
               reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
               // reg_addr reg_val val_mask delay
               init-sequence = [
                   07 84 00 00
                   67 c4 00 00
                   0F bf 00 00
                   3F 08 00 00
                   40 2d 00 00
                   20 10 00 00
                   21 11 00 00
                   22 12 00 00
                   23 13 00 00
                   24 14 00 00
                   25 15 00 00
                   26 16 00 00
                   27 17 00 00
                   30 00 00 00
                   31 01 00 00
                   32 02 00 00
                   33 03 00 00
                   34 04 00 00
                   35 05 00 00
                   36 06 00 00
                   37 07 00 00
               ];
           };
       };
 
       serdes-remote-device-2 {
           compatible = "maxim4c,link2,max96715";
           status = "okay";
 
           remote-id = <2>; // Same as Link ID: 0/1/2/3
 
           // Serializer i2c 7bit address remap
           ser-i2c-addr-def = <0x40>;
           ser-i2c-addr-map = <0x43>; // 0: disable remap
 
           port {
               max96712_dphy0_remote2_out: endpoint {
                   remote-endpoint = <&max96712_dphy0_link2_in>;
               };
           };
 
           remote-init-sequence {
               seq-item-size = <4>; // reg-addr-len + reg-val-len * 2 + 1
               reg-addr-len = <1>; // 1: 8bits, 2: 16bits
               reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
               // reg_addr reg_val val_mask delay
               init-sequence = [
                   07 84 00 00
                   67 c4 00 00
                   0F bf 00 00
                   3F 08 00 00
                   40 2d 00 00
                   20 10 00 00
                   21 11 00 00
                   22 12 00 00
                   23 13 00 00
                   24 14 00 00
                   25 15 00 00
                   26 16 00 00
                   27 17 00 00
                   30 00 00 00
                   31 01 00 00
                   32 02 00 00
                   33 03 00 00
                   34 04 00 00
                   35 05 00 00
                   36 06 00 00
                   37 07 00 00
               ];
           };
       };
 
       serdes-remote-device-3 {
           compatible = "maxim4c,link3,max96715";
           status = "okay";
 
           remote-id = <3>; // Same as Link ID: 0/1/2/3
 
           // Serializer i2c 7bit address remap
           ser-i2c-addr-def = <0x40>;
           ser-i2c-addr-map = <0x44>; // 0: disable remap
 
           port {
               max96712_dphy0_remote3_out: endpoint {
                   remote-endpoint = <&max96712_dphy0_link3_in>;
               };
           };
 
           remote-init-sequence {
               seq-item-size = <4>; // reg-addr-len + reg-val-len * 2 + 1
               reg-addr-len = <1>; // 1: 8bits, 2: 16bits
               reg-val-len = <1>; // 1: 8bits, 2: 16bits, 3: 24bits
 
               // reg_addr reg_val val_mask delay
               init-sequence = [
                   07 84 00 00
                   67 c4 00 00
                   0F bf 00 00
                   3F 08 00 00
                   40 2d 00 00
                   20 10 00 00
                   21 11 00 00
                   22 12 00 00
                   23 13 00 00
                   24 14 00 00
                   25 15 00 00
                   26 16 00 00
                   27 17 00 00
                   30 00 00 00
                   31 01 00 00
                   32 02 00 00
                   33 03 00 00
                   34 04 00 00
                   35 05 00 00
                   36 06 00 00
                   37 07 00 00
               ];
           };
       };
       /* serdes remote device end */
   };
};
 
&mipi2_csi2 {
   status = "okay";
 
   ports {
       #address-cells = <1>;
       #size-cells = <0>;
 
       port@0 {
           reg = <0>;
           #address-cells = <1>;
           #size-cells = <0>;
 
           mipi2_csi2_input: endpoint@1 {
               reg = <1>;
               remote-endpoint = <&csidphy0_out>;
           };
       };
 
       port@1 {
           reg = <1>;
           #address-cells = <1>;
           #size-cells = <0>;
 
           mipi2_csi2_output: endpoint@0 {
               reg = <0>;
               remote-endpoint = <&cif_mipi2_in>;
           };
       };
   };
};
 
&rkcif_mipi_lvds2 {
   status = "okay";
   /* parameters for do cif reset detecting:
    * index0: monitor mode,
          0 for idle,
          1 for continue,
          2 for trigger,
          3 for hotplug (for nextchip)
    * index1: the frame id to start timer,
          min is 2
    * index2: frame num of monitoring cycle
    * index3: err time for keep monitoring
          after finding out err (ms)
    * index4: csi2 err reference val for resetting
    */
   rockchip,cif-monitor = <3 2 1 1000 5>;
 
   port {
       cif_mipi2_in: endpoint {
           remote-endpoint = <&mipi2_csi2_output>;
       };
   };
};
 
&rkcif {
   status = "okay";
   rockchip,android-usb-camerahal-enable;
};
 
&rkcif_mmu {
   status = "okay";
};
 
&pinctrl {
   max96712-dphy0 {
       max96712_dphy0_pwdn: max96712-dphy0-pwdn {
           rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_output_low>;
       };
 
       max96712_dphy0_errb: max96712-dphy0-errb {
           rockchip,pins = <3 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none_smt>;
       };
 
       max96712_dphy0_lock: max96712-dphy0-lock {
           rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none_smt>;
       };
   };
};