The configurations on Xavier platform about Camera

Hi teams

Our current hardware design about camera is Sensor+ DS933( Ti Ser) +DS960(Ti Des).
The MIPI output of DS960 is csi0. the design as below.
DS960 output side:

The cpu csi inside use 4 lanes ( CSI2+CSI3 combine)

the picture upload in reply 1

The driver model I used is based on imx185. Finally result, I want to use 4 sensors and 4 Virtual Channel. Current I just debug for one sensor. The sensor which I uesd is auto sync,so I did not need to set the isp and sensor imager. My driver is already probe normally. In the sys debug fs ,the dev directory is also exist /dev/video0. But it can not capture one frame.I am not sure if the csi port setting is right or not. Could you help me check it ? the device tree in the attachment documents

tegra194-camera-ti960.txt (9.4 KB)

BRs
thanks
Hope for your reply

The port-index in VI scope need the same with nvcsi scope.

		vi@15c10000 {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				status = "okay";
				port@0 {
					reg = <0>;
					status = "okay";
					atar231_vi_in0: endpoint {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&atar231_csi_out0>;
					};
				};
			};
		};

Hi ShaneCC

Thanks for your reply.

When I changed the port-index from "port-index = <0> to “port-index = <2>” ,in the sys fs directory,the /dev/video0 could not registered.

the device tree after I changed as below:

{
host1x {
	vi@15c10000 {
		num-channels = <1>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";
			port@0 {
				reg = <0>;
				status = "okay";
				atar231_vi_in0: endpoint {
					port-index = <2>;
					bus-width = <4>;
					remote-endpoint = <&atar231_csi_out0>;
				};
			};
		};
	};

	nvcsi@15a00000 {
		num-channels = <1>;
		#address-cells = <1>;
		#size-cells = <0>;
		channel@0 {
			reg = <0>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					atar231_csi_in0: endpoint@0 {
						status = "okay";
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&atar231_ar231_out0>;
					};
				};
				port@1 {
					reg = <1>;
					atar231_csi_out0: endpoint@1 {
						remote-endpoint = <&atar231_vi_in0>;
					};
				};
			};
		};
	};
};

I always have a doubt that Out hardware design use 4 lanes to pass the MIPI data.
But I did know how to bind the DS960 MIPI csi output port with xavier’s CSI2 and CSI3 port in the device tree. Fow now,we can see that the device tree only setting the csi2 port use “port-index = <2>”

My questions :

  1. How to setting the csi3 port based on our hardware design ?
  2. Why the /dev/video0 is not register after changed port-index value from 0 to 2 ?
    Could you help me check the device again ?

In addition, We can measure the MIPI signal output of DS960 CSI port with oscilloscope.

thanks
BRs

Change the port-index make the video registered failed not reasonable for me. Please confirm it again.
Please check the trace log if capture failed after you fixed the video node problem.
https://elinux.org/Jetson_TX2_Camera_BringUp

Have this command to capture.
v4l2-ctl --stream-mmap --set-ctrl bypass_mode=0 --stream-count=30 -d /dev/video0

Thanks.
We have check it again.
Do you have any Suggestions for the following questions?

  1. How to setting the csi3 port based on our hardware design ?
  2. Why the /dev/video0 is not register after changed port-index value from 0 to 2 ?

Thanks!

BR

No, as I said the csi port binding by device tree port-index property.
Have a check kernel message to check if can get more information.

Hi ShaneCCC

Now,I had a little confused.Our sensor is not need to set ISP.
Based on our hardware design FDLINK ( DS90UB933+DS90UB960 )
Which driver model should I used in xavier

the hardware flow as below:

You can reference to imx390 for virtual channel use case.
Even you don’t need internal ISP you still can have this driver as template to modify to match your design.

Hi ShaneCCC

thanks for your reply.
I have a question about virtual channels.In the file of tegra194-camera-imx390-a00.dtsi
There’s a piece of code about virtual channels

/ {
host1x {
	vi@15c10000 {
		num-channels = <2>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				imx390_vi_in0: endpoint {
					vc-id = <0>;  //virtual channel
					port-index = <0>; 
					bus-width = <2>;
					remote-endpoint = <&imx390_csi_out0>;
				};
			};

Base on our hardware design,combine the csi2 and csi3 as a four lanes. I has changed the “port-index = <2>” “bus-width = <4>”,But I don’t know which virtual channel ID corresponds to CSI2 and CSI3 Is there any document about it or Could you explain it for me?

BRs
thanks

For imx390 as example these two imx390 are both connect to CSI0 (CSIA) 2 lanes configure.
One imx390 output package include VCID=0 another output VCID=1.

For your case looks like not 4 lane configure? There have 4 sensors two connect ot CSI2 another two connect to CSI3 and both of them are two lane configure as imx390 reference board.

Hi ShaneCCC

thanks for your reply.
I am a quite new learner for Xavier.Could you help check my setting about my dtsi file
I had check the nvidia port setting.

  1. Based on your reply and my understanding about port,The four sensorshould be used as below setting, is it right or not ?

    sensorA----CSI-C-----VI 0
    sensorB----CSI-C-----VI 1
    sensorC----CSI-D-----VI 2
    sensorD----CSI-D-----VI 3

  2. In the vi@15c10000 dts property,there is vc-id setting,I think the four should be 0 1 2 3: In the properties of nvcsi@15a00000 ,about channel@N ,the reg=,the N should be fill with which value.

  3. About the sensor of imx390 property,it also include vc-id ,it is relate to the vc-id of vi@15c10000 ? what’s more,in the property of gmsl-link ,the “st-vc” and “vc-id” should be used which value ?

    4 I had moified a four sensor dtsi file,Could you help me have a look on it ?

four-sensor-imx390.txt (9.5 KB)

BRs
thanks
Hope for your reply.

Current software only support two VC each port. I think the bus-width should be 2 instead of 4 and camera C/D should be set port-index = 3 like below code.

If you want to support 4 lanes you should connect sensor A/B to CSI-C/D sensor C/D to CSI-E/F
Please have a check the design guide for much information. https://developer.nvidia.com/embedded/dlc/jetson-agx-xavier-series-camera-module-hardware-design-guide

/ {
	host1x {
		vi@15c10000 {
			num-channels = <4>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_vi_in0: endpoint {
						vc-id = <0>;
						port-index = <2>;
						bus-width = <2>;
						remote-endpoint = <&imx390_csi_out0>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_vi_in1: endpoint {
						vc-id = <1>;
						port-index = <2>;
						bus-width = <2>;
						remote-endpoint = <&imx390_csi_out1>;
					};
				};
				port@2 {
					reg = <2>;
					imx390_vi_in2: endpoint {
						vc-id = <0>;
						port-index = <3>;
						bus-width = <2>;
						remote-endpoint = <&imx390_csi_out2>;
					};
				};
				port@3 {
					reg = <3>;
					imx390_vi_in3: endpoint {
						vc-id = <1>;
						port-index = <3>;
						bus-width = <2>;
						remote-endpoint = <&imx390_csi_out3>;
					};
				};
			};
		};

Hi ShaneCCC

Thanks for you reply.

I still have a question,The reply#13 setting of device tree just use two VC id and bus-width is 2. Our practical methods are as follows:

the port-index use value 2 and 3 ,I can understand,
But the VC id only use 0 and 1,Is that enough ?
Can I use any two of the 16 virtual channel IDs, or is there a corresponding relationship between the virtual channel ID and the CSI port ?

thanks

Hi ShaneCCC

Sorry to confuse you
There is a problem with the data flow I described and the hardware design
The correctly data flow should be below:

The following dtsi file about “vc-id” and “port-index” is there any problem ?

four-sensor-imx390.txt (9.5 KB)

BRs
thanks

For your design you can have port-index as 2/3 for port@2/port@3

				port@2 {
					reg = <2>;
					imx390_vi_in2: endpoint {
						vc-id = <2>;
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&imx390_csi_out2>;
					};
				};
				port@3 {
					reg = <3>;
					imx390_vi_in3: endpoint {
						vc-id = <3>;
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&imx390_csi_out3>;
					};

Hi ShaneCCC

Thanks for your reply.
I still a little confused for some property.
The property which I mask “/the configure value is right or not/” is not sure.
it’s correct value. based on our 4 sensors input design.

	vi@15c10000 {
		num-channels = <4>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				imx390_vi_in0: endpoint {
					vc-id = <2>;   /*the configure value is right or not*/
					port-index = <2>;   /*the configure value is right or not*/
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out0>;
				};
			};
			port@1 {
				reg = <1>;
				imx390_vi_in1: endpoint {
					vc-id = <2>;   /*the configure value is right or not*/
					port-index = <2>;  /*the configure value is right or not*/
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out1>;
				};
			};
			port@2 {
				reg = <2>;
				imx390_vi_in2: endpoint {
					vc-id = <3>;  /*the configure value is right or not*/
					port-index = <3>;  /*the configure value is right or not*/
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out2>;
				};
			};
			port@3 {
				reg = <3>;
				imx390_vi_in3: endpoint {
					vc-id = <3>;   /*the configure value is right or not*/
					port-index = <3>;   /*the configure value is right or not*/
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out3>;
				};
			};
		};
	};

	nvcsi@15a00000 {
		num-channels = <4>;
		#address-cells = <1>;
		#size-cells = <0>;
		channel@0 {
			reg = <0>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_csi_in0: endpoint@0 {
						port-index = <2>;   /*the configure value is right or not*/
						bus-width = <4>;
						remote-endpoint = <&imx390_imx390_out0>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_csi_out0: endpoint@1 {
						remote-endpoint = <&imx390_vi_in0>;
					};
				};
			};
		};
		channel@1 {
			reg = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_csi_in1: endpoint@2 {
						port-index = <2>;    /*the configure value is right or not*/
						bus-width = <4>;
						remote-endpoint = <&imx390_imx390_out1>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_csi_out1: endpoint@3 {
						remote-endpoint = <&imx390_vi_in1>;
					};
				};
			};
		};
		channel@2 {
			reg = <2>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_csi_in2: endpoint@4 {
						port-index = <3>;   /*the configure value is right or not*/
						bus-width = <4>; 
						remote-endpoint = <&imx390_imx390_out2>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_csi_out2: endpoint@5 {
						remote-endpoint = <&imx390_vi_in2>;
					};
				};
			};
		};
		channel@3 {
			reg = <3>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_csi_in3: endpoint@2 {
						port-index = <3>;   /*the configure value is right or not*/
						bus-width = <4>;
						remote-endpoint = <&imx390_imx390_out3>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_csi_out3: endpoint@3 {
						remote-endpoint = <&imx390_vi_in3>;
					};
				};
			};
		};			
	};

Could your help check ti again ?

BRs
thanks

Not correct for your configure.
All of the port-index are 2 and all of the bus-width are 4
And the vc-id is from 0-3 for each port@x

Hi ShaneCCC,

Thank you very much for your replay!
According to your reply, I have revised the DTS file(as below),
please help us check if there is any mistake!

====
{
host1x {
vi@15c10000 {
num-channels = <0x4>;
ports {
port@0 {
reg = <0x0>;
TI954_vi_in0: endpoint {
vc-id = <0>;
port-index = <0x2>;
bus-width = <0x4>;
remote-endpoint = <&TI954_csi_out0>;
};
};
port@1 {
reg = <0x1>;
TI954_vi_in1: endpoint {
vc-id = <1>;
port-index = <0x2>;
bus-width = <0x4>;
remote-endpoint = <&TI954_csi_out1>;
};
};
port@2 {
reg = <0x2>;
TI954_vi_in2: endpoint {
vc-id = <2>;
port-index = <0x2>;
bus-width = <0x4>;
remote-endpoint = <&TI954_csi_out2>;
};
};
port@3 {
reg = <0x3>;
TI954_vi_in3: endpoint {
vc-id = <3>;
port-index = <0x2>;
bus-width = <0x4>;
remote-endpoint = <&TI954_csi_out3>;
};
};
};
};

    nvcsi@15a00000 {
        num-channels = <4>;
        channel@0 {
            reg = <0>;
            ports {
                port@0 {
                    reg = <0>;
                    vc-id = <0>;
                    TI954_csi_in0: endpoint@0 {
                        port-index = <0x2>;
                        bus-width = <4>;
                        remote-endpoint = <&TI954_out0>;
                    };
                };
                port@1 {
                    reg = <1>;
                    TI954_csi_out0: endpoint@1 {
                        remote-endpoint = <&TI954_vi_in0>;
                    };
                };
            };
        };
        channel@1 {
            reg = <1>;
            ports {
                port@0 {
                    reg = <0>;
                    vc-id = <1>;
                    TI954_csi_in1: endpoint@2 {
                        port-index = <0x2>;
                        bus-width = <4>;
                        remote-endpoint = <&TI954_out1>;
                    };
                };
                port@1 {
                    reg = <1>;
                    TI954_csi_out1: endpoint@3 {
                        remote-endpoint = <&TI954_vi_in1>;
                    };
                };
            };
        };
        channel@2 {
            reg = <2>;
            ports {
                port@0 {
                    reg = <0>;
                    vc-id = <2>;
                    TI954_csi_in2: endpoint@4 {
                        port-index = <0x2>;
                        bus-width = <4>;
                        remote-endpoint = <&TI954_out2>;
                    };
                };
                port@1 {
                    reg = <1>;
                    TI954_csi_out2: endpoint@5 {
                        remote-endpoint = <&TI954_vi_in2>;
                    };
                };
            };
        };
        channel@3 {
            reg = <3>;
            ports {
                port@0 {
                    reg = <0>;
                    vc-id = <3>;
                    TI954_csi_in3: endpoint@6 {
                        port-index = <0x2>;
                        bus-width = <4>;
                        remote-endpoint = <&TI954_out3>;
                    };
                };
                port@1 {
                    reg = <1>;
                    TI954_csi_out3: endpoint@7 {
                        remote-endpoint = <&TI954_vi_in3>;
                    };
                };
            };
        };
    };
};

i2c@31e0000 {

    TI954_a@18 {
        compatible = "BST,ar0231";
        ...
        devnode = "video0";
		
        mode0 {
            ....
            num_lanes = "2";
            tegra_sinterface = "serial_a";
            phy_mode = "DPHY";
			vc_id = "0";
        };
        ports {
            port@0 {
                reg = <0x0>;
                TI954_out0: endpoint {
                    vc-id = <0>;
                    port-index = <0x2>;
                    bus-width = <0x4>;
                    remote-endpoint = <&TI954_csi_in0>;
                };
            };
        };
    };

    TI954_b@19 {
        compatible = "BST,ar0231";
        ...
        devnode = "video1";

        mode0 {
            num_lanes = "2";
            tegra_sinterface = "serial_b";
            phy_mode = "DPHY";
			vc_id = "1";
        };
        ports {
            port@0 {
                reg = <0x0>;
                TI954_out1: endpoint {
                    vc-id = <1>;
                    port-index = <0x2>;
                    bus-width = <0x4>;
                    remote-endpoint = <&TI954_csi_in1>;
                };
            };
        };
    };
    TI954_c@20 {
        compatible = "BST,ar0231";
        ...
        devnode = "video2";

        mode0 {
            num_lanes = "2";
            tegra_sinterface = "serial_c";
            phy_mode = "DPHY";
			vc_id = "2";
			...
        };
        ports {
            port@0 {
                reg = <0x0>;
                TI954_out2: endpoint {
                    vc-id = <2>;
                    port-index = <0x2>;
                    bus-width = <0x4>;
                    remote-endpoint = <&TI954_csi_in2>;
                };
            };
        };
    };
TI954_d@21 {
        compatible = "BST,ar0231";
        devnode = "video3";
        ...
        mode0 {
            num_lanes = "2";
            tegra_sinterface = "serial_d";
            phy_mode = "DPHY";
			vc_id = "3";
        };
        ports {
            port@0 {
                reg = <0x0>;
                TI954_out3: endpoint {
                    vc-id = <3>;
                    port-index = <0x2>;
                    bus-width = <0x4>;
                    remote-endpoint = <&TI954_csi_in3>;
                };
            };
        };
    };
};

tegra-camera-platform {
    compatible = "nvidia, tegra-camera-platform";
    num_csi_lanes = <4>;
    ...

    modules {
        module0 {
            badge = "TI954_front_ar0231";
            position = "front";
            orientation = "1";
            status = "okay";
            drivernode0 {
                pcl_id = "v4l2_sensor";
                devname = "TI954 8-0018";
                proc-device-tree = "/proc/device-tree/i2c@31e0000/TI954_a@18";
                status = "okay";
            };
        };
        module1 {
            badge = "TI954_rear_ar0231";
            position = "rear";
            orientation = "0";
            status = "okay";
            drivernode0 {
                pcl_id = "v4l2_sensor";
                devname = "TI954 8-0019";
                proc-device-tree = "/proc/device-tree/i2c@31e0000/TI954_b@19";
                status = "okay";
            };
        };
        module2 {
            badge = "TI954_left_ar0231";
            position = "front";
            orientation = "1";
            status = "okay";
            drivernode0 {
                pcl_id = "v4l2_sensor";
                devname = "TI954 8-0020";
                proc-device-tree = "/proc/device-tree/i2c@31e0000/TI954_c@20";
                status = "okay";
            };
        };
        module3 {
            badge = "TI954_right_ar0231";
            position = "rear";
            orientation = "0";
            status = "okay";
            drivernode0 {
                pcl_id = "v4l2_sensor";
                devname = "TI954 8-0021";
                proc-device-tree = "/proc/device-tree/i2c@31e0000/TI954_d@21";
                status = "okay";
            };
        };
    };
};

};

Thanks!

BR,

1 Like

Looks much reasonable now.