zero copy architecture in RDK of TI 8168 EVM

原创 2012年03月20日 16:59:41
1 the RDK overview:

    Work is based on EVM: 8168SoC + 5158VideoCapture + 1GB DDR2.

    RDK is an open source SDK which enable you to modify and rebuild uboot, kernel, vpss package, dsp/m3 program, and the core concepts in it are links and mcfw(multichannel framework).  A link is a software entity running on a core with input queue and output queue, also with a unique ID to let other link and the system find it. You can consider a link as a basic component in the software architecture, so links could be placed in different order or topology to change the system behavior.  Links could be connected to each other by specifying a link's previous link and related queue number. For eg, link A could be connect to link B by setting link B's previous ID to A and queue number to 0. mcfw is built based on links which using predefined link topology resulting much easier configuration for the whole system. A link contains its own thread to process data and handling control commands.

                                 | |
        |                                                   |                                                      
     SW Mosaic                              IPC OUT (M3)
     (SC5 422)                                      |
        |                                              IPC IN  (M3)
        |                                                   |
    On-Chip HDMI                         Encode
      1080p60                                        |
                                                IPC BITS OUT (M3)
                                                 IPC BITS IN  (A8)

           graphic 1. links example

    The graphic 1 shows a system containing several links to work as capture->display and encode. It is a combination of links. Changing the link order could make a custom usecase.

2 how link works

    When a link is setup correctly and started, it would automatically pull data from previous link and push the processed data to next link. Because each core have links on it, there needs to be a way to transfer messages between them, this is called IPC(inter processor communication), which enables ARM working with DSP and M3 cores.

      graph 2: Link overview

    As the graphic says, links is built upon traditional software components used on TI Davince serials, syslink. Links resides on different cores so they need syslink/IPC to provide communication across different OS and cores. Syslink use shared memory which different core can access to transfer messages. Some uncached shared memory was used to format a message queue infrastructure, Some are used as heap from which big frame buffer could be allocated.

3 memory layout to make link work
     The physical memory on EVM board is divided to several sections, by default 1GB EVM is divided as following:

(Unrelated sections were not listed here, SR = Shared Region.)
#  0x8000 0000, 256MB, Linux on ARM
#  0x9000 0000, 87MB, SR1, used for transfer bit stream between ARM and M3 video subsystem(codec and decodec).
#  0x9570 0000, 1MB, SR2, used for IPC M3 List MP.(Cached)
#  0xA800 0000, 361MB, SR3, used for frame buffers.
#  0xBE90 0000, 16MB, SR0, used for message queue and IPC List MP.(Uncached)

(Note: DSP and ARM core have its own MMU, but for DDR they are seeing the same physical address)

    The communication is designed to transfer message encapsulated in message queue, which can also called mailbox. If ARM want to send a command to M3 or DSP, ARM need to encapsulate the information into a message and copy it to the SR0(Note, mailbox and lock is actually implemented with hardware support, the chip have 12 "mailboxes" with related interrupts and register, the chip also have 64 hardware "spinlocks" and related register). Frame buffers are organized into lists which resides in SR0  and SR2, while frame buffers resides in SR3, and bit stream from codec resides in SR1. SR2 is cached So it was only used between cores which have same type, in 8168 they are M3 cores.
     The section divided here does not means hardware and firmware banned a core accessing the sections not belonging to them, but if it did there is risk to break the system. I have not try to change the memory layout, but it is possible by modifying uboot, kernel, and VPSS address mapping. On ARM you can access the shared region which was belonging to DSP and M3, But simply mmap() would give you a wrong virtual address. Another thing it refers  is: message queue used SR0 which is uncached and only have 16MB, So do not put large data in the message. If you want to transfer a large set of data, allocated it in other region and encapsulate a pointer pointering to the allocated buffer into the message queue. Following is a demonstration that a link(not a codec link) used to tell other link on another different core that it have new data.

                              graphic 3 example to transfer frames between links

    There are 3 pairs of data and code sections reserved for M3 VPSS, M3 Video, DSP, they are private for each core. What a user need to take care is that, the data section is 2MB, and data section is 10MB/12MB, so it suits for algorithm not memory scan likewise application.

4 Zero copy for frames
    The framework allocate all frame buffers in SR3, and chains the pointer to it into a list. So what changes and transferred are only list and messages, the frame buffer were never copied except "duplication link". One frame is hold and accessed only by one link at one time.


A deeper look at hardware and software of TI 8168 EVM

This SoC is very complex and I'd like to point out something special. 1 Hardware    1) Video subsy...

基于TI 8168 RDK 4.0 多路解码

总的流程 如下: 读文件代码: static Void *readRevframeThr(Void * prm){ static UInt32 flag =0; static UInt...


  • 2015年11月30日 14:47
  • 1.42MB
  • 下载

DM8168 dvr rdk link 代码阅读小结 图

  • 2013年10月14日 19:14
  • 115KB
  • 下载

DM8168 & DVR_RDK配置

从14年8月接触板子,开始学习达芬奇DM8168的架构并尝试移植项目的代码到板子上运行。到15年4月共8个月时间,从板子uboot,打印简单的hello world到把项目代码移植到架构中,调整DSP...

DM8168_DVR_RDK 环境配置

Ubuntu 10.04   CodeSourcery: /home/user/share   简称:   QT: /home/user/share/ qt-everywhere-ope...

how many does the factorial of n(in binary data ) have zero?

how many does the factorial of n(in binary data ) have zero? 个人信息:就读于燕大本科软件工程专业 目前大三; 本人博客:g...

Recent Evolution of Zero Data Loss Guarantee in Spark Streaming With Kafka

When properly deployed, Spark Streaming 1.2 provides zero data loss guarantee.


感谢原作者robin19890305的经验分享。 ========================================================================...

HR--Copy of fetching HR data in different ways

There are 3 methods in fetching the data from HR database tables . 1.using select statements . Thi...
您举报文章:zero copy architecture in RDK of TI 8168 EVM