IMX274-Port Binding Problem. (/dev/video0 not exist)

I am working on LI-IMX274 with Jetson-TX1.
This device’s probe method executed successfully, but I can’t see video0 in the /dev directory.

I can see IMX274 probe method finished with success.
But I see problems with vi, it says

Here is my dmesg output:

[    6.761133] vi 54080000.vi: vi_probe: ++
[    6.767770] vi 54080000.vi: initialized
[    6.771446] vi 54080000.vi: ep of_device is not enabled /host1x/vi/ports/port@0/endpoint.
[    6.771449] vi 54080000.vi: ep of_device is not enabled /host1x/vi/ports/port@1/endpoint.
[    6.771452] vi 54080000.vi: ep of_device is not enabled /host1x/vi/ports/port@2/endpoint.
[    6.771455] vi 54080000.vi: ep of_device is not enabled /host1x/vi/ports/port@3/endpoint.
[    6.771457] vi 54080000.vi: all channel register failed

I am communicating with LI-IMX274 with using CSI-A, and here is my device tree sources:

tegra210-camera-imx274-a00.dtsi

/*
 * Copyright (c) 2016-2017, NVIDIA CORPORATION.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <dt-bindings/media/camera.h>
#include <dt-bindings/platform/t210/t210.h>

/ {
	host1x {
		vi {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					liimx274_vi_in0: endpoint {
						status = "okay";
						csi-port = <0>;
						bus-width = <4>;
						remote-endpoint = <&liimx274_csi_out0>;
					};
				};
			};
		};

		nvcsi {
			num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						liimx274_csi_in0: endpoint@0 {
							status = "okay";
							csi-port = <0>;
							bus-width = <4>;
							remote-endpoint = <&liimx274_imx274_out0>;
						};
					};
					port@1 {
						reg = <1>;
						liimx274_csi_out0: endpoint@1 {
							status = "okay";
							remote-endpoint = <&liimx274_vi_in0>;
						};
					};
				};
			};
		};

		i2c@546c0000 {
			tca9546@70 {
				i2c@0 {
					imx274_a@1a {
						compatible = "nvidia,imx274";
						/* I2C device address */
						reg = <0x1a>;

						/* Physical dimensions of sensor */
						physical_w = "3.674";
						physical_h = "2.738";

						/* Define any required hw resources needed by driver */
						/* ie. clocks, io pins, power sources */
						avdd-reg = "vana";
						iovdd-reg = "vif";
						dvdd-reg = "vdig";

						/* Defines number of frames to be dropped by driver internally after applying */
						/* sensor crop settings. Some sensors send corrupt frames after applying */
						/* crop co-ordinates */
						/*post_crop_frame_drop = "0";*/

						/* if true, delay gain setting by one frame to be in sync with exposure */
						delayed_gain = "true";

						/**
						* A modeX node is required to support v4l2 driver
						* implementation with NVIDIA camera software stack
						*
						* mclk_khz = "";
						* Standard MIPI driving clock, typically 24MHz
						*
						* num_lanes = "";
						* Number of lane channels sensor is programmed to output
						*
						* tegra_sinterface = "";
						* The base tegra serial interface lanes are connected to
						*
						* discontinuous_clk = "";
						* The sensor is programmed to use a discontinuous clock on MIPI lanes
						*
						* dpcm_enable = "true";
						* The sensor is programmed to use a DPCM modes
						*
						* cil_settletime = "";
						* MIPI lane settle time value.
						* A "0" value attempts to autocalibrate based on mclk_multiplier
						*
						* active_w = "";
						* Pixel active region width
						*
						* active_h = "";
						* Pixel active region height
						*
						* pixel_t = "";
						* The sensor readout pixel pattern
						*
						* readout_orientation = "0";
						* Based on camera module orientation.
						* Only change readout_orientation if you specifically
						* Program a different readout order for this mode
						*
						* line_length = "";
						* Pixel line length (width) for sensor mode.
						* This is used to calibrate features in our camera stack.
						*
						* mclk_multiplier = "";
						* Multiplier to MCLK to help time hardware capture sequence
						* TODO: Assign to PLL_Multiplier as well until fixed in core
						*
						* pix_clk_hz = "";
						* Sensor pixel clock used for calculations like exposure and framerate
						*
						* inherent_gain = "";
						* Gain obtained inherently from mode (ie. pixel binning)
						*
						* min_gain_val = ""; (floor to 6 decimal places)
						* max_gain_val = ""; (floor to 6 decimal places)
						* Gain limits for mode
						*
						* min_exp_time = ""; (ceil to integer)
						* max_exp_time = ""; (ceil to integer)
						* Exposure Time limits for mode (us)
						*
						* min_hdr_ratio = "";
						* max_hdr_ratio = "";
						* HDR Ratio limits for mode
						*
						* min_framerate = "";
						* max_framerate = "";
						* Framerate limits for mode (fps)
						*
						* embedded_metadata_height = "";
						* Sensor embedded metadata height in units of rows.
						* If sensor does not support embedded metadata value should be 0.
						*/
						mode0 { // IMX274_MODE_3840X2160
							mclk_khz = "24000";
							num_lanes = "4";
							tegra_sinterface = "serial_a";
							discontinuous_clk = "yes";
							dpcm_enable = "false";
							cil_settletime = "0";

							active_w = "3840";
							active_h = "2160";
							pixel_t = "bayer_rggb";
							readout_orientation = "90";
							line_length = "4208";
							inherent_gain = "1";
							mclk_multiplier = "24";
							pix_clk_hz = "576000000";

							min_gain_val = "1.0";
							max_gain_val = "22.2";
							min_hdr_ratio = "1";
							max_hdr_ratio = "1";
							min_framerate = "1.5";
							max_framerate = "30";
							min_exp_time = "44";
							max_exp_time = "666637";
						};
						mode1 { // IMX274_MODE_1920X1080
							mclk_khz = "24000";
							num_lanes = "4";
							tegra_sinterface = "serial_a";
							discontinuous_clk = "yes";
							dpcm_enable = "false";
							cil_settletime = "0";

							active_w = "1920";
							active_h = "1080";
							pixel_t = "bayer_rggb";
							readout_orientation = "90";
							line_length = "4160";
							inherent_gain = "1";
							mclk_multiplier = "24";
							pix_clk_hz = "576000000";

							min_gain_val = "1.0";
							max_gain_val = "22.2";
							min_hdr_ratio = "1";
							max_hdr_ratio = "1";
							min_framerate = "1.5";
							max_framerate = "60";
							min_exp_time = "58";
							max_exp_time = "184611";
							embedded_metadata_height = "1";
						};
						ports {
							#address-cells = <1>;
							#size-cells = <0>;
							port@0 {
								reg = <0>;
								liimx274_imx274_out0: endpoint {
									status = "okay";
									csi-port = <0>;
									bus-width = <4>;
									remote-endpoint = <&liimx274_csi_in0>;
								};
							};
						};
					};
				};
			};
		};
	};
	lens_imx274@A6V26 {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "5.00";
		f_number = "2.0";
		aperture = "2.2";
	};
};

/ {

	tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		/**
		* Physical settings to calculate max ISO BW
		*
		* num_csi_lanes = <>;
		* Total number of CSI lanes when all cameras are active
		*
		* max_lane_speed = <>;
		* Max lane speed in Kbit/s
		*
		* min_bits_per_pixel = <>;
		* Min bits per pixel
		*
		* vi_peak_byte_per_pixel = <>;
		* Max byte per pixel for the VI ISO case
		*
		* vi_bw_margin_pct = <>;
		* Vi bandwidth margin in percentage
		*
		* max_pixel_rate = <>;
		* Max pixel rate in Kpixel/s for the ISP ISO case
		*
		* isp_peak_byte_per_pixel = <>;
		* Max byte per pixel for the ISP ISO case
		*
		* isp_bw_margin_pct = <>;
		* Isp bandwidth margin in percentage
		*/
		num_csi_lanes = <4>;
		max_lane_speed = <1500000>;
		min_bits_per_pixel = <10>;
		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 {
			module0 {
				badge = "imx274_bottom_A6V26";
				position = "bottom";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "imx274 30-001a";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/tca9546@70/i2c@0/imx274_a@1a";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_imx274@A6V26/";
				};
			};
		};
	};
};

tegra210-jetson-cv-camera-modules.dtsi:

/*
 * Copyright (c) 2016-2017, NVIDIA CORPORATION.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 */

#include "tegra210-jetson-cv-camera-imx274-a00.dtsi"
#include "tegra210-jetson-cv-camera-imx185-a00.dtsi"
#include "tegra210-jetson-cv-camera-e3333-a00.dtsi"
#include "tegra210-jetson-cv-camera-e3326-a00.dtsi"
#include "tegra210-jetson-cv-camera-e3323-a00.dtsi"

#define CAM0_RST_L	TEGRA_GPIO(S, 4)
#define CAM0_PWDN	TEGRA_GPIO(S, 7)
#define CAM1_RST_L	TEGRA_GPIO(S, 5)
#define CAM1_PWDN	TEGRA_GPIO(T, 0)

/ {
	/* set camera gpio direction to output */
	gpio: gpio@6000d000 {
		camera-control-output-low {
			gpio-hog;
			output-low;
			gpios = <CAM0_RST_L 0 CAM0_PWDN 0
				CAM1_RST_L 0 CAM1_PWDN 0>;
			label = "cam0-rst", "cam0-pwdn",
				"cam1-rst", "cam1-pwdn";
        };
	};

	/* all cameras are disabled by default */
	host1x {
		vi_base: vi {
			ports {
				vi_port0: port@0 {
					status = "okay";
					vi_in0: endpoint {
						status = "okay";
					};
				};
				vi_port1: port@1 {
					status = "disabled";
					vi_in1: endpoint {
						status = "disabled";
					};
				};
				vi_port2: port@2 {
					status = "disabled";
					vi_in2: endpoint {
						status = "disabled";
					};
				};
				vi_port3: port@3 {
					status = "disabled";
					vi_in3: endpoint {
						status = "disabled";
					};
				};
				vi_port4: port@4 {
					status = "disabled";
					vi_in4: endpoint {
						status = "disabled";
					};
				};
				vi_port5: port@5 {
					status = "disabled";
					vi_in5: endpoint {
						status = "disabled";
					};
				};
			};
		};
		csi_base: nvcsi {
			csi_chan0: channel@0 {
				status = "okay";
				ports {
					csi_chan0_port0: port@0 {
						status = "okay";
						csi_in0: endpoint@0 {
							status = "okay";
						};
					};
					csi_chan0_port1: port@1 {
						status = "okay";
						csi_out0: endpoint@1 {
							status = "okay";
						};
					};
				};
			};
			csi_chan1: channel@1 {
				status = "disabled";
				ports {
					csi_chan1_port0: port@0 {
						status = "disabled";
						csi_in1: endpoint@2 {
							status = "disabled";
						};
					};
					csi_chan1_port1: port@1 {
						status = "disabled";
						csi_out1: endpoint@3 {
							status = "disabled";
						};
					};
				};
			};
			csi_chan2: channel@2 {
				status = "disabled";
				ports {
					csi_chan2_port0: port@0 {
						status = "disabled";
						csi_in2: endpoint@4 {
							status = "disabled";
						};
					};
					csi_chan2_port1: port@1 {
						status = "disabled";
						csi_out2: endpoint@5 {
							status = "disabled";
						};
					};
				};
			};
			csi_chan3: channel@3 {
				status = "disabled";
				ports {
					csi_chan3_port0: port@0 {
						status = "disabled";
						csi_in3: endpoint@6 {
							status = "disabled";
						};
					};
					csi_chan3_port1: port@1 {
						status = "disabled";
						csi_out3: endpoint@7 {
							status = "disabled";
						};
					};
				};
			};
			csi_chan4: channel@4 {
				status = "disabled";
				ports {
					csi_chan4_port0: port@0 {
						status = "disabled";
						csi_in4: endpoint@8 {
							status = "disabled";
						};
					};
					csi_chan4_port1: port@1 {
						status = "disabled";
						csi_out4: endpoint@9 {
							status = "disabled";
						};
					};
				};
			};
			csi_chan5: channel@5 {
				status = "disabled";
				ports {
					csi_chan5_port0: port@0 {
						status = "disabled";
						csi_in5: endpoint@10 {
							status = "disabled";
						};
					};
					csi_chan5_port1: port@1 {
						status = "disabled";
						csi_out5: endpoint@11 {
							status = "disabled";
						};
					};
				};
			};
		};

		i2c@546c0000 {
			e3326_cam0: ov5693_c@36 {
				status = "disabled";
			};
			e3323_cam0: ov23850_a@10 {
				status = "disabled";
			};
			e3323_vcm0: lc898212@72 {
				status = "disabled";
			};
			cam_tca6408_21: tca6408@21 {
				status = "disabled";
			};
			cam_tca9548_77: tca9548@77 {
				status = "disabled";
				i2c@0 {
					e3333_cam0: ov5693_a@36 {
						status = "disabled";
					};
				};
				i2c@1 {
					e3333_cam1: ov5693_b@36 {
						status = "disabled";
					};
				};
				i2c@2 {
					e3333_cam2: ov5693_c@36 {
						status = "disabled";
					};
				};
				i2c@3 {
					e3333_cam3: ov5693_d@36 {
						status = "disabled";
					};
				};
				i2c@4 {
					e3333_cam4: ov5693_e@36 {
						status = "disabled";
					};
				};
				i2c@5 {
					e3333_cam5: ov5693_f@36 {
						status = "disabled";
					};
				};
			};
			tca6408_21: tca6408@21 {
				default {
					gpio-output-low = <0 1 2 3 4 5 6 7>;
				};
			};
			tca9546_70: tca9546@70 {
				status = "okay";
				i2c@0 {
					imx185_cam0: imx185_a@1a {
						status = "disabled";
					};
					imx274_cam0: imx274_a@1a {
						status = "okay";
					};
				};
			};
		};
	};
	i2c@7000c000 {
		e3323_cam1: ov23850_c@36 {
			status = "disabled";
		};
		e3323_vcm1: lc898212@72 {
			status = "disabled";
		};
	};

	tcp: tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		num_csi_lanes = <2>;
		max_lane_speed = <1500000>;
		min_bits_per_pixel = <10>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <408000>;
		isp_peak_byte_per_pixel = <2>;
		isp_bw_margin_pct = <25>;
		modules {
			cam_module0: module0 {
				status = "disabled";
				cam_module0_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module0_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
			cam_module1: module1 {
				status = "disabled";
				cam_module1_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module1_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
			cam_module2: module2 {
				status = "disabled";
				cam_module2_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module2_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
			cam_module3: module3 {
				status = "disabled";
				cam_module3_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module3_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
			cam_module4: module4 {
				status = "disabled";
				cam_module4_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module4_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
			cam_module5: module5 {
				status = "disabled";
				cam_module5_drivernode0: drivernode0 {
					status = "disabled";
				};
				cam_module5_drivernode1: drivernode1 {
					status = "disabled";
					pcl_id = "v4l2_lens";
				};
			};
		};
	};
};

So, I can’t find the problem with device tree, Could you help me about this issue ?
Thanks

hello sukrubahadirarslan,

these kernel failures means the VI channel endpoint is not enabled.
however, I’m wondering why the reporting i2c bus address were different.
the error logs shows the bus address at 54080000, but your device tree declare imx274 at 546c0000.

could you please review the bus settings.
thanks

Hello,
Thanks for your answers, I enabled endpoints and now I can see /dev/video0 file.
But I wonder that following questions answers.

  1. Is 54080000 is i2c bus address ?
  2. Is vi really a device on i2c bus ?
  3. Why the vi’s i2c bus address must be same with imx274’s bus address ?
  4. How can I set i2c bus address of vi to 546c0000 ?

Could you help me for understanding these questions?
Thanks,
Şükrü.

Hello JerryChang,
Additionaly,
Following image is from reference manual of Tegra X1 (from section Address Map.).

So 5408-0000 is the base address of VI and 546c-0000 is the base address of VII2C.
So Device tree settings are seems to be correct right ?

Thanks,
Şükrü.

hello sukrubahadirarslan,

yap, device tree settings seems correctly.
it’s a failure to initial media controller, which setting up media links between VI and external sensor device.
may I know which JetPack release you’re working with?
you might also contact with your sensor vendor for bring-up issues.
thanks

I have working TX2 DTSI files for a custom camera implementation for L4T r28.2 here:

Check releases for r28.1 and r24.2

It may help to have something to compare against.