Integrating custom MIPI CSI camera with Jetson TX2i

Hi,

We have a custom Jetson TX2i board based on dev board. We are trying to interface our custom MIPI CSI camera to Jetson TX2i. Our CSI camera does not have any EEPROM and neither does is require i2C, it streams the data continuously as soon as it is switched on. We are using Release 32.6.1.

We have gone through the camera programmer’s guide, in the section “To register a device using the main platform device tree file” it states to locate and edit

<top>/hardware/nvidia/platform/t19x/galen/kernel-dts/tegra194-p2888-0001-p2822-0000.dtsi

for Jetson TX2i instead of t19x it should be t18x right? In t18x folder there is no galen folder, instead it has common, lanai and quill, so in which folder should we locate this file>

Also for Jetson TX2i, which dtsi file should we edit?

hello jetuser,

yes, please modify the device tree sources under t18x series for your Jetson TX2i.
as you can see, there’re three folders.

$L4T_Sources/r32.6.1/Linux_for_Tegra/source/public/hardware/nvidia/platform/t18x/
.
├── common
├── lanai
└── quill

since there’re different TX2 platforms, the sources under common were sharing the same settings.
lanai is specific to TX2 NX, you may create your customize device tree on the quill folder.

Thank you for your prompt reply.

We have modified the kernel_src\hardware\nvidia\platform\t18x\quill\kernel-dts\tegra186-quill-p3489-1000-a00-00-base.dts (as we could not find any dtsi file with the same name)

Taking reference from Xavier - using raw CSI without i2c - #2 by ShaneCCC
We have commented out
#include <t18x-common-plugin-manager/tegra186-quill-camera-plugin-manager.dtsi>
and
#include <t18x-common-platforms/tegra186-quill-camera-modules.dtsi>
and have added
#include <t18x-common-modules/tegra186-camera-e3326-a00.dtsi>
PFA dts file for your reference.tegra186-quill-p3489-1000-a00-00-base.dts (10.9 KB)

The post also suggests “Remove all the i2c access function from the ov5693.c”, I do not know which parts to keep and which to remove, I read in one of the post that I can simple ignore the i2c struct, does that mean if i leave ov5693.c unedited it will be ok?

What do you mean “leave ov5693.c uneditedited”
You can confirm the loaded dtb by “dmesg | grep -i kernel” to confirm it.

By leaving ov5693.c unedited, I mean, I have not removed any of the i2c structs and has used it as is.

We have made some progress since previous post.

As mentioned in your post here Xavier - using raw CSI without i2c - #2 by ShaneCCC
we have made the following changes in tegra186-quill-p3489-1000-a00-00-base.dts:

  • Commented out camera module and camera-plugin-manager
  • Included camera-e3326
#include <t18x-common-platforms/tegra186-quill-common-p3489-1000-a00.dtsi>
#include <t18x-common-platforms/tegra186-quill-power-tree-p3489-1000-a00-00.dtsi>
/* #include <t18x-common-platforms/tegra186-quill-camera-modules.dtsi> */
#include <t18x-common-modules/tegra186-display-e3320-1000-a00.dtsi>
#include <t18x-common-modules/tegra186-camera-e3326-a00.dtsi>

/* comms dtsi file should be included after gpio dtsi file */
#include <t18x-common-plugin-manager/tegra186-quill-p3489-1000-a00-plugin-manager.dtsi>
#include <t18x-common-modules/tegra186-super-module-e2614-p2597-1000-a00.dtsi>
#include <t18x-common-plugin-manager/tegra186-quill-display-plugin-manager.dtsi>
#include <t18x-common-prod/tegra186-priv-quill-p3489-1000-a00-prod.dtsi>
/* #include <t18x-common-plugin-manager/tegra186-quill-camera-plugin-manager.dtsi> */

Further we have modified tegra186-camera-e3326-a00.dtsi file to match our sensor requirement.

We were getting following error when we checked with dmesg:

 3.671990] ov5693 2-0036: probing v4l2 sensor.
[    3.672032] ov5693 2-0036: Failed to find clocks
[    3.677243] ov5693 2-0036: unable to get platform data
[    3.682809] ov5693 2-0036: tegra camera driver registration failed

Further to which modified we found our port_index was set to 2, so we modified it to 0 (as we are using serial_a) as per this post Failed tegra camera driver registration on JetPack4.2 - #2 by JerryChang

Following which now we are getting this error:

3.140294] ov5693 2-0036: probing v4l2 sensor.
[    3.140335] ov5693 2-0036: Failed to find clocks
[    3.141993] Mass Storage Function, version: 2009/09/11
[    3.141996] LUN: removable file: (no medium)
[    3.145281] ov5693 2-0036: unable to get platform data
[    3.148162] using random self ethernet address
[    3.148164] using random host ethernet address
[    3.173556] rndis0: HOST MAC 76:88:3a:0d:69:28
[    3.173611] rndis0: MAC 76:88:3a:0d:69:29
[    3.176344] usb0: HOST MAC 76:88:3a:0d:69:2a
[    3.176367] usb0: MAC 76:88:3a:0d:69:2b
[    3.176396] tegra-xudc-new 3550000.xudc: ep 0 (type: 0, dir: out) enabled
[    3.182172] l4tbr0: port 1(rndis0) entered blocking state
[    3.182174] l4tbr0: port 1(rndis0) entered disabled state
[    3.182296] device rndis0 entered promiscuous mode
[    3.183118] ov5693 2-0036: tegra camera driver registration failed

What do we need to do?

hello jetuser,

please refer to Tutorials | NVIDIA Developer page,
you should check [V4L2 Sensor Driver Development Tutorial] to review your driver implementation.
thanks

Thank you @JerryChang the videos helped a lot. Have modified some parameters based on that, however, we are still getting the same error:

3.236413] ov5693 2-0036: probing v4l2 sensor.
[    3.236463] ov5693 2-0036: Failed to find clocks
[    3.242868] ov5693 2-0036: unable to get platform data
[    3.251147] ov5693 2-0036: tegra camera driver registration failed

PFB our tegra186-camera-e3326-a00.dtsi file

/*
 * Copyright (c) 2015-2020, 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/>.
 */

/ {
	host1x {
		vi@15700000 {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					e3326_vi_in0: endpoint {
						port-index = <0>;
						bus-width = <2>;
						remote-endpoint = <&e3326_csi_out0>;
					};
				};
			};
		};

		nvcsi@150c0000 {
			num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						e3326_csi_in0: endpoint@0 {
							port-index = <0>;
							bus-width = <2>;
							remote-endpoint = <&e3326_ov5693_out0>;
						};
					};
					port@1 {
						reg = <1>;
						e3326_csi_out0: endpoint@1 {
							remote-endpoint = <&e3326_vi_in0>;
						};
					};
				};
			};
		};
	};

	i2c@3180000 {
		ov5693_c@36 {
			compatible = "nvidia,ov5693";
			/* I2C device address */
			reg = <0x36>;

			/* V4L2 device node location */
			devnode = "video0";

			/* 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";

			/* Sensor output flip settings */
			vertical-flip = "true";

			/* Enable EEPROM support */
			has-eeprom = "0";

			mode0 { // OV5693_MODE_2592X1944
				mclk_khz = "24000";
				num_lanes = "2";
				tegra_sinterface = "serial_a";
				phy_mode = "DPHY";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";

				active_w = "3264";
				active_h = "2464";
				mode_type = "bayer";
				pixel_phase = "rggb";
				csi_pixel_bit_depth = "10";
				readout_orientation = "90";
				line_length = "3448";
				inherent_gain = "1";
				mclk_multiplier = "6.67";
				pix_clk_hz = "182400000";

				gain_factor = "10";
				min_gain_val = "10";/* 1DB*/
				max_gain_val = "160";/* 16DB*/
				step_gain_val = "1";
				default_gain = "10";
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				framerate_factor = "1000000";
				min_framerate = "2000000";/*1.816577 */
				max_framerate = "21000000";/*30*/
				step_framerate = "1";
				default_framerate = "30000000";
				exposure_factor = "1000000";
				min_exp_time = "13";/* us */
				max_exp_time = "683709";/* us */
				step_exp_time = "1";
				default_exp_time = "33334";/* us */
				embedded_metadata_height = "2";
			};

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

				port@0 {
					reg = <0>;
					e3326_ov5693_out0: endpoint {
						port-index = <0>;
						bus-width = <2>;
						remote-endpoint = <&e3326_csi_in0>;
					};
				};
			};
		};
	};

	e3326_lens_ov5693@P5V27C {
		min_focus_distance = "0.0";
		hyper_focal = "0.0";
		focal_length = "2.67";
		f_number = "2.0";
		aperture = "2.0";
	};

	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 = <2>;
		max_lane_speed = <1500000>;
		min_bits_per_pixel = <10>;
		vi_peak_byte_per_pixel = <2>;
		vi_bw_margin_pct = <25>;
		max_pixel_rate = <160000>;
		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 = "e3326_front_P5V27C";
				position = "rear";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ov5693 2-0036";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/ov5693_c@36";
				};
				drivernode1 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/e3326_lens_ov5693@P5V27C/";
				};
			};
		};
	};
};

With reference to this post How to grab pre-configured csi video stream without I2C? - #7 by DaLT, and “sensor software design programming guide” we need to set status=“okay” if we are not using i2c, I have not declared the status= “okay”, is that causing the problem?

Where exactly should I add status=“okay” in tegra186-camera-e3326-a00.dtsi?

Is the below code correct?

/ {
	host1x {
		vi@15700000 {
			status="okay";
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					e3326_vi_in0: endpoint {
						port-index = <0>;
						bus-width = <2>;
						remote-endpoint = <&e3326_csi_out0>;
					};
				};
			};
		};

or do i need to set status="okay " somewhere else also?

hello jetuser,

you’re having your customize camera driver, right?
you should revise those keywords, such as e3326 , ov5693_c…etc, to avoid the driver parse the reference camera board.
in addition, please also update the string of compatible, or, it’ll always looks for driver with the same string, aka. ov5693.c

	i2c@3180000 {
		ov5693_c@36 {
			compatible = "nvidia,ov5693";

the devname is also another important terms.
please revise it as your own customize device name, maps to your camera nodes.

You could be lost the clock define like below file define cause the “ov5693 2-0036: Failed to find clocks”
…/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-camera-e3326-a00.dtsi

Hi @JerryChang,

We are porting the already existing driver of ov5693, to do that we disabled the plugin manager, included e3326 dtsi file and made the necessary changes to bus width, port-index and other parameters. As we do not need i2C, so I have just added status=“okay” in the i2c@3160000 (as we are using lane a, replaced i2c@3180000 with i2c@316000)

As per your suggestion, I have revised the keywords e3326 and ov5693 and have simply replaced them with c0001 and cm2021 respectively both in the filename and the code. I have also revised name of ov5693.c to cm2021.c and its respective headers. However, I do not understand how only revising the name will solve the issue as the underlying code is still the same with only strings changed?

Further to above, I modified the kernel_src\hardware\nvidia\platform\t18x\quill\kernel-dts\tegra186-quill-p3489-1000-a00-00-base.dts file, here I removed tegra186-camera-e3326-a00.dtsi and included the revised file tegra186-camera-c0001-a00.dtsi

This time I did not get any error message, however still I did not get anything in /dev/video0 also dmesg |gerp v4l2 and dmesg|grep c0001 returned nothing.

Output of various commands are as follows:

$ ls /dev/video*
ls: cannot access '/dev/video*': No such file or directory
$ v4l2-ctl --list-devices
Failed to open /dev/video0: No such file or directory
$ sudo media-ctl -p -d /dev/media0
Media controller API version 0.1.0

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

Device topology
- entity 1: 150c0000.nvcsi--1 (2 pads, 0 link)
            type V4L2 subdev subtype Unknown flags 0
	pad0: Sink
	pad1: Source

I have also attached dmesg log, tegra186-camera-c0001-a00.dtsi and tegra186-quill-p3489-1000-a00-00-base.dts file.

.dmesg_28092021.txt (66.5 KB)
tegra186-camera-c0001-a00.dtsi (9.4 KB)
tegra186-quill-p3489-1000-a00-00-base.dts (10.9 KB)

PS: I have made one more modification in tegra186-camera-c0001-a00.dtsi, since we have a custom board, I have deleted the below portion.

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

Hi @ShaneCCC, Sorry, I did not understand, do I need to modify something in tegra186-quill-camera-e3326-a00.dtsi? (now tegra186-quill-camera-c0001-a00.dtsi after Jerry’s comment)

Just want to confirm if your dts have declare the context like tegra186-quill-camera-e3326-a00.dtsi

hello jetuser,

according to device topology, you have incorrect port binding results,
please review Port Binding session to define the port binding for VI, NvCSI, and sensor modules.

Hi @ShaneCCC, weh have commented out the camera plugin manager, tegra186-quill-camera-e3326-a00.dtsi and have included tegra186-quill-camera-c0001-a00.dtsi which is based on e3326. I am attaching our dts file here.


/*
 * tegra186-quill-p3489-a00-00-base.dts Quill A00 Board
 *
 * Copyright (c) 2015-2019, 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 <t18x-common-platforms/tegra186-quill-common-p3489-1000-a00.dtsi>
#include <t18x-common-platforms/tegra186-quill-power-tree-p3489-1000-a00-00.dtsi>
/* #include <t18x-common-platforms/tegra186-quill-camera-modules.dtsi> */
#include <t18x-common-modules/tegra186-camera-c0001-a00.dtsi>
#include <t18x-common-modules/tegra186-display-e3320-1000-a00.dtsi>
/* #include <t18x-common-modules/tegra186-camera-e3326-a00.dtsi> */

/* comms dtsi file should be included after gpio dtsi file */
#include <t18x-common-plugin-manager/tegra186-quill-p3489-1000-a00-plugin-manager.dtsi>
#include <t18x-common-modules/tegra186-super-module-e2614-p2597-1000-a00.dtsi>
#include <t18x-common-plugin-manager/tegra186-quill-display-plugin-manager.dtsi>
#include <t18x-common-prod/tegra186-priv-quill-p3489-1000-a00-prod.dtsi>
/* #include <t18x-common-plugin-manager/tegra186-quill-camera-plugin-manager.dtsi> */

/ {
	model = "storm";
	compatible = "nvidia,storm", "nvidia,p2597-0000+p3489-0000", "nvidia,tegra186";

	nvidia,dtsfilename = __FILE__;
	nvidia,boardids = "3489:0000:A0";
	nvidia,proc-boardid = "3489:0000:A0";
	nvidia,fastboot-usb-vid = <0x0955>;
	nvidia,fastboot-usb-pid = <0xee16>;

	chosen {
		board-has-eeprom;
#if TEGRA_BOOTARGUMENT_VERSION >= DT_VERSION_2
		bootargs ="console=ttyS0,115200 androidboot.presilicon=true firmware_class.path=/etc/firmware";
#else
		bootargs ="console=ttyS0,115200";
#endif
		stdout-path = &uarta;
		nvidia,tegra-joint_xpu_rail;
	};

	firmware {
		android {
			compatible = "android,firmware";
			hardware = "quill";
		};
	};

	memory@80000000 {
		device_type = "memory";
		reg = <0x0 0x80000000 0x0 0x70000000>;
	};

	xotg {
		status = "okay";
		phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>;
		phy-names = "otg-usb2";
	};

#if TEGRA_XUSB_PADCONTROL_VERSION >= DT_VERSION_2
	xudc@3550000 {
		status = "okay";
		phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>;
		phy-names = "usb2";
		nvidia,boost-cpu-freq = <1200>;
	};

	usb_cd {
		status = "okay";
		phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>;
		phy-names = "otg-phy";
		nvidia,xusb-padctl = <&xusb_padctl>;
	};
#else
	xudc@3550000 {
		status = "okay";
		phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>;
		phy-names = "usb2";
		emc-frequency = <150000000>;
		nvidia,boost-cpu-freq = <1200>;
	};
	usb_cd {
		status = "okay";
		phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>;
		phy-names = "otg-phy";
	};
#endif

#if TEGRA_XUSB_PADCONTROL_VERSION >= DT_VERSION_2
	xusb_padctl@3520000 {
		status = "okay";
		pinctrl-0 = <&vbus_en0_default_state>;
		pinctrl-1 = <&vbus_en1_default_state>;
		pinctrl-2 = <&vbus_en0_sfio_tristate_state>;
		pinctrl-3 = <&vbus_en1_sfio_tristate_state>;
		pinctrl-4 = <&vbus_en0_sfio_passthrough_state>;
		pinctrl-5 = <&vbus_en1_sfio_passthrough_state>;
		pinctrl-names = "vbus_en0_default", "vbus_en1_default",
			"vbus_en0_sfio_tristate", "vbus_en1_sfio_tristate",
			"vbus_en0_sfio_passthrough", "vbus_en1_sfio_passthrough";

		pads {
			usb2 {
				lanes {
					usb2-0 {
						nvidia,function = "xusb";
						status = "okay";
					};
					usb2-1 {
						nvidia,function = "xusb";
						status = "okay";
					};
					usb2-2 {
						nvidia,function = "xusb";
						status = "okay";
					};
				};
			};
			usb3 {
				lanes {
					usb3-0 {
						nvidia,function = "xusb";
						status = "okay";
					};
					usb3-1 {
						nvidia,function = "xusb";
						status = "okay";
					};
					usb3-2 {
						nvidia,function = "xusb";
						status = "okay";
					};
				};
			};
		};

		ports {
			usb2-0 {
				status = "okay";
				mode = "otg";
				vbus-supply = <&vdd_usb0_5v>;
				nvidia,oc-pin = <0>;
			};
			usb2-1 {
				status = "okay";
				mode = "host";
				vbus-supply = <&vdd_usb1_5v>;
				nvidia,oc-pin = <1>;
			};
			usb2-2 {
				status = "okay";
				mode = "host";
				vbus-supply = <&vdd_usb2_5v>;
			};
			usb3-0 {
				nvidia,usb2-companion = <1>;
				status = "okay";
			};
		};
	};
#endif
	pinctrl@3520000 {
		status = "okay";
		pinctrl-0 = <&tegra_xusb_padctl_pinmux_default>;
		pinctrl-1 = <&vbus_en0_sfio_tristate_state>;
		pinctrl-2 = <&vbus_en1_sfio_tristate_state>;
		pinctrl-3 = <&vbus_en0_sfio_passthrough_state>;
		pinctrl-4 = <&vbus_en1_sfio_passthrough_state>;
		pinctrl-5 = <&vbus_en0_default_state>;
		pinctrl-6 = <&vbus_en1_default_state>;
		pinctrl-names = "default",
			"vbus_en0_sfio_tristate", "vbus_en1_sfio_tristate",
			"vbus_en0_sfio_passthrough", "vbus_en1_sfio_passthrough",
			"vbus_en0_default", "vbus_en1_default";
		tegra_xusb_padctl_pinmux_default: pinmux {
			/* Quill does not support usb3-micro AB */
			usb2-micro-AB {
				nvidia,lanes = "otg-0";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
				nvidia,oc-pin = <0>;
			};
			usb2-std-A-port2 {
				nvidia,lanes = "otg-1";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				nvidia,oc-pin = <1>;
			};
			usb3-std-A-port2 {
				nvidia,lanes = "usb3-0";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				nvidia,oc-pin = <1>;
			};

			e3325-usb3-std-A-HS {
				nvidia,lanes = "otg-2";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				status = "disabled";
			};

			e3325-usb3-std-A-SS {
				nvidia,lanes = "usb3-0";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				status = "disabled";
			};
		};
	};

        pcie-controller@10003000 {
		status = "okay";
                pci@1,0 {
                        nvidia,num-lanes = <4>;
                        nvidia,disable-clock-request;
			status = "okay";
                };
                pci@2,0 {
                        nvidia,num-lanes = <0>;
			status = "disabled";
                };
                pci@3,0 {
                        nvidia,num-lanes = <1>;
			status = "okay";
                };
        };

	i2c@3160000 {
		lp8557-backlight-s-wuxga-8-0@2c {
			status = "disabled";
		};
	};

	i2c@c240000 {
		clock-frequency = <400000>;
	};

	cpus {
		status = "disabled";
	};

	host1x {
		disp_imp_table {
			num_settings = <7>;

			disp_imp_settings_6 {
				/* Calculated with 4 wins on one 1080p head */

				/* Global settings */
				nvidia,total_disp_bw_with_catchup = <0 2787800>;
				nvidia,total_disp_bw_without_catchup = <0 2534400>;
				nvidia,disp_emc_floor = <0 102000000>;
				nvidia,disp_min_hubclk = <0 49070000>;
				nvidia,total_win_fetch_slots = /bits/ 16 <1>;
				nvidia,total_cursor_fetch_slots = /bits/ 16 <1>;

				/* Window settings */
				nvidia,imp_win_mapping = /bits/ 8 <0 1 2 3 4 5>;
				nvidia,win_fetch_meter_slots = /bits/ 16 <1 1 1 1 1 1>;
				nvidia,win_dvfs_watermark_values = <0 0 0 0 0 0 0 0 0 0 0 0>;
				nvidia,win_pipe_meter_values = <0 0 0 0 0 0>;
				nvidia,win_mempool_buffer_entries = <0 817 0 817 0 817 0 817 0 817 0 817>;
				nvidia,win_thread_groups = /bits/ 8 <0 1 2 3 4 5>;

				/* Cursor settings */
				nvidia,imp_head_mapping = /bits/ 8 <0 1 2>;
				nvidia,cursor_fetch_meter_slots = /bits/ 16 <1 1 1>;
				nvidia,cursor_dvfs_watermark_values = <0 0 0 0 0 0>;
				nvidia,cursor_pipe_meter_values = <0 0 0>;
				nvidia,cursor_mempool_buffer_entries = <0 16 0 16 0 16>;
			};
		};

		sor {
			status = "disabled";
			dp-display {
				status = "disabled";
			};
			hdmi-display {
				status = "disabled";
			};

			panel-s-edp-uhdtv-15-6 {
				smartdimmer {
					status = "disabled";
				};
			};
		};

		dpaux@155c0000 {
			status = "disabled";
		};

		sor1 {
			status = "okay";
			hdmi-display {
				status = "okay";
			};
			dp-display {
				status = "disabled";
			};
		};

		nvdisplay@15200000 {
			status = "disabled";
		};

		nvdisplay@15220000 {
			status = "disabled";
		};
	};

        mttcan@c310000 {
                status = "okay";
                gpio_can_stb = <&tegra_aon_gpio TEGRA_AON_GPIO(AA, 0) GPIO_ACTIVE_HIGH>;
                gpio_can_en = <&tegra_aon_gpio TEGRA_AON_GPIO(AA, 1) GPIO_ACTIVE_HIGH>;
        };

        mttcan@c320000 {
                status = "okay";
                gpio_can_stb = <&tegra_aon_gpio TEGRA_AON_GPIO(AA, 6) GPIO_ACTIVE_HIGH>;
                gpio_can_en = <&tegra_aon_gpio TEGRA_AON_GPIO(AA, 7) GPIO_ACTIVE_HIGH>;
        };

        mc {
               ecc_on_camera_fw;
        };

	rtcpu@b000000 {
		/delete-property/ autosuspend-delay-ms;
		nvidia,disable-runtime-pm;
	};
	bpmp_i2c {
		spmic@3c {
			regulators {
				ldo0 {
					maxim,active-fps-source = <MAX77620_FPS_SRC_NONE>;
				};
				ldo6 {
					maxim,active-fps-source = <MAX77620_FPS_SRC_NONE>;
					regulator-boot-on;
					regulator-always-on;
				};
				ldo7 {
					regulator-min-microvolt = <1000000>;
					regulator-max-microvolt = <1000000>;
				};
				ldo8 {
					regulator-name = "dvdd-pex";
					regulator-min-microvolt = <1000000>;
					regulator-max-microvolt = <1000000>;
				};
			};
			pinmux@0 {
				pin_gpio2 {
					status = "disabled";
				};
				pin_gpio3 {
					status = "disabled";
				};
				pin_gpio7 {
					drive-push-pull = <1>;
				};
			};
		};
	};

#if TEGRA_XUSB_PADCONTROL_VERSION >= DT_VERSION_2
	xhci@3530000 {
		phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>,
			<&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-1}>,
			<&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-2}>,
			<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-0}>;
		phy-names = "usb2-0", "usb2-1", "usb2-2", "usb3-0";
		status = "okay";

	};
#else
	xhci@3530000 {
		status = "okay";
		phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>,
			<&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(1)>,
			<&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(0)>;
		phy-names = "utmi-0", "utmi-1", "usb3-0";
		nvidia,boost_cpu_freq = <800>;
	};

#endif

	ahci-sata@3507000 {
		gpios = <&spmic 7 0>;
	};

	gpio@2200000 {
		sdmmc-wake-support-input {
		        status = "okay";
		};
		sdmmc-wake-support-output {
		        status = "okay";
		};
	};

	fixed-regulators {
		regulator@1 {
			gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(P, 6) 0>;
		};
	};

	sdhci@3400000 {
		cd-gpios = <&tegra_main_gpio TEGRA_MAIN_GPIO(P, 5) 0>;
		nvidia,cd-wakeup-capable;
	};

	ina3221x@40 {
		channel@0 {
		        ti,shunt-resistor-mohm = <10>;
		};
		channel@1 {
		        ti,shunt-resistor-mohm = <10>;
		};
	};

	ina3221x@41 {
		 channel@0 {
			ti,shunt-resistor-mohm = <20>;
		 };
		 channel@1 {
			ti,shunt-resistor-mohm = <10>;
		 };
		 channel@2 {
			ti,rail-name = "VDD_SYS_DDR";
			ti,shunt-resistor-mohm = <10>;
		 };
	};

	tegra_udrm: tegra_udrm {
		compatible = "nvidia,tegra-udrm";
	};

	soctherm-oc-event {
		status = "okay";
	};
};

#ifdef KERNEL_VERSION_4_9
#include "quill-platforms/tegra186-quill-kernel-4.9.dtsi"
#endif

Hi @JerryChang,

We have taken reference from e3326 and the video tutorial, we have just replaced the keyword e3326 with c0001 and ov5693 with cm2021, this should not cause any pr0blem with respect to binding right? For your reference, please review our port binding:

/ {
	host1x {
		vi@15700000 {
			status = "okay";
			num-channels = <1>;
			ports {
				status = "okay";
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					c0001_vi_in0: endpoint {
						port-index = <0>;
						bus-width = <2>;
						remote-endpoint = <&c0001_csi_out0>;
					};
				};
			};
		};

		nvcsi@150c0000 {
			status = "okay";
			num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						c0001_csi_in0: endpoint@0 {
							port-index = <0>;
							bus-width = <2>;
							remote-endpoint = <&c0001_cm2021_out0>;
						};
					};
					port@1 {
						reg = <1>;
						c0001_csi_out0: endpoint@1 {
							remote-endpoint = <&c0001_vi_in0>;
						};
					};
				};
			};
		};
	};

Also we would like to point out one observation, when we reflashed the device,
Output of various commands were as follows:

$ ls /dev/video*
ls: cannot access '/dev/video*': No such file or directory
$ ls /dev/media0
/dev/media0

However, media-ctl gives us

~$ sudo media-ctl -p -d /dev/media0
[sudo] password for vte: 
sudo: media-ctl: command not found

However when we update using
sudo apt-get install v4l-utils
and then run
~$ sudo media-ctl -p -d /dev/media0
we get

$ sudo media-ctl -p -d /dev/media0
Media controller API version 0.1.0

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

Device topology
- entity 1: 150c0000.nvcsi--1 (2 pads, 0 link)
            type V4L2 subdev subtype Unknown flags 0
	pad0: Sink
	pad1: Source

hello jetuser,

your device topology looks incorrect since it should report the connections of below.

Sensor [out]–> [in] CSI [out] → [in] VI

please check the detail port binding definition from the reference driver,
thanks

Hello @JerryChang,
I’ve got the same issue as @jetuser, the media-ctl utils report an incorrect device topology.
But we have both, at my eyes the right syntax for the port binding, like describe in the Nvidia dev guide, V4L2 Sensor Driver Dev presentation etc…

Can you explain your last reply; is the port binding definition is dependent from the used driver ? Can media-ctl be faulty because of something with the rights device tree bindigs ports ?

hello Gaaryz,

it’s device tree settings to define the port bindings, and it’s media-ctl utility to show the device topology.
suggest you should check the reference driver, such as tegra186-camera-imx185-a00.dtsi.
you may also based-on that to modify the property settings and adapt with your drives.

furthermore,
please see [V4L2 Sensor Driver Development Tutorial] to review your driver implementation.
thanks