TC358743 B102 on Jetson Nano missing /dev/video0

Hi,

I’m trying to get Auvidea’s B102 TC358743 breakout board to work with my Jetson Nano. I’ve seen all other posts on getting TC358743 to work on Jetson Nano, but I still can’t get mine to work. Can someone please give me some pointers?

The B102 breakout board does not expose the interrupt pin, but it appears that the TC358743 driver is expecting it. I have not connected the interrupt pin at this stage.

This is my device-tree file:

/ {
	host1x {
		vi_base: vi {
			num-channels = <2>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				/* CSI-A */
				vi_port0: port@0 {
					status = "okay";
					reg = <0>;
					tc358743_vi_in0: endpoint {
						status = "okay";
						port-index = <0>;
						bus-width = <2>;
						remote-endpoint = <&tc358743_csi_out0>;
					};
				};
			};
		};

		csi_base: nvcsi {
			num-channels = <2>;
			#address-cells = <1>;
			#size-cells = <0>;
			/* CSI-A */
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						status = "okay";
						reg = <0>;
						tc358743_csi_in0: endpoint@0 {
							status = "okay";
							port-index = <0>;
							bus-width = <2>;
							remote-endpoint = <&tc358743_out0>;
						};
					};
					port@1 {
						reg = <1>;
						status = "okay";
						tc358743_csi_out0: endpoint@1 {
							status = "okay";
							remote-endpoint = <&tc358743_vi_in0>;
						};
					};
				};
			};
		};

		i2c@546c0000 {
			status = "okay";
			#address-cells = <1>;
			#size-cells = <0>;
			/* CSI-A */
			tc358743@0f {
				status = "okay";
				compatible = "tc358743";
				/* I2C device address */
				reg = <0x0f>;
				mclk = "cam_mclk1";
				reset-gpios = <&gpio CAM1_PWDN 0>;
				refclk_hz = <27000000>;  // refclk_hz -> regclk

				/* there is no interrupt connection on the B102 breakout board */
				interrupt-parent = <&gpio>;
				interrupts = <TEGRA_GPIO(E, 6) GPIO_ACTIVE_HIGH>;

				/* Physical dimensions of sensor */
				physical_w = "4.713";
				physical_h = "3.494";
				/* Sensor Model */
				sensor_model = "tc358743";

				refclk= <27000000>;

				ddc5v_delay = <2>;

				/* HDCP not yet implemented */
				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 = <0>;

				ports {
					#address-cells = <1>;
					#size-cells = <0>;

					port@0 {
						reg = <0>;
						tc358743_out0: endpoint {
							port-index = <0>;
							bus-width = <2>;
							data-lanes = <1 2>;
							clock-lanes = <0>;
							clock-noncontinuous;
							link-frequencies = /bits/ 64 <297000000>;
							remote-endpoint = <&tc358743_csi_in0>;
						};
					};
				};
			};
		};
	};

	tegra-camera-platform {
		status = "okay";
		compatible = "nvidia, tegra-camera-platform";
		num_csi_lanes = <2>;
		max_lane_speed = <1500000>;
		min_bits_per_pixel = <16>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <750000>;
		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 vender.
		*/
		modules {

			module1 {
				status = "okay";
				badge = "tc358743_top_i2c6_b";
				position = "front";
				orientation = "1";
				drivernode0 {
					status = "okay";
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver's v4l2 device name */
					devname = "tc358743 6-000f";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/tc358743@0f";
				};
			};

		};
	};
};

I have commented out #include "porg-plugin-manager/tegra210-porg-plugin-manager.dtsi" from tegra210-porg-p3448-common.dtsi file as suggested by other posters in other threads.

This is my dmesg output when I insmod the driver:

[   67.171609] chip found @0xf (Tegra I2C adapter)
[   67.171618] tc358743 6-000f: Device Tree Parameters:
[   67.171637] tc358743 6-000f: reset_gpio = 151
[   67.171641] tc358743 6-000f: refclk_hz = 27000000
[   67.171656] tc358743 endpoint->bus.mipi_csi2.flags 512
[   67.171659] tc358743 endpoint->bus.mipi_csi2.clock_lane 0
[   67.171661] tc358743 endpoint->bus.mipi_csi2.num_data_lanes 2
[   67.171663] tc358743 endpoint->bus.mipi_csi2.data_lanes [1-2-0-0]
[   67.171665] tc358743 endpoint->nr_of_link_frequencies 1
[   67.171667] tc358743 state->pdata.pll_prd=4
[   67.171669] tc358743 state->pdata.pll_fbd=88
[   67.171675] tc358743 6-000f: Subdev init done
[   67.172568] tc358743 6-000f: Chip ID val: 0
[   67.172577] ctrl handler initied
[   67.172611] A bunch of new cutoms done
[   67.174922] Controls updated
[   67.175077] Work queue created
[   67.175079] About to call tegra_media_entity_init
[   67.175081] tegra_media_entity_init complete
[   67.175084] Set mbus_fmt_code in probe to: 8207
[   67.175085] About to register subdev
[   67.175088] Register subdev: 0
[   67.175090] before tc358743_initial_setup
[   67.203095] tc358743 6-000f: tc358743_set_hdmi_hdcp: disable
[   67.229254] after tc358743_initial_setup
[   67.229258] tc358743 6-000f: tc358743_set_csi_color_space: YCbCr 422 16-bit
[   67.233620] before tc358743_s_dv_timings
[   67.233624] tc358743 6-000f: tc358743_s_dv_timings
[   67.233627] tc358743 6-000f: enable_stream: disable
[   67.235806] tc358743 6-000f: 792:enable_stream: end
[   67.237360] tc358743 6-000f: tc358743_set_pll:
[   67.237362] tc358743 6-000f: tc358743_set_pll: updating PLL clock
[   67.244092] tc358743 6-000f: tc358743_set_csi:
[   67.259306] before tc358743_init_interrupts, irq: 136
[   67.269729] after tc358743_init_interrupts, irq: 136
[   67.269731] IQR request
[   67.269959] err, 0
[   67.269962] tc358743 6-000f: tc358743_enable_interrupts: cable connected = 1
[   67.274165] tc358743 found @0xf (Tegra I2C adapter)
[   67.274168] tc358743 6-000f: tc358743_s_edid, pad 0, start block 0, blocks 2
[   67.274171] tc358743 6-000f: tc358743_disable_edid:
[   67.283797] tc358743 6-000f: tc358743_enable_edid
[   67.283799] tc358743 6-000f: tc358743_enable_edid:
[   67.283802] tc358743 6-000f: tc358743_enable_interrupts: cable connected = 1
[   67.288015] tc358743 6-000f: tc358743_enable_edid completed successfully
[   67.288017] tc358743 6-000f: tc358743_s_edid completed successfully
[   67.288020] tc358743 6-000f: Calling tc358743_g_edid
[   67.294867] tc358743 6-000f: EDID_RAM has 256 byte from: 0x8c00 to 0x8d00
[   67.294869] tc358743 6-000f: tc358743_g_edid completed successfully
[   67.297126] tc358743 6-000f: -----Chip status-----
[   67.297914] tc358743 6-000f: Chip ID:0x00
[   67.298683] tc358743 6-000f: Chip revision:0x00
[   67.298686] tc358743 6-000f: Reset: IR: 1, CEC: 1, CSI TX: 0, HDMI: 0
[   67.298689] tc358743 6-000f: Sleep mode: off
[   67.298690] tc358743 6-000f: Cable detected (+5V power): yes
[   67.299434] tc358743 6-000f: DDC lines enabled: yes
[   67.300181] tc358743 6-000f: Hotplug enabled: no
[   67.300952] tc358743 6-000f: CEC enabled: no
[   67.300954] tc358743 6-000f: -----Signal status-----
[   67.300955] tc358743 6-000f: TMDS signal detected: no
[   67.300957] tc358743 6-000f: Stable sync signal: no
[   67.300959] tc358743 6-000f: PHY PLL locked: no
[   67.300961] tc358743 6-000f: PHY DE detected: no
[   67.301721] tc358743 6-000f: tc358743_get_detected_timings: no valid signal
[   67.301724] tc358743 6-000f: No video detected
[   67.301728] tc358743 6-000f: Configured format: 1920x1080p60.0 (2200x1125)
[   67.301731] tc358743 6-000f: horizontal: fp = 88, +sync = 44, bp = 148
[   67.301733] tc358743 6-000f: vertical: fp = 4, +sync = 5, bp = 36
[   67.301736] tc358743 6-000f: pixelclock: 148500000
[   67.301739] tc358743 6-000f: flags (0x12): CAN_REDUCE_FPS CE_VIDEO
[   67.301741] tc358743 6-000f: standards (0x3): CEA DMT
[   67.301743] tc358743 6-000f: -----CSI-TX status-----
[   67.301746] tc358743 6-000f: Lanes needed: 4
[   67.302573] tc358743 6-000f: Lanes in use: 4
[   67.303344] tc358743 6-000f: Waiting for particular sync signal: no
[   67.304113] tc358743 6-000f: Transmit mode: no
[   67.304883] tc358743 6-000f: Receive mode: no
[   67.305972] tc358743 6-000f: Stopped: no
[   67.305974] tc358743 6-000f: Color space: YCbCr 422 16-bit
[   67.306723] tc358743 6-000f: -----DVI-D status-----
[   67.306726] tc358743 6-000f: HDCP encrypted content: no
[   67.306728] tc358743 6-000f: Input color space: RGB full range
[   67.307474] Probe complete
[   67.385716] tc358743 6-000f: tc358743_delayed_work_enable_hotplug:

After insmod, I still don’t see /dev/video0. What did I do wrong?

Maybe need to trace the v4l2_async_register_subdev() in the tc358743_probe() to check, this function call should be gen the video node if successfully.

I managed to get it working after following this thread: No captured data from v4l2 driver (TC358743)

I managed to record 1920x1080 resolution at 60Hz, which is pretty cool. Btw, the Toshiba chip interrupt pin is NOT required to be connected to the Jetson Nano.

For what it’s worth, this is what I’ve done to get it to work.

In tegra210-porg-p3448-common.dtsi file, remove the below lines:

#include "porg-platforms/tegra210-porg-camera-rbpcv2-imx219.dtsi"
#include "porg-platforms/tegra210-porg-camera-rbpcv2-dual-imx219.dtsi"
#include "porg-plugin-manager/tegra210-porg-plugin-manager.dtsi"

and add this line:

#include "porg-platforms/tegra210-tc358743.dtsi"

These are my device-tree and device driver files:
tegra210-tc358743.dtsi (3.5 KB)
tc358743.c (72.7 KB)
tc358743_regs.h (29.4 KB)
tc358743.h (4.2 KB)

Testing with gstreamer:

gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,width=1920,height=1080,framerate=60/1,format=UYVY" ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! omxh265enc bitrate=8000000 ! matroskamux ! filesink location=capture.mkv -e