imx8MPlus MIPI-CSI2 capture video stream failed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8MPlus MIPI-CSI2 capture video stream failed

504 Views
Jerryzhou
Contributor I
Hi everyone:
 
Background:
    Now i encounter a problem,and development progress is suspended here.
    I want to use the mipi csi 4lane to catch the video stream of fpga (no communication of i2c, only video stream - RGB888 800*800 30fps).
    I use the driver of ov5640(which has ran ok on my board with 2 lane, yuyv422, 30fps), and i ported and modified this driver. Delete most of not using function and interface.
 
Phenomena:
    And i sync made a test program of V4L2 that can be used normally. I can REQBUF、QUERYBUF、QBUF、STREAMON, but i alaways DQBUF failed. And i don't know where is error. No matter use v4l2-ctrl or use my v4l2 program all failed.
 
    V4L2 command: 
 
v4l2-ctl --set-fmt-video=width=800,height=800,pixelformat=RGB3 --stream-mmap --stream-to=./ --verbose
 
And the log as below : i notice one point is the red frame. YUYV -> RGB3? My driver and app is all set RGB3, why it appear YUYV ???
Jerryzhou_0-1688989342569.png

 

 
 
The debug log as below:
 
VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture Multiplanar:
Width/Height : 800/800
Pixel Format : 'RGB3' (24-bit RGB 8-8-8)
Field : None
Number of planes : 1
Flags :
Colorspace : JPEG
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization : Default
Plane 0 :
Bytes per Line : 2400
Size Image : 1920000
could not open ./ for writing
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
 
 
 
Problem:
    Below i post my devicetree and my driver. Beside i find in the kernel version of 5.10.9, it use ISI dirver frame,i don't change anything about this beacause i am afraid of making error.
    I don't know if my devicetree or driver has any problem. Please help me and point out the problem, thanks a lot. 
 
    And one thing i want to know is if should i set the clk, and how to set.
    Now i use the core of imx8mplus, Linux version 5.10.9. If you need any more file, details or whatever you need,I'll provide
 
Best wishes for you
 
 
 
Devicetree:
 
    dtsi:
 
mipi_csi_0: csi@32e40000 {
compatible = "fsl,imx8mp-mipi-csi", "fsl,imx8mn-mipi-csi";
reg = <0x32e40000 0x10000>;
interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <500000000>;
clocks = <&clk IMX8MP_CLK_MEDIA_CAM1_PIX>,
<&clk IMX8MP_CLK_MEDIA_AXI>,
<&clk IMX8MP_CLK_MEDIA_APB>,
<&media_blk_ctrl IMX8MP_CLK_MEDIA_BLK_CTRL_MIPI_CSI_PCLK>,
<&media_blk_ctrl IMX8MP_CLK_MEDIA_BLK_CTRL_MIPI_CSI_ACLK>;
clock-names = "mipi_clk",
"disp_axi",
"disp_apb",
"media_blk_csi_pclk",
"media_blk_csi_aclk";
assigned-clocks = <&clk IMX8MP_CLK_MEDIA_CAM1_PIX>;
assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_1000M>;
assigned-clock-rates = <500000000>;
bus-width = <4>;
csi-gpr = <&mediamix_gasket0>;
gpr = <&media_blk_ctrl>;
resets = <&media_blk_ctrl IMX8MP_MEDIA_BLK_CTRL_RESET_MIPI_CSI_PCLK>,
<&media_blk_ctrl IMX8MP_MEDIA_BLK_CTRL_RESET_MIPI_CSI_ACLK>;
reset-names = "csi_rst_pclk", "csi_rst_aclk";
power-domains = <&mipi_phy1_pd>;
status = "disabled";
};
 
 
 
    dts:
 
csi1_io: csi1-io {
compatible = "regulator-fixed";
regulator-name = "csi1_pwr";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
enable-active-high;
regulator-always-on;
};
 
//zp csi0
zp5640: zp5640@3c {
compatible = "ovti,zp5640";
reg = <0x3c>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_csi0_pwn>, <&pinctrl_csi0_rst>,<&pinctrl_io0_pwn>;
clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
clock-names = "xclk";
assigned-clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
//assigned-clock-parents = <&clk IMX8MP_CLK_24M>;
//assigned-clock-rates = <24000000>;
csi_id = <0>;
 
powerdown-gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
 
mclk = <24000000>;
mclk_source = <0>;
mipi_csi;
status = "okay";
 
port {
ov5640_mipi_0_ep: endpoint {
remote-endpoint = <&mipi_csi0_ep>;
data-lanes = <1 2 3 4>;
max-pixel-frequency = /bits/ 64 <500000000>;
 
clock-lanes = <0>;
};
};
};
 
 
//zp csi0
&mipi_csi_0 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
//no-reset-control;
 
port@0 {
reg = <0>;
mipi_csi0_ep: endpoint {
  remote-endpoint = <&ov5640_mipi_0_ep>;
  data-lanes = <4>;
  csis-hs-settle = <13>;
  csis-clk-settle = <2>;
  csis-wclk;
  };
 };
};
 
&cameradev {
  status = "okay";
};
 
&isi_0 {
  status = "okay";
  no-reset-control;
  cap_device {
  status = "okay";
};
};
 
&isi_1 {
  status = "okay";
 
  cap_device {
    status = "okay";
    };
};
 
  &isp_0{
  status = "okay";
  };
};
0 Kudos
Reply
0 Replies