Orinx NX portting sensor failed

hello nvidia: I am portting a new sensor to Orin NX, it can’t receive any validate data from the MIPI bus. The same DTS and driver is working well in jetson tx2 nx and jetson nano. There is some trace info below. I have no ideas to solve it, please help me.

root@nvidia-desktop:/home/nvidia# v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'UYVY' (UYVY 4:2:2)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
        [1]: 'NV16' (Y/CbCr 4:2:2)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
        [2]: 'UYVY' (UYVY 4:2:2)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)


root@nvidia-desktop:/home/nvidia# media-ctl -p -d /dev/media0
Media controller API version 5.10.120

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

Device topology
- entity 1: 13e40000.host1x:nvcsi@15a00000- (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
        pad0: Sink
                <- "nvp6188 7-0030":0 [ENABLED]
        pad1: Source
                -> "vi-output, nvp6188 7-0030":0 [ENABLED]

- entity 4: nvp6188 7-0030 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev1
        pad0: Source
                [fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb]
                -> "13e40000.host1x:nvcsi@15a00000-":0 [ENABLED]

- entity 6: vi-output, nvp6188 7-0030 (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video0
        pad0: Sink
                <- "13e40000.host1x:nvcsi@15a00000-":1 [ENABLED]



root@nvidia-desktop:/home/nvidia# cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 31/31   #P:4
#
#                                _-----=> irqs-off
#                               / _----=> need-resched
#                              | / _---=> hardirq/softirq
#                              || / _--=> preempt-depth
#                              ||| /     delay
#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
#              | |         |   ||||      |         |
     kworker/2:0-25      [002] ....   135.555946: rtcpu_string: tstamp:4891112159 id:0x04010000 str:"VM0 deactivating."
        v4l2-ctl-2284    [000] ....   154.898668: tegra_channel_open: vi-output, nvp6188 7-0030
        v4l2-ctl-2284    [000] ....   154.904509: tegra_channel_set_power: nvp6188 7-0030 : 0x1
        v4l2-ctl-2284    [000] ....   154.904521: camera_common_s_power: status : 0x1
        v4l2-ctl-2284    [000] ....   154.904545: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x1
        v4l2-ctl-2284    [000] ....   154.904547: csi_s_power: enable : 0x1
        v4l2-ctl-2284    [000] ....   154.905231: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13
        v4l2-ctl-2284    [001] ....   154.911590: tegra_channel_set_stream: enable : 0x1
        v4l2-ctl-2284    [001] ....   154.922626: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x1
        v4l2-ctl-2284    [001] ....   154.922629: csi_s_stream: enable : 0x1
        v4l2-ctl-2284    [001] ....   154.923064: tegra_channel_set_stream: nvp6188 7-0030 : 0x1
     kworker/2:0-25      [002] ....   154.934342: rtcpu_string: tstamp:5496348338 id:0x04010000 str:"VM0 activating."
     kworker/2:0-25      [002] ....   154.934345: rtcpu_vinotify_event: tstamp:5496811973 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:175887248096 data:0x759d580010000000
     kworker/2:0-25      [002] ....   154.934346: rtcpu_vinotify_event: tstamp:5496812129 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:175887254560 data:0x0000000031000001
     kworker/2:0-25      [002] ....   154.934346: rtcpu_vinotify_event: tstamp:5496812285 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:175887305600 data:0x759d550010000000
     kworker/2:0-25      [002] ....   154.934346: rtcpu_vinotify_event: tstamp:5496812417 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:175887312192 data:0x0000000031000002
 vi-output, nvp6-2286    [003] ....   157.470592: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13
     kworker/2:0-25      [002] ....   157.526110: rtcpu_vinotify_event: tstamp:5576681213 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:178446462496 data:0x759d580010000000
     kworker/2:0-25      [002] ....   157.526112: rtcpu_vinotify_event: tstamp:5576681354 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:178446489920 data:0x0000000031000001
     kworker/2:0-25      [002] ....   157.526113: rtcpu_vinotify_event: tstamp:5576681510 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:178446501248 data:0x759d550010000000
     kworker/2:0-25      [002] ....   157.526113: rtcpu_vinotify_event: tstamp:5576681644 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:178446540064 data:0x0000000031000002
        v4l2-ctl-2284    [002] ....   158.499007: tegra_channel_close: vi-output, nvp6188 7-0030
 vi-output, nvp6-2286    [003] ....   160.061560: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13
        v4l2-ctl-2284    [002] ....   160.071204: tegra_channel_set_stream: enable : 0x0
        v4l2-ctl-2284    [002] ....   160.071205: tegra_channel_set_stream: nvp6188 7-0030 : 0x0
        v4l2-ctl-2284    [002] ....   160.072225: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x0
        v4l2-ctl-2284    [002] ....   160.072227: csi_s_stream: enable : 0x0
        v4l2-ctl-2284    [001] ....   160.084838: tegra_channel_set_power: nvp6188 7-0030 : 0x0
        v4l2-ctl-2284    [001] ....   160.084847: camera_common_s_power: status : 0x0
        v4l2-ctl-2284    [001] ....   160.088516: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x0
        v4l2-ctl-2284    [001] ....   160.088519: csi_s_power: enable : 0x0

This is my DTS, “lane_polarity” I try to use 0 and 6 both not work.

/ {
	tegra-capture-vi  {
		num-channels = <1>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				nvp6188_vi_in0: endpoint {
					port-index = <0>;
					bus-width = <2>;
					remote-endpoint = <&nvp6188_csi_out0>;
				};
			};
		};
	};

	host1x@13e00000 {
		nvcsi@15a00000 {
			num-channels = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				ports {
					#address-cells = <1>;
					#size-cells = <0>;
					port@0 {
						reg = <0>;
						nvp6188_csi_in0: endpoint@0 {
							port-index = <0>;
							bus-width = <2>;
							remote-endpoint = <&nvp6188_nvp6188_out0>;
						};
					};
					port@1 {
						reg = <1>;
						nvp6188_csi_out0: endpoint@1 {
							remote-endpoint = <&nvp6188_vi_in0>;
						};
					};
				};
			};
		};
	};

	i2c@c250000 {		
		nvp6188_a@30 {
			compatible = "nvidia,nvp6188";
			reg = <0x30>;
			devnode = "video0";
			physical_w = "15.0";
			physical_h = "12.5";
			sensor_model ="nvp6188";
			post_crop_frame_drop = "3";
			use_decibel_gain = "true";
			delayed_gain = "true";
			use_sensor_mode_id = "true";
			mode0 {/*mode NVP6188_MODE_1920X1080_CROP_30FPS*/
				mclk_khz = "27000";
				num_lanes = "2";
				tegra_sinterface = "serial_a";
				phy_mode = "DPHY";
				discontinuous_clk = "yes";
				dpcm_enable = "false";
				cil_settletime = "0";
				lane_polarity = "0";

				active_w = "1920";
				active_h = "1080";
				mode_type = "yuv";
				pixel_phase = "uyvy";
				dynamic_pixel_bit_depth = "16";
				csi_pixel_bit_depth = "16";
				readout_orientation = "0";
				line_length = "2200";
				inherent_gain = "1";
				mclk_multiplier = "18";
				pix_clk_hz = "1188000000";

				gain_factor = "16";
				framerate_factor = "1000000";
				exposure_factor = "1000000";
				min_gain_val = "16";
				max_gain_val = "356";
				step_gain_val = "1";
				default_gain = "16";
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "1500000"; /* 1.5 */
				max_framerate = "30000000"; /* 30 */
				step_framerate = "1";
				default_framerate = "30000000";
				min_exp_time = "25"; /* us */
				max_exp_time = "660000"; /* us */
				step_exp_time = "1";
				default_exp_time = "33334";/* us */
				embedded_metadata_height = "0";
			};

			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					nvp6188_nvp6188_out0: endpoint {
						port-index = <0>;
						bus-width = <2>;
						remote-endpoint = <&nvp6188_csi_in0>;
					};
				};
			};
		};
	};
	
};

/ {
	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 = <8>;
		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 = "nvp6188_front_linv6188";
				position = "bottom";
				orientation = "0";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "nvp6188 30-001a";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@c250000/nvp6188_a@30";
				};
			};
		};
	};
};

Hello @user7218,

What can you observe from the captured data ?
Ia it all black or does it have some color pixels like there could be data ?

What happens if you try to capture with nvarguscamerasrc?

regards,
Andrew

Hi @user7218,

Regarding the lane_polarity I saw you tested with 0x0 and 0x6, but just to confirm according to the NVIDIA’s documentation you should use lane_polarity = "0x6":

Your issue could be on the value selected for the pix_clk_hz = "1188000000", looks very big (1.188 Gbps), you could check Sensor Pixel Clock documentation to find out the correct value for your camera. Sometimes is difficult to find the right one and it’s needed to test different values. You could also try some values for example: 74500000, 100000000, 150000000, 250000000, 500000000.

Also you can try to set it a low value like 74500000, and boost the VI, NVCSI, ISP clocks, to see you get the capture working:

sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate

Best Regards,

Enrique Ramirez
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com

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