Gmsl ar0233 camera can't work

Hi
I use xavier CSI2 to connect ar0233 camera module, this module has its isp, and format is uyvy.
and I changed the dts like below:

/ {
	host1x {
		vi@15c10000 {
			num-channels = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ar0233_vi_in0: endpoint {
						port-index = <2>;////CSI2
						bus-width = <4>;//Number of CSI lanes connected to sensor; determines the bus width.
						remote-endpoint = <&ar0233_csi_out0>;//Label for binding two ports. The binding expects one port to be for the sink and the other one for the source.
					};
				};
			};
		};

		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>;
						ar0233_csi_in0: endpoint@2{
							port-index = <2>;//
							bus-width = <4>;
							remote-endpoint = <&ar0233_ar0233_out0>;
						};
					};
					port@1 {
						reg = <1>;
						ar0233_csi_out0: endpoint@3 {
							remote-endpoint = <&ar0233_vi_in0>;
						};
					};
				};
			};
		};
	};

	i2c@3180000 {
		ar0233_a@1b {
			compatible = "nvidia,ar0233";

			reg = <0x1b>;

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

			sensor_model ="ar0233";

			post_crop_frame_drop = "0";

			use_sensor_mode_id = "true";

			mode0 {/*mode AR0233_MODE_1920X1080_CROP_30FPS. mclk_khz*/
				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 = "16";//这块存疑,jefby
				csi_pixel_bit_depth = "16";//这块存疑,jefby
				mode_type = "yuv";
				pixel_phase = "uyvy";
				active_w = "1920";
				active_h = "1080";
				readout_orientation = "0";
				line_length = "2200";
				inherent_gain = "1";
				pix_clk_hz = "742500000";
				serdes_pix_clk_hz = "1485000000";
				gain_factor = "10";
				min_gain_val = "0"; /* dB */
				max_gain_val = "300"; /* dB */
				step_gain_val = "3"; /* 0.3 */
				default_gain = "0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				framerate_factor = "1000000";
				min_framerate = "30000000";
				max_framerate = "30000000";
				step_framerate = "1";
				default_framerate = "30000000";
				exposure_factor = "1000000";
				min_exp_time = "59"; /*us, 2 lines*/
				max_exp_time = "33333";
				step_exp_time = "1";
				default_exp_time = "33333";/* us */
				embedded_metadata_height = "0";
			};
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					ar0233_ar0233_out0: endpoint {
						port-index = <2>;//CSI2
						bus-width = <4>;
						remote-endpoint = <&ar0233_csi_in0>;
					};
				};
			};
		};
	};
};

/ {

	tegra-camera-platform {
		compatible = "nvidia, tegra-camera-platform";
		num_csi_lanes = <4>;
		max_lane_speed = <4000000>;
		min_bits_per_pixel = <16>;
		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 = "ar0233_rear";
				position = "rear";
				orientation = "1";
				drivernode0 {
					/* Declare PCL support driver (classically known as guid)  */
					pcl_id = "v4l2_sensor";
					/* Driver v4l2 device name */
					devname = "ar0233 30-001b";
					/* Declare the device-tree hierarchy to driver instance */
					proc-device-tree = "/proc/device-tree/i2c@3180000/ar0233_a@1b";
				};
			};
		};
	};
};

but now it will failed when use command to grab an image. error information:
trace (20.0 MB)

Apply below patch to try.

Hi @ShaneCCC ,
I applied the patch and set serdes_pix_clk_hz to 2499999999, it can’t grab any data from vi.

[ 121.036399] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[ 123.740449] tegra194-vi5 15c10000.vi: no reply from camera processor
[ 123.740601] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[ 123.740772] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[ 123.742907] tegra-capture-ivc ivc-bc00000.rtcpu:ivccontrol@3: No callback found for msg id: 0x39
[ 123.743097] tegra-capture-ivc ivc-bc00000.rtcpu:ivccontrol@3: No callback found for msg id: 0x41
[ 123.743248] tegra-capture-ivc ivc-bc00000.rtcpu:ivccontrol@3: No callback found for msg id: 0x37
[ 123.743427] tegra194-vi5 15c10000.vi: err_rec: successfully reset the capture channel
[ 123.814723] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194402
[ 123.848068] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194402
[ 123.881367] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194402
[ 123.914690] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194402
[ 123.948019] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194402
[ 123.981367] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194402
[ 124.014656] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194402
[ 124.047990] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194402
[ 124.081342] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194402
[ 124.114644] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 4194402

by the way i use the jetpack 4.5.1, and camera-rtcpu-rce.img can’t work on my hardware. it will failed( so i use original camera-rtcpu-rce.img)

Thanks very much

Hi @ShaneCCC , my camera topopoloy is ar0233->gmsl A->max9296->phy B(this will copy phyA data)-> xavier CSI2 → VI 2. and i measure the hardware signal it looks that max9296 phyB has correct data.

Below log tell the err_intr_stat_pd_crc_err_vc0 have a check with vendor to check if support CRC in package.
Have a check the REG NVCSI_STREAM_0_INTR_STATUS_VC0_0 in TRM for more information.

 kworker/0:3-2013  [000] ....   199.051292: rtcpu_nvcsi_intr: tstamp:6918899681 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:2 vc:0 status:0x00000004

hi, how to read the register value??

hi @ShaneCCC
I use the devmem2 to read the value ,it always print the bus error:
root@autogo-os:~/work# devmem2 0x15a0408c
/dev/mem opened.
Memory mapped at address 0x7f83fea000.
Bus error

I would suggest to modify the csi2_fops.c to read it.