Max9296 ----max9295-----imx390

When I use v4l2 to get raw Image throught the /dev/video0 , It will enter the blockage.

[ 95.472398] imx390 2-0021: imx390_power_on: power on
[ 95.480504] imx390 2-0021: imx390_s_stream++ enable 1
[ 95.716920] [RCE] Configuring VI GoS.
[ 95.716936] [RCE] VM GOS[#0] addr=0xe4900000
[ 95.716941] [RCE] VM GOS[#1] addr=0xe4901000
[ 95.716946] [RCE] VM GOS[#2] addr=0xe4902000
[ 95.716950] [RCE] VM GOS[#3] addr=0xe4903000
[ 95.716954] [RCE] VM GOS[#4] addr=0xe4904000
[ 95.716958] [RCE] VM GOS[#5] addr=0xe4905000
[ 95.717014] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[ 95.717066] [RCE] VI GOS[#0] set to VM GOS[4] base 0xe4904000
[ 98.407024] tegra194-vi5 15c10000.vi: no reply from camera processor
[ 98.407160] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[ 98.407302] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[ 98.409992] tegra194-vi5 15c10000.vi: err_rec: successfully reset the capture channel
[ 98.419557] [RCE] Configuring VI GoS.
[ 98.419562] [RCE] VM GOS[#0] addr=0xe4900000
[ 98.419565] [RCE] VM GOS[#1] addr=0xe4901000
[ 98.419567] [RCE] VM GOS[#2] addr=0xe4902000
[ 98.419592] [RCE] VM GOS[#3] addr=0xe4903000
[ 98.419596] [RCE] VM GOS[#4] addr=0xe4904000
[ 98.419617] [RCE] VM GOS[#5] addr=0xe4905000
[ 98.477770] imx390 2-0021: imx390_s_stream++ enable 0
[ 98.481109] tegra194-vi5 15c10000.vi: unexpected response from camera processor
[ 98.481400] video4linux video0: vi capture release failed
[ 98.481590] tegra194-vi5 15c10000.vi: unexpected response from camera processor
[ 98.481943] tegra194-vi5 15c10000.vi: unexpected response from camera processor
[ 98.482175] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 98.482333] Mem abort info:
[ 98.482409] ESR = 0x96000005
[ 98.482728] Exception class = DABT (current EL), IL = 32 bits
[ 98.482845] SET = 0, FnV = 0
[ 98.483108] EA = 0, S1PTW = 0
[ 98.483197] Data abort info:
[ 98.483312] ISV = 0, ISS = 0x00000005
[ 98.483457] CM = 0, WnR = 0
[ 98.483600] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc78e9e2000
[ 98.483729] [0000000000000000] *pgd=0000000000000000, *pud=0000000000000000
[ 98.483856] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 98.483952] Modules linked in: mttcan can_dev can_raw can fuse bnep overlay m25p80 nvs_bmi160 nvs nvgpu binfmt_misc bluedroid_pm ip_tables x_tables
[ 98.487625] CPU: 0 PID: 8380 Comm: v4l2-ctl Not tainted 4.9.140 #77
[ 98.493658] Hardware name: jetson-xavier (DT)
[ 98.498209] task: ffffffc7863bc600 task.stack: ffffffc78e92c000
[ 98.504180] PC is at vi_capture_request_unpin+0x40/0xb8
[ 98.509322] LR is at vi_capture_request_unpin+0x34/0xb8
[ 98.514567] pc : [] lr : [] pstate: 20400045
[ 98.521915] sp : ffffffc78e92fa30
[ 98.525073] x29: ffffffc78e92fa30 x28: 0000000000000000
[ 98.530943] x27: ffffffc7c7b27030 x26: 0000000000000001
[ 98.536527] x25: ffffff8009fe1490 x24: 0000000000000013
[ 98.542128] x23: ffffffc7c16de400 x22: 0000000000000000
[ 98.546939] x21: ffffffc7c16de668 x20: ffffffc77519f880
[ 98.552015] x19: 0000000000000000 x18: 0000000000000010
[ 98.557788] x17: 0000000000000002 x16: 0000000000000000
[ 98.563480] x15: ffffffffffffffff x14: 6f72662065736e6f
[ 98.568913] x13: 7073657220646574 x12: 63657078656e7520
[ 98.574687] x11: 3a69762e30303030 x10: 000000000000048d
[ 98.580716] x9 : 2d34393161726765 x8 : ffffff80083d2fe8
[ 98.586490] x7 : ffffff8009ec4118 x6 : ffffff80083d23f8
[ 98.592003] x5 : 0000000000000015 x4 : ffffffc7ffde3be8
[ 98.597339] x3 : ffffffc7ffde3be8 x2 : 0000000000000007
[ 98.602422] x1 : 0000000000000000 x0 : 0000000000000000

[ 98.609454] Process v4l2-ctl (pid: 8380, stack limit = 0xffffffc78e92c000)
[ 98.616079] Call trace:
[ 98.618453] [] vi_capture_request_unpin+0x40/0xb8
[ 98.624309] [] vi_capture_shutdown+0xac/0x118
[ 98.629908] [] vi_channel_close_ex+0x2c/0x88
[ 98.635515] [] vi5_channel_stop_streaming+0x64/0xa8
[ 98.641461] [] tegra_channel_stop_streaming+0x34/0x48
[ 98.647595] [] __vb2_queue_cancel+0x34/0x188
[ 98.653449] [] vb2_core_streamoff+0x54/0xb8
[ 98.658773] [] vb2_streamoff+0x54/0x88
[ 98.663844] [] vb2_ioctl_streamoff+0x54/0x60
[ 98.669456] [] v4l_streamoff+0x3c/0x50
[ 98.674351] [] __video_do_ioctl+0x204/0x2c8
[ 98.679965] [] video_usercopy+0x2a0/0x6a0
[ 98.685816] [] video_ioctl2+0x3c/0x50
[ 98.691057] [] v4l2_ioctl+0x88/0x118
[ 98.696219] [] do_vfs_ioctl+0xb0/0x8d8
[ 98.701554] [] SyS_ioctl+0x8c/0xa8
[ 98.706461] [] el0_svc_naked+0x34/0x38
[ 98.711715] —[ end trace 288b49af438e4457 ]—

Hi @dingjie,

This can occur due a number of reasons. Could you please provide the following information:

  • Jetpack version
  • Are you using a custom driver?
  • Do you get the same behaviour if you configure the camera with other resolutions, framerate, etc?
  • What command are you using to get the raw image?
  • Are you able to read/write manually to camera registers?

Regards,
Fabian
www.ridgerun.com

Also have a check this link may help.

https://elinux.org/Jetson_TX2_Camera_BringUp

Thanks,you are right,It can slove my probleam.

I use two max9296 to link four max9295 to use four imx390.
Now ,I can open 2 camera and get video when it’s port-index=<0>.
But I can’t get video from the other two camera (port-index=<2>).
although I can measured the MIPI waveform on the max9296.

/ {
host1x {
	vi@15c10000 {
		num-channels = <4>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				imx390_vi_in0: endpoint {
					vc-id = <0>;
					port-index = <0>;
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out0>;
				};
			};
			#if 1
			port@1 {
				reg = <1>;
				imx390_vi_in1: endpoint {
					vc-id = <1>;
					port-index = <0>;
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out1>;
				};
			};
			#endif

			#if 1
			port@2 {
				reg = <2>;
				imx390_vi_in2: endpoint {
					vc-id = <0>;
					port-index = <2>;
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out2>;
				};
			};
			#endif

			#if 1
			port@3 {
				reg = <3>;
				imx390_vi_in3: endpoint {
					vc-id = <1>;
					port-index = <2>;
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out3>;
				};
			};
			#endif
		};
	};

	nvcsi@15a00000 {
		num-channels = <4>;
		#address-cells = <1>;
		#size-cells = <0>;
		channel@0 {
			reg = <0>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_csi_in0: endpoint@0 {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx390_imx390_out0>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_csi_out0: endpoint@1 {
						remote-endpoint = <&imx390_vi_in0>;
					};
				};
			};
		};
		#if 1
		channel@1 {
			reg = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_csi_in1: endpoint@2 {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx390_imx390_out1>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_csi_out1: endpoint@3 {
						remote-endpoint = <&imx390_vi_in1>;
					};
				};
			};
		};
		#endif

		#if 1
		channel@2 {
			reg = <2>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_csi_in2: endpoint@4 {
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&imx390_imx390_out2>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_csi_out2: endpoint@5 {
						remote-endpoint = <&imx390_vi_in2>;
					};
				};
			};
		};
		#endif

		#if 1
		channel@3 {
			reg = <3>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_csi_in3: endpoint@6 {
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&imx390_imx390_out3>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_csi_out3: endpoint@7 {
						remote-endpoint = <&imx390_vi_in3>;
					};
				};
			};
		};
		#endif
	};
};

i2c@3180000 {
		imx390_a@11{
			compatible = "nvidia,imx390";

			reg = <0x11>;

			/* Physical dimensions of sensor */
			physical_w = "15.0";
			physical_h = "12.5";

			sensor_model ="imx390";

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

			/* Convert Gain to unit of dB (decibel) befor passing to kernel driver */
			use_decibel_gain = "true";

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

			/* enable CID_SENSOR_MODE_ID for sensor modes selection */
			use_sensor_mode_id = "true";

			mode0 {/*mode IMX390_MODE_1920X1080_CROP_30FPS*/
				mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_a";
				vc_id = "0";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";
				dynamic_pixel_bit_depth = "12";
				csi_pixel_bit_depth = "12";
				mode_type = "bayer";
				pixel_phase = "rggb";

				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb12";
				readout_orientation = "0";
				line_length = "4400";
				inherent_gain = "1";
				mclk_multiplier = "6.18";
				pix_clk_hz = "148500000";
				serdes_pix_clk_hz = "148500000";

				min_gain_val = "0"; /* dB */
				max_gain_val = "30"; /* dB */
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "1.5";
				max_framerate = "30";
				min_exp_time = "118"; /*us,4 lines*/
				max_exp_time = "660000";
				embedded_metadata_height = "0";
			};
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_imx390_out0: endpoint {
						vc-id = <0>;
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx390_csi_in0>;
						};
					};
				};
			gmsl-link {
				src-csi-port = "b";
				dst-csi-port = "b";
				serdes-csi-link = "a";
				csi-mode = "1x4";
				st-vc = <0>;
				vc-id = <0>;
				num-lanes = <4>;
			    streams = "raw12";
				};
			};

		#if 1
		imx390_b@12 {
			compatible = "nvidia,imx390";

			reg = <0x12>;

			/* Physical dimensions of sensor */
			physical_w = "15.0";
			physical_h = "12.5";

			sensor_model ="imx390";

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

			/* Convert Gain to unit of dB (decibel) befor passing to kernel driver */
			use_decibel_gain = "true";

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

			/* enable CID_SENSOR_MODE_ID for sensor modes selection */
			use_sensor_mode_id = "true";

			mode0 {/*mode IMX390_MODE_1920X1080_CROP_30FPS*/
				mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_a";
				vc_id = "1";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";
				dynamic_pixel_bit_depth = "12";
				csi_pixel_bit_depth = "12";
				mode_type = "bayer";
				pixel_phase = "rggb";

				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb12";
				readout_orientation = "0";
				line_length = "4400";
				inherent_gain = "1";
				mclk_multiplier = "6.18";
				pix_clk_hz = "148500000";
				serdes_pix_clk_hz = "148500000";

				min_gain_val = "0"; /* dB */
				max_gain_val = "30"; /* dB */
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "1.5";
				max_framerate = "30";
				min_exp_time = "118"; /*us,4 lines*/
				max_exp_time = "660000";
				embedded_metadata_height = "0";
			};
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_imx390_out1: endpoint {
						vc-id = <1>;
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx390_csi_in1>;
						};
					};
				};
			gmsl-link {
				src-csi-port = "b";
				dst-csi-port = "b";
				serdes-csi-link = "b";
				csi-mode = "1x4";
				st-vc = <0>;
				vc-id = <1>;
				num-lanes = <4>;
				streams =  "raw12";
				};
			};
			#endif

		#if 1
		imx390_c@13 {
			compatible = "nvidia,imx390";
			reg = <0x13>;
			physical_w = "15.0";
			physical_h = "12.5";
			sensor_model ="imx390";
			post_crop_frame_drop = "0";
			use_decibel_gain = "true";
			delayed_gain = "true";
			use_sensor_mode_id = "true";
			mode0 {/*mode IMX390_MODE_1920X1080_CROP_30FPS*/
				mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_c";
				vc_id = "0";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";
				dynamic_pixel_bit_depth = "12";
				csi_pixel_bit_depth = "12";
				mode_type = "bayer";
				pixel_phase = "rggb";
				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb12";
				readout_orientation = "0";
				line_length = "4400";
				inherent_gain = "1";
				mclk_multiplier = "6.18";
				pix_clk_hz = "148500000";
				serdes_pix_clk_hz = "148500000";
				min_gain_val = "0"; /* dB */
				max_gain_val = "30"; /* dB */
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "1.5";
				max_framerate = "30";
				min_exp_time = "118"; /*us,4 lines*/
				max_exp_time = "660000";
				embedded_metadata_height = "0";
			};
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_imx390_out2: endpoint {
						vc-id = <0>;
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&imx390_csi_in2>;
						};
					};
				};
			gmsl-link {
				src-csi-port = "b";
				dst-csi-port = "b";
				serdes-csi-link = "a";
				csi-mode = "1x4";
				st-vc = <0>;
				vc-id = <0>;
				num-lanes = <4>;
				streams =  "raw12";
				};
			};
			#endif

		#if 1
		imx390_d@14 {
			compatible = "nvidia,imx390";
			reg = <0x14>;
			physical_w = "15.0";
			physical_h = "12.5";
			sensor_model ="imx390";
			post_crop_frame_drop = "0";
			use_decibel_gain = "true";
			delayed_gain = "true";
			use_sensor_mode_id = "true";
			mode0 {/*mode IMX390_MODE_1920X1080_CROP_30FPS*/
				mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_c";
				vc_id = "1";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";
				dynamic_pixel_bit_depth = "12";
				csi_pixel_bit_depth = "12";
				mode_type = "bayer";
				pixel_phase = "rggb";
				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb12";
				readout_orientation = "0";
				line_length = "4400";
				inherent_gain = "1";
				mclk_multiplier = "6.18";
				pix_clk_hz = "148500000";
				serdes_pix_clk_hz = "148500000";
				min_gain_val = "0"; /* dB */
				max_gain_val = "30"; /* dB */
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "1.5";
				max_framerate = "30";
				min_exp_time = "118"; /*us,4 lines*/
				max_exp_time = "660000";
				embedded_metadata_height = "0";
			};
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_imx390_out3: endpoint {
						vc-id = <1>;
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&imx390_csi_in3>;
						};
					};
				};
			gmsl-link {
				src-csi-port = "b";
				dst-csi-port = "b";
				serdes-csi-link = "b";
				csi-mode = "1x4";
				st-vc = <0>;
				vc-id = <1>;
				num-lanes = <4>;
				streams =  "raw12";
				};
			};
			#endif
};

};

/ {

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 = <8>;
	max_lane_speed = <4000000>;
	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 {
			badge = "imx390_rear";
			position = "rear";
			orientation = "1";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "imx390 2-0011";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/imx390_a@11";
			};
		};
		#if 1
		module1 {
			badge = "imx390_front";
			position = "front";
			orientation = "1";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "imx390 2-0012";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/imx390_b@12";
			};
		};
		#endif

		#if 1
		module2 {
			badge = "imx390_left";
			position = "left";
			orientation = "1";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "imx390 2-0013";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/imx390_c@13";
			};
		};
		#endif

		#if 1
		module3 {
			badge = "imx390_right";
			position = "right";
			orientation = "1";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "imx390 2-0014";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/imx390_d@14";
			};
		};
		#endif
	};
};

};

This is my dts. The camera imx390_c and imx390_d is not normal. I can`t get video stream from them.

Didn’t see have problem for the source code of the dt currently.
Have you check the trace log while capture failed?

This is a part of my trace log.
trace.log (121.3 KB)

Have a check the TRM for REG NVCSI_STREAM_0_INTR_STATUS_VC0_0 it’s intr_stat_ph_ecc_single_bit_err_vc0 and intr_stat_pd_wc_short_err_vc0 the sensor output package have problem may be HW or something wrong cause it.

kworker/0:1-9996 [000] … 3361.985505: rtcpu_nvcsi_intr: tstamp:105265961597 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:2 vc:0 status:0x0000000a

I’m also interested in this issue,but how to check the reg you mentioned.

You can download the TRM from download center.

Yes,I have got the TRM,and the start address of NVCSI is 0x15a00000,the offset of “NVCSI_STREAM_0_INTR_STATUS_VC0_0” is 0x408C,I try to read the register:

titan@titan-desktop:~$ sudo devmem2 0x15a0408c
**[sudo] password for titan: **
/dev/mem opened.
Memory mapped at address 0x7f9da26000.
Bus error

if I access the 0x15a04080,

titan@titan-desktop:~$ sudo devmem2 0x15a04080
[sudo] password for titan:

and the XAVIER reboot

I have saw the TRM about NVCSI_STREAM_0_INTR_STATUS_VC0_0, I think this REG is about STREAM0 .
,my camera whose port-index=<0>(STREAM 0) can get video, athought it may have some probleam.

Now ,we need to focus on the camera whose port-index=<2>. It can’t get video.This is what we need to slove urgently at present.

Thanks.

I would suggest to review the HW and Max’s configure.

I dont think this is a problem with Max’s configure.
As shown in the figure,we configured two groups with the same configuration.The above group is good,the only different between two groups is csi lane.

Hi @dingjie,

From the device tree file that you shared I noticed that the tegra_sinterface may be misconfigured, from the image you provided above you should have CSI A,B,C,D configured, but at the device tree you are not reflecting those configurations. Please check the following property at each camera to make sure they are serial_a, serial_b, serial_c and serial_d if that is where you are receiving data they should match your needs.

tegra_sinterface = "serial_c";

I dont think it should be serial_a,serial_b,serial_c and serial_d.
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fcamera_sensor_prog.html%23wwpID0E0XBB0HA


In this pic,if the bus-width=<4>,the CSI A and CSI B will be divided into one group,CSI C and CSI D are the same .
so I think the two cameras connected to the first max9296 shoud be serial_a and port-index=<0>,The other two are serial_c and port-index=<2>.

I am not familiar with the Max driver, but I found below configure have a litter different with reference board tegra186-camera-e3322-a00.dtsi

		gmsl-link {
			src-csi-port = "b";
			dst-csi-port = "b";
			serdes-csi-link = "b";
			csi-mode = "1x4";
			st-vc = <0>;
			vc-id = <1>;
			num-lanes = <4>;
			streams =  "raw12";
			};

I modifed my device tree,and now ,I can turn on the other two cameras,but the previous can’t be opened.

/ {
host1x {
	vi@15c10000 {
		num-channels = <4>;
		ports {
			#address-cells = <1>;
			#size-cells = <0>;
			port@0 {
				reg = <0>;
				imx390_vi_in0: endpoint {
					vc-id = <0>;
					port-index = <2>;
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out0>;
				};
			};
			port@1 {
				reg = <1>;
				imx390_vi_in1: endpoint {
					vc-id = <1>;
					port-index = <2>;
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out1>;
				};
			};
			#if 1
			port@2 {
				reg = <2>;
				imx390_vi_in2: endpoint {
					vc-id = <0>;
					port-index = <0>;
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out2>;
				};
			};
			port@3 {
				reg = <3>;
				imx390_vi_in3: endpoint {
					vc-id = <1>;
					port-index = <0>;
					bus-width = <4>;
					remote-endpoint = <&imx390_csi_out3>;
				};
			};
			#endif
		};
 };

	nvcsi@15a00000 {
		num-channels = <4>;
		#address-cells = <1>;
		#size-cells = <0>;

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

				port@1 {
					reg = <1>;
					imx390_csi_out0: endpoint@1 {
						remote-endpoint = <&imx390_vi_in0>;
					};
				};

			};
		};
		channel@1 {
			reg = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_csi_in1: endpoint@2 {
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&imx390_imx390_out1>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_csi_out1: endpoint@3 {
						remote-endpoint = <&imx390_vi_in1>;
					};
				};
			};
		};
		#if 1
		channel@2 {
			reg = <2>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_csi_in2: endpoint@4 {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx390_imx390_out2>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_csi_out2: endpoint@5 {
						remote-endpoint = <&imx390_vi_in2>;
					};
				};
			};
		};
		channel@3 {
			reg = <3>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_csi_in3: endpoint@6 {
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx390_imx390_out3>;
					};
				};
				port@1 {
					reg = <1>;
					imx390_csi_out3: endpoint@7 {
						remote-endpoint = <&imx390_vi_in3>;
					};
				};
			};
		};
		#endif
	};

};

i2c@3180000 {

		imx390_a@1b {
			compatible = "nvidia,imx390";
			reg = <0x1b>;
			physical_w = "15.0";
			physical_h = "12.5";
			sensor_model ="imx390";
			post_crop_frame_drop = "0";
			use_decibel_gain = "true";
			delayed_gain = "true";
			use_sensor_mode_id = "true";
			mode0 {/*mode IMX390_MODE_1920X1080_CROP_30FPS*/
				mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_c";
				vc_id = "0";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";
				dynamic_pixel_bit_depth = "12";
				csi_pixel_bit_depth = "12";
				mode_type = "bayer";
				pixel_phase = "rggb";
				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb12";
				readout_orientation = "0";
				line_length = "4400";
				inherent_gain = "1";
				mclk_multiplier = "6.18";
				pix_clk_hz = "148500000";
				serdes_pix_clk_hz = "1485000000";
				min_gain_val = "0"; /* dB */
				max_gain_val = "30"; /* dB */
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "1.5";
				max_framerate = "30";
				min_exp_time = "118"; /*us,4 lines*/
				max_exp_time = "660000";
				embedded_metadata_height = "0";
			};
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_imx390_out0: endpoint {
						vc-id = <0>;
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&imx390_csi_in0>;
						};
					};
				};
			gmsl-link {
				src-csi-port = "b";
				dst-csi-port = "b";
				serdes-csi-link = "a";
				csi-mode = "1x4";
				st-vc = <0>;
				vc-id = <0>;
				num-lanes = <4>;
				streams = "raw12";
				};
			};
		imx390_b@1c {
			compatible = "nvidia,imx390";
			reg = <0x1c>;
			physical_w = "15.0";
			physical_h = "12.5";
			sensor_model ="imx390";
			post_crop_frame_drop = "0";
			use_decibel_gain = "true";
			delayed_gain = "true";
			use_sensor_mode_id = "true";
			mode0 {/*mode IMX390_MODE_1920X1080_CROP_30FPS*/
				mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_c";
				vc_id = "1";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";
				dynamic_pixel_bit_depth = "12";
				csi_pixel_bit_depth = "12";
				mode_type = "bayer";
				pixel_phase = "rggb";
				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "4400";
				inherent_gain = "1";
				mclk_multiplier = "6.18";
				pix_clk_hz = "148500000";
				min_gain_val = "0"; /* dB */
				max_gain_val = "30"; /* dB */
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "1.5";
				max_framerate = "30";
				min_exp_time = "118"; /*us,4 lines*/
				max_exp_time = "660000";
				embedded_metadata_height = "0";
			};
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_imx390_out1: endpoint {
						vc-id = <1>;
						port-index = <2>;
						bus-width = <4>;
						remote-endpoint = <&imx390_csi_in1>;
						};
					};
				};
			gmsl-link {
				src-csi-port = "b";
				dst-csi-port = "b";
				serdes-csi-link = "b";
				csi-mode = "1x4";
				st-vc = <0>;
				vc-id = <1>;
				num-lanes = <4>;
				streams = "raw12";
				};
			};

		#if 1
		imx390_c@1d {
			compatible = "nvidia,imx390";
			reg = <0x1d>;
			physical_w = "15.0";
			physical_h = "12.5";
			sensor_model ="imx390";
			post_crop_frame_drop = "0";
			use_decibel_gain = "true";
			delayed_gain = "true";
			use_sensor_mode_id = "true";
			mode0 {/*mode IMX390_MODE_1920X1080_CROP_30FPS*/
				mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_a";
				vc_id = "0";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";
				dynamic_pixel_bit_depth = "12";
				csi_pixel_bit_depth = "12";
				mode_type = "bayer";
				pixel_phase = "rggb";
				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb12";
				readout_orientation = "0";
				line_length = "4400";
				inherent_gain = "1";
				mclk_multiplier = "6.18";
				pix_clk_hz = "148500000";
				serdes_pix_clk_hz = "1485000000";
				min_gain_val = "0"; /* dB */
				max_gain_val = "30"; /* dB */
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "1.5";
				max_framerate = "30";
				min_exp_time = "118"; /*us,4 lines*/
				max_exp_time = "660000";
				embedded_metadata_height = "0";
			};
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_imx390_out2: endpoint {
						vc-id = <0>;
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx390_csi_in2>;
						};
					};
				};
			gmsl-link {
				src-csi-port = "b";
				dst-csi-port = "b";
				serdes-csi-link = "a";
				csi-mode = "1x4";
				st-vc = <0>;
				vc-id = <0>;
				num-lanes = <4>;
				streams = "raw12";
				};
			};

		imx390_d@1e{
			compatible = "nvidia,imx390";
			reg = <0x1e>;
			physical_w = "15.0";
			physical_h = "12.5";
			sensor_model ="imx390";
			post_crop_frame_drop = "0";
			use_decibel_gain = "true";
			delayed_gain = "true";
			use_sensor_mode_id = "true";
			mode0 {/*mode IMX390_MODE_1920X1080_CROP_30FPS*/
				mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_a";
				vc_id = "1";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";
				dynamic_pixel_bit_depth = "12";
				csi_pixel_bit_depth = "12";
				mode_type = "bayer";
				pixel_phase = "rggb";
				active_w = "1920";
				active_h = "1080";
				pixel_t = "bayer_rggb";
				readout_orientation = "0";
				line_length = "4400";
				inherent_gain = "1";
				mclk_multiplier = "6.18";
				pix_clk_hz = "148500000";
				min_gain_val = "0"; /* dB */
				max_gain_val = "30"; /* dB */
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				min_framerate = "1.5";
				max_framerate = "30";
				min_exp_time = "118"; /*us,4 lines*/
				max_exp_time = "660000";
				embedded_metadata_height = "0";
			};
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					imx390_imx390_out3: endpoint {
						vc-id = <1>;
						port-index = <0>;
						bus-width = <4>;
						remote-endpoint = <&imx390_csi_in3>;
						};
					};
				};
			gmsl-link {
				src-csi-port = "b";
				dst-csi-port = "b";
				serdes-csi-link = "b";
				csi-mode = "1x4";
				st-vc = <0>;
				vc-id = <1>;
				num-lanes = <4>;
				streams = "raw12";
				};
			};
	    #endif
};

};

/ {

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 = <8>;
	max_lane_speed = <4000000>;
	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 {
			badge = "imx390_rear";
			position = "rear";
			orientation = "0";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "imx390 2-001b";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/imx390_a@1b";
			};
		};
		module1 {
			badge = "imx390_front";
			position = "front";
			orientation = "1";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "imx390 2-001c";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/imx390_b@1c";
			};
		};
		module2 {
			badge = "imx390_left";
			position = "left";
			orientation = "0";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "imx390 2-001d";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/imx390_c@1d";
			};
		};
		module3 {
			badge = "imx390_right";
			position = "right";
			orientation = "1";
			drivernode0 {
				/* Declare PCL support driver (classically known as guid)  */
				pcl_id = "v4l2_sensor";
				/* Driver v4l2 device name */
				devname = "imx390 2-001e";
				/* Declare the device-tree hierarchy to driver instance */
				proc-device-tree = "/proc/device-tree/i2c@3180000/imx390_d@1e";
			};
		};
	};
};
};

What did you modify? Change the port-index?
I check others customer’s design are 2 lane usage for Max9xx with imx390 don’t if it matter for the Max9xx configure problem.

I have solved this problem,.
the cause of the problem is that badge and position cannot use left and right.

Thinks