Jetpack6 nvcsi link issue

Hi authors

My developing environment
・Module:Jetson orin nx 8G
・Carrier Board: Developer -kit
・Jetson Linux R36.4.3 / Jetson Linux R35.4.1

I am developing driver for my custom camera module.
My camera module composition below.

Cam0 port|—|Mux tca9546|—ch:1—|sensor_a@10
—ch:0—|power_ic

Under my jetson Linux R35.4.1 environment , custom developed driver & device tree works well.
So, I try to port device tree and device drivers in new R36.4.3 environment, but it doesn’t works it…
Device driver works as normal and tegra-capture-vi bind success, but media-pad link fail. Like below

Dmesg:

[ 9.312405] tegra-camrtc-capture-vi tegra-capture-vi: subdev sensor_a 16-0010 bound

Media ctrl link Fail & No /dev/video0 found

Media controller API version 5.15.148

Media device information

driver tegra-camrtc-ca
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 5.15.148

Device topology

  • entity 1: sensor_a 16-0010 (1 pad, 0 link)
    type V4L2 subdev subtype Sensor flags 0
    pad0: Source

So I checked this media link fail issue from dmesg, I found a cause which is seems to nvcsi issue from dmesg’s log.

dmesg:

[ 8.326267] platform 13e00000.host1x:nvcsi@15a00000: Fixing up cyclic dependency with 16-0010
[ 8.326284] platform 13e00000.host1x:nvcsi@15a00000: Fixing up cyclic dependency with tegra-capture-vi

I tested to change sensor node like below for check my device tree’s remote-endpoint setting .
When test device tree setted that node, media link construct success and find /dev/video0

Cam0 port|—|Mux tca9546|—ch:1—xx
—ch:0—|power_ic
|—|sensor_a@10

Questions:
・What reason do you think about media link fail cause at R36.4.3, when cam0 connect to sensor_a throug tca9546?
・I think this fail caused by device tree’s remote-endpoint issue (or graph.c driver isuue),how to fix it at R36.4.3?

Best regards.

hello Orinbeginner_xyz,

you may refer to developer guide, Camera Driver Porting.
please see-also Topic 310858 for known changes when porting DTS from JP-5 to JP-6.

Hello Jerrychang

Thank for your replay!
I already checked and corresponded JP5-JP6 changes.
I modified my custom device trees are based on “tegra234-camera-imx219.dtsi” , “tegra234-p3767-camera-p3768-imx219-dual.dts”.

Path Changes and modified like below

		fragment-camera@0 {
		target-path = "/";
		__overlay__ {
			tegra-capture-vi  {
				status="okay";
				num-channels = <2>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					vi_port0: port@0 {
						reg = <0>;
						sensor_a_vi_in0: endpoint {
							port-index = <1>;
							bus-width = <1>;
							remote-endpoint = <&sensor_a_csi_out0>;
						};
					};
					vi_port1: port@1 {
						reg = <1>;
						sensor_a_vi_in1: endpoint {
							port-index = <2>;
							bus-width = <1>;
							remote-endpoint = <&sensor_a_csi_out1>;
						};
					};
				};
			};

			bus@0 {
				host1x@13e00000 {
					nvcsi@15a00000 {
						status="okay";
						num-channels = <2>;
						#address-cells = <1>;
						#size-cells = <0>;
						csi_chan0: channel@0 {
							reg = <0>;
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								csi_chan0_port0: port@0 {
									reg = <0>;
									sensor_a_csi_in0: endpoint@0 {
										port-index = <1>;
										bus-width = <1>;
										remote-endpoint = <&sensor_a_out0>;
									};
								};
								csi_chan0_port1: port@1 {
									reg = <1>;
									sensor_a_csi_out0: endpoint@1 {
										remote-endpoint = <&sensor_a_vi_in0>;
									};
								};
							};
						};
						csi_chan1: channel@1 {
							reg = <1>;
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								csi_chan1_port0: port@0 {
									reg = <0>;
									sensor_a_csi_in1: endpoint@2 {
										port-index = <2>;
										bus-width = <1>;
										remote-endpoint = <&sensor_a_out1>;
									};
								};
								csi_chan1_port1: port@1 {
									reg = <1>;
									sensor_a_csi_out1: endpoint@3 {
										remote-endpoint = <&sensor_a_vi_in1>;
									};
								};
							};
						};
					};
				};
				cam_i2cmux {
					/* CAM PORT0 */
					i2c_0:i2c@0 {
						tca9546_a@70{
							/* Camera module MUX Channel:0 */
							cam_mod_i2c_a@0 {
							};
							/* Camera module MUX Channel:1 */
							cam_mod_i2c_a@1 {
								sensor_a_cam0: sensor_a_a@10 {
									compatible = "sony,sensor_a";
									/* I2C device address */
									reg = <0x10>;

									/* V4L2 device node location */
									devnode = "video0";
									mode0 { /* sensor_a mode_60fps */
										/*omitted*/
									};
									ports {
										#address-cells = <1>;
										#size-cells = <0>;
										port@0 {
											reg = <0>;
											sensor_a_out0: endpoint {
												port-index = <1>;
												bus-width = <1>;
												remote-endpoint = <&sensor_a_csi_in0>;
											};
										};
									};
								};
							};
						};
					};
					/* CAM PORT1 */
					i2c_1: i2c@1 {
						tca9546_c@70{
							/* Camera module MUX Channel:0 */
							cam_mod_i2c_c@0 {
							};
							/* Camera module MUX Channel:1 */
							cam_mod_i2c_c@1 {
								sensor_a_cam1: sensor_a_c@10 {
									compatible = "sony,sensor_a";
									/* I2C device address */
									reg = <0x10>;

									/* V4L2 device node location */
									devnode = "video1";
									mode0 { /* sensor_a_60fps */
										/*omitted*/
									};
									ports {
										#address-cells = <1>;
										#size-cells = <0>;
										port@0 {
											reg = <0>;
											sensor_a_out1: endpoint {
												port-index = <2>;
												bus-width = <1>;
												remote-endpoint = <&sensor_a_csi_in1>;
											};
										};
									};
								};
							};
						};
					};
				};				
			};

			tcp: tegra-camera-platform {
				compatible = "nvidia, tegra-camera-platform";
				modules {
					cam_module0: module0 {
						badge = "jakku_front_RBP194";
						position = "front";
						orientation = "1";
						cam_module0_drivernode0: drivernode0 {
							pcl_id = "v4l2_sensor";
							sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@0/tca9546_a@70/cam_mod_i2c_a@1/sensor_a_a@10";
						};
					};
					cam_module1: module1 {
						badge = "jakku_rear_RBP194";
						position = "rear";
						orientation = "1";
						cam_module1_drivernode0: drivernode0 {
							pcl_id = "v4l2_sensor";
							sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/tca9546_c@70/cam_mod_i2c_c@1/sensor_a_c@10";
						};
					};
				};
			};
		};
	};
};


In our case, Sensor node position is under cam_i2cmux and tca9546(mux), So I device tree modified .
But If sensor driver probing success, media bus ctrl path connections seems to fail and /dev/video0 is not created.

*media ctrl error

Media controller API version 5.15.148

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

Device topology
- entity 1: sensor_a 16-0010 (1 pad, 0 link)
            type V4L2 subdev subtype Sensor flags 0
pad0: Source

In JP6, dose sensor must put under cam_i2cmux?
If I want to put sensor node like below, how I should modify my device tree?

cam_i2cmux–i2c0@0–tca9546_a@70-cam_mod_i2c0@0–sensor_a@10

it’s also works without i2xmux.

your device topology looks incorrect, did you load the device tree overlay blob correctly?
please see-also r36.4.4 release note, see-also [4.1. Camera] and [4.2. Device Registration] section for more details.

Thank you for replay!

I will check release note and confirm my device tree node settings !

Is it incorrect way of build and applying a dtbo?
All i2c devices works well and enable to access these devices throw a i2c protocol.
But construction of media control path between sink and source are always failed.

[To build dtbo file]
I build as a overlay file “tegra234-p3767-camera-p3768-sensor_a-dual.dtbo” which is consist of “tegra234-p3767-camera-p3768-sensor_a-dual.dts” included with “tegra234-camera-sensor_a.dtsi”.
“tegra234-camera-sensor_a.dtsi” is a code shown you previous comment.

[Applying a dtbo file to jetson system]
I putted in to the /boot directory at that overlay file(.dtbo). And I activated that overlay file by a jetoson-io tool.
After that, I reboot jetson system entirely.

I confirm to that jetson-io tool add a new line in a jetson’s extlinux file, like below.

OVERLAYS /boot/tegra234-p3767-camera-p3768-sensor_a-dual.dtbo

hello Orinbeginner_xyz,

please also note that, You can specify FDT alone. You can specify FDT + OVERLAYS. You cannot do only OVERLAYS though.
Overlays from Rootfs are processed only if DTB is coming from Rootfs. when FDT entry is not present in extlinux.conf UEFI DTB is used.

Thank you for replay!

I tried some settings in my device-tree.

I found that when a sensor port node put under “cam_i2cmux/i2c@0/tca9456_a@70/mod_i2c@1/sensor_a@10” media-link between sensor ports and nvcsi must be failed some reason.
( Do not appear a device topology like that , “- entity 1: 13e00000.host1x:nvcsi@15a00000- (2 pads, 2 links”)
)

But it putted under “cam_i2cmux/i2c@0/sensor_a@10” , media link construction between sensor ports and nvcsi were always succeed.
( nvcsi media device topology appeared. )

I think ,It seems to can not track sensor port’s remote end point where is put under cam_i2cmux and tca9546 node by nvcsi driver or of_graph driver.

On the other hands, I2c bus node construction and connection with i2c protocol successes in a case which is under “cam_i2cmux/i2c@0/tca9456_a@70/mod_i2c@1/sensor_a@10”.

In “cam_i2cmux/i2c@0/tca9456_a@70/mod_i2c@1/sensor_a@10” case, How I should done succeed media link connection between nvcsi and sensor ports? Or is it my mistakes at device tree settings?

hello Orinbeginner_xyz,

please visit tutorials page for the training slides of Develop a V4L2 Sensor Driver.