Here are two patches to support BT656 and BT1120 output for i.MX6 ipuv3. With this patch, the i.MX6 can support the CVBS output on TV encoder. It is useful for a TV box.
"L3.0.35_1.1.0_GA_bt656_output_patch.zip" is the patch for Freescale L3.0.35_1.1.0_GA_iMX6DQ BSP.
"r13.4.1_bt656_output_patch.zip" is the patch for Freescale Android R13.4.1 BSP.
1. Features supported:
1) Support BT656(8 bits) and BT1120 (16 bits)interlaced output on display port.
2) Support both RGB and YUV frame buffer for BT656/BT1120 output.
3) Support PAL and NTSC mode.
4) Support on the fly switch between PAL and NTSC mode.
5) Support CVBS output based on adv7391 TV encoder.
2. Hardware link between iMX6 and adv7391 TV encoder chip.
IPU1_DI0_DISP_CLK connected to adv7391 CLKIN pin.
IPU1_DISP0_DAT_23~DISP0_DAT_16 connected to adv7391 P7~P0 pins.
IPU1_DI0_PIN2 connected to adv7391 HSYNC pin. (option)
IPU1_DI0_PIN4 connected to adv7391 VSYNC pin. (option)
- Android R13.4.1 kernel.
3. How to use
-- Copy the two patch files to kernel folder.
$ git apply ./0001-Support-BT656-and-BT1120-output-for-iMX6-ipuv3.patch
$ git apply ./0002-Support-adv739x-TV-encoder-for-BT656-output.patch
-- Select them in kernel config and build the new kernel image:
Device Drivers --->
Graphics support --->
[*] MXC BT656 and BT1120 output
[*] ADV7390/7391 TV Output Encoder
-- Uboot parameters for video mode
Output BT656 NTSC data to display port with UVYV frame buffer mode:
Output BT656 NTSC data to display port with RGB565 frame buffer mode:
Output BT656 PAL data to display port with RGB24 frame buffer mode:
Output CVBS NTSC signal on adv7391 with UYVY frame buffer mode:
Output CVBS PAL signal on adv7391 with RGB565 frame buffer mode:
-- Switch between PAL and NTSC
$ echo D:720x480i-60 > /sys/class/graphics/fb0/mode
$ echo D:720x576i-50 > /sys/class/graphics/fb0/mode
1) For 8 bits BT656 interface, the default data pins are "DISP0_DAT_23~DISP0_DAT_16", it can also
be any other continued display data pins, for example if "DISP0_DAT_7~DISP0_DAT_0" are used, the
macro "BT656_IF_DI_MSB" in "kernel_imx/drivers/mxc/ipu3/ipu_disp.c" should be changed from "23"
2) For 16 bits BT1120 interface, the default data pins are "DISP0_DAT_23~DISP0_DAT_8", it can also
be any other continued display data pins, the macro "BT656_IF_DI_MSB" should be modified if the
hardware pins are changed.
3) When bt656 interface is the second display for each IPU,1-layer-fb (it can be checked with command
"$ cat /sys/class/graphics/fbx/fsl_disp_propperty"), the frame buffer can only be YUV format. In this
case, the IPU DC channel was used for BT656 display, it has no CSC function, so RGB frame buffer was
The new release package "L3.0.35_1.1.0_GA_bt656_output_patch_2013-08-09.zip" had fixed the BT656 dual display issue on iMX6S/DL.
Removed the old release package.
The new release package "r13.4.1_bt656_output_patch_2013-09-04.zip" had fixed the BT656 dual display issue on iMX6S/DL.
For default, the dual display was tested with HDMI + CVBS, HDMI is the main display and adv739x CVBS output is the second display.
For iMX6DQ which has two IPUs, please assign dual display to two IPUs, for example adv739x is on IPU1 DI0, it is fixed, because hardware pins used for it is fixed. Then we can assign HDMI or LVDS to another IPU (IPU2).
For iMX6S/DL which has only one IPU, since adv739x had used IPU1 DI0, another display should be IPU1 DI1.
Added patch for L3.0.35_4.1.0_GA BSP, the file is "L3.0.35_4.1.0_GA_bt656_output_patch_2013-09-30.zip".
Added patch for L3.10.17_1.0.0_GA BSP, the file is "L3.10.17_1.0.0_GA_bt656_output_patch_2014-07-21.zip".
Updated the IPU microcode for 1080i50 and 1080i60 BT1120 output, the parameters "N" for command BMA is a 8 bits parameters, so its max value is 255, but for 1080i50 and 1080i60 output, it needs more blank data in each line, the "N" will be bigger than 255, the updated IPU microcode can fix this limitation.
The updated file is "IPU_Microcode_Update_for_BT1120_1080i_20150126.zip". You can update the macro "DC_MCODE_BT656_xxx" and function _ipu_dc_setup_bt656_interlaced() to the old patch if you used BT1120 mode to support 1080i display.
The verified 1080i display mode is:
/* 1080I60 Interlaced output */
"BT1120-1080I60", 30, 1920, 1080, 13468,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
/* 1080I50 Interlaced output */
"BT1120-1080I50", 25, 1920, 1080, 13468,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
Updated IPU microcode to align with BT656.4 specification for NTSC output. For other BSP version with NTSC format support, please reference to ipu_disp_update.c for the final microcode.
File "L3.0.35_4.1.0_GA_bt656_output_patch_20160128.zip"., Details, please reference to the readme.txt file in the package.
Added BT656 and BT1120 progressive mode support.
File "L3.0.35_4.1.0_GA_bt656_output_patch_20160624.zip". Details, please reference to the readme.txt file in the package.
The patch for 3.14.52 GA1.1.0 BSP will be released in next week.
Add BT656 and BT1120 display patch for 3.14.52 BSP. File "L3.14.52_1.1.0_GA_bt656_output_patch_2016-06-27.zip", details, please reference to the readme.txt in the package.
Fixed a hard coding DC macro issue for progressive mode. Added patch "0008-Fixed-a-hard-coding-DC-macro-issue-for-progressive-m.patch" in L3.0.35_4.1.0_GA_bt656_output_patch_2017-03-10.zip.
The code in patch "L3.14.52_1.1.0_GA_bt656_output_patch_2016-06-27" is correct.
Original Attachment has been moved to: r13.4.1_bt656_output_patch_2013-09-04.zip
Original Attachment has been moved to: L3.0.35_1.1.0_GA_bt656_output_patch_2013-08-09.zip
Original Attachment has been moved to: L3.10.17_1.0.0_GA_bt656_output_patch_2014-07-21.zip
Original Attachment has been moved to: L3.14.52_1.1.0_GA_bt656_output_patch_2016-06-27.zip
Original Attachment has been moved to: L3.0.35_4.1.0_GA_bt656_output_patch_2016-06-24.zip
Original Attachment has been moved to: L3.0.35_4.1.0_GA_bt656_output_patch_2017-03-10.zip
Added reference patch for L4.1.15 kernel.