-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathorinov9281working10bitkernel35.3.1.patch
1543 lines (1498 loc) · 50 KB
/
orinov9281working10bitkernel35.3.1.patch
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
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff -ruN orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-camera-rbpcv2-imx219.dtsi orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-camera-rbpcv2-imx219.dtsi
--- orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-camera-rbpcv2-imx219.dtsi 2023-03-19 09:52:55.000000000 -0500
+++ orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-camera-rbpcv2-imx219.dtsi 2023-08-17 13:48:26.467607069 -0500
@@ -94,6 +94,7 @@
cam_i2cmux {
i2c_0:i2c@0 {
imx219_cam0: rbpcv2_imx219_a@10 {
+ status = "disabled";
compatible = "sony,imx219";
/* I2C device address */
reg = <0x10>;
@@ -466,6 +467,7 @@
};
i2c_1: i2c@1 {
imx219_cam1: rbpcv2_imx219_c@10 {
+ status = "disabled";
compatible = "sony,imx219";
/* I2C device address */
reg = <0x10>;
@@ -817,7 +819,7 @@
port@0 {
reg = <0>;
rbpcv2_imx219_out1: endpoint {
- status = "okay";
+ /*status = "okay"; */
port-index = <2>;
bus-width = <2>;
remote-endpoint = <&rbpcv2_imx219_csi_in1>;
diff -ruN orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-camera-rbpcv2-ov9281.dtsi orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-camera-rbpcv2-ov9281.dtsi
--- orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-camera-rbpcv2-ov9281.dtsi 1969-12-31 18:00:00.000000000 -0600
+++ orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-camera-rbpcv2-ov9281.dtsi 2023-08-24 16:10:39.790240576 -0500
@@ -0,0 +1,514 @@
+/*
+ * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#include <dt-bindings/media/camera.h>
+
+/ {
+ tegra-capture-vi {
+ num-channels = <2>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ vi_port0: port@0 {
+ reg = <0>;
+ rbpcv2_ov9281_vi_in0: endpoint {
+ port-index = <0>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_csi_out0>;
+ };
+ };
+ vi_port1: port@1 {
+ reg = <1>;
+ rbpcv2_ov9281_vi_in1: endpoint {
+ port-index = <2>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_csi_out1>;
+ };
+ };
+ };
+ };
+
+ host1x@13e00000 {
+ nvcsi@15a00000 {
+ num-channels = <2>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ csi_chan0: channel@0 {
+ reg = <0>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ csi_chan0_port0: port@0 {
+ reg = <0>;
+ rbpcv2_ov9281_csi_in0: endpoint@0 {
+ port-index = <1>; /* rjs <0> */
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_out0>;
+ };
+ };
+ csi_chan0_port1: port@1 {
+ reg = <1>;
+ rbpcv2_ov9281_csi_out0: endpoint@1 {
+ remote-endpoint = <&rbpcv2_ov9281_vi_in0>;
+ };
+ };
+ };
+ };
+ csi_chan1: channel@1 {
+ reg = <1>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ csi_chan1_port0: port@0 {
+ reg = <0>;
+ rbpcv2_ov9281_csi_in1: endpoint@2 {
+ port-index = <2>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_out1>;
+ };
+ };
+ csi_chan1_port1: port@1 {
+ reg = <1>;
+ rbpcv2_ov9281_csi_out1: endpoint@3 {
+ remote-endpoint = <&rbpcv2_ov9281_vi_in1>;
+ };
+ };
+ };
+ };
+ };
+ };
+
+ cam_i2cmux {
+ i2c_0:i2c@0 {
+ ov9281_cam0: rbpcv2_ov9281_a@60 {
+ compatible = "ovti,ov9281";
+ /* I2C device address */
+ reg = <0x60>;
+
+ /*hzhy add */
+ clocks = <&bpmp_clks TEGRA234_CLK_EXTPERIPH1>;
+ clock-names = "extperiph1";
+ mclk = "extperiph1";
+ fsync = "none";
+
+ /* V4L2 device node location */
+ devnode = "video0";
+
+ /* Physical dimensions of sensor */
+ physical_w = "3.680";
+ physical_h = "2.760";
+
+ sensor_model = "ov9281";
+
+ use_sensor_mode_id = "false";
+
+ /**
+ * ==== Modes ====
+ * A modeX node is required to support v4l2 driver
+ * implementation with NVIDIA camera software stack
+ *
+ * == Signal properties ==
+ *
+ * phy_mode = "";
+ * PHY mode used by the MIPI lanes for this device
+ *
+ * tegra_sinterface = "";
+ * CSI Serial interface connected to tegra
+ * Incase of virtual HW devices, use virtual
+ * For SW emulated devices, use host
+ *
+ * pix_clk_hz = "";
+ * Sensor pixel clock used for calculations like exposure and framerate
+ *
+ * readout_orientation = "0";
+ * Based on camera module orientation.
+ * Only change readout_orientation if you specifically
+ * Program a different readout order for this mode
+ *
+ * lane_polarity
+ * Based on the camera connector pin.
+ * CSIx_D0 | CSIx_D1 | CSI(X+1)_D0 | CSI(X+1)CSIx_D1
+ * LSB | BIT1 | BIT2 | MSB
+ * if there is a polarity swap on any lane, the bit corrsponding
+ * to the lane should be set
+ * e.g. polarity swap on CSIx_D0 only -> lane_polarity = "1"; 0001
+ * e.g. polarity swap on CSIx_D1 and CSI(X+1)_D0 -> lane_polarity = "6"; 0110
+ *
+ * == Image format Properties ==
+ *
+ * active_w = "";
+ * Pixel active region width
+ *
+ * active_h = "";
+ * Pixel active region height
+ *
+ * pixel_t = "";
+ * The sensor readout pixel pattern
+ *
+ * line_length = "";
+ * Pixel line length (width) for sensor mode.
+ *
+ * == Source Control Settings ==
+ *
+ * Gain factor used to convert fixed point integer to float
+ * Gain range [min_gain/gain_factor, max_gain/gain_factor]
+ * Gain step [step_gain/gain_factor is the smallest step that can be configured]
+ * Default gain [Default gain to be initialized for the control.
+ * use min_gain_val as default for optimal results]
+ * Framerate factor used to convert fixed point integer to float
+ * Framerate range [min_framerate/framerate_factor, max_framerate/framerate_factor]
+ * Framerate step [step_framerate/framerate_factor is the smallest step that can be configured]
+ * Default Framerate [Default framerate to be initialized for the control.
+ * use max_framerate to get required performance]
+ * Exposure factor used to convert fixed point integer to float
+ * For convenience use 1 sec = 1000000us as conversion factor
+ * Exposure range [min_exp_time/exposure_factor, max_exp_time/exposure_factor]
+ * Exposure step [step_exp_time/exposure_factor is the smallest step that can be configured]
+ * Default Exposure Time [Default exposure to be initialized for the control.
+ * Set default exposure based on the default_framerate for optimal exposure settings]
+ *
+ * gain_factor = ""; (integer factor used for floating to fixed point conversion)
+ * min_gain_val = ""; (ceil to integer)
+ * max_gain_val = ""; (ceil to integer)
+ * step_gain_val = ""; (ceil to integer)
+ * default_gain = ""; (ceil to integer)
+ * Gain limits for mode
+ *
+ * exposure_factor = ""; (integer factor used for floating to fixed point conversion)
+ * min_exp_time = ""; (ceil to integer)
+ * max_exp_time = ""; (ceil to integer)
+ * step_exp_time = ""; (ceil to integer)
+ * default_exp_time = ""; (ceil to integer)
+ * Exposure Time limits for mode (sec)
+ *
+ * framerate_factor = ""; (integer factor used for floating to fixed point conversion)
+ * min_framerate = ""; (ceil to integer)
+ * max_framerate = ""; (ceil to integer)
+ * step_framerate = ""; (ceil to integer)
+ * default_framerate = ""; (ceil to integer)
+ * Framerate limits for mode (fps)
+ *
+ * embedded_metadata_height = "";
+ * Sensor embedded metadata height in units of rows.
+ * If sensor does not support embedded metadata value should be 0.
+ */
+ mode0 { /* OV9281_MODE_1280x720_144FPS */
+ mclk_khz = "24000";
+ num_lanes = "2";
+ tegra_sinterface = "serial_a";
+ phy_mode = "DPHY";
+ discontinuous_clk = "yes"; /* yes rjs */
+ dpcm_enable = "false";
+ cil_settletime = "0";
+ lane_polarity = "6";
+
+ active_w = "1280";
+ active_h = "720";
+ mode_type = "grey";
+ pixel_phase = "y";
+ csi_pixel_bit_depth = "8";
+ readout_orientation = "90";
+ line_length = "1355"; /* 1408 rjs */
+ inherent_gain = "1";
+ /*mclk_multiplier = "9.33";*/ /* 9.33 rjs */
+ pix_clk_hz = "130900000"; /* "74250000" ; */ /* 800000000 rjs */
+
+ gain_factor = "1";
+ framerate_factor = "1";
+ exposure_factor = "1";
+ min_gain_val = "1"; /* 1.00x */
+ max_gain_val = "8191"; /* 10.66x */
+ step_gain_val = "1";
+ default_gain = "16"; /* 1.00x */
+ min_hdr_ratio = "1";
+ max_hdr_ratio = "1";
+ min_framerate = "2000000"; /* 2.0 fps */
+ max_framerate = "144000000"; /* 120.0 fps */
+ step_framerate = "1";
+ default_framerate = "144000000"; /* 120.0 fps */
+ min_exp_time = "1"; /* us */
+ max_exp_time = "16777215"; /* us */
+ step_exp_time = "1";
+ default_exp_time = "10896"; /* us */
+
+ embedded_metadata_height = "0";
+ };
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ port@0 {
+ reg = <0>;
+ rbpcv2_ov9281_out0: endpoint {
+ port-index = <0>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_csi_in0>;
+ };
+ };
+ };
+ };
+ };
+ i2c_1: i2c@1 {
+ ov9281_cam1: rbpcv2_ov9281_c@60 {
+ compatible = "ovti,ov9281";
+ /* I2C device address */
+ reg = <0x60>;
+
+ /*hzhy add */
+ clocks = <&bpmp_clks TEGRA234_CLK_EXTPERIPH2>;
+ clock-names = "extperiph2";
+ mclk = "extperiph2";
+ fsync = "none";
+
+ /* V4L2 device node location */
+ devnode = "video1";
+
+ /* Physical dimensions of sensor */
+ physical_w = "3.680";
+ physical_h = "2.760";
+
+ sensor_model = "ov9281";
+
+ use_sensor_mode_id = "false";
+
+ /**
+ * ==== Modes ====
+ * A modeX node is required to support v4l2 driver
+ * implementation with NVIDIA camera software stack
+ *
+ * == Signal properties ==
+ *
+ * phy_mode = "";
+ * PHY mode used by the MIPI lanes for this device
+ *
+ * tegra_sinterface = "";
+ * CSI Serial interface connected to tegra
+ * Incase of virtual HW devices, use virtual
+ * For SW emulated devices, use host
+ *
+ * pix_clk_hz = "";
+ * Sensor pixel clock used for calculations like exposure and framerate
+ *
+ * readout_orientation = "0";
+ * Based on camera module orientation.
+ * Only change readout_orientation if you specifically
+ * Program a different readout order for this mode
+ *
+ * == Image format Properties ==
+ *
+ * active_w = "";
+ * Pixel active region width
+ *
+ * active_h = "";
+ * Pixel active region height
+ *
+ * pixel_t = "";
+ * The sensor readout pixel pattern
+ *
+ * line_length = "";
+ * Pixel line length (width) for sensor mode.
+ *
+ * == Source Control Settings ==
+ *
+ * Gain factor used to convert fixed point integer to float
+ * Gain range [min_gain/gain_factor, max_gain/gain_factor]
+ * Gain step [step_gain/gain_factor is the smallest step that can be configured]
+ * Default gain [Default gain to be initialized for the control.
+ * use min_gain_val as default for optimal results]
+ * Framerate factor used to convert fixed point integer to float
+ * Framerate range [min_framerate/framerate_factor, max_framerate/framerate_factor]
+ * Framerate step [step_framerate/framerate_factor is the smallest step that can be configured]
+ * Default Framerate [Default framerate to be initialized for the control.
+ * use max_framerate to get required performance]
+ * Exposure factor used to convert fixed point integer to float
+ * For convenience use 1 sec = 1000000us as conversion factor
+ * Exposure range [min_exp_time/exposure_factor, max_exp_time/exposure_factor]
+ * Exposure step [step_exp_time/exposure_factor is the smallest step that can be configured]
+ * Default Exposure Time [Default exposure to be initialized for the control.
+ * Set default exposure based on the default_framerate for optimal exposure settings]
+ *
+ * gain_factor = ""; (integer factor used for floating to fixed point conversion)
+ * min_gain_val = ""; (ceil to integer)
+ * max_gain_val = ""; (ceil to integer)
+ * step_gain_val = ""; (ceil to integer)
+ * default_gain = ""; (ceil to integer)
+ * Gain limits for mode
+ *
+ * exposure_factor = ""; (integer factor used for floating to fixed point conversion)
+ * min_exp_time = ""; (ceil to integer)
+ * max_exp_time = ""; (ceil to integer)
+ * step_exp_time = ""; (ceil to integer)
+ * default_exp_time = ""; (ceil to integer)
+ * Exposure Time limits for mode (sec)
+ *
+ * framerate_factor = ""; (integer factor used for floating to fixed point conversion)
+ * min_framerate = ""; (ceil to integer)
+ * max_framerate = ""; (ceil to integer)
+ * step_framerate = ""; (ceil to integer)
+ * default_framerate = ""; (ceil to integer)
+ * Framerate limits for mode (fps)
+ *
+ * embedded_metadata_height = "";
+ * Sensor embedded metadata height in units of rows.
+ * If sensor does not support embedded metadata value should be 0.
+ */
+ mode0 { /* OV9281_MODE_1280x720_144FPS */
+ mclk_khz = "24000";
+ num_lanes = "2";
+ tegra_sinterface = "serial_c";
+ phy_mode = "DPHY";
+ discontinuous_clk = "yes"; /* yes rjs */
+ dpcm_enable = "false";
+ cil_settletime = "0";
+ lane_polarity = "0";
+
+ active_w = "1280";
+ active_h = "720";
+ mode_type = "grey";
+ pixel_phase = "y";
+ csi_pixel_bit_depth = "8";
+ readout_orientation = "90";
+ line_length = "1355"; /*1408*/
+ inherent_gain = "1";
+ /*mclk_multiplier = "9.33";*/ /* 9.33 rjs */
+ pix_clk_hz = "130900000"; /* "74250000" ; */ /* 800000000 rjs */
+
+ gain_factor = "1";
+ framerate_factor = "1";
+ exposure_factor = "1";
+ min_gain_val = "1"; /* 1.00x */
+ max_gain_val = "8191"; /* 10.66x */
+ step_gain_val = "1";
+ default_gain = "16"; /* 1.00x */
+ min_hdr_ratio = "1";
+ max_hdr_ratio = "1";
+ min_framerate = "2000000"; /* 2.0 fps */
+ max_framerate = "144000000"; /* 120.0 fps */
+ step_framerate = "1";
+ default_framerate = "144000000"; /* 120.0 fps */
+ min_exp_time = "1"; /* us */
+ max_exp_time = "16777215"; /* us */
+ step_exp_time = "1";
+ default_exp_time = "10896"; /* us */
+
+ embedded_metadata_height = "0";
+ };
+
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ port@0 {
+ reg = <0>;
+ rbpcv2_ov9281_out1: endpoint {
+ /*status = "okay"; */
+ port-index = <2>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_csi_in1>;
+ };
+ };
+ };
+ };
+ };
+ };
+
+ lens_ov9281@RBPCV2 {
+ min_focus_distance = "0.0";
+ hyper_focal = "0.0";
+ focal_length = "3.04";
+ f_number = "2.0";
+ aperture = "0.0";
+ };
+};
+/ {
+ tcp: tegra-camera-platform {
+ compatible = "nvidia, tegra-camera-platform";
+ /**
+ * Physical settings to calculate max ISO BW
+ *
+ * num_csi_lanes = <>;
+ * Total number of CSI lanes when all cameras are active
+ *
+ * max_lane_speed = <>;
+ * Max lane speed in Kbit/s
+ *
+ * min_bits_per_pixel = <>;
+ * Min bits per pixel
+ *
+ * vi_peak_byte_per_pixel = <>;
+ * Max byte per pixel for the VI ISO case
+ *
+ * vi_bw_margin_pct = <>;
+ * Vi bandwidth margin in percentage
+ *
+ * max_pixel_rate = <>;
+ * Max pixel rate in Kpixel/s for the ISP ISO case
+ *
+ * isp_peak_byte_per_pixel = <>;
+ * Max byte per pixel for the ISP ISO case
+ *
+ * isp_bw_margin_pct = <>;
+ * Isp bandwidth margin in percentage
+ */
+ num_csi_lanes = <4>;
+ max_lane_speed = <1500000>;
+ min_bits_per_pixel = <8>;
+ vi_peak_byte_per_pixel = <2>;
+ vi_bw_margin_pct = <25>;
+ max_pixel_rate = <240000>;
+ isp_peak_byte_per_pixel = <5>;
+ isp_bw_margin_pct = <25>;
+
+ /**
+ * The general guideline for naming badge_info contains 3 parts, and is as follows,
+ * The first part is the camera_board_id for the module; if the module is in a FFD
+ * platform, then use the platform name for this part.
+ * The second part contains the position of the module, ex. "rear" or "front".
+ * The third part contains the last 6 characters of a part number which is found
+ * in the module's specsheet from the vendor.
+ */
+ modules {
+ cam_module0: module0 {
+ badge = "jakku_front_RBP194";
+ position = "front";
+ orientation = "1";
+ cam_module0_drivernode0: drivernode0 {
+ pcl_id = "v4l2_sensor";
+ devname = "ov9281 9-0060";
+ proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_ov9281_a@60";
+ };
+ cam_module0_drivernode1: drivernode1 {
+ pcl_id = "v4l2_lens";
+ proc-device-tree = "/proc/device-tree/lens_ov9281@RBPCV2/";
+ };
+ };
+ cam_module1: module1 {
+ badge = "jakku_rear_RBP194";
+ position = "rear";
+ orientation = "1";
+ cam_module1_drivernode0: drivernode0 {
+ pcl_id = "v4l2_sensor";
+ devname = "ov9281 10-0060";
+ proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv2_ov9281_c@60";
+ };
+ cam_module1_drivernode1: drivernode1 {
+ pcl_id = "v4l2_lens";
+ proc-device-tree = "/proc/device-tree/lens_ov9281@RBPCV2/";
+ };
+ };
+ };
+ };
+};
diff -ruN orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3509-a02.dtsi orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3509-a02.dtsi
--- orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3509-a02.dtsi 2023-03-19 09:52:55.000000000 -0500
+++ orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3509-a02.dtsi 2023-08-16 15:10:52.457525859 -0500
@@ -18,6 +18,7 @@
#include "tegra234-p3509-audio.dtsi"
#include "tegra234-p3768-camera-rbpcv3-imx477.dtsi"
#include "tegra234-p3768-camera-rbpcv2-imx219.dtsi"
+#include "tegra234-p3768-camera-rbpcv2-ov9281.dtsi"
/ {
gpio-keys {
diff -ruN orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-0000-a0.dtsi orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-0000-a0.dtsi
--- orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-0000-a0.dtsi 2023-03-19 09:52:55.000000000 -0500
+++ orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-0000-a0.dtsi 2023-08-17 13:30:53.447972277 -0500
@@ -18,6 +18,7 @@
#include "tegra234-p3768-audio.dtsi"
#include "tegra234-p3768-camera-rbpcv3-imx477.dtsi"
#include "tegra234-p3768-camera-rbpcv2-imx219.dtsi"
+#include "tegra234-p3768-camera-rbpcv2-ov9281.dtsi"
/ {
gpio-keys {
@@ -273,7 +274,8 @@
host1x@13e00000 {
nvcsi@15a00000 {
- csi_chan0 {
+ channel@0 {
+ /*csi_chan0 { RJS */
ports {
port@0 {
endpoint@0 {
@@ -287,7 +289,7 @@
cam_i2cmux{
i2c@0 {
- rbpcv2_imx219_a@10 {
+ rbpcv2_imx219_a@10 {
mode0 {
tegra_sinterface = "serial_b";
lane_polarity = "6";
@@ -308,6 +310,20 @@
tegra_sinterface = "serial_b";
lane_polarity = "6";
};
+ ports {
+ port@0 {
+ endpoint {
+ port-index = <1>;
+ };
+ };
+ };
+ };
+
+ rbpcv2_ov9281_a@60 {
+ mode0 {
+ tegra_sinterface = "serial_b";
+ lane_polarity = "6";
+ };
ports {
port@0 {
endpoint {
diff -ruN orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-camera-rbpcv2-imx219.dtsi orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-camera-rbpcv2-imx219.dtsi
--- orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-camera-rbpcv2-imx219.dtsi 2023-03-19 09:52:55.000000000 -0500
+++ orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-camera-rbpcv2-imx219.dtsi 2023-08-17 13:51:02.221954272 -0500
@@ -23,14 +23,14 @@
/ {
cam_i2cmux{
- status = "okay";
+ status = "disabled";
compatible = "i2c-mux-gpio";
#address-cells = <1>;
#size-cells = <0>;
i2c-parent = <&cam_i2c>;
mux-gpios = <&tegra_aon_gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
i2c@0 {
- status = "okay";
+ status = "disabled";
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
@@ -39,7 +39,7 @@
};
};
i2c@1 {
- status = "okay";
+ status = "disabled";
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
diff -ruN orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-camera-rbpcv2-ov9281.dtsi orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-camera-rbpcv2-ov9281.dtsi
--- orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-camera-rbpcv2-ov9281.dtsi 1969-12-31 18:00:00.000000000 -0600
+++ orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-camera-rbpcv2-ov9281.dtsi 2023-08-16 22:10:54.772422858 -0500
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "tegra234-camera-rbpcv2-ov9281.dtsi"
+
+#define CAM0_PWDN TEGRA234_MAIN_GPIO(H, 6)
+#define CAM1_PWDN TEGRA234_MAIN_GPIO(AC, 0)
+#define CAM_I2C_MUX TEGRA234_AON_GPIO(CC, 3)
+
+/ {
+ cam_i2cmux{
+ status = "okay";
+ compatible = "i2c-mux-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ i2c-parent = <&cam_i2c>;
+ mux-gpios = <&tegra_aon_gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
+ i2c@0 {
+ status = "okay";
+ reg = <0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ rbpcv2_ov9281_a@60 {
+ reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
+ };
+ };
+ i2c@1 {
+ status = "okay";
+ reg = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ rbpcv2_ov9281_c@60 {
+ reset-gpios = <&tegra_main_gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
+ };
+ };
+ };
+
+ gpio@2200000 {
+ camera-control-output-low {
+ gpio-hog;
+ output-low;
+ gpios = <CAM0_PWDN 0 CAM1_PWDN 0>;
+ label = "cam0-pwdn","cam1-pwdn";
+ };
+ };
+};
diff -ruN orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/Makefile orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/Makefile
--- orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/Makefile 2023-03-19 09:52:55.000000000 -0500
+++ orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/Makefile 2023-08-16 15:44:07.859081908 -0500
@@ -39,6 +39,8 @@
dtbo-$(BUILD_ENABLE) += tegra234-p3767-camera-p3768-imx219-dual.dtbo
dtbo-$(BUILD_ENABLE) += tegra234-p3767-camera-p3768-imx477-dual.dtbo
dtbo-$(BUILD_ENABLE) += tegra234-p3767-camera-p3768-imx477-dual-4lane.dtbo
+dtbo-$(BUILD_ENABLE) += tegra234-p3767-camera-ov9281-dual.dtbo
+dtbo-$(BUILD_ENABLE) += tegra234-p3767-camera-p3768-ov9281-dual.dtbo
dtbo-$(BUILD_ENABLE) += tegra234-p3767-overlay.dtbo
ifneq ($(dtb-y),)
diff -ruN orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-camera-ov9281-dual.dts orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-camera-ov9281-dual.dts
--- orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-camera-ov9281-dual.dts 1969-12-31 18:00:00.000000000 -0600
+++ orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-camera-ov9281-dual.dts 2023-08-16 15:17:14.436699060 -0500
@@ -0,0 +1,117 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Jetson Device-tree overlay for dual camera OV9281 rbpcv2 on dual
+ * cam connector baseboards
+ *
+ * Copyright (c) 2022-2023 NVIDIA CORPORATION. All rights reserved.
+ *
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-common/jetson/tegra234-p3767-0000-common.h>
+
+/ {
+ overlay-name = "Camera OV9281 Dual";
+ jetson-header-name = "Jetson Nano CSI Connector";
+ compatible = JETSON_COMPATIBLE_P3509;
+
+ /* ov9281 dual sensor module */
+ fragment@0 {
+ target = <&ov9281_cam0>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+ fragment@1 {
+ target = <&cam_module0>;
+ __overlay__ {
+ status = "okay";
+ badge = "jakku_front_RBP194";
+ position = "front";
+ orientation = "1";
+ };
+ };
+ fragment@2 {
+ target = <&cam_module0_drivernode0>;
+ __overlay__ {
+ status = "okay";
+ pcl_id = "v4l2_sensor";
+ devname = "ov9281 9-0060";
+ proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_ov9281_a@60";
+ };
+ };
+ fragment@3 {
+ target = <&ov9281_cam1>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+ fragment@4 {
+ target = <&cam_module1>;
+ __overlay__ {
+ status = "okay";
+ badge = "jakku_rear_RBP194";
+ position = "rear";
+ orientation = "1";
+ };
+ };
+ fragment@5 {
+ target = <&cam_module1_drivernode0>;
+ __overlay__ {
+ status = "okay";
+ pcl_id = "v4l2_sensor";
+ devname = "ov9281 10-0060";
+ proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv2_ov9281_c@60";
+ };
+ };
+ fragment@6 {
+ target = <&rbpcv2_ov9281_vi_in0>;
+ __overlay__ {
+ status = "okay";
+ port-index = <0>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_csi_out0>;
+ };
+ };
+ fragment@7 {
+ target = <&rbpcv2_ov9281_vi_in1>;
+ __overlay__ {
+ status = "okay";
+ port-index = <2>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_csi_out1>;
+ };
+ };
+ fragment@8 {
+ target = <&rbpcv2_ov9281_csi_in0>;
+ __overlay__ {
+ status = "okay";
+ port-index = <0>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_out0>;
+ };
+ };
+ fragment@9 {
+ target = <&rbpcv2_ov9281_csi_out0>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+ fragment@10 {
+ target = <&rbpcv2_ov9281_csi_in1>;
+ __overlay__ {
+ status = "okay";
+ port-index = <2>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_out1>;
+ };
+ };
+ fragment@12 {
+ target = <&rbpcv2_ov9281_csi_out1>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+};
diff -ruN orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-camera-p3768-ov9281-dual.dts orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-camera-p3768-ov9281-dual.dts
--- orinorig/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-camera-p3768-ov9281-dual.dts 1969-12-31 18:00:00.000000000 -0600
+++ orinmod/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-camera-p3768-ov9281-dual.dts 2023-08-16 15:43:35.162128967 -0500
@@ -0,0 +1,117 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Jetson Device-tree overlay for dual camera OV9281 rbpcv2 on dual
+ * cam connector baseboards
+ *
+ * Copyright (c) 2022-2023 NVIDIA CORPORATION. All rights reserved.
+ *
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-common/jetson/tegra234-p3767-0000-common.h>
+
+/ {
+ overlay-name = "Camera OV9281 Dual";
+ jetson-header-name = "Jetson 24pin CSI Connector";
+ compatible = JETSON_COMPATIBLE_P3768;
+
+ /* OV9281 dual sensor module */
+ fragment@0 {
+ target = <&ov9281_cam0>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+ fragment@1 {
+ target = <&cam_module0>;
+ __overlay__ {
+ status = "okay";
+ badge = "jakku_front_RBP194";
+ position = "front";
+ orientation = "1";
+ };
+ };
+ fragment@2 {
+ target = <&cam_module0_drivernode0>;
+ __overlay__ {
+ status = "okay";
+ pcl_id = "v4l2_sensor";
+ devname = "ov9281 9-0060";
+ proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_ov9281_a@60";
+ };
+ };
+ fragment@3 {
+ target = <&ov9281_cam1>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+ fragment@4 {
+ target = <&cam_module1>;
+ __overlay__ {
+ status = "okay";
+ badge = "jakku_rear_RBP194";
+ position = "rear";
+ orientation = "1";
+ };
+ };
+ fragment@5 {
+ target = <&cam_module1_drivernode0>;
+ __overlay__ {
+ status = "okay";
+ pcl_id = "v4l2_sensor";
+ devname = "ov9281 10-0060";
+ proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv2_ov9281_c@60";
+ };
+ };
+ fragment@6 {
+ target = <&rbpcv2_ov9281_vi_in0>;
+ __overlay__ {
+ status = "okay";
+ port-index = <1>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_csi_out0>;
+ };
+ };
+ fragment@7 {
+ target = <&rbpcv2_ov9281_vi_in1>;
+ __overlay__ {
+ status = "okay";
+ port-index = <2>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_csi_out1>;
+ };
+ };
+ fragment@8 {
+ target = <&rbpcv2_ov9281_csi_in0>;
+ __overlay__ {
+ status = "okay";
+ port-index = <1>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_out0>;
+ };
+ };
+ fragment@9 {
+ target = <&rbpcv2_ov9281_csi_out0>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+ fragment@10 {
+ target = <&rbpcv2_ov9281_csi_in1>;
+ __overlay__ {
+ status = "okay";
+ port-index = <2>;
+ bus-width = <2>;
+ remote-endpoint = <&rbpcv2_ov9281_out1>;
+ };
+ };
+ fragment@12 {
+ target = <&rbpcv2_ov9281_csi_out1>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+};
diff -ruN orinorig/kernel/nvidia/drivers/media/i2c/nv_ov9281.c orinmod/kernel/nvidia/drivers/media/i2c/nv_ov9281.c
--- orinorig/kernel/nvidia/drivers/media/i2c/nv_ov9281.c 2023-03-19 09:53:53.000000000 -0500
+++ orinmod/kernel/nvidia/drivers/media/i2c/nv_ov9281.c 2023-08-24 16:12:19.452842299 -0500
@@ -19,6 +19,7 @@
#include <linux/uaccess.h>
#include <linux/gpio.h>
#include <linux/module.h>
+#include <linux/i2c.h>
#include <linux/version.h>
#include <linux/seq_file.h>
@@ -85,31 +86,52 @@
/* OV9281 Other Stuffs */
#define OV9281_DEFAULT_GAIN 0x0010 /* 1.0x real gain */
-#define OV9281_MIN_GAIN 0x0001
-#define OV9281_MAX_GAIN 0x1FFF
+#define OV9281_MIN_GAIN 0x0000
+#define OV9281_MAX_GAIN 0x00FE
#define OV9281_DEFAULT_FRAME_LENGTH 0x071C
#define OV9281_MIN_FRAME_LENGTH 0x0001
#define OV9281_MAX_FRAME_LENGTH 0xFFFF
-#define OV9281_FRAME_LENGTH_1SEC (0x40d * 120) /* TODO: try to calc */
+#define OV9281_FRAME_LENGTH_1SEC (0x40d * 144) /* TODO: try to calc */
-#define OV9281_MIN_EXPOSURE_COARSE 0x00000001
-#define OV9281_MAX_EXPOSURE_COARSE 0x000FFFFF
+#define OV9281_MIN_EXPOSURE_COARSE 0x00000010
+#define OV9281_MAX_EXPOSURE_COARSE 0x00003750
#define OV9281_DEFAULT_EXPOSURE_COARSE 0x00002A90
#define OV9281_MAX_WIDTH 1280
-#define OV9281_MAX_HEIGHT 800
+#define OV9281_MAX_HEIGHT 720
-#define OV9281_DEFAULT_MODE OV9281_MODE_1280X800
+#define OV9281_DEFAULT_MODE OV9281_MODE_1280X720
#define OV9281_DEFAULT_WIDTH OV9281_MAX_WIDTH
#define OV9281_DEFAULT_HEIGHT OV9281_MAX_HEIGHT
-#define OV9281_DEFAULT_DATAFMT MEDIA_BUS_FMT_SBGGR10_1X10
-#define OV9281_DEFAULT_CLK_FREQ 26000000
+/*#define OV9281_DEFAULT_DATAFMT MEDIA_BUS_FMT_SBGGR10_1X10*/
+/*#define OV9281_DEFAULT_DATAFMT MEDIA_BUS_FMT_SRGGB8_1X8*/
+#define OV9281_DEFAULT_DATAFMT MEDIA_BUS_FMT_Y8_1X8