AnsweredAssumed Answered

BT.1120 capture on i.mx6q CSI1 using linux

Question asked by Alexandre Belloni on Jul 9, 2013
Latest reply on Apr 7, 2014 by Qiang Li - Mpu Se

Hi,

 

I'm using an i.mx6q sabrelite with a kernel based on BSP 4.0.0.

 

There is a GV7600 full HD deserializer connected on J12 (EIM/boot mode). It is giving BT.1120 video as a pixel clock and 20bits of data. Hsync, Vsync and data enable are not connected, my understanding is that they are not necessary for BT.1120.

 

On the software side, I have that pinmuxing:

 

    MX6PAD(EIM_EB2__IPU2_CSI1_D_19),    /* GPIO2[30] */
    MX6PAD(EIM_A23__IPU2_CSI1_D_18),    /* GPIO6[6] */
    MX6PAD(EIM_A22__IPU2_CSI1_D_17),    /* GPIO2[16] */
    MX6PAD(EIM_A21__IPU2_CSI1_D_16),    /* GPIO2[17] */
    MX6PAD(EIM_A20__IPU2_CSI1_D_15),    /* GPIO2[18] */
    MX6PAD(EIM_A19__IPU2_CSI1_D_14),    /* GPIO2[19] */
    MX6PAD(EIM_A18__IPU2_CSI1_D_13),    /* GPIO2[20] */
    MX6PAD(EIM_A17__IPU2_CSI1_D_12),    /* GPIO2[21] */
    MX6PAD(EIM_EB0__IPU2_CSI1_D_11),    /* GPIO2[28] */
    MX6PAD(EIM_EB1__IPU2_CSI1_D_10),    /* GPIO2[29] */
    MX6PAD(EIM_DA0__IPU2_CSI1_D_9),        /* GPIO3[0] */
    MX6PAD(EIM_DA1__IPU2_CSI1_D_8),        /* GPIO3[1] */
    MX6PAD(EIM_DA2__IPU2_CSI1_D_7),        /* GPIO3[2] */
    MX6PAD(EIM_DA3__IPU2_CSI1_D_6),        /* GPIO3[3] */
    MX6PAD(EIM_DA4__IPU2_CSI1_D_5),        /* GPIO3[4] */
    MX6PAD(EIM_DA5__IPU2_CSI1_D_4),        /* GPIO3[5] */
    MX6PAD(EIM_DA6__IPU2_CSI1_D_3),        /* GPIO3[6] */
    MX6PAD(EIM_DA7__IPU2_CSI1_D_2),        /* GPIO3[7] */
    MX6PAD(EIM_DA8__IPU2_CSI1_D_1),        /* GPIO3[8] */
    MX6PAD(EIM_DA9__IPU2_CSI1_D_0),        /* GPIO3[9] */
    MX6PAD(EIM_DA10__IPU2_CSI1_DATA_EN),    /* GPIO3[10] */
    MX6PAD(EIM_DA11__IPU2_CSI1_HSYNC),    /* GPIO3[11] */
    MX6PAD(EIM_DA12__IPU2_CSI1_VSYNC),    /* GPIO3[12] */
    MX6PAD(EIM_A16__IPU2_CSI1_PIXCLK),    /* GPIO2[22] */

 

That is what I have in my data_capture[] :

 

        {
                .ipu = 1,
                .csi = 1,
                .mclk_source = 0,
                .is_mipi = 0,
        },

 

I also set CSI1 to parallel with:

    mxc_iomux_set_gpr_register(1, 20, 1, 1);

 

I tweaked drivers/media/video/mxc/capture/mxc_v4l2_capture.c to be able to set BT.1120 clock mode:

 

       csi_param.clk_mode = IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_SDR;
       csi_param.pixclk_pol = 0;
       csi_param.data_width = IPU_CSI_DATA_WIDTH_10;
       csi_param.mclk = 74250000;
       csi_param.Hsync_pol = 0;
       csi_param.Vsync_pol = 0;
       csi_param.ext_vsync = 0;

 

I end up with those register set (by drivers/mxc/ipu3/ipu_capture.c):

CSI_SENS_CONF = 0x4001A50

CSI_SENS_FRM_SIZE = 0x0437077F

CSI_ACT_FRM_SIZE = 0x0437077F

CSI_OUT_FRM_CTRL = 0x0

CSI_CCIR_CODE_1 = 0x1040030

CSI_CCIR_CODE_3 = 0xFF0000

 

 

So, my issue is that I always hit a timeout in mxc_v4l_dqueue() without having the ipu detecting any frame. Also, shouldn't I put 2200x1125 as my resolution in CSI_SENS_FRM_SIZE or would the active resolution of 1920x1080 be cropped/synced automatically thanks to the CCIR ?


What am I missing ? Is there any way to debug what the IPU is seeing ? Any help appreciated


Outcomes