Cameras with ub960 on Xavier

I want to use cameras as follow:

cam0(vc=0) -->  |                             |
                |  UB960(4lane) --->CSI0 ---> |
cam1(vc=1) -->  |                             |
                                              |
                                              |--> Xavier
                                              |  
cam0(vc=0) -->  |                             |
                |  UB960(4lane) --->CSI1 ---> |
cam1(vc=1) -->  |                             |

But I’m not sure that what is the struct of the device tree. I make a brief device tree as follow:


		vi@15c10000 {
			...
			...
			ports {
				...
				port@0 {
					...
					cam_vi_in0: endpoint {
						vc-id = <0>;
						port-index = <0x0>;
						remote-endpoint = <&cam_csi_out0>;

					};
				};

				port@1 {
					...

					cam_vi_in1: endpoint {
						vc-id = <1>;
						port-index = <0x0>;
						remote-endpoint = <&cam_csi_out1>;

					};
				};

				port@2 {
					...
					cam_vi_in2: endpoint {
						vc-id = <0>;
						port-index = <0x2>;
						remote-endpoint = <&cam_csi_out2>;
					};
				};

				port@3 {
					...

					cam_vi_in3: endpoint {
						vc-id = <1>;
						port-index = <0x2>;
						remote-endpoint = <&cam_csi_out3>;
					};
				};
			};
		};
		
		
		
		nvcsi@15a00000 {

			channel@0 {

				ports {
					port@0 {

						cam_csi_in0: endpoint@0 {
							port-index = <0x0>;
							remote-endpoint = <&cam_out0>;
						};
					};

					port@1 {

						cam_csi_out0: endpoint@1 {
							port-index = <0x0>;
							remote-endpoint = <&cam_vi_in0>;
						};
					};
				};
			};

			channel@1 {

				ports {

					port@0 {

						cam_csi_in1: endpoint@2 {
							port-index = <0x0>;
							remote-endpoint = <&cam_out1>;
						};
					};

					port@1 {

						cam_csi_out1: endpoint@3 {
							port-index = <0x0>;
							remote-endpoint = <&cam_vi_in1>;
						};
					};
				};
			};

			channel@2 {

				ports {

					port@0 {

						cam_csi_in2: endpoint@4 {
							port-index = <0x2>;
							remote-endpoint = <&cam_out2>;
						};
					};

					port@1 {

						cam_csi_out2: endpoint@5 {
							port-index = <0x2>;
							remote-endpoint = <&cam_vi_in2>;
						};
					};
				};
			};

			channel@3 {

				ports {

					port@0 {

						cam_csi_in3: endpoint@6 {
							port-index = <0x2>;
							remote-endpoint = <&cam_out3>;
						};
					};

					port@1 {
						cam_csi_out3: endpoint@7 {
							port-index = <0x2>;
							remote-endpoint = <&cam_vi_in3>;
						};
					};
				};
			};
		};
		
	i2c@3180000 {	
		cam_a@40 {

			mode0 {
			...
			};

			ports {

				port@0 {
					cam_out0: endpoint {
						vc-id = <0>;
						port-index = <0x0>;
						remote-endpoint = <&cam_csi_in0>;
					};
				};
			};
		};
		
		cam_b@41 {
			...
			mode0 {
				...
			};
			ports {
				...
				port@0 {
					reg = <0x0>;
					cam_out1: endpoint {
						vc-id = <1>;
						port-index = <0x0>;
						remote-endpoint = <&cam_csi_in1>;

					};
				};
			};
		};
		cam_c@42 {
			...
			mode0 {
				...
			};
			ports {
				...
				port@0 {
					reg = <0x0>;
					cam_out2: endpoint {
						vc-id = <0>;
						port-index = <0x2>;
						remote-endpoint = <&cam_csi_in2>;

					};
				};
			};
		};
		cam_d@43 {
			...
			mode0 {
				...
			};
			ports {
				...
				port@0 {
					reg = <0x0>;
					cam_out3: endpoint {
						vc-id = <1>;
						port-index = <0x2>;
						remote-endpoint = <&cam_csi_in3>;

					};
				};
			};
		};
	}

Can this device tree work for me?
I am not sure about that the relation between physical CSI port and csi channel of device tree. So does VI module.

@ShaneCCC

If you want to use 4 lanes configure you need to connect first two cameras to csi0-csi1
and latest two cameras to csi2-csi3

my mistake, I will change the structure as follow, and my device tree is OK?

Yes, the port_index is correct.

OK, thanks, I’ll try it.