How to enable i.MX6UL  CSI port support BT.656 deinterlace mode and PXP preview

Showing results for 
Search instead for 
Did you mean: 

How to enable i.MX6UL  CSI port support BT.656 deinterlace mode and PXP preview

No ratings

How to enable i.MX6UL  CSI port support BT.656 deinterlace mode and PXP preview

i.MX6UL CSI (CMOS Sensor Interface) host port support BT.656(CCIR656) Interlace mode by hardware.  It can received  PAL(720pix X 576pix) and NTSC(720pix X 480 pix) format data from camera.

This document introduce how to add this feature to Linux L3.14.38-ga and receive ADV7180 output.

Software: yocto L3.14.38-ga.

Hareware:  i.mx6ul-evk + ADV7180.

ADV7180: PAL 720pix X576pix  ,  YUV4:2:2(UYVY) interlace output.

LCD Display screen resolution:  800 X 480,  RGB565.

1) Note : For BT.656 mode,   parallel data port is  CSI_DATA[9:2], not CSI_DATA[13:6].    So,  "pinctrl_csi1" is the same as "ov5640" in "imx6ul-14x14-evk.dts":

pinctrl_csi1: csi1grp {

   fsl,pins = <





    MX6UL_PAD_CSI_DATA00__CSI_DATA02 0x1b088

    MX6UL_PAD_CSI_DATA01__CSI_DATA03 0x1b088

    MX6UL_PAD_CSI_DATA02__CSI_DATA04 0x1b088

    MX6UL_PAD_CSI_DATA03__CSI_DATA05 0x1b088

    MX6UL_PAD_CSI_DATA04__CSI_DATA06 0x1b088

    MX6UL_PAD_CSI_DATA05__CSI_DATA07 0x1b088

    MX6UL_PAD_CSI_DATA06__CSI_DATA08 0x1b088

    MX6UL_PAD_CSI_DATA07__CSI_DATA09 0x1b088

    MX6UL_PAD_SNVS_TAMPER5__GPIO5_IO05 0x17059            /* configue csi_reset in this case */

    MX6UL_PAD_SNVS_TAMPER6__GPIO5_IO06 0x17059            /* configure csi_en in this case*/


2) Applay the video driver patches as attatched.

  $git am 0001-Enable-CSI-support-BT656-interlace-and-add-adv7180.patch

3) Build the kernel.

   make imx_v7_defconfig

   make -j4

4) Use  unit_tests "mx6s_v4l2_capture_uyvy.out" to test it,  source code is attached "mx6s_v4l2_capture.c":

Copy "mx6s_v4l2_capture_uyvy.out" to target device FS  "/unit_tests" folder, and run it like this:

./mx6s_v4l2_capture_uyvy.out -m 0 -t 50 -d /dev/video0

5) In this "mx6s_v4l2_capture.c" demo test code,   it can utilize software algorithm to implement CSC(Color Space Conversion) from YUV4:2:2 to RGB.

PXP module can realize hardware CSC and image resize.

6) How to use CSI + PXP to preview camera, refer to  unit_tests "imx-test" package "pxp_v4l2_test" - "pxp_v4l2_test.c"  .

Run following command in Target device FS:   /unit_tests

/*Record raw camera UYVY data(720x576) to save in test1.yuv */
./mx6s_v4l2_capture_uyvy.out -m 0 -t 10 -of test1.yuv -d /dev/video0

/*Play this test1.yuv file(UYVY) by PXP engine and resize to full screan(800x480) */
./pxp_v4l2_test.out -sx 800 -sy 480 -res 720:576 -dst 0:0:800:480 -a 100 -f 5 test1.yuv BLANK

7) The "pxp_v4l2_preview_test.c" demo attached  is  a TV-in demo for i.MX6ul which support ADV7180 camera preview by PXP in time. This demo implements scaling image frame to full screen, Alpha blending and Composite two image together function by PXP hardware.

Tags (1)


Hi Yifang Guo,

AVNET DFAE is asking for this document (I am not sure how does he find it). Can I share this document and attachments with the DFAE?



Version history
Revision #:
1 of 1
Last update:
‎03-22-2016 08:18 PM
Updated by: