Camera fails to capture frames with VIFALC_TDSTATE error

I am developing a MIPI camera driver on Jetson AGX Orin. However I fail to capture any frame by ioctl() interface and the trace log reports VIFALC_TDSTATE error.

Environment

kernel version:
Jetpack 5.1.1 [L4T 35.3.1]

device link:
OX01F10 —> max96701 —> LI-MAX9296-IPX-DESER —> LI-JXAV-MIPI-ADPT-4CAM —> Orin
The boards LI-MAX9296-IPX-DESER and LI-JXAV-MIPI-ADPT-4CAM are from Leopard.
The OX01F10 sensor and max96701 are integrated into a single camera device from Mitsubishi.

drivers:
I write the driver codes for max96701 and OX01F10, and I reuse the driver codes for max9296 provided by Jetpack with a little modification.

My test code is like

enum v4l2_buf_type v4l2buftype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
struct v4l2_requestbuffers v4l2reqbuf = {
    .count = 1,
    .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
    .memory = V4L2_MEMORY_MMAP,
};
struct v4l2_buffer v4l2buf = {
    .index = 0,
    .type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    .memory = V4L2_MEMORY_MMAP;
};

int fd = open("/dev/video0", O_RDWR);
ioctl(fd, VIDIOC_REQBUFS, &v4l2reqbuf);
ioctl(fd, VIDIOC_QUERYBUF, &v4l2buf);
ioctl(fd, VIDIOC_STREAMON, &v4l2buftype);
ioctl(fd, VIDIOC_QBUF, &v4l2buf);
ioctl(fd, VIDIOC_DQBUF, &v4l2buf);
ioctl(fd, VIDIOC_STREAMOFF, &v4l2buftype);
close(fd);

The dmesg shows timeout error

[  199.041247] mitsubishi_max9296 30-0048: [MAX9296]: probing GMSL Deserializer
[  199.041367] mitsubishi_max9296 30-0048: mitsubishi_max9296_probe:  success
[  202.529930] mitsubishi_max96701 30-0060: [MAX96701]: probing GMSL Serializer
[  202.529938] mitsubishi_max96701 30-0060: [MAX96701]: probing success
[  207.897696] mitsubishi_gen2_cam 30-001b: [Mitsubushi Gen2 Camera]: probing camera
[  207.898011] mitsubishi_gen2_cam 30-001b: tegracam sensor driver:mitsubishi_gen2_cam_v2.0.6
[  208.141514] tegra-camrtc-capture-vi tegra-capture-vi: subdev mitsubishi_gen2_cam 30-0 bound
[  208.143291] mitsubishi_gen2_cam 30-001b: [Mitsubushi Gen2 Camera]: probing success
[  252.314472] bwmgr API not supported
[  252.346734] mitsubishi_gen2_cam 30-001b: mitsubishi_gen2_cam_start_streaming : camera has started streaming.
[  254.918368] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[  254.927556] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[  254.938164] (NULL device *): vi_capture_control_message: NULL VI channel received
[  254.945894] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[  254.956540] (NULL device *): vi_capture_control_message: NULL VI channel received
[  254.964252] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[  254.975034] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel 

The trace log shows VIFALC_TDSTATE error

# tracer: nop
#
# entries-in-buffer/entries-written: 25/25   #P:12
#
#                                _-----=> irqs-off
#                               / _----=> need-resched
#                              | / _---=> hardirq/softirq
#                              || / _--=> preempt-depth
#                              ||| /     delay
#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
#              | |         |   ||||      |         |
     kworker/4:2-143     [004] ....   178.069619: rtcpu_string: tstamp:6437016911 id:0x04010000 str:"VM0 deactivating."
     simple_test-3669    [004] ....   178.852725: tegra_channel_open: vi-output, mitsubishi_gen2_cam
     simple_test-3669    [004] ....   178.854123: tegra_channel_set_power: mitsubishi_gen2_cam 30-0 : 0x1
     simple_test-3669    [004] ....   178.854147: camera_common_s_power: status : 0x1
     simple_test-3669    [004] ....   178.854161: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x1
     simple_test-3669    [004] ....   178.854166: csi_s_power: enable : 0x1
     simple_test-3669    [000] ....   178.855018: tegra_channel_capture_setup: vnc_id 0 W 1280 H 964 fmt 13
     kworker/4:2-143     [004] ....   178.858034: rtcpu_string: tstamp:6462874854 id:0x04010000 str:"VM0 activating."
     simple_test-3669    [002] ....   178.863424: tegra_channel_set_stream: enable : 0x1
     simple_test-3669    [002] ....   178.877521: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x1
     simple_test-3669    [002] ....   178.877524: csi_s_stream: enable : 0x1
     simple_test-3669    [002] ....   178.877893: tegra_channel_set_stream: mitsubishi_gen2_cam 30-0 : 0x1
     kworker/4:2-143     [004] ....   178.917367: rtcpu_vinotify_event: tstamp:6464281677 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:206855944032 data:0x399d580010000000
     kworker/4:2-143     [004] ....   178.917369: rtcpu_vinotify_event: tstamp:6464281816 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:206855950464 data:0x0000000031000001
 vi-output, forv-3671    [001] ....   181.522024: tegra_channel_capture_setup: vnc_id 0 W 1280 H 964 fmt 13
     simple_test-3669    [002] ....   181.531752: tegra_channel_set_stream: enable : 0x0
     simple_test-3669    [002] ....   181.531754: tegra_channel_set_stream: mitsubishi_gen2_cam 30-0 : 0x0
     simple_test-3669    [002] ....   181.531780: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x0
     simple_test-3669    [002] ....   181.531781: csi_s_stream: enable : 0x0
     simple_test-3669    [003] ....   181.545192: tegra_channel_set_power: mitsubishi_gen2_cam 30-0 : 0x0
     simple_test-3669    [003] ....   181.545211: camera_common_s_power: status : 0x0
     simple_test-3669    [003] ....   181.545265: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x0
     simple_test-3669    [003] ....   181.545270: csi_s_power: enable : 0x0
     simple_test-3669    [003] ....   181.545396: tegra_channel_close: vi-output, mitsubishi_gen2_cam
     kworker/4:2-143     [004] ....   187.561710: rtcpu_string: tstamp:6734171612 id:0x04010000 str:"VM0 deactivating."

My device tree overlay for test

#include <dt-common/jetson/tegra234-p3737-0000-p3701-0000.h>

/dts-v1/;
/plugin/;

/ {
    overlay-name = "1MP Mitsubishi Gen 2 Camera";
    jetson-header-name = "Jetson AGX CSI Connector";
    compatible = JETSON_COMPATIBLE;
};

&capture_vi_base {
    status = "okay";
    num-channels = <0x08>;
};

&vi_port0 {
    status = "okay";
};

&vi_in0 {
    status = "okay";
    port-index = <0x00>;
    vc-id = <0x00>;
    bus-width = <0x04>;
};

&csi_chan0 {
    status = "okay";
};

&csi_chan0_port0 {
    status = "okay";
};

&csi_in0 {
    status = "okay";
    remote-endpoint = <&mitsubishi_gen2_cam_0_out>;
};

&csi_chan0_port1 {
    status = "okay";
};

&csi_out0 {
    status = "okay";
};

&{/i2c@3180000/tca9546@70} {
    status = "okay";
};

&{/i2c@3180000/tca9546@70/i2c@0} {
    i2c-mux,deselect-on-exit;
    #address-cells = <0x01>;
    #size-cells = <0x00>;
    status = "okay";
    reg = <0x00>;

    max9296@48 {
        compatible = "maxim,mitsubishi_max9296";
        reg = <0x48>;
        status = "okay";
        csi-mode = "2x4";
        max-src = <0x02>;
        reset-gpios = <&tegra_main_gpio TEGRA234_MAIN_GPIO(H, 3) GPIO_ACTIVE_HIGH>;
    };

    max96701_0_a:max96701_a@40 {
        compatible = "maxim,mitsubishi_max96701";
        status = "okay";
        reg = <0x40>;
        maxim,gmsl-dser-device = <&max9296_dser>;
    };

    mitsubishi_gen2_cam_0@36 {
        compatible = "mitsubishi,gen2_cam";
        status = "okay";
        reg = <0x36>;
        use_sensor_mode_id = "false";

        gmsl-link {
            maxim,gmsl-ser-device = <&max96701_0_a>;
            maxim,gmsl-dser-device = <&max9296_dser>;
            dst-csi-port = "a";
            serdes-csi-link = "a";
            csi-mode = "1x4";
            st-vc = <0x00>;
            vc-id = <0x0>;
            num-csi-lanes = <0x04>;
            streams = "yuv8";
        };

        ports {
            #address-cells = <0x1>;
            #size-cells = <0x0>;

            port@0 {
                reg = <0x00>;
                mitsubishi_gen2_cam_0_out: endpoint {
                    vc-id = <0x00>;
                    port-index = <0x00>;
                    bus-width = <0x04>;
                    remote-endpoint = <&csi_in0>;
                };
            };
        };

        mode0 {
            num_lanes = "4";
            pix_clk_hz = "42420000";
            serdes_pix_clk_hz = "175000000"; /* output frequency = 700 MHz  */
            csi_pixel_bit_depth = "16";
            cil_settletime = "0";
            discontinuous_clk = "no";
            dpcm_enable = "false";
            tegra_sinterface = "serial_a";
            active_w = "1280";
            active_h = "964";
            line_length = "2560";
            embedded_metadata_height = "0";    
            pixel_phase = "uyvy";
            mode_type = "yuv";
        };
    };
};

The camera used here has internal clock so I think no need to set mclk and mclk_khz properties.

The trace log shows didn’t receive any validate data from MIPI.
You may need to probe the sensor output to confirm it.

Hi ShaneCCC, I did probe to get MIPI output signal, see the attachments. However the Orin still cannot capture any frames and the trace log is the same.


Maybe dump the device tree to double confirm the settings.

sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree

Hi ShaneCCC, I have dumped the dts file and double checked it. The device tree is as I expected.

extracted_proc.txt (526.9 KB)

Maybe try get trace log again if still the doesn’t receive any validate I would suspect it could be HW problem.

I see…

So you could NOT find any abnormal configuration in my device tree overlay shown above?

Besides, I am confused about the reset-gpios property. For example, the reset-gpios I used for the camera shown above is TEGRA234_MAIN_GPIO(H, 3). According to Jetson_AGX_Orin_Series_Pinmux_Config_Template_1.9 this GPIO is for camera #0 reset. I also find in Table 2-1 in Jetson_AGX_Xavier_and_Orin_Series_Camera_Design_Guide that the PIN for camera #0 reset is PIN 95.

  1. Does TEGRA234_MAIN_GPIO(H, 3) defined in kernel codes stand for the physical PIN 95 of Jetson Camera Connector by default?
  2. Does the actual effect of TEGRA234_MAIN_GPIO(H, 3) output rely on the circuit design of the connection board that connected to Jetson Camera Connector?

To confirm that the link LI-MAX9296-IPX-DESER -> LI-JXAV-MIPI-ADPT-4CAM -> Orin is OK, I use another camera that is believed to output legal signal.

However, Orin crashes immediately when I use insmod to load the camera driver. After investigation I find that the crash occurs when the driver calls tegracam_v4l2subdev_register() to register the v4l2_subdev. The output image format is 1920 * 1086p @ 60fps, bayer_bggr12. And the mode0 device tree node for this new camera is:

mode0 {
    num_lanes = "4";
    pix_clk_hz = "125107200"; /* 1920 * 1086p @ 60fps*/
    serdes_pix_clk_hz = "400000000"; /* max9296 CSI-PHY output frequency set to be 1200 MHz */
    cil_settletime = "0";
    discontinuous_clk = "no";
    dpcm_enable = "false";
    tegra_sinterface = "serial_a";

    active_w = "1920";
    active_h = "1086"; /* front embedded lines = 2, foot embedded lines = 4 */
    line_length = "1920";
    embedded_metadata_height = "0";
    pixel_phase = "bggr";
    mode_type = "bayer";
    csi_pixel_bit_depth = "12";
};

However, Orin does successfully load the driver if I modify the mode0 to be 1280 * 964p, yuv_uyvy16:

mode0 {
    num_lanes = "4";
    pix_clk_hz = "125107200"; /* 1920 * 1086p @ 60fps*/
    serdes_pix_clk_hz = "400000000"; /* max9296 CSI-PHY output frequency set to be 1200 MHz */
    cil_settletime = "0";
    discontinuous_clk = "no";
    dpcm_enable = "false";
    tegra_sinterface = "serial_a";

    active_w = "1280";
    active_h = "964";
    line_length = "2560";
    embedded_metadata_height = "0";
    pixel_phase = "uyvy";
    mode_type = "yuv";
    csi_pixel_bit_depth = "16";
};

How can I fix this problem?

Hi ShaneCCC,

I have found the reason for this kernel panic. Function extract_pixel_format() in file nvidia\drivers\media\platform\tegra\camera\sensor_common.c says Orin supports image format bayer_bggr12:

else if (strncmp(pixel_t, "bayer_bggr12", size) == 0)
    *format = V4L2_PIX_FMT_SBGGR12;

However no element relating to V4L2_PIX_FMT_SBGGR12 is defined in camera_common_color_fmts[] in file nvidia\drivers\media\platform\tegra\camera\camera_common.c. I think this is a bug of tegra camera framework.

I still need your answer to my other questions.

You can add V4L2_PIX_FMT_SBGGR12 for it.

Hi ShaneCCC,

I use a new LI-JXAV-MIPI-ADPT-4CAM connection board. This time Orin is confirmed to receiver signal from sensor but it still cannot capture images.

The format of the output image is 1920 * 1080p @ 60fps bayer_bggr12. I have configured the sensor to disable all embedded data.

The dmesg shows the frame has been discarded:

[  261.610524] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072

The trace log shows CHANSEL_NOMATCH error.

# tracer: nop
#
# entries-in-buffer/entries-written: 36/36   #P:12
#
#                                _-----=> irqs-off
#                               / _----=> need-resched
#                              | / _---=> hardirq/softirq
#                              || / _--=> preempt-depth
#                              ||| /     delay
#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
#              | |         |   ||||      |         |
     simple_test-3699    [005] ....   261.557707: tegra_channel_open: vi-output, ox03c10_cam 3
     simple_test-3699    [005] ....   261.559995: tegra_channel_set_power: ox03c10_cam 30-0036 : 0x1
     simple_test-3699    [005] ....   261.560022: camera_common_s_power: status : 0x1
     simple_test-3699    [005] ....   261.560037: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x1
     simple_test-3699    [005] ....   261.560042: csi_s_power: enable : 0x1
     simple_test-3699    [005] ....   261.560580: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1084 fmt c4
     simple_test-3699    [006] ....   261.561634: tegra_channel_set_stream: enable : 0x1
     simple_test-3699    [006] ....   261.579378: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x1
     simple_test-3699    [006] ....   261.579382: csi_s_stream: enable : 0x1
     simple_test-3699    [006] ....   261.579709: tegra_channel_set_stream: ox03c10_cam 30-0036 : 0x1
     simple_test-3699    [006] ....   261.620830: tegra_channel_set_stream: enable : 0x0
     simple_test-3699    [006] ....   261.620832: tegra_channel_set_stream: ox03c10_cam 30-0036 : 0x0
     simple_test-3699    [006] ....   261.620841: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x0
     simple_test-3699    [006] ....   261.620842: csi_s_stream: enable : 0x0
     simple_test-3699    [007] ....   261.633522: tegra_channel_set_power: ox03c10_cam 30-0036 : 0x0
     simple_test-3699    [007] ....   261.633534: camera_common_s_power: status : 0x0
     simple_test-3699    [007] ....   261.633545: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x0
     simple_test-3699    [007] ....   261.633548: csi_s_power: enable : 0x0
     simple_test-3699    [007] ....   261.633593: tegra_channel_close: vi-output, ox03c10_cam 3
     kworker/8:1-76      [008] ....   261.639044: rtcpu_vinotify_error: tstamp:9047838347 cch:-1 vi:0 tag:CSIMUX_STREAM channel:0x00 frame:0 vi_tstamp:289530803360 data:0x0000000000000001
     kworker/8:1-76      [008] ....   261.639051: rtcpu_vinotify_event: tstamp:9047845593 cch:-1 vi:0 tag:CSIMUX_STREAM channel:0x00 frame:0 vi_tstamp:289530803360 data:0x0000000000000001
     kworker/8:1-76      [008] ....   261.639052: rtcpu_vinotify_event: tstamp:9047845730 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:289530832768 data:0x399d580010000000
     kworker/8:1-76      [008] ....   261.639053: rtcpu_vinotify_event: tstamp:9047845885 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:289530839264 data:0x0000000031000001
     kworker/8:1-76      [008] ....   261.639054: rtcpu_vinotify_event: tstamp:9048521765 cch:0 vi:0 tag:FS channel:0x00 frame:0 vi_tstamp:289542489088 data:0x0000000000000010
     kworker/8:1-76      [008] ....   261.639055: rtcpu_vinotify_event: tstamp:9048521923 cch:0 vi:0 tag:ATOMP_FS channel:0x00 frame:0 vi_tstamp:289542489120 data:0x0000000800000000
     kworker/8:1-76      [008] ....   261.639056: rtcpu_vinotify_event: tstamp:9048522055 cch:0 vi:0 tag:CHANSEL_PXL_SOF channel:0x23 frame:0 vi_tstamp:289542524288 data:0x0000000000000001
     kworker/8:1-76      [008] ....   261.639057: rtcpu_vinotify_event: tstamp:9048522208 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:289542525824 data:0x0000000008020001
     kworker/8:1-76      [008] ....   261.639058: rtcpu_vinotify_error: tstamp:9048724850 cch:0 vi:0 tag:CHANSEL_NOMATCH channel:0x01 frame:0 vi_tstamp:289559171360 data:0x0000000000000589
     kworker/8:1-76      [008] ....   261.639058: rtcpu_vinotify_event: tstamp:9048859930 cch:0 vi:0 tag:FE channel:0x00 frame:0 vi_tstamp:289557800032 data:0x0000000000000020
     kworker/8:1-76      [008] ....   261.639059: rtcpu_vinotify_event: tstamp:9048860087 cch:0 vi:0 tag:CHANSEL_SHORT_FRAME channel:0x01 frame:0 vi_tstamp:289557800032 data:0x0438200001000000
     kworker/8:1-76      [008] ....   261.639060: rtcpu_vinotify_event: tstamp:9048860221 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:0 vi_tstamp:289557809312 data:0x0000000001020001
     kworker/8:1-76      [008] ....   261.639060: rtcpu_vinotify_event: tstamp:9048860380 cch:0 vi:0 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:289557800032 data:0x0000000800000000
     kworker/8:1-76      [008] ....   261.639062: rtcpu_vinotify_event: tstamp:9048860511 cch:0 vi:0 tag:FS channel:0x00 frame:0 vi_tstamp:289559136224 data:0x0000000000000010
     kworker/8:1-76      [008] ....   261.639062: rtcpu_vinotify_event: tstamp:9048860664 cch:0 vi:0 tag:CHANSEL_NOMATCH channel:0x01 frame:0 vi_tstamp:289559171360 data:0x0000000000000589
     kworker/8:1-76      [008] ....   261.639063: rtcpu_vinotify_event: tstamp:9049541901 cch:-1 vi:0 tag:FE channel:0x00 frame:0 vi_tstamp:289580334624 data:0x0000000000000020
     kworker/8:1-76      [008] ....   267.806032: rtcpu_string: tstamp:9241340550 id:0x04010000 str:"VM0 deactivating."

Hi ws_huang,

Hope you’re doing fine. Did you check that the output rate?

For Orin you need to check if output rate is more than 1.5Gbps.

Skew calibration is required if sensor or deserializer is using DPHY, and the output data rate is > 1.5Gbps.
An initiation deskew signal should be sent by sensor or deserializer to perform the skew calibration. If the deskew signals is not sent, the receiver will stall, and the capture will time out.
You can calculate the output data rate with the following equation:

Output data rate = (sensor or deserializer pixel clock in hertz) * (bits per pixel) / (number of CSI lanes)

Best,

Juan Diego Delgado
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com

Hi jdiegodelgado,

Yes, I did check the output data rate.

Register 0x0320 of max9296 is set to be 0x2C, i.e. the output data rate is 1200 MHz.

And in device tree, num_lanes is set to be 4, csi_pixel_bit_depth is set to be 12, serdes_pix_clk_hz is set to be 400000000. According to your provided formula, the calculated output data rate is also 1200 MHz.

@SimonZhu
Could you help for the driver of LI-JXAV-MIPI-ADPT-4CAM on AGX Orin.

Thanks

@ws_huang
It looks that the camera is not from us. We have AGX Orin driver for IMX490-GMSL2 (MAX9295) + LI-JXAV-MIPI-ADPT-4CAM + LI-MAX9296-IPX-DESER kit.
You can download the driver patches (source code) from Dropbox link in page1 of driver guide for your reference.

Thank @SimonZhu for providing the example.

Hi @ShaneCCC @jdiegodelgado , I am still facing the problem. Could you help me check is there any incorrect in my dts settings, especially those relating to csi channel configurations?

#include <dt-common/jetson/tegra234-p3737-0000-p3701-0000.h>


/dts-v1/;
/plugin/;

/ {
    overlay-name = "OX03C10 Camera";
    jetson-header-name = "Jetson AGX CSI Connector";
    compatible = JETSON_COMPATIBLE;
};

/* 
 * /tegra-capture-vi
 */
&capture_vi_base {
    status = "okay";
    num-channels = <0x08>;
};

/* 
 * /tegra-capture-vi/ports/port@0 
 */
&vi_port0 {
    status = "okay";
};

/*
 * /tegra-capture-vi/ports/port@0/endpoint
 */
&vi_in0 {
    status = "okay";
    port-index = <0x00>;
    vc-id = <0x00>;
    bus-width = <0x04>;
};

/*
 * /host1x@13e00000/nvcsi@15a00000
 */
&nvcsi {
    num-channels = <0x8>;
};

/*
 * /host1x@13e00000/nvcsi@15a00000/channel@0
 */
&csi_chan0 {
    status = "okay";
};

/*
 * /host1x@13e00000/nvcsi@15a00000/channel@0/ports/port@0
 */
&csi_chan0_port0 {
    status = "okay";
};

/*
 * /host1x@13e00000/nvcsi@15a00000/channel@0/ports/port@0/endpoint@0
 */
&csi_in0 {
    status = "okay";
    remote-endpoint = <&ox03c10_cam_out>;
};

/*
 * /host1x@13e00000/nvcsi@15a00000/channel@0/ports/port@1
 */
&csi_chan0_port1 {
    status = "okay";
};

/*
 * /host1x@13e00000/nvcsi@15a00000/channel@0/ports/port@1/endpoint@1
 */
&csi_out0 {
    status = "okay";
};

/*
 * /tegra-camera-platform
 */
&tcp {
    num_csi_lanes = <12>;
    max_lane_speed = <1500000>;
    min_bits_per_pixel = <10>;
    vi_peak_byte_per_pixel = <2>;
    vi_bw_margin_pct = <25>;
    isp_peak_byte_per_pixel = <5>;
    isp_bw_margin_pct = <25>;
};

/*
 * /tegra-camera-platform/modules/module0
 */
&cam_module0 {
    badge = "ox03c10_bottomleft_03c10";
    position = "bottomleft";
    orientation = "0";
    status = "okay";
};

/*
 * /tegra-camera-platform/modules/module0/drivernode0
 */
&cam_module0_drivernode0 {
    status = "okay";
    pcl_id = "v4l2_sensor";
    devname = "ox03c10 30-0036";
    proc-device-tree = "/proc/device-tree/i2c@3180000/tca9546@70/i2c@0/ox03c10@36";
};


&{/i2c@3180000/tca9546@70} {
    status = "okay";
};

&{/i2c@3180000/tca9546@70/i2c@0} {
    i2c-mux,deselect-on-exit;
    #address-cells = <0x01>;
    #size-cells = <0x00>;
    status = "okay";
    reg = <0x00>;

    /* labeled as max9296_dser in original device tree */
    max9296@48 {
        compatible = "maxim,max9296";
        reg = <0x48>;
        status = "okay";
        csi-mode = "2x4";
        max-src = <0x02>;
        reset-gpios = <&tegra_main_gpio TEGRA234_MAIN_GPIO(H, 3) GPIO_ACTIVE_HIGH>;
    };

    max96717_ser: max96717@40 {
        compatible = "maxim,max96717";
        status = "okay";
        reg = <0x40>;
        maxim,gmsl-dser-device = <&max9296_dser>;
    };

    ox03c10@36 {
        compatible = "ov,ox03c10_cam";
        status = "okay";
        reg = <0x36>;
        use_sensor_mode_id = "false";

        gmsl-link {
            maxim,gmsl-ser-device = <&max96717_ser>;
            maxim,gmsl-dser-device = <&max9296_dser>;
            dst-csi-port = "a";
            serdes-csi-link = "a";
            csi-mode = "1x4";
            st-vc = <0x00>;
            vc-id = <0x0>;
            num-csi-lanes = <0x04>;
            streams = "raw12";
        };

        ports {
            #address-cells = <0x1>;
            #size-cells = <0x0>;

            port@0 {
                reg = <0x00>;
                ox03c10_cam_out: endpoint {
                    vc-id = <0x00>;
                    port-index = <0x00>;
                    bus-width = <0x04>;
                    remote-endpoint = <&csi_in0>;
                };
            };
        };

        mode0 {
            num_lanes = "4";
            pix_clk_hz = "124416000"; /* 1920 * 1080p @ 60fps*/
            serdes_pix_clk_hz = "400000000"; /* max9296 CSI-PHY output frequency set to be 1200 MHz */
            cil_settletime = "0";
            discontinuous_clk = "no";
            dpcm_enable = "false";
            tegra_sinterface = "serial_a";
            /* image properties */
            active_w = "1920";
            active_h = "1080";
            line_length = "1920";
            embedded_metadata_height = "0";
            pixel_phase = "rggb";
            mode_type = "bayer";
            csi_pixel_bit_depth = "12";
        };
    };
};

&{/i2c@3180000/tca9546@70/i2c@1} {
    i2c-mux,deselect-on-exit;
    #address-cells = <0x01>;
    #size-cells = <0x00>;
    status = "okay";
    reg = <0x01>;
};

&{/i2c@3180000/tca9546@70} {
    i2c@2 {
        i2c-mux,deselect-on-exit;
        #address-cells = <0x01>;
        #size-cells = <0x00>;
        status = "okay";
        reg = <0x02>;
    };
};

&{/i2c@3180000/tca9546@70} {
    i2c@3 {
        i2c-mux,deselect-on-exit;
        #address-cells = <0x01>;
        #size-cells = <0x00>;
        status = "okay";
        reg = <0x03>;
    };
};



You need to check it depend on your HW design.
Also dump the device tree by below command for the final configuration.

sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree

Hi @SimonZhu , I have some questions about the circuit design of LI-MAX9296-IPX-DESER and LI-JXAV-MIPI-ADPT-4CAM . It will be great if you could provide me the circuit diagrams.

  1. Is the data delivered to csi port 0 and 1 of Orin if the camera is connected to interface J1 of LI-JXAV-MIPI-ADPT-4CAM?
  2. What do the gpios TEGRA234_MAIN_GPIO(H, 3), TEGRA234_MAIN_GPIO(H, 6), TEGRA234_MAIN_GPIO(AC, 2) and TEGRA234_MAIN_GPIO(AC, 0) represent? Do they all represent the PWDNB pin of MAX9296 on LI-MAX9296-IPX-DESER?

@ws_huang
Please contact support@leopardimaging.com to get the document of adapter boards.

Hi @ShaneCCC @jdiegodelgado, sorry to bother again.

I am trying to figure out what is happening as the trace log shown:

I have read the Camera_BringUp but I still have many questions:

  1. What’s cch and channel? What’s the difference between them?
  2. What do the events FS, ATOMP_FS, FE, ATOMP_FE, CHANSEL_PXL_SOF, VIFALC_ACTIONLST and CHANSEL_SHORT_FRAME tell in the trace log?

Best regards.