TC358743 HDMI-to-CSI Bridge: CAM1 Works, CAM0 Timeout on Jetson Orin NX (JetPack 6.1)

Environment

  • Platform: Jetson Orin NX with Xavier carrier board
  • JetPack Version: 6.1 (L4T r36.x)
  • Kernel: 5.15.148-tegra
  • Bridge Chip: Toshiba TC358743 HDMI-to-CSI-2

Problem Summary

We have successfully ported the TC358743 driver from JetPack 5 to JetPack 6.1. The bridge works perfectly on CAM1 connector (csi_port=0), but fails with timeout errors on CAM0 connector (csi_port=2), even though both use the same hardware bridge and identical driver configuration.

Working Configuration (CAM1 - csi_port=0)

When the TC358743 bridge is connected to CAM1, we get frames (with some correctable errors):

[   62.277587] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 18432, flags: 0, err_data 512
[   62.744253] tc358743 10-000f: Calling tc358743_s_stream - start of attempt 
[   62.744258] tc358743 10-000f: enable_stream: enable
[   62.745245]   jc- csi5_stop_streaming: csi5 csi_pt=0, st_id=0, vc_id=0, pg_mode=0x0

Key observations for CAM1:

  • csi_pt=0, st_id=0 (csi_port=0)
  • Frames are coming through (corr_err indicates data is being received)
  • I2C communication successful (tc358743 10-000f)

Failing Configuration (CAM0 - csi_port=2)

When the same TC358743 bridge is connected to CAM0, we get timeout errors with no data:

[  393.536850] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- DEBUG csi5_start_streaming: port_idx=0
[  393.536858] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- DEBUG port->csi_port=2, port->stream_id=0
[  393.536861] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- DEBUG port->lanes=2, port->virtual_channel_id=0
[  393.536863]   jc- csi5  csi5_start_streaming:  csi_pt=2, st_id=2, vc_id=0, pg_mode=0x0
[  393.536866]   jc- csi5  csi5_stream_set_config: stream_id=2, csi_port=2
[  393.536878] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- lane_polarity BEFORE fix: 0, csi_port: 2
[  393.536881] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- lane_polarity AFTER fix: 6
[  393.536885] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- brick_config.lane_polarity[0-3]: 0 1 1 0 (raw value: 6)
[  393.536890] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- using hardcode 5940
[  393.536892] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- mipi_clock_rate is : 297000
[  393.537215] tc358743 9-000f: Calling tc358743_s_stream - start of attempt 
[  393.537218] tc358743 9-000f: enable_stream: enable
[  396.249301] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : uncorr_err: request timed out after 2500 ms
[  396.249322] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel

Key observations for CAM0:

  • csi_pt=2, st_id=2 (csi_port=2)
  • Timeout error - no data received at all
  • I2C communication successful (tc358743 9-000f)
  • Same lane_polarity=6 applied
  • Same mipi_clock_rate=297000

HDMI Signal Verification

HDMI signal is properly detected on CAM0:

$ v4l2-ctl -d /dev/video0 --query-dv-timings
	Active width: 1920
	Active height: 1080
	Total width: 2200
	Total height: 1125
	Frame format: progressive
	Pixelclock: 148500000 Hz (60.00 frames per second)

Driver Modifications (csi5_fops.c)

We modified csi5_fops.c to hardcode lane_polarity for TC358743:

/* Lane polarity fix based on physical CSI port */
dev_err(csi->dev, "   X-- lane_polarity BEFORE fix: %d, csi_port: %d\n", lane_polarity, csi_port);

if (csi_port == 0 || csi_port == 2) {
    lane_polarity = 6;
}

dev_err(csi->dev, "   X-- lane_polarity AFTER fix: %d\n", lane_polarity);

Device Tree Configuration (tc358743.dts)

tegra-capture-vi {
    num-channels = <2>;
    ports {
        vi_port0: port@0 {
            reg = <0>;
            toshiba_tc358743_vi_in0: endpoint {
                port-index = <0>;  /* CAM0 */
                bus-width = <2>;
            };
        };
        vi_port1: port@1 {
            reg = <1>;
            toshiba_tc358743_vi_in1: endpoint {
                port-index = <2>;  /* CAM1 */
                bus-width = <2>;
            };
        };
    };
};

/* CAM0 configuration */
tc358743_cam0: toshiba_tc358743_a@0f {
    tegra_sinterface = "serial_a";
    num_lanes = "2";
    /* ... */
    ports {
        port@0 {
            toshiba_tc358743_out0: endpoint {
                port-index = <0>;
                bus-width = <2>;
                data-lanes = <1 2>;
            };
        };
    };
};

/* CAM1 configuration */
tc358743_cam1: toshiba_tc358743_c@0f {
    tegra_sinterface = "serial_c";
    num_lanes = "2";
    /* ... */
    ports {
        port@0 {
            toshiba_tc358743_out1: endpoint {
                port-index = <2>;
                bus-width = <2>;
                data-lanes = <1 2>;
            };
        };
    };
};

What I’ve Tried

  1. Lane polarity fix (lane_polarity=6) - works for CAM1, not for CAM0
  2. Verified I2C communication works on both ports
  3. Verified HDMI signal detection on both ports
  4. mipi_clock_rate hardcoded to 297000 kHz
  5. Device tree port-index configuration matching JetPack 5

Questions

  1. Why does csi_port=0 (CAM1) work but csi_port=2 (CAM0) times out with identical configuration?

  2. Does csi_port=2 (Brick B/serial_c) require different lane_polarity than csi_port=0 (Brick A/serial_a)? We tried lane_polarity=6 for both, but only CAM1 works.

  3. Is there any Orin NX hardware-level difference between CSI port 0 and port 2 that we need to account for?

  4. Are there any additional NVCSI/VI configurations needed for csi_port=2 that differ from csi_port=0?

Any guidance would be greatly appreciated. I can provide additional logs or test different configurations as needed. (what is the lane polarity of cam0)

*** Please note that this reply is generated by LLM automatically ***

Based on the provided context, the issue seems to be related to the lane polarity configuration for the TC358743 bridge on the CAM0 connector (csiport2). The same driver configuration and hardware bridge work perfectly on the CAM1 connector (csiport0), but fail with timeout errors on CAM0.

The key observations for CAM0 (csiport2) are:

  • No data is received at all
  • I2C communication is successful (tc358743 @ 9000f)
  • Same lane polarity (lanepolarity6) is applied as for CAM1
  • Same mipi clock rate (297000 kHz) is hardcoded

The question is asking for guidance on why the lane polarity fix (lanepolarity6) works for CAM1 but not for CAM0.

Unfortunately, the provided context does not explicitly mention the lane polarity of CAM0. However, it can be inferred that the lane polarity of CAM0 is different from CAM1, as the same configuration (lanepolarity6) works for CAM1 but not for CAM0.

To resolve this issue, it is recommended to verify the lane polarity configuration for CAM0 and adjust it accordingly. The device tree configuration (tc358743.dts) and the driver modifications (csi5fopsc) should be reviewed to ensure that the correct lane polarity is applied for CAM0.

Additionally, it may be helpful to provide additional logs or test different configurations to further troubleshoot the issue. The mipi clock rate and I2C communication should also be verified to ensure that they are correct and consistent for both CAM0 and CAM1.

In summary, the lane polarity of CAM0 is likely different from CAM1, and adjusting the lane polarity configuration for CAM0 may resolve the issue. However, without explicit information on the lane polarity of CAM0, it is difficult to provide a definitive answer.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

The csi_port=2

Should set the lane_polarity = 0

// SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

/dts-v1/;
/plugin/;

#define CAM0_RST        TEGRA234_MAIN_GPIO(H, 3)
#define CAM0_PWDN       TEGRA234_MAIN_GPIO(H, 6)
#define CAM1_PWDN       TEGRA234_MAIN_GPIO(AC, 0)
#define CAM_I2C_MUX     TEGRA234_AON_GPIO(CC, 3)

#include <dt-bindings/clock/tegra234-clock.h>
#include <dt-bindings/gpio/tegra234-gpio.h>
#include <dt-bindings/tegra234-p3767-0000-common.h>

/ {
	overlay-name = "Camera TC358743";
	jetson-header-name = "Jetson 24pin CSI Connector";
	compatible = JETSON_COMPATIBLE_P3768;

	fragment-camera@0 {
		target-path = "/";
		__overlay__ {
			tegra-capture-vi  {
				num-channels = <2>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					vi_port0: port@0 {
						reg = <0>;
						toshiba_tc358743_vi_in0: endpoint {
							port-index = <0>;
							bus-width = <2>;
							remote-endpoint = <&toshiba_tc358743_csi_out0>;
						};
					};
					vi_port1: port@1 {
						reg = <1>;
						toshiba_tc358743_vi_in1: endpoint {
							port-index = <2>;
							bus-width = <2>;
							remote-endpoint = <&toshiba_tc358743_csi_out1>;
						};
					};
				};
			};

			bus@0 {
				host1x@13e00000 {
					nvcsi@15a00000 {
						num-channels = <2>;
						#address-cells = <1>;
						#size-cells = <0>;
						csi_chan0: channel@0 {
							status = "okay";
							reg = <0>;
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								csi_chan0_port0: port@0 {
									status = "okay";
									reg = <0>;
									toshiba_tc358743_csi_in0: endpoint@0 {
										status = "okay";
										port-index = <0>;
										bus-width = <2>;
										remote-endpoint = <&toshiba_tc358743_out0>;
									};
								};
								csi_chan0_port1: port@1 {
									status = "okay";
									reg = <1>;
									toshiba_tc358743_csi_out0: endpoint@1 {
										status = "okay";
										remote-endpoint = <&toshiba_tc358743_vi_in0>;
									};
								};
							};
							
						};
						csi_chan1: channel@1 {
							status = "okay";
							reg = <1>;
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								csi_chan1_port0: port@0 {
									status = "okay";
									reg = <0>;
									toshiba_tc358743_csi_in1: endpoint@2 {
										status = "okay";
										port-index = <2>;
										bus-width = <2>;
										remote-endpoint = <&toshiba_tc358743_out1>;
									};
								};
								csi_chan1_port1: port@1 {
									reg = <1>;
									status = "okay";
									toshiba_tc358743_csi_out1: endpoint@3 {
										status = "okay";
										remote-endpoint = <&toshiba_tc358743_vi_in1>;
									};
								};
							};
						};
					};
				};
				cam_i2cmux {
					status = "okay";
					compatible = "i2c-mux-gpio";
					#address-cells = <1>;
					#size-cells = <0>;
					i2c-parent = <&cam_i2c>;
					mux-gpios = <&gpio_aon CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
					i2c_0:i2c@0 {
						status = "okay";
						reg = <0>;
						tc358743_cam0: toshiba_tc358743_a@0f {
                            				reset-gpios = <&gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
							status = "okay";
							compatible = "toshiba,tc358743";
							reg = <0x0f>;

							devnode = "video0";
							refclk_hz = <27000000>;
							refclk = <27000000>;
							clock-names = "refclk";
							clock-frequency = <27000000>;
							/* Physical dimensions of sensor */
							physical_w = "3.680";
							physical_h = "2.760";
							sensor_model = "tc358743";
							use_sensor_mode_id = "true";

							//HD num_lanes = "4";
							num_lanes = "2";
							tegra_sinterface = "serial_a";
							phy_mode = "DPHY";
							discontinuous_clk = "no";
							lane_polarity = "6"; 	// dose not do anything

							ddc5v_delay = <2>;
							enable_hdcp = "false";
							lineinitcnt = <0xe80>;
							lptxtimecnt = <0x003>;
							tclk_headercnt = <0x1403>;
							tclk_trailcnt = <0x00>;
							ths_headercnt = <0x0103>;
							twakeup = <0x4882>;
							tclk_postcnt = <0x008>;
							ths_trailcnt = <0x02>;
							hstxvregcnt = <0x0>;
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								port@0 {
									reg = <0>;
									toshiba_tc358743_out0: endpoint {
										port-index = <0>;

										bus-width = <2>;
										phy_mode = "DPHY";
										cil_settletime = "20";


										data-lanes = <1 2>;

										clock-lanes = <0>;
										clock-noncontinuous;
										link-frequencies = /bits/ 64 <297000000>;
										remote-endpoint = <&toshiba_tc358743_csi_in0>;
									};
								};
							};
						};
					};
					i2c_1: i2c@1 {
						status = "okay";
						reg = <1>;
						tc358743_cam1: toshiba_tc358743_c@0f {
                            				reset-gpios = <&gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
							status = "okay";
							compatible = "toshiba,tc358743";
							/* I2C device address */
							reg = <0x0f>;
							/* V4L2 device node location */
							devnode = "video1";
							refclk_hz = <27000000>;  // refclk_hz -> regclk
							refclk = <27000000>;  // refclk_hz -> regclk
							/* Physical dimensions of sensor */
							physical_w = "3.680";
							physical_h = "2.760";
							sensor_model = "tc358743";
							use_sensor_mode_id = "true";

							//HD num_lanes = "4";
							num_lanes = "2";
							tegra_sinterface = "serial_c";	// just a guess from imx477
							phy_mode = "DPHY";
							discontinuous_clk = "no";
							lane_polarity = "6";

							ddc5v_delay = <2>;
							enable_hdcp = "false";
							lineinitcnt = <0xe80>;
							lptxtimecnt = <0x003>;
                            				tclk_headercnt = <0x1403>;
							tclk_trailcnt = <0x00>;
							ths_headercnt = <0x0103>;
							twakeup = <0x4882>;
							tclk_postcnt = <0x008>;
							ths_trailcnt = <0x02>;
							hstxvregcnt = <0x0>;
							ports {
								#address-cells = <1>;
								#size-cells = <0>;
								port@0 {
									reg = <0>;
									toshiba_tc358743_out1: endpoint {
										port-index = <2>;
										//HD bus-width = <4>;
										bus-width = <2>;


										//HD use all four
										//data-lanes = <1 2 3 4>;
										data-lanes = <1 2>;
										clock-lanes = <0>;
										clock-noncontinuous;
										link-frequencies = /bits/ 64 <297000000>;
										remote-endpoint = <&toshiba_tc358743_csi_in1>;
									};
								};
							};
						};
					};
				};
			
			};
			

			tcp: tegra-camera-platform {
				status = "okay";
				compatible = "nvidia, tegra-camera-platform";

				num_csi_lanes = <4>;
				max_lane_speed = <2500000>;
				min_bits_per_pixel = <10>;
				vi_peak_byte_per_pixel = <2>;
				vi_bw_margin_pct = <25>;
				max_pixel_rate = <7500000>;
				isp_peak_byte_per_pixel = <5>;
				isp_bw_margin_pct = <25>;
				/**
				 * The general guideline for naming badge_info contains 3 parts, and is as follows,
				 * The first part is the camera_board_id for the module; if the module is in a FFD
				 * platform, then use the platform name for this part.
				 * The second part contains the position of the module, ex. "rear" or "front".
				 * The third part contains the last 6 characters of a part number which is found
				 * in the module's specsheet from the vendor.
				 */
				modules {
					cam_module0: module0 {
						badge = "jakku_front_TOSHIBA";
						position = "front";
						orientation = "1";
						cam_module0_drivernode0: drivernode0 {
							status = "okay";
							pcl_id = "v4l2_sensor";
							sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@0/toshiba_tc358743_a@0f";
						};
					};
					cam_module1: module1 {
						badge = "jakku_rear_TOSHIBA";
						position = "rear";
						orientation = "1";
						cam_module1_drivernode0: drivernode0 {
							status = "okay";
							pcl_id = "v4l2_sensor";
							sysfs-device-tree = "/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/toshiba_tc358743_c@0f";
						};

					};
				};
			};
		};
	};
};

my dts file here. I tried what you said. I saw in the log same (also I have timed out error)

[Mon Jan 12 02:10:38 2026] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : uncorr_err: request timed out after 2500 ms
[Mon Jan 12 02:10:38 2026] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[Mon Jan 12 02:10:38 2026] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[Mon Jan 12 02:10:38 2026] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : vi5_capture_dequeue : before vi_capture_status 

Actually I changed the tc358743.c files some lines also csi_fops.c. but everything works with cam1. (Not working cam0)

  • How can I resolve this error?
  • Where should I look to debug and fix it?
  • Could this issue be related to something other than lane polarity and csi_port?
  • Is there any other log or debug output you would like me to share?

Get the trace log to get more information.

echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 3 > /sys/kernel/debug/camrtc/log-level
echo 1 > /sys/kernel/debug/tracing/events/camera_common/enable
echo > /sys/kernel/debug/tracing/trace

v4l2-ctl --stream-mmap -c bypass_mode=0

cat /sys/kernel/debug/tracing/trace
$ v4l2-ctl --stream-mmap -c bypass_mode=0
New timings found

When I runned this command I see the logs below

[ 1094.630297] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : uncorr_err: request timed out after 2500 ms
[ 1094.630321] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 1094.631599] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 1094.631613] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : vi5_capture_dequeue : before vi_capture_status 
[ 1094.631616]   jc- in vi_capture_status 
[ 1094.631618]   jc- in vi_capture_status : capture initialized 
[ 1094.631619]   jc- in vi_capture_status : valid channel ID found 
[ 1094.631620]   jc- in vi_capture_status : after wait timeout...
[ 1097.186286] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : uncorr_err: request timed out after 2500 ms
[ 1097.186310] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 1097.187490] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 1097.187502] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : vi5_capture_dequeue : before vi_capture_status 
[ 1097.187504]   jc- in vi_capture_status 
[ 1097.187505]   jc- in vi_capture_status : capture initialized 
[ 1097.187506]   jc- in vi_capture_status : valid channel ID found 

The other command

$ sudo cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 42/42   #P:8
#
#                                _-------=> irqs-off
#                               / _------=> need-resched
#                              | / _-----=> need-resched-lazy
#                              || / _----=> hardirq/softirq
#                              ||| / _---=> preempt-depth
#                              |||| / _--=> preempt-lazy-depth
#                              ||||| / _-=> migrate-disable
#                              |||||| /     delay
#           TASK-PID     CPU#  |||||||  TIMESTAMP  FUNCTION
#              | |         |   |||||||      |         |
        v4l2-ctl-86208   [001] .......  1410.083224: tegra_channel_open: vi-output, tc358743 9-000f
        v4l2-ctl-86208   [001] .......  1410.104354: tegra_channel_set_power: tc358743 9-000f : 0x1
        v4l2-ctl-86208   [001] .......  1410.104365: tegra_channel_set_power: 13e00000.host1x:nvcsi@15a00000- : 0x1
        v4l2-ctl-86208   [001] .......  1410.104368: csi_s_power: enable : 0x1
        v4l2-ctl-86208   [001] .......  1410.104987: tegra_channel_capture_setup: vnc_id 0 W 1280 H 720 fmt 9
 vi-output, tc35-86209   [001] .......  1410.116533: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1410.116537: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1410.116537: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1410.116538: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
        v4l2-ctl-86208   [002] .......  1410.116566: tegra_channel_set_stream: enable : 0x1
        v4l2-ctl-86208   [002] .......  1410.119919: tegra_channel_set_stream: 13e00000.host1x:nvcsi@15a00000- : 0x1
        v4l2-ctl-86208   [002] .......  1410.119922: csi_s_stream: enable : 0x1
        v4l2-ctl-86208   [001] .......  1410.120277: tegra_channel_set_stream: tc358743 9-000f : 0x1
 vi-output, tc35-86210   [000] .......  1412.835387: tegra_channel_capture_setup: vnc_id 0 W 1280 H 720 fmt 9
 vi-output, tc35-86209   [001] .......  1412.835508: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1412.835516: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1412.835517: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1412.835518: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86210   [003] .......  1415.395385: tegra_channel_capture_setup: vnc_id 0 W 1280 H 720 fmt 9
 vi-output, tc35-86209   [001] .......  1415.395521: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1415.395532: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1415.395534: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1415.395535: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86210   [003] .......  1417.955395: tegra_channel_capture_setup: vnc_id 0 W 1280 H 720 fmt 9
 vi-output, tc35-86209   [001] .......  1417.955505: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1417.955514: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1417.955516: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [001] .......  1417.955517: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86210   [000] .......  1420.519387: tegra_channel_capture_setup: vnc_id 0 W 1280 H 720 fmt 9
 vi-output, tc35-86209   [003] .......  1420.519506: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [003] .......  1420.519514: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [003] .......  1420.519516: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
 vi-output, tc35-86209   [003] .......  1420.519517: vi_task_submit: class_id:48 ch:0 syncpt_id:1 syncpt_thresh:0 pid:86209 tid:86209
        v4l2-ctl-86208   [002] .......  1421.877755: tegra_channel_close: vi-output, tc358743 9-000f
 vi-output, tc35-86210   [003] .......  1423.043369: tegra_channel_capture_setup: vnc_id 0 W 1280 H 720 fmt 9
        v4l2-ctl-86208   [002] .......  1423.043486: tegra_channel_set_stream: enable : 0x0
        v4l2-ctl-86208   [002] .......  1423.043488: tegra_channel_set_stream: tc358743 9-000f : 0x0
        v4l2-ctl-86208   [002] .......  1423.044555: tegra_channel_set_stream: 13e00000.host1x:nvcsi@15a00000- : 0x0
        v4l2-ctl-86208   [002] .......  1423.044558: csi_s_stream: enable : 0x0
        v4l2-ctl-86208   [000] .......  1423.048324: tegra_channel_set_power: tc358743 9-000f : 0x0
        v4l2-ctl-86208   [000] .......  1423.048336: tegra_channel_set_power: 13e00000.host1x:nvcsi@15a00000- : 0x0
        v4l2-ctl-86208   [000] .......  1423.048338: csi_s_power: enable : 0x0

Before running these commands, I cleared the kernel log with sudo dmesg -C. After that, I saved the log below in the file.
log.txt (18.7 KB)

trace_pipe.txt (7.6 KB)

From the log looks like NVCSI/VI didn’t receive any data from the device.

You may need probe the output signal by scope for both CAM0/CAM1 to compare if any different.

Thanks

Actually, I want to use the one camera only with the CAM0 CSI port. How can I route or forward it from CAM1 to CAM0 (when connect it to the cam0 csi port it should work as cam1)? Is it enough to change the DTS file, or are there other changes required?

Hello @37yavuzhamza

Is the device tree from this reply the one that you are currently using? Or could you please share the full updated device tree file?

Regards!
Eduardo Salazar
Embedded SW Engineer at RidgeRun

Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

yes I am currently using this dts.

Thanks for response! I could not solve this issue. and i don’t know what should I look. So shared the whole logs for cam0 and cam1 csi port.
cam0_log.txt (113.1 KB)
cam1_log.txt (130.5 KB)

the other output for cam1 and cam0

CAM0:

$ sudo media-ctl -p -d /dev/media0
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: 13e00000.host1x:nvcsi@15a00000- (2 pads, 0 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
	pad1: Source

- entity 4: 13e00000.host1x:nvcsi@15a00000- (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
	pad0: Sink
		<- "tc358743 9-000f":0 [ENABLED]
	pad1: Source
		-> "vi-output, tc358743 9-000f":0 [ENABLED]

- entity 7: tc358743 9-000f (1 pad, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev2
	pad0: Source
		[fmt:UYVY8_1X16/1280x720 field:none colorspace:smpte170m]
		[dv.caps:BT.656/1120 min:1x1@0 max:10000x10000@165000000 stds:CEA-861,DMT,CVT,GTF caps:progressive,reduced-blanking,custom]
		[dv.detect:BT.656/1120 1280x720p50 (1980x750) stds: flags:]
		[dv.current:BT.656/1120 1280x720p50 (1980x750) stds: flags:]
		-> "13e00000.host1x:nvcsi@15a00000-":0 [ENABLED]

- entity 9: vi-output, tc358743 9-000f (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "13e00000.host1x:nvcsi@15a00000-":1 [ENABLED]
$ sudo cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 0/0   #P:8
#
#                                _-------=> irqs-off
#                               / _------=> need-resched
#                              | / _-----=> need-resched-lazy
#                              || / _----=> hardirq/softirq
#                              ||| / _---=> preempt-depth
#                              |||| / _--=> preempt-lazy-depth
#                              ||||| / _-=> migrate-disable
#                              |||||| /     delay
#           TASK-PID     CPU#  |||||||  TIMESTAMP  FUNCTION
#              | |         |   |||||||      |         |
$ sudo i2cdetect -y -r 9
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- UU 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 
$ sudo i2cdetect -y -r 10
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 

CAM1:

$ sudo media-ctl -p -d /dev/media0
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: 13e00000.host1x:nvcsi@15a00000- (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		<- "tc358743 10-000f":0 [ENABLED]
	pad1: Source
		-> "vi-output, tc358743 10-000f":0 [ENABLED]

- entity 4: 13e00000.host1x:nvcsi@15a00000- (2 pads, 0 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev1
	pad0: Sink
	pad1: Source

- entity 7: tc358743 10-000f (1 pad, 1 link)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev2
	pad0: Source
		[fmt:UYVY8_1X16/1280x720 field:none colorspace:smpte170m]
		[dv.caps:BT.656/1120 min:1x1@0 max:10000x10000@165000000 stds:CEA-861,DMT,CVT,GTF caps:progressive,reduced-blanking,custom]
		[dv.detect:BT.656/1120 1280x720p50 (1980x750) stds: flags:]
		[dv.current:BT.656/1120 1280x720p50 (1980x750) stds: flags:]
		-> "13e00000.host1x:nvcsi@15a00000-":0 [ENABLED]

- entity 9: vi-output, tc358743 10-000f (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
	pad0: Sink
		<- "13e00000.host1x:nvcsi@15a00000-":1 [ENABLED]
$ sudo cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 0/0   #P:8
#
#                                _-------=> irqs-off
#                               / _------=> need-resched
#                              | / _-----=> need-resched-lazy
#                              || / _----=> hardirq/softirq
#                              ||| / _---=> preempt-depth
#                              |||| / _--=> preempt-lazy-depth
#                              ||||| / _-=> migrate-disable
#                              |||||| /     delay
#           TASK-PID     CPU#  |||||||  TIMESTAMP  FUNCTION
#              | |         |   |||||||      |         |
$ sudo i2cdetect -y -r 9
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 
$ sudo i2cdetect -y -r 10
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- UU 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --   

@37yavuzhamza

Did you try setting lane_polarity = "0"; for CAM0 as @ShaneCCC mentioned?

I saw that you are hardcoding the lane_polarity to always be 6 for both CAM1 and CAM0 and also I checked the DTB y and the lane_polarity remains 6.

Could you remove the hardcoding code in csi5_fops.c and set lane_polarity = "0"; in the device tree?

Please let me know your results.
Regards!

Thank you for your reply.
I changed the DTS file and also updated the csi5_fops.c file to set the lane polarity to 0, but the error and logs are still the same.

[   91.614428] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[   91.638630] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : vi5_capture_dequeue : before vi_capture_status 
[   91.638639]   jc- in vi_capture_status 
[   91.638641]   jc- in vi_capture_status : capture initialized 
[   91.638642]   jc- in vi_capture_status : valid channel ID found 
[   91.638643]   jc- in vi_capture_status : after wait timeout...
[   94.173476] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : uncorr_err: request timed out after 2500 ms
[   94.173502] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[   94.174113] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[   94.199479] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : vi5_capture_dequeue : before vi_capture_status 
[   94.199484]   jc- in vi_capture_status 
[   94.199486]   jc- in vi_capture_status : capture initialized 
[   94.199488]   jc- in vi_capture_status : valid channel ID found 
[   94.199489]   jc- in vi_capture_status : after wait timeout...
[   96.733458] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : uncorr_err: request timed out after 2500 ms
[   96.733476] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[   96.734311] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[   96.756319] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : vi5_capture_dequeue : before vi_capture_status 
[   96.756328]   jc- in vi_capture_status 
[   96.756329]   jc- in vi_capture_status : capture initialized 
[   96.756330]   jc- in vi_capture_status : valid channel ID found 
[   96.756331]   jc- in vi_capture_status : after wait timeout...
[   99.293465] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : uncorr_err: request timed out after 2500 ms
[   99.293490] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[   99.294195] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[   99.318408] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : vi5_capture_dequeue : before vi_capture_status 
[   99.318416]   jc- in vi_capture_status 
[   99.318417]   jc- in vi_capture_status : capture initialized 
[   99.318418]   jc- in vi_capture_status : valid channel ID found 
[   99.318419]   jc- in vi_capture_status : after wait timeout...
[  101.825481] tegra-camrtc-capture-vi tegra-capture-vi:   jc-- vi5_ops.c : uncorr_err: request timed out after 2500 ms
[  101.825501] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[  101.826138] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[  101.826160] tc358743 9-000f: Calling tc358743_s_stream - start of attempt 
[  101.826168] tc358743 9-000f: enable_stream: enable
[  101.826421] tc358743 9-000f: I2C write 0x0238 = 0x00000000
[  101.826643] tc358743 9-000f: I2C write 0x0238 = 0x00000001
[  101.826787] tc358743 9-000f: I2C write 0x857f = 0xc0
[  101.827170] tc358743 9-000f: I2C write 0x0004 = 0x0cd7
[  101.827172] tc358743 9-000f: after mutex_unlock - 823:enable_stream: end
[  101.827179]   jc- csi5_stop_streaming: csi5 csi_pt=2, st_id=2, vc_id=0, pg_mode=0x0
[  101.831864] tc358743 9-000f: function tc358743_s_power
[  101.831870]   jc- csi5 csi5_power_off

$ sudo dmesg | grep lane
[   43.160058] tc358743 endpoint.bus.mipi_csi2.clock_lane 0
[   43.160059] tc358743 endpoint.bus.mipi_csi2.num_data_lanes 2
[   43.160060] tc358743 endpoint.bus.mipi_csi2.data_lanes [1-2-0-0]
[   43.214544] tc358743 9-000f: function tc358743_num_csi_lanes_needed : fps(bt)  60   bits_pr_pixel 24 
[   43.214547] tc358743 9-000f: function tc358743_num_csi_lanes_needed : bps 3564000000   bps_pr_lane 594000000 
[   43.214550] tc358743 9-000f: function tc358743_num_csi_lanes_needed : ET.width 2200   ET.height 1125 
[   43.214552] tc358743 9-000f: tc358743_set_csi: lanes is using in_use
[   43.214554] tc358743 9-000f: function tc358743_num_csi_lanes_needed : fps(bt)  60   bits_pr_pixel 24 
[   43.214556] tc358743 9-000f: function tc358743_num_csi_lanes_needed : bps 3564000000   bps_pr_lane 594000000 
[   43.214558] tc358743 9-000f: function tc358743_num_csi_lanes_needed : ET.width 2200   ET.height 1125 
[   43.214562] tc358743 9-000f: function tc358743_num_csi_lanes_in_use
[   43.214824] tc358743 9-000f: tc358743_set_csi:  jc- lanes : 6
[   43.215370] tc358743 9-000f: tc358743_set_csi:  jc- post reset lanes= 6
[   43.245132] tc358743 9-000f: function tc358743_num_csi_lanes_needed : fps(bt)  60   bits_pr_pixel 24 
[   43.245134] tc358743 9-000f: function tc358743_num_csi_lanes_needed : bps 3564000000   bps_pr_lane 594000000 
[   43.245136] tc358743 9-000f: function tc358743_num_csi_lanes_needed : ET.width 2200   ET.height 1125 
[   43.245139] tc358743 9-000f: function tc358743_num_csi_lanes_in_use
[   43.250425] tc358743 endpoint.bus.mipi_csi2.clock_lane 0
[   43.250426] tc358743 endpoint.bus.mipi_csi2.num_data_lanes 2
[   43.250428] tc358743 endpoint.bus.mipi_csi2.data_lanes [1-2-0-0]
[   86.444202] tc358743 9-000f: function tc358743_num_csi_lanes_needed : fps(bt)  50   bits_pr_pixel 16 
[   86.444204] tc358743 9-000f: function tc358743_num_csi_lanes_needed : bps 1188000000   bps_pr_lane 594000000 
[   86.444205] tc358743 9-000f: function tc358743_num_csi_lanes_needed : ET.width 1980   ET.height 750 
[   86.444206] tc358743 9-000f: tc358743_set_csi: lanes is using in_use
[   86.444207] tc358743 9-000f: function tc358743_num_csi_lanes_needed : fps(bt)  50   bits_pr_pixel 16 
[   86.444208] tc358743 9-000f: function tc358743_num_csi_lanes_needed : bps 1188000000   bps_pr_lane 594000000 
[   86.444209] tc358743 9-000f: function tc358743_num_csi_lanes_needed : ET.width 1980   ET.height 750 
[   86.444211] tc358743 9-000f: function tc358743_num_csi_lanes_in_use
[   86.444501] tc358743 9-000f: tc358743_set_csi:  jc- lanes : 2
[   86.445099] tc358743 9-000f: tc358743_set_csi:  jc- post reset lanes= 2
[   86.479366] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- DEBUG: lane_polarity BEFORE override = 0, csi_port = 2
[   86.479371] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- DEBUG: lane_polarity AFTER override = 0
[   86.479375] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- DEBUG: brick_config.lane_polarity[0] = 0 (from lane_polarity=0)
[   86.479377] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- DEBUG: brick_config.lane_polarity[1] = 0 (from lane_polarity=0)
[   86.479379] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- DEBUG: brick_config.lane_polarity[2] = 0 (from lane_polarity=0)
[   86.479380] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- DEBUG: brick_config.lane_polarity[3] = 0 (from lane_polarity=0)
[   86.479382] t194-nvcsi 13e00000.host1x:nvcsi@15a00000:    X-- DEBUG: Final lane_polarity array: [0 0 0 0]

Actually I could not figure out one thing on my jetson:

I’m using a Jetson Orin NX on the Seeed carrier board (J4012) with JetPack 6.x, and I’m trying to understand the camera I2C mux mapping (cam_i2cmux).

On my system I see something that looks inconsistent compared to what I expected from other DTS examples:

  1. In one case, my device is under:
    /sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/@0f

But it appears on Linux as I2C bus 9:
readlink -f /sys/bus/i2c/devices/9-000f/of_node
/sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@1/

So in this case: i2c@1 → i2c-9.

  1. Also, when I connect the camera to the other connector (CAM1), it works and I see the device under:
    /sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@0

And in that working case it appears on Linux as I2C bus 10 (device like 10-000f), so:
i2c@0 → i2c-10 (and streaming works).

My confusion: in most DTS/DTBO examples I found, people seem to imply i2c@0 is associated with i2c-9 (and i2c@1 with the other bus), but on my setup it looks swapped (i2c@0→10 and i2c@1→9), and only the “CAM1 case” works.

Is this mapping expected/normal on the J4012 carrier (JetPack 6.1), or does it suggest something wrong in my base DTB/overlay mapping?
Should we treat i2c@0/i2c@1 as the reliable way to identify CAM0 vs CAM1 (regardless of Linux bus numbers), or should the Linux bus numbers (i2c-9 / i2c-10) match a fixed connector?

If there is a standard mapping for J4012 (which connector corresponds to i2c@0 vs i2c@1 and which Linux bus number), could you please confirm it?

Thanks!

It could be kernel regression. Looks like JP6 have the i2c bus revert but the functionality without any problem.

Below is current JP6 bus map.

The CAM0(tegra-capture-vi:1) assign to i2c bus 10

The CAM1(tegra-capture-vi:2) assign to i2c bus 9

v4l2-ctl --list-devices
NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
	/dev/media0

vi-output, imx477 10-001a (platform:tegra-capture-vi:1):
	/dev/video1

vi-output, imx477 9-001a (platform:tegra-capture-vi:2):
	/dev/video0