Mt9v022 interface with sabresd board

cancel
Showing results for 
Search instead for 
Did you mean: 

Mt9v022 interface with sabresd board

772 Views
guna007
Contributor III

I have ported the mt9v022 driver from soc camera model to platform camera model as used in ov5642 driver present in the imx kernel (3.14.54v). And I added the device tree node for the image sensor. The driver is getting loaded and when I use v4l2-clt to capture image it shows time out error.

Board details: imx6qsabresd platform

capture command:

$ v4l2-ctl --stream-mmap=3 --stream-count=1 --stream-to=gt.jpeg

Error details:

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

debug messages:

In MVC: mxc_v4l_open

   device name is Mxc Camera

In g_ifparm function

In ioctl_g_fmt_cap function

End of mxc_v4l_open: v2f pix widthxheight 288 x 352

End of mxc_v4l_open: crop_bounds widthxheight 640 x 480

End of mxc_v4l_open: crop_defrect widthxheight 640 x 480

End of mxc_v4l_open: crop_current widthxheight 640 x 480

On Open: Input to ipu size is 640 x 480

ipu csi init interface

In s_power function

In standby function

In ioctl_init function

In dev_init function

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl 80685600

   case VIDIOC_QUERYCAP

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl c0e85667

   case default or not supported

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl c0445624

   case VIDIOC_REQBUFS

In MVC:mxc_streamoff

MVC: In mxc_free_frame_buf

In MVC:mxc_allocate_frame_buf - size=152064

cma: dma_alloc_from_contiguous(cma 80e0719c, count 38, align 6)

cma: dma_alloc_from_contiguous(): returned abcd9000

cma: dma_alloc_from_contiguous(cma 80e0719c, count 38, align 6)

cma: dma_alloc_from_contiguous(): returned abcd9800

cma: dma_alloc_from_contiguous(cma 80e0719c, count 38, align 6)

cma: dma_alloc_from_contiguous(): returned abcda000

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl c0445609

   case VIDIOC_QUERYBUF

In MVC:mxc_v4l2_buffer_status

In MVC:mxc_mmap

   pgoff=0x3c100, start=0x76a53000, end=0x76a79000

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl c044560f

   case VIDIOC_QBUF

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl c0445609

   case VIDIOC_QUERYBUF

In MVC:mxc_v4l2_buffer_status

In MVC:mxc_mmap

   pgoff=0x3c140, start=0x76a2d000, end=0x76a53000

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl c044560f

   case VIDIOC_QBUF

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl c0445609

   case VIDIOC_QUERYBUF

In MVC:mxc_v4l2_buffer_status

In MVC:mxc_mmap

   pgoff=0x3c180, start=0x76a07000, end=0x76a2d000

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl c044560f

   case VIDIOC_QBUF

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl 40045612

   case VIDIOC_STREAMON

In MVC:mxc_streamon

camera enable

In irq request

YUV420

IN IPU Enable CSI and enabling csi: 0

CSI 0 Enabled<6>Enabled CSI

In MVC:mxc_poll

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl c0445611

   case VIDIOC_DQBUF

In MVC:mxc_v4l_dqueue

galcore 130000.gpu: pm_genpd_runtime_resume()

galcore 130000.gpu: pm_genpd_runtime_suspend()

ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0

In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl 40045613

   case VIDIOC_STREAMOFF

In MVC:mxc_streamoff

IN IPU Disable CSI and disabling csi: 0

In irq requestCSI 0 Disabled

cma: dma_release_from_contiguous(page abcda800)

In MVC:mxc_free_frames

In MVC:mxc_v4l_close

In MVC:mxc_streamoff

In s_power function

In standby function

mxc_v4l_close: release resource

MVC: In mxc_free_frame_buf

cma: dma_release_from_contiguous(page abcd9000)

cma: dma_release_from_contiguous(page abcd9800)

cma: dma_release_from_contiguous(page abcda000)

In MVC:mxc_free_frames

Any help would be great.

Labels (4)
Tags (3)
0 Kudos
11 Replies

155 Views
guna007
Contributor III

Got things working. Thank you Igor.

0 Kudos

155 Views
lampo
Contributor I

Hi Guna,

   I am porting mt9v034 on imx6q, toradex board. there's a lot stuff needed to be done ,  as the project is very urgent , could you please post or send me your mt9v022 porting code so I can use it as a reference ?   I am working on monochrome/color CMOS sensor driver porting and algorithm development , maybe we could discuss it and help each other  afterwards.

   My email address is guanlinbo@supcon.com.   Thanks a lot!

 

0 Kudos

155 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Gunasekaran

I think you can look at implementation of mt9v022 driver in phytec

releases (though for older kernels), as module VM-010 (Mt9v022) in

ftp://ftp.phytec.com/products/PFL-A-02_phyFLEX-iMX6/Linux/PD13.2.2/

then port it to device tree kernel using attached Porting Guide

Chapter 7 Supporting the i.MX 6Dual/6Quad/6Solo/6DualLite Camera Sensor with CSI

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

155 Views
guna007
Contributor III

Hi Igor,

Thanks for the prompt reply.

I have ported the mt9v022 driver code (present under soc_camera) from Phytec BSP only. I have converted the platform data of mt9v022 to "OF" node data in the device tree. I am able to load the driver and initialize the IPU unit and when I give stream, I can trace the  VIDIOC_STREAMON IOCTL being called. But I am getting error in TIMEOUT in waiting for the frame buffer.

Thanks,

Guna

0 Kudos

155 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Gunasekaran

if you have correct working old driver version then one can trace wrong

settings running&dumping both new/old imx-test/../mxc_v4l2_test/  tests

Best regards

igor

0 Kudos

155 Views
guna007
Contributor III

Hi Igor,

What is the imx_test? Is it some test code available in fsl-community-bsp?

And one more thing. What about the CSI0_DATA_EN pin? Whether it should be enabled or disabled? Currently, in sabresd, that pin is connected to PCI_WAKE.

Thanks,

Guna

0 Kudos

155 Views
igorpadykov
NXP TechSupport
NXP TechSupport
0 Kudos

155 Views
guna007
Contributor III

Hi Igor,

I am getting an error when I am registering the irq for IPU unit. I think thats the reason for the timeout. How can I handle that?

0 Kudos

155 Views
guna007
Contributor III

Hi Igor,

I have added the debug messages in enable_irq, request_irq, disable_irq and clear_irq function present in drivers/mxc/ipu3/ipu_common.c. I have attached the debug messages.

Could you direct me on how to handle this?

Debug messages:

NR_IRQS:16 nr_irqs:16 16

In irq request and Irq no=23

In err disable and irq no=23

In irq request and Irq no=87

In err disable and irq no=87

In irq request and Irq no=51

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In clear irq and irq no=1

In irq enable and enabling irq = 23

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In irq request and Irq no=451

In irq Handler  and handling irq = 40

In clear irq and irq no=1

In irq enable and enabling irq = 23

In irq Handler  and handling irq = 40

In clear irq and irq no=1

In irq enable and enabling irq = 23

In irq request and Irq no=27

In err disable and irq no=27

In irq request and Irq no=91

In err disable and irq no=91

In irq request and Irq no=31

In clear irq and irq no=1

In err disable and irq no=27

In clear irq and irq no=1

In err disable and irq no=91

In irq request and Irq no=23

In err disable and irq no=23

In irq request and Irq no=87

In err disable and irq no=87

In irq request and Irq no=51

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In irq Handler  and handling irq = 40

In irq request and Irq no=27

In err disable and irq no=27

In irq request and Irq no=91

In err disable and irq no=91

In irq request and Irq no=31

In clear irq and irq no=1

In err disable and irq no=27

In clear irq and irq no=1

In err disable and irq no=91

In irq request and Irq no=28

In err disable and irq no=28

In irq request and Irq no=92

In err disable and irq no=92

In clear irq and irq no=1

In err disable and irq no=28

In clear irq and irq no=1

In err disable and irq no=92

In clear irq and irq no=1

In irq enable and enabling irq = 23

In irq Handler  and handling irq = 40

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In irq request and Irq no=451

In irq Handler  and handling irq = 40

In clear irq and irq no=1

In irq enable and enabling irq = 23

In irq Handler  and handling irq = 40

In clear irq and irq no=1

In irq enable and enabling irq = 23

In irq Handler  and handling irq = 40

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In irq request and Irq no=451

In irq Handler  and handling irq = 40

In clear irq and irq no=1

In irq enable and enabling irq = 23

In irq request and Irq no=451

In irq Handler  and handling irq = 40

In irq Handler  and handling irq = 40

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In irq request and Irq no=451

In irq Handler  and handling irq = 40

In clear irq and irq no=1

In irq enable and enabling irq = 23

In irq request and Irq no=451

In irq Handler  and handling irq = 40

In irq Handler  and handling irq = 40

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In irq request and Irq no=451

In irq Handler  and handling irq = 40

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

In clear irq and irq no=1

In err disable and irq no=23

In clear irq and irq no=1

In err disable and irq no=87

Thanks,

Gunasekaran S

0 Kudos

155 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Guna

mt9v022 driver is not supported in official nxp bsp releases, for porting drivers

one can apply to NXP Professional Services:

http://www.nxp.com/pages/freescale-professional-services:PROFESSIONAL-SERVICES

Best regards

igor

0 Kudos

155 Views
guna007
Contributor III

Hi Igor,

I feel the problem is with the IPU interrupt registration and nothing to do with MT9v022 driver per say. Could you direct me on how to handle the interrupt request?

And I am getting this error even without MT9V022 driver i.e with only ov5642_camera.

Thanks

Guna

0 Kudos