ERROR: v4l2 capture: mxc_v4l_read timeout counter 0 - IMX6Q - parallel CSI

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

ERROR: v4l2 capture: mxc_v4l_read timeout counter 0 - IMX6Q - parallel CSI

4,650 Views
Selea
Senior Contributor I

DEar,

I'm using a custom board with a custom sensor, with kernel 3.10.17_ga

I modified the DTS files to adapt to our hardware, and starting from the ov5640.c driver  i wrote the driver for our sensor.

the probe is workink, the video dev is registered (ipu =1 csi =1 -> /dev/video2)... everything seems to be fine,

but when i try to cat /dev/video2 i have the error

ERROR: v4l2 capture: mxc_v4l_read timeout counter 0

imx-ipuv3 2800000.ipu: Not A CSI channel

cat: read error: Timer expired

I tried just to make an experiment to use a different ipu csi (0,0) , of course it will not work due to wrong pin but i have a timeout on read error and not the "not a CSI channel error"...

so i think i miss something in the dts file to connect ipu1,1 to vpu....

what coudl be wrong?

Thanks

Omar

Labels (4)
Tags (2)
13 Replies

1,814 Views
Selea
Senior Contributor I

I think i made some kind of error in IPU/CSI configuration:

I'm using ipu=1 CSI =1 in the dts

1,813 Views
Selea
Senior Contributor I

Now i tried t use the OV5640 (i'm using the OV5640 mipi board from boundary).

And I have the same error.... SO it should be not a problem of driver (already included and tested) or hardware (the probe is working...

but still I have the timeout error on mxc_v4l_read ("timeout counter 0")

Omar

0 Kudos

1,814 Views
Selea
Senior Contributor I

ok the ov5640_mipi now is working... was a mistake in the ipucsi config in dts file... but still digging on my Ar0134 (parallel) sensor capture

in my hardware should be captured on IPU2...

0 Kudos

1,814 Views
richarddestiny
Contributor III

HI,Omar Pighi

       I‘m using  imx6q and  ov5640 too,can you tell  me  how did you  slove the poblem。

thanks

Richard

0 Kudos

1,814 Views
donfreiling
Contributor III

I am having the same issue with the ov5640_mipi module on sabresd Quad board. Relevant DTS entries are shown below. I am building as-per L5.0.0_1.0.0 BSP instructions and I am seeing:

root@sabresd_6dq:/ # cat /dev/video1

ERROR: v4l2 capture: mxc_v4l_read timeout counter 0

imx-ipuv3 2400000.ipu: Not a CSI channel

/system/bin/sh: cat: /dev/video1: Timer expired

Omar: What was your solution?

Cheers,

Don

ov5640_mipi: ov5640_mipi@3c { /* i2c2 driver */

      compatible = "ovti,ov5640_mipi";

      reg = <0x3c>;

      clocks = <&clks 201>;

      clock-names = "csi_mclk";

      DOVDD-supply = <&vgen4_reg>; /* 1.8v */

      AVDD-supply = <&vgen3_reg>;  /* 2.8v, rev C board is VGEN3  rev B board is VGEN5 */

      DVDD-supply = <&vgen2_reg>;  /* 1.5v*/

      pwn-gpios = <&gpio1 19 1>;   /* active low: SD1_DAT2 */

      rst-gpios = <&gpio1 20 0>;   /* active high: SD1_CLK */

      ipu_id = <0>;

      csi_id = <1>;

      mclk = <24000000>;

      mclk_source = <0>;

   };

&mipi_csi {

   status = "okay";

   ipu_id = <0>;

   csi_id = <1>;

   v_channel = <0>;

   lanes = <2>;

};

v4l2_cap_0 {

      compatible = "fsl,imx6q-v4l2-capture";

      ipu_id = <0>;

      csi_id = <0>;

      mclk_source = <0>;

      status = "okay";

   };

   v4l2_cap_1 {

      compatible = "fsl,imx6q-v4l2-capture";

      ipu_id = <0>;

      csi_id = <1>;

      mclk_source = <0>;

      status = "okay";

   };

0 Kudos

1,814 Views
Selea
Senior Contributor I

I have  question on a couple of register:

IOMUXC_GPR1 in this bit i configure if mipi or parallel goes to CSI in my hardware bit20 =1 because i'm using the parallel CSI1 to IPU2 (see answer above)

but I have also IPU2_CONF register where some bits confuse me (bit 29 and bit 31) seem to be a duplicate.... where , when and what I have to configure (if I had to this second register IPU specific?)

thanks

Omar

0 Kudos

1,814 Views
Selea
Senior Contributor I

where are defined the register of IPU (IPU2_CONF etc..)...

i think ihave to configure the input of IPU2 from CSI1 doing something like that:

if(sensor->csi==1)
{
   val= (1<<20) ;
   ipur = syscon_regmap_lookup_by_pdevname("ipu2");
   if (!IS_ERR(ipur))
   { 
 
regmap_update_bits(ipur, IPU2_CONF, 0xA0000000, 0x80000000);    
   }
   else
   {
     pr_err("%s: ipu2 not found\n", __func__);  
   }
}

I'm not able to find the definition of IPU2_CONF ..... I made the name so probably is different.. but somewhere should be defined the registers to configure the IPU...

0 Kudos

1,814 Views
Selea
Senior Contributor I

what do you think to add something like that:

                    ipur = ipu_get_soc(sensor->ipu_id);
                    ipu_enable_csi(ipur, sensor->csi);
0 Kudos

1,814 Views
Sasamy
Contributor IV

Hi ,

I think you need to configure the interface and channel for your board, for example

linux-2.6-imx.git - Freescale i.MX Linux Tree

Alexander

1,813 Views
Selea
Senior Contributor I

in my driver (took from OV5640) I did:

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");

    if (!IS_ERR(gpr)) {

   if (of_machine_is_compatible("fsl,imx6q")) {
   int mask = sensor->csi ? (1 << 20) : (1 << 19);

   if (sensor->csi != sensor->ipu_id) {
   pr_warning("%s: csi_id != ipu_id\n", __func__);
   return -ENODEV;
   }
   regmap_update_bits(gpr, IOMUXC_GPR1, mask, mask);
   } else if (of_machine_is_compatible("fsl,imx6dl")) {
   int mask = sensor->csi ? (7 << 3) : (7 << 0);
   int val =  sensor->csi ? (4 << 3) : (4 << 0);

   regmap_update_bits(gpr, IOMUXC_GPR13, mask, val);
   }

    } else {

   pr_err("%s: failed to find fsl,imx6q-iomux-gpr regmap\n",
       __func__);

    }

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Is the ERROR here probably... what do you think?

Omar

0 Kudos

1,814 Views
Sasamy
Contributor IV

Omar, sorry,

I was wrong  -  I have not noticed that CSI is configured in the sensor driver and I see no error here.

csi_id = <1>;

int mask = sensor->csi ? (1 << 20) : (1 << 19);

IOMUXC_GPR1 --> 20 MIPI sensor to IPU-2 mux control --> 1 Enable parallel interface to IPU2 CSI1

Alexander

1,814 Views
Selea
Senior Contributor I

I was wondering if the code portion you showed me is called anyway other then driver... so maybe it is overriding my settings....

Omar

0 Kudos

1,814 Views
Selea
Senior Contributor I

maybe i understood what you mean... I will try to add for my board... thanks

Omar

0 Kudos