AnsweredAssumed Answered

BT.656 Camera Input

Question asked by Pierre-Olivier Huard on Oct 11, 2016
Latest reply on Oct 14, 2016 by Pierre-Olivier Huard

Hello,

We are currently trying to make the BT.656 mode works on a iMX6Q. We use a custom driver, a custom baord, with a SOM.

 

I will explain all the configuration done, and the errors recieved:

 

On the .dtsi file :

        pinctrl_ipu2_csi1: ipu1grp-csi0 {
            fsl,pins = <
                MX6QDL_PAD_EIM_A24__IPU2_CSI1_DATA19        0xb0b1      // Y/C[0]       
                MX6QDL_PAD_EIM_A23__IPU2_CSI1_DATA18        0xb0b1      // Y/C[1]
                MX6QDL_PAD_EIM_A22__IPU2_CSI1_DATA17        0xb0b1      // Y/C[2]
                MX6QDL_PAD_EIM_A21__IPU2_CSI1_DATA16        0xb0b1      // Y/C[3]   
                MX6QDL_PAD_EIM_A20__IPU2_CSI1_DATA15        0xb0b1      // Y/C[4]               
                MX6QDL_PAD_EIM_A19__IPU2_CSI1_DATA14        0xb0b1      // Y/C[5]
                MX6QDL_PAD_EIM_A18__IPU2_CSI1_DATA13        0xb0b1      // Y/C[6]
                MX6QDL_PAD_EIM_A17__IPU2_CSI1_DATA12        0xb0b1      // Y/C[7]
                MX6QDL_PAD_EIM_A16__IPU2_CSI1_PIXCLK        0xb0b1      // Clk
                //DATA_EN pin
                MX6QDL_PAD_EIM_DA10__GPIO3_IO10         PAD_CTRL_HYS_PU

 

                //Unused
                MX6QDL_PAD_EIM_DA11__IPU2_CSI1_HSYNC    PAD_CTRL_HYS_PD
                MX6QDL_PAD_EIM_DA12__IPU2_CSI1_VSYNC    PAD_CTRL_HYS_PD
                MX6QDL_PAD_EIM_DA5__IPU2_CSI1_DATA04    PAD_CTRL_HYS_PD
                MX6QDL_PAD_EIM_DA4__IPU2_CSI1_DATA05    PAD_CTRL_HYS_PD
                MX6QDL_PAD_EIM_DA3__IPU2_CSI1_DATA06    PAD_CTRL_HYS_PD
                MX6QDL_PAD_EIM_DA2__IPU2_CSI1_DATA07    PAD_CTRL_HYS_PD
                MX6QDL_PAD_EIM_DA1__IPU2_CSI1_DATA08    PAD_CTRL_HYS_PD
                MX6QDL_PAD_EIM_DA0__IPU2_CSI1_DATA09    PAD_CTRL_HYS_PD
                MX6QDL_PAD_EIM_EB1__IPU2_CSI1_DATA10    PAD_CTRL_HYS_PD
                MX6QDL_PAD_EIM_D21__IPU2_CSI1_DATA11    PAD_CTRL_HYS_PD
               >;
        };

We are using the BT656 pins, (DATA19 to DATA12), other pins are declared but set in pull down, DATA_EN is set in pull-up, our fpga on the board, also set a +3V3 on this pin.

 

In the .dts:

v4l2_cap_0 {
   compatible = "fsl,imx6q-v4l2-capture";
   ipu_id = <0>;
   csi_id = <1>;
  mclk_source = <0>;
      status = "okay";
};

driver {
   compatible = "driver,driver_camera";
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_ipu2_csi1 &pinctrl_cam0_gpio>;
   clocks = <&clks 200>;
   clock-names = "csi_mclk";
   csi_id = <1>;
   mclk = <148500000>;
   mclk_source = <0>;
   power-gpio = <&gpio3 19 0>;
   status = "okay";
};

A FPGA is connected to the CSI pins, the FPGA seems to send valid data, with embedded sync.

Our driver works with mxc_v4l2_capture, and sets the following parametters:

.if_type = V4L2_IF_TYPE_BT656_PROGRESSIVE,
.mode = V4L2_IF_TYPE_BT656_MODE_BT_8BIT,
.bt_sync_correct = 0,
.nobt_vs_inv = 0,
.nobt_hs_inv = 0,
.pixelformat = V4L2_PIX_FMT_YUYV,

I put some debug in drivers/mxc/ipu_capture.c, when I run a pipeline I get the CSI registers :

[  107.782327] CSI_SENS_CONF = 0x00000920
[  107.786096] CSI_SENS_FRM_SIZE = 0x0437077F
[  107.790197] CSI_ACT_FRM_SIZE = 0x0437077F
[  107.794227] CSI_OUT_FRM_CTRL = 0x00000000
[  107.798241] CSI_TST_CTRL = 0x00000000
[  107.801906] CSI_CCIR_CODE_1 = 0x00040030
[  107.805846] CSI_CCIR_CODE_2 = 0x00000000
[  107.809773] CSI_CCIR_CODE_3 = 0x00FF0000

The CSI is in BT656, 8bpp, YUYV. 1920*1080, with the FF0000 embedded sync.

When the driver start :

[    6.098746] mxc_v4l2_master_attach: ipu0:/csi1 parallel attached driver:mxc_v4l2_cap0

I think I have something wrong, I use IPU2 but mxc_v4l2 says I'm using IPU0, how do I change this? I tried to modify the ipu_id in the dts, but the slave is not found.

 

Also, when I run a gstreamer pipeline, I get a ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

 

I'm on 3.14 kernel, building images with Yocto, on poky branch.

 

Thanks for the Help,

Best regards,

Pierre-Olivier

Outcomes