Custom camera registeration issue in AGX Xavier

Hello All,

I’m migration custom camera sensor from jetson-tx2 to xavier board.

when device driver was registered, i can’t found “video0” in dev folder.
so i checked dmesg as shown below.
[RCE] WARNING is never seen before.
what should i check it?

[   64.380964] imx686 2-0010: [IMX686]: probing v4l2 sensor at addr 0x10.
[   64.387296] imx686 2-0010: tegracam sensor driver:imx686_v2.0.6
[   64.408107] imx686 2-0010: imx686_set_exposure_ex: val: 0 [us], coarse_time: 0 [lines]
[   64.408589] imx686 2-0010: imx686_set_frame_rate_ex: val: 0e-6 [fps], frame_length: 0 [lines/frame] 900000000 [pix_clk_val] 1000000 [frm_factor] 13856 [line_length]
[   64.409688] imx686 2-0010: imx686_set_exposure_ex: val: 34 [us], coarse_time: 2 [lines]
[   64.410141] imx686 2-0010: imx686_set_frame_rate_ex: val: 4000000e-6 [fps], frame_length: 16238 [lines/frame] 900000000 [pix_clk_val] 1000000 [frm_factor] 13856 [line_length]
[   64.410896] imx686 2-0010: imx686_read_id: val: 0x0 = 0
[   64.411200] imx686 2-0010: imx686_read_id: val: 0x1 = 0
[   64.411350] imx686 2-0010: Detected IMX686 sensor
[  102.991671] [RCE] WARNING: t194/isp5.c:901 [config_channel] "All error notifications not enabled: correctable=0x00 uncorrectable=0x00"

hello jpchae,

assume your custom camera sensor works on Jetson-TX2, the port bindings should correct.
so, please follow Sensor Software Driver Programming and review all your device tree properties.
thanks

Hello JerryChang,

As your recommend, i verified port binding comand “sudo media-ctl -p -d /dev/media0”
device topology information was not appear.

Please review whether there is anything wrong while migrating to the xavier device tree.


Media controller API version 0.1.0

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

Device topology

my custom sensor specification as shown below.

csi-lane : 4 lane
ext-clock : 24MHz
nvidia-csi bus : csi-c/d
data format : bayer-raw10bit

1. device tree file " tegra194-camera-imx686-a00.dtsi" modified to setup port binding as directory below. **
** Kernel_bulid/public_sources/hardware/nvidia/platform/t19x/common/kernel-dts/t19x-common-modules/

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

			};
		};

		nvcsi@150c0000 {
			num-channels = <1>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						imx686_csi_in0: endpoint@0 {
							port-index = <2>;
							bus-width = <4>;
							remote-endpoint = <&imx686_imx686_out0>;
						};
					};
					port@1 {
						reg = <1>;
						imx686_csi_out0: endpoint@1 {
							remote-endpoint = <&imx686_vi_in0>;
						};
					};
				};
			};

		};

 
	tegra-camera-platform {
		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>;
		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 {
				status = "okay";
				badge = "imx686_rear";
				position = "rear";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "imx686 2-0010";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/imx686_c@10";
				};
			};

		};
	};
};

2. modified device tree file " tegra194-p2822-0000-camera-imx686-a00.dtsi " to setup gpio define. **
** Kernel_bulid/public_sources/hardware/nvidia/platform/t18x/common/kernel-dts/ common /

#include <t19x-common-modules/tegra194-camera-imx686-a00.dtsi>
#include "dt-bindings/clock/tegra194-clock.h"

#define CAM0_RST_L	TEGRA194_MAIN_GPIO(H, 3)
#define CAM0_PWDN	TEGRA194_MAIN_GPIO(H, 6)
#define CAM1_RST_L	TEGRA194_MAIN_GPIO(T, 6)
#define CAM1_PWDN	TEGRA194_MAIN_GPIO(T, 5)



/* camera control gpio definitions */

/ {

	gpio@2200000 {
		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";
		};
	};

	i2c@3180000 {
		imx686_c@10 {
			/* Define any required hw resources needed by driver */
			/* ie. clocks, io pins, power sources */
			/* mclk-index indicates the index of the */
			/* mclk-name with in the clock-names array */

			clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>,
			         <&bpmp_clks TEGRA194_CLK_PLLP_OUT0>;
			clock-names = "extperiph1", "pllp_grtba";
			mclk = "extperiph1";
			clock-frequency = <24000000>;
			reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
			pwdn-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
			vana-supply = <&p2822_avdd_cam_2v8>;  //<&en_vdd_cam_hv_2v8>;
			vif-supply =  <&p2822_vdd_1v8_cvb>;      //<&en_vdd_cam>;
			//vdig-supply = <&en_vdd_cam_1v2>;
		};


	};


}; 

3. device tree file "tegra194-p2888-0001-p2822-0000.dtsi " modified to register a device using the main platform device tree as folder directory below.
Kernel_bulid/public_sources/hardware/nvidia/platform/t19x/galen/kernel-dts/

#include "common/tegra194-p2888-0001-p2822-0000-common.dtsi"

//#include "common/tegra194-p2822-camera-modules.dtsi“                         // modified remove line 
//#include "t19x-common-modules/tegra194-camera-plugin-manager.dtsi“       // modified remove line 

#include "common/tegra194-p2822-0000-camera-imx686-a00.dtsi"                // include new device dtsi file  

hello jpchae,

please do not exclude tegra194-p2822-camera-modules.dtsi from the device tree sources.
this dtsi file assign the default CSI, VI port definitions, and also some general camera GPIOs.
please add this device tree sources back and please share the results.
thanks

Hello JerryChang,

I solved the problem.
The problem is that the VI and NVCSI register addresses do not match.
so i changed register address and fixed it .

including tegra194-p2822-camera-modules.dtsi from the device tree sources case was not working,
because i want to added new device using main platform device tree file.


	host1x {
		/* vi@15700000 {  //for tx2 */
		vi@15c10000 {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx686_vi_in0: endpoint {
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&imx686_csi_out0>;
					};
				};

			};
		};

		/* nvcsi@150c0000 {   //for tx2 */
		nvcsi@15a00000 {
			num-channels = <1>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						imx686_csi_in0: endpoint@0 {
							port-index = <2>;
							bus-width = <4>;
							remote-endpoint = <&imx686_imx686_out0>;
						};
					};
					port@1 {
						reg = <1>;
						imx686_csi_out0: endpoint@1 {
							remote-endpoint = <&imx686_vi_in0>;
						};
					};
				};
			};

		};

thanks,

1 Like