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?