Video0 node not created after probing success OV2311

Hi,
I am using NVIDIA xavier NX interfaced with OV2311 image sensor with 2 lanes CSI4D0 and CSI4D1. I am using the following device tree:
/ {

host1x {
	vi@15c10000 {
		num-channels = <1>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				status = "okay";
				ov2311_vi_in4: endpoint {
					status = "okay";
					port-index = <4>;
					bus-width = <2>;
					remote-endpoint = <&ov2311_csi_out4>;
				};
			};
		};
	};
};

nvcsi@15a00000 {
	num-channels = <1>;
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";
	channel@0 {
		status = "okay";
		reg = <0>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				status = "okay";
				reg = <0>;
				ov2311_csi_in4: endpoint@0 {
					status = "okay";
					port-index = <4>;
					bus-width = <2>;
					remote-endpoint = <&ov2311_out4>;
				};
			};
			port@1 {
				status = "okay";
				reg = <1>;
				ov2311_csi_out4: endpoint@1 {
			   		status = "okay";
					remote-endpoint = <&ov2311_vi_in4>;
				};
			};
		};
	};
};


i2c@3180000 {   
	ov2311@60 {
		compatible = "nvidia,ov2311";
		reg = <0x60>; //I2C slave address
		devnode = "video0";//device name

		/* Physical dimensions of sensor */
		physical_w = "3.674";	//physical width of the sensor
		physical_h = "2.738";	//physical height of the sensor

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

		/* Define any required hw resources needed by driver */
		/* ie. clocks, io pins, power sources */
		avdd-reg = "vana";	//Power Regulator 
		iovdd-reg = "vif";	//Power Regulator
		mode0 { 
			mclk_khz = "24000";		//MIPI driving clock
			num_lanes = "2";		//Number of lanes
			tegra_sinterface = "serial_e"; //Serial interface
			phy_mode = "DPHY";		//physical connection mode
			discontinuous_clk = "yes";
			dpcm_enable = "false";		//Don't care
			cil_settletime = "0";		//Don't care

			active_w = "2592";		//active width
			active_h = "1944";		//active height
			mode_type = "bayer";		//sensor type
			pixel_phase = "bggr";		//output format
			csi_pixel_bit_depth = "10";	//bit per pixel
			readout_orientation = "0";	//Don't care
			line_length = "2688";		//Total width
			inherent_gain = "1";		//Don't care
			mclk_multiplier = "6.67";	//pix_clk_hz/mclk_khz
			pix_clk_hz = "160000000";	//Pixel clock HTotal*VTotal*FPS 
			gain_factor = "10";		//Don't care
			min_gain_val = "10";/* 1DB*/	//Don't care
			max_gain_val = "160";/* 16DB*/ //Don't care
			step_gain_val = "1";		//Don't care
			default_gain = "10";		//Don't care
			min_hdr_ratio = "1";		//Don't care
			max_hdr_ratio = "1";		//Don't care
			framerate_factor = "1000000";	//Don't care
			min_framerate = "1816577";	//Don't care
			max_framerate = "30000000";
			step_framerate = "1";
			default_framerate = "30000000";
			exposure_factor = "1000000";	//Don't care
			min_exp_time = "34";		//Don't care
			max_exp_time = "550385";	//Don't care
			step_exp_time = "1";		//Don't care
			default_exp_time = "33334";	//Don't care
			embedded_metadata_height = "0";//Don't care
		};	
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				ov2311_out4: endpoint {
					port-index = <4>;
					bus-width = <2>;
					remote-endpoint = <&ov2311_csi_in4>;
				};
			};
		};
	};
};

};

/ {
tegra-camera-platform {
compatible = “nvidia, tegra-camera-platform”;
num_csi_lanes = <2>; //Number of lanes
max_lane_speed = <1500000>; //Maximum lane speed
min_bits_per_pixel = <12>; //bits per pixel
vi_peak_byte_per_pixel = <2>; //byte per pixel
vi_bw_margin_pct = <25>; //Don’t care
max_pixel_rate = <160000>; //Don’t care
isp_peak_byte_per_pixel = <5>;//Don’t care
isp_bw_margin_pct = <25>; //Don’t care

	modules {
    	module0 { //OV2311 basic details
        		badge = "jakku_front_ov2311";
        		position = "front";
        		orientation = "1";	
		status = "okay";
        		drivernode0 {
            		pcl_id = "v4l2_sensor";
			status = "okay";
            		devname = "ov2311 2-0060";
            		proc-device-tree = "/proc/device-tree/i2c@3180000/ov2311@60"; //Device tree node path
        			};
    		};
		};
};  	

};

The cam_i2c pins are directly connected. The image sensor is detected properly but the /dev/video0 node is not created. Can anyone help with this ?

Does any vi bound message from kernel boot message like below?

[    2.006568] imx219 10-0010: tegracam sensor driver:imx219_v2.0.6
[    3.082487] tegra194-vi5 15c10000.vi: subdev imx219 10-0010 bound

yes I got following message:
ov2311 2-0060: Detected OV002311 sensor
tegra194-vi5 15c10000.vi: subdev mov2311 2-0060 bound

Does the .compatible string in ov2311.c correct?

yes its same:
static const struct of_device_id ov2311_of_match = {
{ .compatible = “nvidia,ov2311” },
{},
};
MODULE_DEVICE_TABLE(of, ov2311_of_match);

static const struct i2c_device_id ov2311_match_id = {
{ “ov2311”, 0 },
{ },
};
MODULE_DEVICE_TABLE(i2c, ov2311_match_id);

Is anything need to be added in overlay dts. I am new to image sensor . Can you provide suggestions to debug?

Try to enable the debug print in the tegracam_core.c to check if able figure any clue.

Like the tegracam_device_register() and tegracam_v4l2subdev_register()

v4l2_async_register_subdev is used for registering device and its returning no error.

Hi ,
I done changes in device tree. Now I am facing seg fault during insmod. I am getting following trace:
[ 44.732246] Process insmod (pid: 7666, stack limit = 0xffffffc1d5e0c000)
[ 44.738625] Call trace:
[ 44.740735] [] tegra_channel_fmts_bitmap_init+0x18c/0x298
[ 44.747640] [] tegra_channel_init_subdevices+0x17c/0x790
[ 44.753855] [] tegra_vi_graph_notify_complete+0x2e8/0x6e8
[ 44.760594] [] v4l2_async_test_notify+0xcc/0x148
[ 44.766365] [] v4l2_async_register_subdev+0x88/0x128
[ 44.772237] [] ov2311_probe+0x52c/0x708 [ov2311]
[ 44.778096] [] i2c_device_probe+0x144/0x258
[ 44.783432] [] driver_probe_device+0x298/0x448
[ 44.789289] [] __driver_attach+0xdc/0x128
[ 44.794539] [] bus_for_each_dev+0x5c/0xa8
[ 44.800315] [] driver_attach+0x30/0x40
[ 44.805563] [] bus_add_driver+0x20c/0x2a8
[ 44.810992] [] driver_register+0x6c/0x110
[ 44.816768] [] i2c_register_driver+0x4c/0xb0
[ 44.822894] [] ov2311_i2c_driver_init+0x14/0x30 [ov2311]
[ 44.829891] [] do_one_initcall+0x44/0x130
[ 44.835578] [] do_init_module+0x64/0x1b0
[ 44.840831] [] load_module+0x10ac/0x12e0
[ 44.846514] [] SyS_finit_module+0xd8/0xf0
[ 44.852288] [] el0_svc_naked+0x34/0x38
[ 44.857545] —[ end trace 6ac8333664792b08 ]—

I am new to camera sensor driver.Can you please suggest a way to debug it.

Maybe check what modification cause the NULL point in tegra_channel_fmts_bitmap_init()

Hi Shane, I got the ov2311 module probed . I am getting error logs when tried to get image using v4l2-ctl command:
misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 0 kbyteps at 0 KHz
[ 272.770802] misc tegra_camera_ctrl: tegra_camera_isomgr_request: failed to reserve 0 KBps
[ 272.770936] misc tegra_camera_ctrl: tegra_camera_update_isobw: failed to reserve 0 KBps with isomgr
[ 272.821611] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 32, err_data 164
[ 272.838239] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2, flags: 32, err_data 164
[ 272.857241] tegra194-vi5 15c10000.vi: corr_err: discarding frame 3, flags: 0, err_data 512
[ 272.871554] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 164
[ 273.180138] misc tegra_camera_ctrl: tegra_camera_update_isobw:Set iso bw 0 kbyteps at 0 KHz

I used following command:

v4l2-ctl --set-fmt-video=width=1600,height=1080,pixelformat=Y10 --stream-mmap -d /dev/video0 --set-ctrl bypass_mode=0 --stream-count=1 --stream-to=test.Y10

Check the trace log to get more information.

https://elinux.org/Jetson/l4t/Camera_BringUp

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.