world leader in high performance signal processing
Trace: » v4l2_blackfin_display

v4l2 Blackfin Display Driver

The Blackfin Display Driver is a v4l2 driver supporting Video Encoders on multiple platforms.



Configure Kernel

You typically need to enable i2c support and Video Encoder driver. The driver utilizes at least two buffers to store display frames. All buffers are located in uncached memory area.

  • Config DMA region size:
    The size is dependent on image resolution, bytes per pixel and requested numbers of buffer
    Blackfin Processor Options  --->
        Uncached DMA region (Enable 32M DMA region)  ---> 
  • I2C support:
    Device Drivers  --->
        <M> I2C support  --->
                I2C Hardware Bus support  --->
                    <M> Blackfin TWI I2C support
                    (100) Blackfin TWI I2C clock (kHz)
  • Enable v4l2 and display driver:
    Device Drivers  --->
        <M> Multimedia support  --->
            [*]   Cameras/video grabbers support
            [*]   Media Controller API (EXPERIMENTAL)
            [*]   V4L platform devices  --->
                  <M>   Blackfin Video Display Driver
            Encoders, decoders, sensors and other helper chips  --->
                  <M> Analog Devices ADV7511 HDMI transmitter
                  <M> ADV7343 video encoder 
  • Note: Please make sure sysclk frequency is no less than 200MHz.
    Blackfin Processor Options  --->
        Board customizations  --->
            (25000000) Frequency of the crystal on the board in Hz
            [*] Re-program Clocks while Kernel boots?
            (20)  VCO Multiplier
                  Core Clock Divider (1)  --->
            (2)   System Clock Divider
            (2)   System Clock0 Divider
            (2)   System Clock1 Divider
            (2)   DDR Clock Divider         

Configure Userspace Application

  • In buildroot, enable V4L2 video test application to play video file.
    Package Selection for the target  --->
        Miscellaneous  --->
            [*] V4L2 video test program

Test method

  • Prepare a 720p yuv file, use v4l2_video_display to play this file, results can be seen on TV through HDMI port.
  • Bellow is the example log:
    Linux version 3.3.0-ADI-2012R1-dirty (test@linux85-beagle) (gcc version 4.3.5 (ADI-2012R1-RC2) ) #2 Mon Jul 23 14:37:18 CST 2012
    register early platform devices
    bootconsole [early_shadow0] enabled
    ERROR: Not running on ADSP-BF609: unknown CPUID 0x0000 Rev 0.0
    bootconsole [early_BFuart0] enabled
    early printk enabled on early_BFuart0
    Board Memory: 128MB
    Kernel Managed Memory: 128MB
    Memory map:
      fixedcode = 0x00000400-0x00000490
      text      = 0x00001000-0x001c7028
      rodata    = 0x001c704c-0x00261e7c
      bss       = 0x00262000-0x002750f4
      data      = 0x002750f4-0x002a0000
        stack   = 0x0029e000-0x002a0000
      init      = 0x002a0000-0x00617000
      available = 0x00617000-0x06000000
      DMA Zone  = 0x06000000-0x08000000
    Hardware Trace active and enabled
    Blackfin support (C) 2004-2010 Analog Devices, Inc.
    Compiled for ADSP-BF609 Rev 0.0
    Blackfin Linux support by
    Processor Speed: 500 MHz core clock, 250 MHz SCLk, 125 MHz SCLK0, 125 MHz SCLK1 and 250 MHz DCLK
    NOMPU: setting up cplb tables
    Instruction Cache Enabled for CPU0
      External memory: cacheable in instruction cache
      L2 SRAM        : uncacheable in instruction cache
    Data Cache Enabled for CPU0
      External memory: cacheable (write-back) in data cache
      L2 SRAM        : uncacheable in data cache
    Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 24384
    Kernel command line: root=/dev/mtdblock0 rw ip= earlyprintk=serial,uart0,57600 console=ttyBF0,57600 ip=
    PID hash table entries: 512 (order: -1, 2048 bytes)
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Memory available: 91156k/131072k RAM, (3548k init code, 1816k kernel code, 868k data, 32768k dma, 916k reserved)
    Configuring Blackfin Priority Driven Interrupts
    Console: colour dummy device 80x25½¬Ëk½±~U~A[ttyBF0] enabled, bootconsole disabled
    console [ttyBF0] enabled, bootconsole disabled
    Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)
    pid_max: default: 32768 minimum: 301
    Mount-cache hash table entries: 512
    Blackfin Scratchpad data SRAM: 4 KB
    Blackfin L1 Data A SRAM: 16 KB (9 KB free)
    Blackfin L1 Data B SRAM: 16 KB (16 KB free)
    Blackfin L1 Instruction SRAM: 64 KB (50 KB free)
    Blackfin L2 SRAM: 256 KB (256 KB free)
    NET: Registered protocol family 16
    gpiochip_add: registered GPIOs 0 to 111 on device: BFIN-GPIO
    Blackfin DMA Controller
    ezkit_init(): registering device resources
    ezkit_init(): request emac pins failed
    bio: create slab <bio-0> at 0
    SCSI subsystem initialized
    bfin-spi bfin-spi.0: bfin-spi probe success
    bfin-spi bfin-spi.1: bfin-spi probe success
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    i2c-bfin-twi i2c-bfin-twi.0: Blackfin on-chip I2C TWI Contoller, regs_base@ffc01e00
    i2c-bfin-twi i2c-bfin-twi.1: Blackfin on-chip I2C TWI Contoller, regs_base@ffc01f00
    NET: Registered protocol family 23
    Switching to clocksource bfin_cs_cycles
    musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
    NET: Registered protocol family 2
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)
    TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
    TCP: Hash tables configured (established 4096 bind 4096)
    TCP reno registered
    UDP hash table entries: 256 (order: 0, 4096 bytes)
    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    NET: Registered protocol family 1
    msgmni has been set to 178
    io scheduler noop registered (default)
    bfin-uart: Blackfin serial driver
    bfin-uart.0: ttyBF0 at MMIO 0xffc02000 (irq = 96) is a BFIN-UART
    physmap platform flash device: 01000000 at b0000000
    physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000089 Chip ID 0x008821
    Intel/Sharp Extended Query Table at 0x010A
    Intel/Sharp Extended Query Table at 0x010A
    Intel/Sharp Extended Query Table at 0x010A
    Intel/Sharp Extended Query Table at 0x010A
    Intel/Sharp Extended Query Table at 0x010A
    Using buffer write method
    Using auto-unlock on power-up/resume
    cfi_cmdset_0001: Erase suspend on write enabled
    Creating 3 MTD partitions on "physmap-flash.0":
    0x000000000000-0x000000080000 : "bootloader(nor)"
    0x000000080000-0x000000480000 : "linux kernel(nor)"
    0x000000480000-0x000001000000 : "file system(nor)"
    m25p80 spi0.1: w25q32 (4096 Kbytes)
    Creating 3 MTD partitions on "m25p80":
    0x000000000000-0x000000080000 : "bootloader(spi)"
    0x000000080000-0x000000200000 : "linux kernel(spi)"
    0x000000200000-0x000000400000 : "file system(spi)"
    CAN device driver interface
    bfin_can bfin_can.0: bfin_can device registered(&reg_base=ffc00a00, rx_irq=55, tx_irq=56, err_irq=57, sclk=125000000)
     No HW DMA feature register supported
     Enhanced/Alternate descriptors
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    input: bfin-rotary as /devices/platform/bfin-rotary/input/input0
    i2c /dev entries driver
    Linux media interface: v0.10
    lirc_dev: IR Remote Control driver registered, major 252
    IR NEC protocol handler initialized
    IR RC5(x) protocol handler initialized
    IR RC6 protocol handler initialized
    IR JVC protocol handler initialized
    IR Sony protocol handler initialized
    IR RC5 (streamzap) protocol handler initialized
    IR SANYO protocol handler initialized
    IR MCE Keyboard/mouse protocol handler initialized
    IR LIRC bridge handler initialized
    Linux video capture interface: v2.00
    ppi probe success
    bfin_display bfin_display.0: v4l2 device registered
    bfin_display bfin_display.0: video device registered as: video0
    adv7511 0-0039: adv7511 found @ 0x72 (i2c-bfin-twi)
    bfin_display bfin_display.0: v4l2 sub device registered
    bfin-wdt: initialized: timeout=20 sec (nowayout=0)
    Blackfin hardware CRC crypto driver
    dma_alloc_init: dma_page @ 0x04b75000 - 8192 pages at 0x06000000
    bfin-hmac-crc bfin-hmac-crc.0: initialized
    usbcore: registered new interface driver usbhid
    usbhid: USB HID core driver
    TCP cubic registered
    NET: Registered protocol family 17
    can: controller area network core (rev 20090105 abi 8)
    NET: Registered protocol family 29
    eth0: device MAC address 00:e0:22:fe:88:1d
    stmmac: probed
    eth0: PHY ID 20005c90 at 1 IRQ 0 (stmmac-0:01) active
     No MAC Management Counters available
    IP-Config: Complete:
         device=eth0, addr=, mask=, gw=,
         host=bf609-ezkit, domain=, nis-domain=(none),
         bootserver=, rootserver=, rootpath=
    Freeing unused kernel memory: 3548k freed
    BusyBox v1.17.4 (2012-07-23 13:17:13 CST) hush - the humble shell
    root:/> v4l2_video_display -F /adv7842.yuv
    enum outputs
    output[0]: HDMI
    set output to 0: support dv_timings
    dv_timings: progressive,width=1280,height=720
    enum formats
    format[0]: YCbCr 4:2:2 Interleaved UYVY 16
    negotiated formats: 1280x720
    field order: progressive
    size = 1843200
    bytesperline = 2560
    pixelformat: UYVY
    request 3 buffers
    open image file '/adv7842.yuv' success
    stream on success