Port indexing for a 4-lane input camera

I’m using the 4-lane #1 configuration (as described in the Table 47 of the TX2 Series OEM Product Design Guide) and I have some doubts of how to configure the device tree’s NVCSI and VI ports (based on the Port Index section of the Sensor Driver Programming Guide). I see that the CSI block does not support more than 2 lanes per port, so how would be the correct form of programming this?

I’ve thought in dividing the input into two i2c entries (CAM_A@24 and CAM_B@24), each of them with num_lanes = “2”;. Then, connect each of them to a NVCSI port, and then merge the output of both port outputs, to a single input port in the VI block. Would this be correct? Simplified, something like this:

@euskadi
You can reference to the E3333 dtsi to know the detail of two lanes configure for connect to CSIA and CSIB.

…/common/kernel-dts/t18x-common-modules/tegra186-camera-e3333-a00.dtsi

I took that as reference, but yet it is connected to 6 VI channels (NVCSI channel <-> VI channel). As my video source is only one, they’ll have to merge somewhere. Would it be possible to merge it as I depicted in the image of the post in a single channel of the VI block? Or they don’t need to be explicitly merged?

You can just reference to the first 2 and remove the others 4 from the dtb.

  1. Could you have below command to enable the kernel log for imx219 and check if the --sensor-id have any different.

sudo su
echo file imx219.c +p > /sys/kernel/debug/dynamic_debug/control

  1. check the extracted_proc.dts from below

    sudo apt-get update
    sudo apt-get install device-tree-compiler

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

Before flashing the image into the TX2, is the TCA9548 required if I use both stream channels in the VI block? Something like:

i2c@3180000{
	tca9548@77{
		i2c@0{
			cam_a@24{
				/****/
			}
			ports{
				port@0{
					/* TO VI STREAM CHANNEL 0 */
				}
			}
		}
		i2c@1{
			cam_b@24{
				/****/
			}
			ports{
				port@0{
					/* TO VI STREAM CHANNEL 1 */
				}
			}
		}
	}
}

It depend on your HW design. If your HW didn’t have it can connect to different i2c bus you need to modify it.

That makes sense. I thought it was integrated in the Jetson TX2 Devkit board.

Regarding the A and B channels, they still can go through the same i2c bus right? Differentiating them via tegra_sinterface parameter

i2c@3180000{
	cam_a@24{
		tegra_sinterface = "serial_a";
		/****/
	}
	ports{
		port@0{
			/* TO VI STREAM CHANNEL 0 */
		}
	}
	cam_b@24{
		tegra_sinterface = "serial_b";
		/****/
	}
	ports{
		port@0{
			/* TO VI STREAM CHANNEL 1 */
		}
	}
}

You can connect all of the to the same bus if the slave address not conflict.

But how do you manage then a 4-lane camera, with a single slave address, and without the I2C mux? It is connected to two interfaces (CSI_A and CSI_B). Is it possible?

How many sensors do you want to connect? If singel 4 lane camera configure that need connect to CSI_A and CSI_B

Just 1 sensor, which hardware is configured to send data through CSI_A and CSI_B (with CSI_A clock) as specified in the documentation. Anyway, as it is a single sensor, it has only one slave address. The solution proposed in comment #8 would be valid?

For a single sensor only you can reference to tegra186-camera-imx274-a00.dtsi
the csi-port and bus-width do the things. YOu should have a check the document for the details.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fcamera_dev.html%23

csi-port = <0>;
bus-width = <4>;