Fpga output mipi yuv 422 8bit data to nx orin csi1 and csi3

i use jetpack 5.1.2 on orin nx 16GB board,we use two fpga devs to send yuv 422 8bit mipi data on orin nx mipi csi1 and csi3 interface。i modify imx219.c and devicetree , but i can not by v4l-ctl to get data. can you help me ??
thanks !
this is my log and files …


nv_imx219.txt (19.7 KB)
tegra234-camera-rbpcv2-imx219.txt (7.3 KB)

hello 741024073,

you should review your sensor driver as it’s reported an error… VIDIOC_S_FMT: failed: Inappropriate ioctl for device.

i use imx219.c and remove i2c reg_read_write ,other is not change, can you help me to check it? thanks … i can not check it err anything

hello 741024073,

since you used FPGA to send YUV 422-8bit MIPI data.
please refer to Sensor Software Driver Programming to review driver implemenation.

hi,bro, i am not sure if the devicetree is rigth ,if i use csi1 and csi3 to recv mipi data.
please help me check the dts, host1x { vi@15c10000 ,nvcsi@15a00000 {, Are the addresses of these nodes correct? port-index is the csi_num ?

host1x {
	vi@15c10000  {
	num-channels = <2>;
	status="okay";
	ports {
		#address-cells = <1>;
		#size-cells = <0>;
		vi_port0: port@0 {
			reg = <0>;
			fpga_vi_in0: endpoint {
				port-index = <1>;
				bus-width = <2>;
				remote-endpoint = <&fpga_csi_out0>;
			};
		};
		vi_port1: port@1 {
			reg = <1>;
			fpga_vi_in1: endpoint {
				port-index = <3>;
				bus-width = <2>;
				remote-endpoint = <&fpga_csi_out1>;
			};
		};
	};
};

	nvcsi@15a00000 {
		num-channels = <2>;
		status="okay";
		#address-cells = <1>;
		#size-cells = <0>;
		csi_chan0: channel@0 {
			reg = <0>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				csi_chan0_port0: port@0 {
					reg = <0>;
					fpga_csi_in0: endpoint@0 {
						port-index = <1>;
						bus-width = <2>;
						remote-endpoint = <&fpga_out0>;
					};
				};
				csi_chan0_port1: port@1 {
					reg = <1>;
					fpga_csi_out0: endpoint@1 {
						remote-endpoint = <&fpga_vi_in0>;
					};
				};
			};
		};
		csi_chan1: channel@1 {
			reg = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				csi_chan1_port0: port@0 {
					reg = <0>;
					fpga_csi_in1: endpoint@2 {
						port-index = <3>;
						bus-width = <2>;
						remote-endpoint = <&fpga_out1>;
					};
				};
				csi_chan1_port1: port@1 {
					reg = <1>;
					fpga_csi_out1: endpoint@3 {
						remote-endpoint = <&fpga_vi_in1>;
					};
				};
			};
		};
	};
};

hi ,bro, as you said, VIDIOC_S_FMT: failed: Inappropriate ioctl for device . the jetpack_5.1.2, the nv_imx219.c no pick “pixel_t” properties.

hi, bro, i want to ask you about the picture shows csi5_stream_close ,
but video0 binds csi_1 , video1 binds csi_3, so i want to sure it is right?

hello 741024073,

pixel_t has deprecated. please use below three properties instead to report pixel format types,
for instance, mode_type, csi_pixel_bit_depth, and pixel_phase

that’s ok, /dev/video* it’s video node registration, it’s DT settings to define port bindings.
and, it looks you’re defined 1st video node for using csi-1 (csi-b) and 2nd node for using csi-3 (csi-d).

yes, i know , mode_type = “yuv”;pixel_phase = “yuyv”;csi_pixel_bit_depth = “16”; i have seted

i set mode_type = “yuv”,pixel_phase = “yuyv”;
but by v4l2-ctl -d /dev/videox --list-formats-ext ,it not show YUYV ,why is it??
and i set tegra_sinterface = “serial_a” for video0 csi1, tegra_sinterface = “serial_c” for video1 csi3 is right?
thanks bro!

hello 741024073,

$ v4l2-ctl -d /dev/videox --list-formats-ext it actually check the driver side to report the supported formats.
please check struct camera_common_frmfmt in your drivers.

please configure tegra_sinterface as same as your port bindings. since it looks you’re defined 1st video node for using csi-1 (csi-b) and 2nd node for using csi-3 (csi-d).

yes , i noticed the struct camera_common_frmfmt,and modify it.
if i USE csi1 and csi3 ,should i set tegra_sinterface = “serial_b” and tegra_sinterface = “serial_d” ?? ; thanks bro…

yes… please configure tegra_sinterface as same as your port bindings, which already mentioned in my previous comments.

hello, i modify the nv_imx219.c and imx219_mode_tbls.h, for examples
nv_imx219.c,
static struct camera_common_sensor_ops imx219_common_ops = {
.numfrmfmts = ARRAY_SIZE(imx219_frmfmt),
.frmfmt_table = imx219_frmfmt,
.power_on = imx219_power_on,
.power_off = imx219_power_off,
.write_reg = imx219_write_reg,
.read_reg = imx219_read_reg,
.parse_dt = imx219_parse_dt,
.power_get = imx219_power_get,
.power_put = imx219_power_put,
.set_mode = imx219_set_mode,
.start_streaming = imx219_start_streaming,
.stop_streaming = imx219_stop_streaming,
};
and imx219_mode_tbls.h have added the struct camera_common_frmfmt,
imx219_mode_tbls.txt (1.8 KB)

but it still show VIDIOC_S_FMT:failed

hello 741024073,

it has NULL VI error reported, assume you’ve port bindings defined correctly.
please double check you’ve signaling on the CSI channel, you should arrange hardware resources to probe the signaling for confirmation.
besides, you may see-also Debugging Tips section for some troubleshootings.

hello, I WANT to ask you for v4l2-ctl -d /dev/video0 --list-formats-ext

it show 4 format, but my dts only set one mode which is yuyv, and camera_common_frmfmt have one format … Why the RGB format appears ??

now the mipi csi1 and csi3 have datas, but the mipi clk only 100mv ,

I don’t know if it can receives MIPI data.

MIPI data usually present in high-speed in MHz.

mipi clk 300MHZ, i said the Signal amplitude100mv

hi , bro why is it ?? can you reply me ?