MCAPI in Bfin Linux
By AlenXuJune 14, 2013
1.Mcapi是什么?
Mcapi是一种基于共享内存的多核通信接口,里面定义了一些多个核公用的一些变量和数据结构。多核间数据处理是通过共享内存来实现的,事件通知是通过中断来实现的。Mcapi lib是基于ICC
driver顶层的库,因此内核必须要有ICC driver支持。
2.Mcapiin linux是怎样工作的?
Core A系统正常启动
Core B ICC通用工具被core B loader加载到RAM,但是这个core
B loader是运行在core A的
Core A向core B发中断,coreB开始运行ICC
server
Core B用户应用程序在ICC server上运行
Core A ICC用户程序在linux下运行并且与core B上运行的程序通信
3.Mcapiin Bfin Linux上的代码架构?
libmcapi/libmcapi-2.0/tests: test code example, customerapplication will also be here
icc-10837/libmcapi_coreb: MCAPI libs forcore B
icc-10837/icc_core: ICC protocol on coreB
icc-10837/example/task: example user appcode on core B
icc-10837/icc_loader: core B loaderprogram, but running on core A
4.Systemconfig
6.1 build kernel with ICC support
Select CoreB loader driver
BlackfinProcessor Options --->
-*-Enable Core B loader
Select ICC driver.Debug mode is optional
Device Drivers --->
[*] Stagingdrivers --->
[*]icc driver --->
--- icc driver
[*]icc protocol
[ ]iccdebug
Disable L2 cache, L2will be used to deliver messages and synchronize by ICC
Blackfin Processor Options --->
***Cache Support ***
[ ] EnableICACHE for L2 SRAM
[ ] EnableDCACHE for L2 SRAM
select external meorydcache policy write through
External memory DCACHE policy (Write through) --->
Build icc utils and test suites
Package Selection for the target --->
Miscellaneous --->
[*] bfin inter-core communicationsupport
ICC cpu type (BF609) --->
Note: Check following setting before build kernel:
L2 cache is disabled.
External memory dcache policy set to write through.
Reserve last 4M external memory for slave coreapplications.
Reserve first 128k bytes L2 SRAM for ICCmessage queues and slave core code
5. Load and run the ICC server and user app on core B
$cd /bin
$./icc_loader-l ./icc
$./icc_loader-e mcapi_msg1
6. Run user app on core A
$msg1