AnsweredAssumed Answered

Custom sensor V4L2 driver for HummingBoard-i2eX (i.MX6 Dual)-Issue

Question asked by Rejeesh Babu on Feb 4, 2016
Latest reply on Jan 17, 2017 by Navinar Savad

Hello All,

 

I am developing V4L2 image sensor driver for a custom sensor.

 

Platform details are:

Board : HummingBoard-i2eX (i.MX6 Dual)

OS      : Ubuntu, Linux Kernel 3.0.35

 

Sensor details:

1. Supported MIPI lanes : 2 Lane/4 Lane (configured to use 2 lane mode)

2. Supported MIPI data format : RAW 10 /RAW8 (configured to use RAW10)

3. Virtual channel : configured to 0

4. Clock Frequency : 24MHz (This is actually sensor clock, MIPI clock is 114 MHz)

5. Resolution : 1280 x 720

 

I am getting error "ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0" for  VIDIOC_DQBUF IOCTL.

 

To begin my trouble shooting, I would like to get my below board configuration file modifications reviewed:

 

//Sensor details

static struct fsl_mxc_camera_platform_data mipi_csi2_data = {

  .mclk = 24000000, // Is this OK ? Or should I put the MIPI clock(114 MHz) here?

  .mclk_source = 0, // Does this indicate HB MIPI clock source is sensor?

  .csi = 0, // Does this indicate camera sensor is using IPU #1/CSI0 ?

  .io_init = mx6q_csi0_io_init, // I use this function to Enable mipi to IPU1 CSI0 (mxc_iomux_set_gpr_register(1, 19, 1, 0))

};

 

Since this structure definition doesn't have any documentation, I did not understand the meaning of these parameters. Please explain me these parameters if anybody is aware of.

 

//Details of MIPI CSI2 interface

static struct mipi_csi2_platform_data mipi_csi2_pdata = {

       .ipu_id   = 0,

       .csi_id = 0,

         .v_channel = 0,

       .lanes =2,

         .dphy_clk = "mipi_pllref_clk",

         .pixel_clk = "emi_clk",

};

 

/*Details of capture device*/

static struct fsl_mxc_capture_platform_data capture_data[] = {

   {

        .csi = 0,

        .ipu = 0,

        .mclk_source = 0,

        .is_mipi = 1,

    },  

};

 

Actually, I took these values from another sensor patch, i dont really know what these parameters are

 

Now, assuming that my board configuration is ok, I went ahead with driver debugging. Below are the observations:

 

1. I2C communication is ok

2. MIPI_CSI_PHY_STATE value is : 630,sometimes 330,300 also (Is this ok or is it indicating any clock related issue?)

3. MIPI_CSI_ERR1/2 both return 0

 

Any hints to my issue? Can this be related to the format my sensor support (RAW 10)? Can someone direct me how to proceed with debugging?

 

Also, in mxc_mipi driver, I saw apis to read MIPI_CSI_PHY_STATE and  MIPI_CSI_ERR1/2 registers,however, I didnt find any apis to read other registers

(MIPI_CSI_N_LANES ~ MIPI_CSI_DATA_IDS_2). Can someone guide me on how to read the other registers (also, IPU registers) ?

Outcomes