Dual camera configuration with sensors MIPI 4 line in 24.2 release.

I’m writing a driver for imx172 sensor.
The basis is taken driver imx274 sensor.
After many changes in my work one sensor on the /dev/video0" with the file DT:

#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>

#define CAM0_RST_L  TEGRA_GPIO(S, 4)
#define CAM0_PWDN   TEGRA_GPIO(S, 7)
#define CAM1_RST_L  TEGRA_GPIO(S, 5)
#define CAM1_PWDN   TEGRA_GPIO(T, 0)

/ {
    gpio: gpio@6000d000 
    {
        camera-control 
        {
            gpio-output-low = <
                CAM0_RST_L
                CAM0_PWDN
                CAM1_RST_L
                CAM1_PWDN
                >;
        };
    };

    host1x 
    {
        vi_base: vi 
        {
            num-channels = <2>;

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

                vi_port0: port@0 
                {
                    status              = "okay";
                    reg                 = <0>;

                    imx274_a_csia_in0: endpoint 
                    {
                        status          = "okay";
                        csi-port        = <0>;
                        bus-width       = <4>;
                        remote-endpoint = <&imx274_out0>;
                    };
                };
            
                vi_port1: port@1 
                {
                    status              = "disabled";
                    reg                 = <1>;

                    imx274_c_csic_in1: endpoint
                    {
                        status          = "disabled";
                        csi-port        = <2>;
                        bus-width       = <4>;
                        remote-endpoint = <&imx274_out1>;
                    };
                };

                port@2 {
                    status = "disabled";
                    reg = <2>;
                    e3322_vi_in2: endpoint { remote-endpoint = <&imx219_out2>; };
                };
                port@3 {
                    status = "disabled";
                    reg = <3>;
                    e3322_vi_in3: endpoint { remote-endpoint = <&imx219_out3>; };
                };
                port@4 {
                    status = "disabled";
                    reg = <4>;
                    e3322_vi_in4: endpoint { remote-endpoint = <&imx219_out4>; };
                };
                port@5 {
                    status = "disabled";
                    reg = <5>;
                    e3322_vi_in5: endpoint { remote-endpoint = <&imx219_out5>; };
                };
            };
        };

        i2c@546c0000 
        {
            status          = "okay";
            #address-cells  = <1>;
            #size-cells     = <0>;

            imx274_a@52 
            {
                status = "okay";

                /* Define any required hw resources needed by driver */
                /* ie. clocks, io pins, power sources */
                /* mclk-index indicates the index of the */
                /* mclk-name with in the clock-names array */

                clocks                          = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
                clock-names                     = "mclk";
                clock-frequency                 = <24000000>;
                                                
                mclk                            = "cam_mclk1";
                reset-gpios                     = <&gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
                pwdn-gpios                      = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
                vana-supply                     = <&en_vdd_cam_hv_2v8>;
                vif-supply                      = <&en_vdd_cam>;

                compatible                      = "nvidia,imx274";
                reg                             = <0x52>;          
                physical_w                      = "4.000";  
                physical_h                      = "3.000";
                sensor_model                    = "imx274";
                avdd-reg                        = "vana";
                iovdd-reg                       = "vif";
                post_crop_frame_drop            = "0";

                mode0
                {
                    mclk_khz                    = "24000";
                    num_lanes                   = "4";
                    tegra_sinterface            = "serial_a";
                    discontinuous_clk           = "yes"; 
                    dpcm_enable                 = "false";
                    cil_settletime              = "0";
                    active_w                    = "3200";
                    active_h                    = "3040";
                    pixel_t                     = "bayer_rggb";
                    readout_orientation         = "0";
                    line_length                 = "4320";
                    inherent_gain               = "1";
                    mclk_multiplier             = "25";
                    pix_clk_hz                  = "400000000";

                    min_gain_val                = "1.0";
                    max_gain_val                = "22.5";
                    min_hdr_ratio               = "1";
                    max_hdr_ratio               = "64";
                    min_framerate               = "2.2290";
                    max_framerate               = "30";
                    min_exp_time                = "44";
                    max_exp_time                = "33000";
                    embedded_metadata_height    = "0";
                }; 
                ports {
                    #address-cells              = <1>;
                    #size-cells                 = <0>;

                    port@0 
                    {
                        reg                     = <0>;
                        imx274_out0: endpoint 
                        {
                            csi-port            = <0>;
                            bus-width           = <4>;
                            remote-endpoint     = <&imx274_a_csia_in0>;
                        };
                    };
                };
            };

            imx274_c@56
            {
                status = "okay";

                clocks                          = <&tegra_car TEGRA210_CLK_ID_CLK_OUT_3>;
                clock-names                     = "mclk";
                clock-frequency                 = <24000000>;
                                                
                mclk                            = "cam_mclk1";
                reset-gpios                     = <&gpio CAM1_RST_L GPIO_ACTIVE_HIGH>;
                pwdn-gpios                      = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
                vana-supply                     = <&en_vdd_cam_hv_2v8>;
                vif-supply                      = <&en_vdd_cam>;

                compatible                      = "nvidia,imx274";
                reg                             = <0x56>;          
                physical_w                      = "4.000";  
                physical_h                      = "3.000";
                sensor_model                    = "imx274";
                avdd-reg                        = "vana";
                iovdd-reg                       = "vif";
                post_crop_frame_drop            = "0";

                mode0
                {
                    mclk_khz                    = "24000";
                    num_lanes                   = "4";
                    tegra_sinterface            = "serial_c";
                    discontinuous_clk           = "yes"; 
                    dpcm_enable                 = "false";
                    cil_settletime              = "0";
                    active_w                    = "3200";
                    active_h                    = "3040";
                    pixel_t                     = "bayer_rggb";
                    readout_orientation         = "0";
                    line_length                 = "4320";
                    inherent_gain               = "1";
                    mclk_multiplier             = "25";
                    pix_clk_hz                  = "400000000";

                    min_gain_val                = "1.0";
                    max_gain_val                = "22.5";
                    min_hdr_ratio               = "1";
                    max_hdr_ratio               = "64";
                    min_framerate               = "2.2290";
                    max_framerate               = "30";
                    min_exp_time                = "44";
                    max_exp_time                = "33000";
                    embedded_metadata_height    = "0";
                }; 
                ports {
                    #address-cells              = <1>;
                    #size-cells                 = <0>;

                    port@0 
                    {
                        reg                     = <0>;
                        imx274_out1: endpoint 
                        {
                            csi-port            = <2>;
                            bus-width           = <4>;
                            remote-endpoint     = <&imx274_c_csic_in1>;
                        };
                    };
                };
            };

            imx219_c@10 {
                ports {
                    #address-cells = <1>;
                    #size-cells = <0>;

                    port@0 {
                        reg = <0>;
                        imx219_out2: endpoint {
                            csi-port = <2>;
                            bus-width = <2>;
                            remote-endpoint = <&e3322_vi_in2>;
                        };
                    };
                };
            };

            imx219_d@10 {
                ports {
                    #address-cells = <1>;
                    #size-cells = <0>;

                    port@0 {
                        reg = <0>;
                        imx219_out3: endpoint {
                            remote-endpoint = <&e3322_vi_in3>;
                        };
                    };
                };
            };
            imx219_e@10 {
                ports {
                    #address-cells = <1>;
                    #size-cells = <0>;

                    port@0 {
                        reg = <0>;
                        imx219_out4: endpoint {
                            remote-endpoint = <&e3322_vi_in4>;
                        };
                    };
                };
            };
            imx219_f@10 {
                ports {
                    #address-cells = <1>;
                    #size-cells = <0>;

                    port@0 {
                        reg = <0>;
                        imx219_out5: endpoint {
                            remote-endpoint = <&e3322_vi_in5>;
                        };
                    };
                };
            };

};
    };

    tegra-camera-platform 
    {
        compatible = "nvidia, tegra-camera-platform";

        modules 
        {
            cam_module0: module0
            {
                status                  = "okay";
                badge                   = "e3326_front_P5V27C";
                position                = "rear";
                orientation             = "1";

                drivernode0 
                {
                    status              = "okay";
                    pcl_id              = "v4l2_sensor";    /* Declare PCL support driver (classically known as guid)  */
                    devname             = "imx274 6-0052";  /* Driver's v4l2 device name */
                                                            /* Declare the device-tree hierarchy to driver instance */
                    proc-device-tree    = "/proc/device-tree/host1x/i2c@546c0000/imx274_a@52";  
                };
            };

            cam_module1: module1
            {
                status                  = "disabled";
                badge                   = "e3326_front_P5V27C";
                position                = "rear";
                orientation             = "1";

                drivernode0 
                {
                    status              = "disabled";
                    pcl_id              = "v4l2_sensor";
                    devname             = "imx274 6-0056";
                    proc-device-tree    = "/proc/device-tree/host1x/i2c@546c0000/imx274_c@56";
                };
            };

            cam_module2: module2 
            {
                status = "disabled";
                cam_module2_drivernode0: drivernode0 
                {
                    status = "disabled";
                };
                cam_module2_drivernode1: drivernode1 
                {
                    status = "disabled";
                    pcl_id = "v4l2_focuser_stub";
                    proc-device-tree = "";
                };
            };

            cam_module3: module3 
            {
                status = "disabled";
                cam_module3_drivernode0: drivernode0 
                {
                    status = "disabled";
                };
                cam_module3_drivernode1: drivernode1 
                {
                    status = "disabled";
                    pcl_id = "v4l2_focuser_stub";
                    proc-device-tree = "";
                };
            };

            cam_module4: module4 
            {
                status = "disabled";
                cam_module4_drivernode0: drivernode0 
                {
                    status = "disabled";
                };
                cam_module4_drivernode1: drivernode1 
                {
                    status = "disabled";
                    pcl_id = "v4l2_focuser_stub";
                    proc-device-tree = "";
                };
            };

            cam_module5: module5 
            {
                status = "disabled";
                cam_module5_drivernode0: drivernode0 
                {
                    status = "disabled";
                };
                cam_module5_drivernode1: drivernode1 
                {
                    status = "disabled";
                    pcl_id = "v4l2_focuser_stub";
                    proc-device-tree = "";
                };
            };

        };
    };
};

Please tell me what changes you need to make that would earn two sensors at the same time?

Any changes in this file are to stop working even one sensor.

Where did you buy the sensor? We could help you to get it working, we have been able to modify the device tree to get 6 cameras working. Which address and i2c bus uses the camera? What error are you seeing?

This is our own design that runs on a different platform.
Also we have a working driver for the 23.2 release.

I have a suspicion that the release 24.2 have problems with MIPI 4 line.
I obviously that you have 2 lines MIPI and Nvidia are all examples of such sensors.

52h / 56h
One sensor works successfully.

If I try to activate the second sensor, then either missing /dev/videoX or GStreamer can not get the image from any sensor.

With R23.1 we had tested 4 Lanes working properly. We have not tested with latest R24.2 to see if 4 lanes work too, only 2 lanes have been tested in R24.2 but it shouldn’t be something difficult to test for us.

In our internal task list we have one item to port the R23.1 drivers to R24.2 but the work for the current customers is priority at the moment so I can’t give you an estimate on when this will happen. Any chance to provide us the hardware for testing this for you?

I don’t see why /dev/videoX would disappear, it sounds like an issue in your driver.

We are using dual IMX 274 sensors and concurrently running 4k and 1080p capture and encoding with TX1 and release 24.2, so the issue is not likely the platform. I can’t provide any details due to an NDA, but can confirm that it does indeed work very well.