V4L2 Drivers for Tegra X2 - v4l2 and nvcamerasrc

Hi,

Over the last couple of weeks I been working on supporting capture on the TX2 as of L4T 27.1 using sensors and carrier boards that we were able to use on the TX1. I wanted to share the experience gattered from this process as well as some issues and tips that might be useful to know along the way of adding support for a sensor. First, the next couple of posts provide a good insight on the process of adding support for a driver and the device tree:

[1] https://devtalk.nvidia.com/default/topic/1007058/jetson-tx2/porting-tx1-camera-driver-to-kernel-4-4-15-pxl_sof-syncpt-timeout

[2] https://devtalk.nvidia.com/default/topic/1009359/jetson-tx2/jetson-tx1-sensor-driver-porting-to-tx2-4-4-kernel-/

After adding the driver and support on the device tree, there are two main issues that you can experience testing capture with Yatva or V4l2-ctrl (you can check them running dmesg on the cmdline after trying to capture with either of the tools I just mentioned):

a - tegra_mipi_cal 3990000.mipical: Mipi cal timeout,val:108861, lanes:300000 : I’ve seen this message tipically when the CSI port assigned in the device tree for the sensor was not the one where the sensor is actually connected to (It’s also given for example, when you try to capture from a port which doesn’t have a sensor attached).In this case, check you device tree settings specifically the CSI configuration.

b- tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11 : SOF is an acronym for Start of Frame, I was able to partially fix this issue by applying the patches for embedded data available in my reference post [1].

At this moment I’m still experiencing the issue b in certain resolutions, for example in a configuration of 6 cameras with the imx219 I can capture using Yavta or v4l2-ctrl of eacht of the 6 CSI ports to the resolution 1640x1232 or 3280x2464, but I can not capture at 1920x1080.

Regarding nvcamerasrc I have only been able to capture when the camera is capturing the port CSI-C using a width of 2 lanes, so specifically when the CSI configuration on the device tree is:

csi-port = <2>;
bus-width = <2>;

for that particular sensor, it’s to notice that CSI-C using 2 lanes is the same configuration that the ov5693 has in the Jetson TX2 EVM. Using the other CSI ports at 2 lanes translated at nvcamerasrc being unable to provide buffers and I get only a green output when running a gstreamer pipeline, also nvcamera-daemon is stucked when trying to close that pipeline which forces me to kill the process and restart it. On the other hand here are the remaining considerations that I had to have:

1- I enconter issues when the driver for the sensor was being loaded by the kernel at boot time and it tried to start comunication with the sensor via I2C. For example, if in the probe function o the driver tried to set some registers on the sensor on i2c bus 7 at boot time, the i2c communication will fail and prevent the driver from being loaded. This was an issue for example in my configuration for 6 cameras since nvcamerasrc segfaulted when there was a definition for a camera on the device tree and there was not driver loaded (even when I was not capturing from that particular sensor that didn’t have the driver loaded properly). As a recomendation for a workaround, avoid setting sensor registers at the probe function.

2- As I mentioned, I’ve only been successful capturing from a CSI-C port using 2 lanes (the same one that uses the ov5693 sensor on the Jetson TX2 EVM) I would like to know if anyone has been able to get frames using nvcamerasrc using other ports and more lanes.

Please let me know if you found more information on the issues I described.
Regards,
JJ

Hi Jose
The internal E3323/E3333 are working for the E3333 is 6 camera board. For your case could you compare the device tree with e3333 to check if any different.

Hi Josejich,

Other than applying the NVIDIA patch, did you do anything else to fix SOF timeout error?

Regards,
Rejeesh

Hi Josejich,

I’ve had similar issues that you are describing while bringing up a 3 camera system.

What’s really strange is that I can get all three cameras to work but the CSI sensors are mapped in reverse regardless of how I declare my ‘video0-2’ in my DTS file?!

I don’t want to make this confusing so on the TX1 I get the following:

video0 is mapped to CSI port A
video1 is mapped to CSI port C
video2 is mapped to CSI port E

TX2:

video2 is mapped to CSI port A
video1 is mapped to CSI port C
video0 is mapped to CSI port E

I have another problem associated with the three separate GPIOs used for camera reset on my board but because the reset pin is not working what happens is that I open up video2 and all I get is green screen but when I open up video0 then video2 everything works because the configuration for I2C associated with video0 is setup to work with video2.

Anyways, this may sound strange but would you try and mirror your I2C bus wrt your CSI port. Port C shouldn’t change.

I hope this makes sense.

Dave

Hi Cospan
Could you check the position is the same on TX1 and TX2

module0 {
				badge = "e3333_bottomleft_P5V27C";
				position = "bottomleft";
				orientation = "1";
				drivernode0 {

Hi All,

After applying the patches, I tried below resolutions. All of them fail with PXL_SOF error. However, I could see some changes in my camera viewer. Sometimes half the window is white, sometimes some lines in the white area.

  1. 1280x720
  2. 1296_736
  3. 1920_1080
  4. 1936_1096

From Josejich post, I understood that, 1640x1232 or 3280x2464 worked for him. I shall give a try with these.

So, can I keep issues with other resolutions open assuming that NVIDIA would come up with some fix soon? Or is there something I should keep trying?

Regards,
Rejeesh

Hi Shane & Josejich,

I tried both 1640x1232 or 3280x2464, but no luck; same behavior as in the case of other resolutions.

I have applied below patches (and fixed the compilation issues). Other than these, is there anything else I should take care?

  1. 0001-vi4-Allocate-buffer-for-embedded-data.patch
  2. 0002-drivers-camera-Fix-DT-parsing-issues.patch
  3. 0003-include-media-Add-headers-for-parsing-DT.patch

Regards,
Rejeesh

@ShaneCCC

I realized I didn’t have email notification for this topic, sorry for not responding sooner.

Thanks for the feedback, it didn’t fix the issue.

I looked at my old DTSI file for the TX1 I used the three camera configuration of ‘bottom’ ‘top’, ‘center’ I did the same configuration for the TX2.

As an experiment I tried changing the order of the labels on the TX2 from ‘bottom’, ‘top’ ‘center’ to ‘center’, ‘top’, ‘bottom’ as well as adapting the 6 camera version with ‘bottomleft’ for the CSIA, ‘centerleft’ for CSIC and ‘topleft’ for CSIE and it didn’t change the behavior.

As a reference here are the significant portions in both my DTSI files:

TX1:

/ {                                                                                                                                    
  tcp: tegra-camera-platform {                                                                                                         
    compatible = "nvidia, tegra-camera-platform";                                                                                      
    num_csi_lanes = <6>;                                                                                                               
    max_lane_speed = <1500000>;                                                                                                        
    min_bits_per_pixel = <10>;                                                                                                         
    vi_peak_byte_per_pixel = <2>;                                                                                                      
    vi_bw_margin_pct = <25>;                                                                                                           
    //max_pixel_rate = <182400>;                                                                                                       
    max_pixel_rate = <408000>;                                                                                                         
    isp_peak_byte_per_pixel = <2>;                                                                                                     
    isp_bw_margin_pct = <25>;                                                                                                          
                                                                                                                                       
    modules {                                                                                                                          
      cam_module0: module0 {                                                                                                           
        status = "okay";                                                                                                               
        //badge = "uav_back_imx219";                                                                                                   
        badge = "e3322_bottom_A815P2";                                                                                                 
        //badge = "e3326_bottom_P5V27C";                                                                                               
        //position = "rear";                                                                                                           
        position = "bottom";                                                                                                           
        orientation = "0";                                                                                                             
        cam_module0_drivernode0: drivernode0 {                                                                                         
          status = "okay";                                                                                                             
          /* Declare PCL support driver (classically known as guid)  */                                                                
          pcl_id = "v4l2_sensor";                                                                                                      
          /* Driver's v4l2 device name */                                                                                              
          devname = "imx219 7-0010";                                                                                                   
          /* Declare the device-tree hierarchy to driver instance */                                                                   
          proc-device-tree = "/proc/device-tree/host1x/i2c-camera-mux/i2c@0/imx219_a@10";                                              
        };                                                                                                                             
      };                                                                                                                               
                                                                                                                                       
      cam_module1: module1 {                                                                                                           
        status = "okay";                                                                                                               
        //badge = "uav_frontright_imx219";                                                                                             
        //position = "topright";                                                                                                       
        badge = "e3322_top_A815P2";                                                                                                    
        //badge = "e3326_top_P5V27C";                                                                                                  
        position = "top";                                                                                                              
        orientation = "1";                                                                                                             
        cam_module1_drivernode0: drivernode0 {                                                                                         
          /* Declare PCL support driver (classically known as guid)  */                                                                
          pcl_id = "v4l2_sensor";                                                                                                      
          /* Driver's v4l2 device name */                                                                                              
          devname = "imx219 8-0010";                                                                                                   
          /* Declare the device-tree hierarchy to driver instance */                                                                   
          proc-device-tree = "/proc/device-tree/host1x/i2c-camera-mux/i2c@1/imx219_c@10";                                              
          status = "okay";                                                                                                             
        };                                                                                                                             
      };                                                                                                                               
                                                                                                                                       
      cam_module2: module2 {                                                                                                           
        status = "okay";                                                                                                               
        //badge = "uav_frontleft_imx219";                                                                                              
        //badge = "e3326_center_P5V27C";                                                                                               
        badge = "e3322_center_A815P2";                                                                                                 
        //position = "topleft";                                                                                                        
        position = "center";                                                                                                           
        orientation = "1";                                                                                                             
        cam_module2_drivernode0: drivernode0 {                                                                                         
          /* Declare PCL support driver (classically known as guid)  */                                                                
          pcl_id = "v4l2_sensor";                                                                                                      
          /* Driver's v4l2 device name */                                                                                              
          devname = "imx219 9-0010";                                                                                                   
          /* Declare the device-tree hierarchy to driver instance */                                                                   
          proc-device-tree = "/proc/device-tree/host1x/i2c-camera-mux/i2c@2/imx219_e@10";                                              
          status = "okay";                                                                                                             
        };                                                                                                                             
      };                                                                                                                               
    };                                                                                                                                 
  };                                                                                                                                   
};

TX2

/* camera control gpio definitions */                                                                                                  
/ {     
  tegra-camera-platform {
    compatible = "nvidia, tegra-camera-platform";                                                                                      
    num_csi_lanes = <6>;
    max_lane_speed = <1500000>;
    max_pixel_rate = <750000>;
    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>;                                                                                                          
      
    modules {                                                                                                                          
      module0 {
        status = "okay";                                                                                                               
        //badge = "imx185_bottom_liimx185";                                                                                            
        //badge = "e3322_bottom_A815P2";                                                                                               
        badge = "e3326_bottom_P5V27C";                                                                                                 
        position = "bottom";
        orientation = "0";                                                                                                             
        drivernode0 { 
          pcl_id = "v4l2_sensor";
          devname = "imx219 9-0010";
          proc-device-tree = "/proc/device-tree/host1x/i2c-camera-mux/i2c@0/imx219_a@10";                                              
        };
      };  
      module1 {
        status = "okay";
        //badge = "imx185_top_liimx185";                                                                                               
        //badge = "e3322_top_A815P2";                                                                                                  
        badge = "e3326_top_P5V27C";                                                                                                    
        position = "top";                                                                                                              
        orientation = "1";
        drivernode0 {
          pcl_id = "v4l2_sensor";
          devname = "imx219 10-0010";
          proc-device-tree = "/proc/device-tree/host1x/i2c-camera-mux/i2c@1/imx219_c@10";                                              
        };
      };
      module2 {
        status = "okay";
        //badge = "imx185_center_liimx185";
        //badge = "e3322_center_A815P2";                                                                                               
        badge = "e3326_center_P5V27C";
        position = "center";
        orientation = "1";
        drivernode0 {
          pcl_id = "v4l2_sensor";                                                                                                      
          devname = "imx219 11-0010";                                                                                                  
          proc-device-tree = "/proc/device-tree/host1x/i2c-camera-mux/i2c@2/imx219_e@10";                                              
        };                                                                                                                             
      };                                                                                                                               
    };                                                                                                                                 
  };
};

At this time my csi ports and /dev/video files have agreed to disagree

@Rejeesh_QueST

The steps I mentioned above work for me for the imx219, I’m currently working on another driver and I still get the PXL_SOF timeout error. I will get back to you if I have any further findings.

@cospan and @ShaneCCC, thanks for the recommentations I will try them and let you know if it fixes my issues with nvcamerasrc.

Hi Josejich,

I am also using IMX219, but still I am getting PXL_SOF timeout error for 1640x1232 or 3280x2464 resolutions.

I tried with 2 lane mode using CSI port-A and 4 lane mode using CSI port-EF. Behavior is same in both case.

What fps did you try? Also, if there are no confidentiality issues, could you share the dtsi file used for IMX219?

Regards,
Rejeesh

Hi All

  1. Please reference to below link to get all patch, and make sure embedded_metadata_height’s value from the sensor vendor.

https://devtalk.nvidia.com/default/topic/1007058/jetson-tx2/porting-tx1-camera-driver-to-kernel-4-4-15-pxl_sof-syncpt-timeout/2

  1. Make sure the sensor clock mode to modify the discontinuous_clk and try cil_settletime it range is 1 - 15
mode1 { //OV5693_MODE_2592X1458
					mclk_khz = "24000";
					num_lanes = "2";
					tegra_sinterface = "serial_c";
					discontinuous_clk = "no";
					dpcm_enable = "false";
					cil_settletime = "0";

@cospan
Could you attach the VI/CSI part of the device tree, mean while I will check the 6 camera reference board to find out the rule

@Shane: Yeah sure

/*
 * Copyright (c) 2015-2016, 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/>.
 */

/* camera control gpio definitions */

//#include "t18x-common-platforms/tegra186-quill-camera-li-mipi-adpt-a00.dtsi"
#include "dt-bindings/clock/tegra186-clock.h"
#include <dt-bindings/pinctrl/pinctrl-tegra.h>
#include <dt-bindings/gpio/tegra186-gpio.h>



//GPIOs
#define CAM0_RST_L  TEGRA_MAIN_GPIO(R, 0)
#define CAM1_RST_L  TEGRA_MAIN_GPIO(N, 2)
#define CAM2_RST_L  TEGRA_MAIN_GPIO(R, 5)

//This is used in the platform file
#define CAM_MUX0		TEGRA_MAIN_GPIO(I, 7)	//GPIO 0 on control UAV
#define CAM_MUX1		TEGRA_MAIN_GPIO(I, 6)	//GPIO 1 on control UAV


/* camera control gpio definitions */
/ {

  host1x {
    vi@15700000 {
      num-channels = <3>;
      ports {
        #address-cells = <1>;
        #size-cells = <0>;
        vi_port0: port@0 {
          status = "okay";
          reg = <0>;
          vi_in0: endpoint {
            status = "okay";
            csi-port = <0>;
            bus-width = <2>;
            remote-endpoint = <&csi_out0>;
          };
        };
        vi_port1: port@1 {
          status = "okay";
          reg = <1>;
          vi_in1: endpoint {
            status = "okay";
            csi-port = <2>;
            bus-width = <2>;
            remote-endpoint = <&csi_out1>;
          };
        };
        vi_port2: port@2 {
          status = "okay";
          reg = <2>;
          vi_in2: endpoint {
            status = "okay";
            csi-port = <4>;
            bus-width = <2>;
            remote-endpoint = <&csi_out2>;
          };
        };
    	};
		};

		nvcsi@150c0000 {
      status = "okay";
      num-channels = <3>;
      #address-cells = <1>;
      #size-cells = <0>;
			channel@0 {
        reg = <0>;
				status = "okay";
        ports {
          #address-cells = <1>;
          #size-cells = <0>;
					port@0 {
            status = "okay";
            reg = <0>;
            csi_in0: endpoint@0 {
              csi-port = <0>;
              bus-width = <2>;
              remote-endpoint = <&mit_uav_out0>;
            };
          };
					port@1 {
            reg = <1>;
            csi_out0: endpoint@1 {
              remote-endpoint = <&vi_in0>;
            };
          };
        };
      };
			channel@1 {
        reg = <1>;
				status = "okay";
        ports {
          #address-cells = <1>;
          #size-cells = <0>;
					port@0 {
						status = "okay";
            reg = <0>;
            csi_in1: endpoint@2 {
						  status = "okay";
              csi-port = <2>;
              bus-width = <2>;
              remote-endpoint = <&mit_uav_out1>;
            };
          };
					port@1 {
						status = "okay";
            reg = <1>;
            csi_out1: endpoint@3 {
						  status = "okay";
              remote-endpoint = <&vi_in1>;
            };
          };
        };
      };
			channel@2 {
        reg = <2>;
				status = "okay";
        ports {
          #address-cells = <1>;
          #size-cells = <0>;
					port@0 {
				    status = "okay";
            reg = <0>;
            csi_in2: endpoint@4 {
				      status = "okay";
              csi-port = <4>;
              bus-width = <2>;
              remote-endpoint = <&mit_uav_out2>;
            };
          };
					port@1 {
				    status = "okay";
            reg = <1>;
            csi_out2: endpoint@5 {
              remote-endpoint = <&vi_in2>;
				      status = "okay";
            };
          };
        };
      };
    };
		//Make seperate module
    i2c-camera-mux {
      //i2c@3180000
      status = "okay";
      compatible = "i2c-mux-gpio";
      #address-cells = <1>;
      #size-cells = <0>;
      mux-gpios     = < &tegra_main_gpio 	CAM_MUX0 GPIO_ACTIVE_HIGH
 	 											&tegra_main_gpio 	CAM_MUX1 GPIO_ACTIVE_HIGH>;

      i2c-parent = <&cam_i2c>;
 	 	//idle-state = <0>;

      i2c@0 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <0>;

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

          //ADDED
          clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>;
          clock-names = "extperiph1";
          mclk = "extperiph1";
          reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_LOW>;
          //reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
          //vana-supply = <&en_vdd_cam_hv_2v8>;
          //vana-supply = <&en_vdd_cam_hv_2v8>;
          //vdig-supply = <&en_vdd_sys>;
          //dovdd-supply = <&en_vdd_cam>;
          //END

          devnode = "video0";
          compatible = "nvidia,imx219";
          reg = <0x10>;

          physical_w = "5.095";
          physical_h = "4.930";

          sensor_model ="imx219";
          //dovdd-supply = <&en_vdd_cam>;
          avdd-reg = "vana";
          dvdd-reg = "vdig";
          iovdd-reg = "dovdd";

          mode0 { // IMX219_MODE_1920X1080
            mclk_khz = "24000";
            mclk_multiplier = "25";
            pix_clk_hz = "182400000";
            //pix_clk_hz = "170000000";

            num_lanes = "2";
            tegra_sinterface = "serial_a";
            discontinuous_clk = "yes";
            cil_settletime = "0";
            pixel_t = "bayer_rggb";
            readout_orientation = "90";
            inherent_gain = "1";

            active_w = "1920";
            active_h = "1080";

            line_length = "3448";
            dpcm_enable = "false";

            min_gain_val = "1.0";
            max_gain_val = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "64";
            min_framerate = "1";
            max_framerate = "30";
            //min_exp_time = "33";
            min_exp_time = "11";
            max_exp_time = "683709";
            embedded_metadata_height = "0";
          };
          mode1 { // IMX219_MODE_1280X720
            mclk_khz = "24000";
            mclk_multiplier = "25";
            pix_clk_hz = "182400000";
            //pix_clk_hz = "170000000";

            num_lanes = "2";
            tegra_sinterface = "serial_a";
            discontinuous_clk = "yes";
            cil_settletime = "0";
            pixel_t = "bayer_rggb";
            readout_orientation = "90";
            inherent_gain = "1";

            active_w = "1280";
            active_h = "720";

            line_length = "3448";
            dpcm_enable = "false";
            //line_length = "1752";

            min_gain_val = "1";
            max_gain_val = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "64";
            min_framerate = "1";
            max_framerate = "60";
            //min_exp_time = "16";
            min_exp_time = "11";
            max_exp_time = "683710";
            embedded_metadata_height = "0";
          };
          mode2 { // IMX219_MODE_640X480
            //mclk_khz = "47000";
            mclk_khz = "24000";
            mclk_multiplier = "25.0";
            pix_clk_hz = "182400000";
            //pix_clk_hz = "170000000";

            num_lanes = "2";
            tegra_sinterface = "serial_a";
            discontinuous_clk = "yes";
            cil_settletime = "0";
            pixel_t = "bayer_rggb";
            readout_orientation = "90";
            inherent_gain = "1";

            active_w = "640";
            active_h = "480";

            //line_length = "3448";
            line_length = "3559";
            dpcm_enable = "false";

            min_gain_val = "1";
            max_gain_val = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "64";
            min_framerate = "1";
            max_framerate = "90";
            min_exp_time = "11";
 	 			  max_exp_time = "358731";
            embedded_metadata_height = "0";
          };


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

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

      i2c@1 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <1>;

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

          //ADDED!
          clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>;
          clock-names = "extperiph1";
          mclk = "extperiph1";
          reset-gpios = <&tegra_main_gpio CAM1_RST_L GPIO_ACTIVE_LOW>;
          //reset-gpios = <&tegra_main_gpio CAM1_RST_L GPIO_ACTIVE_HIGH>;
          //vana-supply = <&en_vdd_cam_hv_2v8>;
          //vdig-supply = <&en_vdd_sys>;
          //dovdd-supply = <&en_vdd_cam>;
          //END

          devnode = "video1";
          compatible = "nvidia,imx219";
          reg = <0x10>;

          physical_w = "5.095";
          physical_h = "4.930";

          sensor_model ="imx219";
          avdd-reg = "vana";
          dvdd-reg = "vdig";
          iovdd-reg = "dovdd";

          mode0 { // IMX219_MODE_1920X1080
            mclk_khz = "24000";
            mclk_multiplier = "25";
            pix_clk_hz = "182400000";
            //pix_clk_hz = "170000000";

            num_lanes = "2";
            tegra_sinterface = "serial_c";
            discontinuous_clk = "yes";
            cil_settletime = "0";
            pixel_t = "bayer_rggb";
            readout_orientation = "270";
            //readout_orientation = "90";
            inherent_gain = "1";

            active_w = "1920";
            active_h = "1080";

            line_length = "3448";
            dpcm_enable = "false";

            min_gain_val = "1";
            max_gain_val = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "64";
            min_framerate = "1";
            max_framerate = "30";
            min_exp_time = "11";
            max_exp_time = "683709";
            embedded_metadata_height = "0";
          };
          mode1 { // IMX219_MODE_1280X720
            mclk_khz = "24000";
            mclk_multiplier = "25";
            pix_clk_hz = "182400000";
            //pix_clk_hz = "170000000";

            num_lanes = "2";
            tegra_sinterface = "serial_c";
            discontinuous_clk = "yes";
            cil_settletime = "0";
            pixel_t = "bayer_rggb";
            readout_orientation = "270";
            inherent_gain = "1";

            active_w = "1280";
            active_h = "720";

            line_length = "3448";
            dpcm_enable = "false";
            //line_length = "1752";

            min_gain_val = "1";
            max_gain_val = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "64";
            min_framerate = "1";
            max_framerate = "60";
            //min_exp_time = "16";
            min_exp_time = "13";
            max_exp_time = "683709";
            embedded_metadata_height = "0";
          };
          mode2 { // IMX219_MODE_640X480

            //mclk_khz = "47000";
            mclk_khz = "24000";
            mclk_multiplier = "25.0";
            pix_clk_hz = "182400000";
            //pix_clk_hz = "170000000";

            num_lanes = "2";
            tegra_sinterface = "serial_c";
            discontinuous_clk = "yes";
            cil_settletime = "0";
            pixel_t = "bayer_rggb";
            readout_orientation = "270";
            inherent_gain = "1";

            active_w = "640";
            active_h = "480";

            //line_length = "3448";
            line_length = "3559";
            dpcm_enable = "false";

            min_gain_val = "1";
            max_gain_val = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "64";
            min_framerate = "1";
            max_framerate = "90";
            min_exp_time = "11";
 	 			  max_exp_time = "358733";
            embedded_metadata_height = "0";
          };

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

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


      i2c@2 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <2>;

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

          //ADDED
          clocks = <&tegra_car TEGRA186_CLK_EXTPERIPH1>;
          clock-names = "extperiph1";
          mclk = "extperiph1";
          reset-gpios = <&tegra_main_gpio CAM2_RST_L GPIO_ACTIVE_LOW>;
          //reset-gpios = <&tegra_main_gpio CAM2_RST_L GPIO_ACTIVE_HIGH>;
          //vana-supply = <&en_vdd_cam_hv_2v8>;
          //vdig-supply = <&en_vdd_sys>;
          //dovdd-supply = <&en_vdd_cam>;
          //END

          devnode = "video2";
          compatible = "nvidia,imx219";
          reg = <0x10>;

          physical_w = "5.095";
          physical_h = "4.930";

          sensor_model ="imx219";
          avdd-reg = "vana";
          dvdd-reg = "vdig";
          iovdd-reg = "dovdd";

          mode0 { // IMX219_MODE_1920X1080
            mclk_khz = "24000";
            mclk_multiplier = "25";
            pix_clk_hz = "182400000";
            //pix_clk_hz = "170000000";

            num_lanes = "2";
            tegra_sinterface = "serial_e";
            discontinuous_clk = "yes";
            cil_settletime = "0";
            pixel_t = "bayer_rggb";
            readout_orientation = "270";
            inherent_gain = "1";

            active_w = "1920";
            active_h = "1080";

            line_length = "3448";
            dpcm_enable = "false";

            min_gain_val = "1";
            max_gain_val = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "64";
            min_framerate = "1";
            max_framerate = "30";
            min_exp_time = "11";
            max_exp_time = "683709";
            embedded_metadata_height = "0";
          };
          mode1 { // IMX219_MODE_1280X720
            mclk_khz = "24000";
            mclk_multiplier = "25";
            pix_clk_hz = "182400000";
            //pix_clk_hz = "170000000";

            num_lanes = "2";
            tegra_sinterface = "serial_e";
            discontinuous_clk = "yes";
            cil_settletime = "0";
            pixel_t = "bayer_rggb";
            readout_orientation = "270";
            inherent_gain = "1";

            active_w = "1280";
            active_h = "720";

            line_length = "3448";
            dpcm_enable = "false";
            //line_length = "1752";

            min_gain_val = "1";
            max_gain_val = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "64";
            min_framerate = "1";
            max_framerate = "60";
            //min_exp_time = "16";
            min_exp_time = "13";
            max_exp_time = "683709";
            embedded_metadata_height = "0";
          };
          mode2 { // IMX219_MODE_640X480

            mclk_khz = "24000";
            mclk_multiplier = "25.0";
            pix_clk_hz = "182400000";

            num_lanes = "2";
            tegra_sinterface = "serial_e";
            discontinuous_clk = "yes";
            cil_settletime = "0";
            pixel_t = "bayer_rggb";
            readout_orientation = "270";
            inherent_gain = "1";

            active_w = "640";
            active_h = "480";

            line_length = "3559";
            dpcm_enable = "false";

            min_gain_val = "1.0";
            max_gain_val = "16";
            min_hdr_ratio = "1";
            max_hdr_ratio = "64";
            min_framerate = "1";
            max_framerate = "90";
            //min_exp_time = "22";
            min_exp_time = "11";
 	 			  max_exp_time = "358733";
            embedded_metadata_height = "0";
          };

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

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


/* camera control gpio definitions */
/ {
	tegra-camera-platform {
    compatible = "nvidia, tegra-camera-platform";
    num_csi_lanes = <6>;
    max_lane_speed = <1500000>;
		max_pixel_rate = <750000>;
    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>;

    modules {
      module0 {
        status = "okay";
				//badge = "imx185_bottom_liimx185";
        //badge = "e3322_bottom_A815P2";
				badge = "e3326_bottom_P5V27C";
        position = "bottom";
        orientation = "0";
        drivernode0 {
          pcl_id = "v4l2_sensor";
          devname = "imx219 9-0010";
          proc-device-tree = "/proc/device-tree/host1x/i2c-camera-mux/i2c@0/imx219_a@10";
        };
      };
      module1 {
        status = "okay";
				//badge = "imx185_top_liimx185";
        //badge = "e3322_top_A815P2";
				badge = "e3326_top_P5V27C";
        position = "top";
        orientation = "1";
        drivernode0 {
          pcl_id = "v4l2_sensor";
          devname = "imx219 10-0010";
          proc-device-tree = "/proc/device-tree/host1x/i2c-camera-mux/i2c@1/imx219_c@10";
        };
      };
      module2 {
        status = "okay";
				//badge = "imx185_center_liimx185";
        //badge = "e3322_center_A815P2";
				badge = "e3326_center_P5V27C";
        position = "center";
        orientation = "1";
        drivernode0 {
          pcl_id = "v4l2_sensor";
          devname = "imx219 11-0010";
          proc-device-tree = "/proc/device-tree/host1x/i2c-camera-mux/i2c@2/imx219_e@10";
        };
      };
    };
  };
};

Sorry about all the comments I was running some experiments

Dave

@cospan
Could you dump below information to check.

ubuntu@tegra-ubuntu:~$ sudo media-ctl -p
[sudo] password for ubuntu:
Media controller API version 0.1.0

Media device information
------------------------
driver          tegra-vi4
model           NVIDIA Tegra Video Input Device
serial
bus info
hw revision     0x3
driver version  0.0.0

Device topology
- entity 1: vi-output, ov5693 30-0036 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "150c0000.nvcsi-0":1 [ENABLED]

- entity 2: vi-output, ov5693 31-0036 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video1
        pad0: Sink
                <- "150c0000.nvcsi-1":1 [ENABLED]

- entity 3: vi-output, ov5693 32-0036 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video2
        pad0: Sink
                <- "150c0000.nvcsi-2":1 [ENABLED]

- entity 4: vi-output, ov5693 33-0036 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video3
        pad0: Sink
                <- "150c0000.nvcsi-3":1 [ENABLED]

- entity 5: vi-output, ov5693 34-0036 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video4
        pad0: Sink
                <- "150c0000.nvcsi-4":1 [ENABLED]

- entity 6: vi-output, ov5693 35-0036 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video5
        pad0: Sink
                <- "150c0000.nvcsi-5":1 [ENABLED]

- entity 7: ov5693 35-0036 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev0
        pad0: Source
                [fmt:SRGGB10/2592x1944 field:none]
                -> "150c0000.nvcsi-5":0 [ENABLED]

- entity 8: ov5693 34-0036 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev1
        pad0: Source
                [fmt:SRGGB10/2592x1944 field:none]
                -> "150c0000.nvcsi-4":0 [ENABLED]

- entity 9: ov5693 33-0036 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev2
        pad0: Source
                [fmt:SRGGB10/2592x1944 field:none]
                -> "150c0000.nvcsi-3":0 [ENABLED]

- entity 10: ov5693 32-0036 (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev3
        pad0: Source
                [fmt:SRGGB10/2592x1944 field:none]
                -> "150c0000.nvcsi-2":0 [ENABLED]

- entity 11: 150c0000.nvcsi-5 (2 pads, 2 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev4
        pad0: Sink
                <- "ov5693 35-0036":0 [ENABLED]
        pad1: Source
                -> "vi-output, ov5693 35-0036":0 [ENABLED]

- entity 12: 150c0000.nvcsi-4 (2 pads, 2 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev5
        pad0: Sink
                <- "ov5693 34-0036":0 [ENABLED]
        pad1: Source
                -> "vi-output, ov5693 34-0036":0 [ENABLED]

- entity 13: 150c0000.nvcsi-3 (2 pads, 2 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev6
        pad0: Sink
                <- "ov5693 33-0036":0 [ENABLED]
        pad1: Source
                -> "vi-output, ov5693 33-0036":0 [ENABLED]

- entity 14: 150c0000.nvcsi-2 (2 pads, 2 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev7
        pad0: Sink
                <- "ov5693 32-0036":0 [ENABLED]
        pad1: Source
                -> "vi-output, ov5693 32-0036":0 [ENABLED]

- entity 15: 150c0000.nvcsi-1 (2 pads, 2 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev8
        pad0: Sink
                <- "ov5693 31-0036":0 [ENABLED]
        pad1: Source
                -> "vi-output, ov5693 31-0036":0 [ENABLED]

- entity 16: 150c0000.nvcsi-0 (2 pads, 2 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev9
        pad0: Sink
                <- "ov5693 30-0036":0 [ENABLED]
        pad1: Source
                -> "vi-output, ov5693 30-0036":0 [ENABLED]

- entity 17: ov5693 31-0036 (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev10
        pad0: Source
                [fmt:SRGGB10/2592x1944 field:none]
                -> "150c0000.nvcsi-1":0 [ENABLED]

- entity 18: ov5693 30-0036 (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev11
        pad0: Source
                [fmt:SRGGB10/2592x1944 field:none]
                -> "150c0000.nvcsi-0":0 [ENABLED]

@Shane

Thanks for looking into this. I’m working out of the office today, I’ll check this tomorrow and let you know.

Okay got it:

Media controller API version 0.1.0

Media device information
------------------------
driver          tegra-vi4
model           NVIDIA Tegra Video Input Device
serial          
bus info        
hw revision     0x3
driver version  0.0.0

Device topology
- entity 1: vi-output, imx219 9-0010 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "150c0000.nvcsi-0":1 [ENABLED]

- entity 2: vi-output, imx219 10-0010 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video1
	pad0: Sink
		<- "150c0000.nvcsi-2":1 [ENABLED]

- entity 3: vi-output, imx219 11-0010 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video2
	pad0: Sink
		<- "150c0000.nvcsi-4":1 [ENABLED]

- entity 4: 150c0000.nvcsi-4 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		<- "imx219 11-0010":0 [ENABLED]
	pad1: Source
		-> "vi-output, imx219 11-0010":0 [ENABLED]

- entity 5: 150c0000.nvcsi-2 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
	pad0: Sink
		<- "imx219 10-0010":0 [ENABLED]
	pad1: Source
		-> "vi-output, imx219 10-0010":0 [ENABLED]

- entity 6: 150c0000.nvcsi-0 (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev2
	pad0: Sink
		<- "imx219 9-0010":0 [ENABLED]
	pad1: Source
		-> "vi-output, imx219 9-0010":0 [ENABLED]

- entity 7: imx219 11-0010 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev3
	pad0: Source
		[fmt:SRGGB10/1920x1080 field:none]
		-> "150c0000.nvcsi-4":0 [ENABLED]

- entity 8: imx219 10-0010 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev4
	pad0: Source
		[fmt:SRGGB10/1920x1080 field:none]
		-> "150c0000.nvcsi-2":0 [ENABLED]

- entity 9: imx219 9-0010 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev5
	pad0: Source
		[fmt:SRGGB10/1920x1080 field:none]
		-> "150c0000.nvcsi-0":0 [ENABLED]

@cospan
From you dump everything looks well.
You can see the map like below not like you say #4

video0 → nvcsi-0(csia) → imx219 9-0010
video1 → nvcsi-2(csic) → imx219 10-0010
video2 → nvcsi-4(csie) → imx219 11-0010