NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
OpenAMP Prototype
NOTE: This feature is no longer supported actively in the later releases of Processor SDK.
Contents
Overview[edit]
The OpenAMP provides an open source framework that allows operating systems to interact within a broad range of complex homogeneous and heterogeneous architectures and allows asymmetric multiprocessing applications to leverage parallelism offered by the multicore configuration.
See link here for more details OpenAMP
TI has done an initial prototype implementation of OpenAMP running on C6x on AM57x platform.
This page gives details about the prototype implementation and testing.
CAUTION: This is just a proof of concept prototype. The software is provided AS-IS with limited testing.
The following diagram shows the layers involved in the application image built for the DSP.
Source code details[edit]
The source code for OpenAMP layers ( open-amp & libmetal) are copied from the public OpenAMP repositories and modifications done to get the OpenAMP functional on the C6x core.
Also new sources added to support c6x tool chain support to build for c6x DSP core running TI RTOS.
The updated code is checked into the following git repos.
open-amp: branch ti_prototype
libmetal: branch ti_prototype
The test code used on the Linux user space side is here:
ti-openamp-test
Building the OpenAMP libraries and C6x DSP test application[edit]
Please refer to the README.md in open-amp.git for details on building the libraries and test code.
Repeating the build procedure here for convenience.
Example to compile OpenAMP TI BIOS for c6x core of DRA7xx/AM57xx platform[edit]
Pre-requisites[edit]
To build OpenAMP for c6x running TI BIOS requires the following components distributed part of the Processor SDK RTOS for AM57xx.[1]
- xdctools: tools needed to compile with TI RTOS
- bios: TI RTOS package
- ti-cgt-c6000: C6x codegen tools
- pdk_am57xx : Platform Development Kit for am57xx
The procedure below assume
- Processor SDK installed under <sdk_base_directory> with the individual <component name>_<version>
- libmetal git cloned to: <libmetal_source>
- open-amp git cloned to: <openamp_source>
Build procedure[edit]
Compile the libmetal library
NOTE: Remember to use full absolute path for the different variables below and NOT short cut using ~
$ mkdir -p build-libmetal $ cd build-libmetal $ cmake <libmetal_source> \ -DCMAKE_TOOLCHAIN_FILE=<libmetal_source>/cmake/platforms/dra7xx-c6x-tirtos.cmake \ -DC6X_GEN_INSTALL_PATH=<sdk_base_directory>/ti-cgt-c6000_<cgt_version> \ -DPDK_INSTALL_PATH=<sdk_base_directory>/pdk_am57xx_<pdk_version> \ -DXDC_INSTALL_PATH=<sdk_base_directory>/xdctools_<xdc_version>_core \ -DBIOS_INSTALL_PATH=<sdk_base_directory>/bios_<bios_version> \ -DWITH_TESTS=1 $ make VERBOSE=1 DESTDIR=<libmetal_install_path> install
Compile the OpenAMP library and echo test application:
$ mkdir -p build-openamp $ cd build-openamp $ cmake <openamp_source> \ -DCMAKE_TOOLCHAIN_FILE=<openamp_source>/cmake/platforms/dra7xx-c6x-tirtos.cmake \ -DC6X_GEN_INSTALL_PATH=<sdk_base_directory>/ti-cgt-c6000_<cgt_version> \ -DPDK_INSTALL_PATH=<sdk_base_directory>/pdk_am57xx_<pdk_version> \ -DXDC_INSTALL_PATH=<sdk_base_directory>/xdctools_<xdc_version>_core \ -DBIOS_INSTALL_PATH=<sdk_base_directory>/bios_<bios_version> \ -DLIBMETAL_INSTALL_PATH=<libmetal_install_path> \ -DWITH_APPS=ON $ make VERBOSE=1 DESTDIR=<openamp install_path>
The OpenAMP library will be installed to <DESTDIR>/build/usr/local/lib directory, headers will be generated to build/usr/local/include directory, and the applications executable will be generated to build/usr/local/bin directory.
cmake option -DWITH_APPS=ON is to build the demonstration applications.
Building A15 Linux test application[edit]
Pre-requisites[edit]
ARM GCC toolchain : gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf
Build procedure[edit]
See the readme.txt for instructions on building linux side test application.
Testing Details[edit]
The test is done with a sample test application, on the A15 Linux side, which sends messages to the DSP through the rpmsg_proto socket interface.
On the C6x DSP side, the OpenAMP application: echo_testd.out which is designed to loop back the packet back to the source is used.
The C6x DSP image is initially downloaded and run through the Linux kernel Remoteproc driver. And then the Linux side test application is used to send and receive messages.
See the following block diagrams on the layers involved on both A15 and DSP.
NOTE: For prototype purpose, the behavior of OpenAMP was slightly modified to match up with the expectations on the rpmsg proto interface.
Please refer to the following defines in the code to look at the modifications: "NS_2_0" "RPMSG_PROTO_WORKAROUND".
NS_2_0: This enables use of the Name service announcement 2.0 version(with additional descriptor in the Announcement message).
RPMSG_PROTO_WORKAROUND: The default code sets the Destination address based on the received message. With this defined, the destination address is set to the channel id 0.
Currently these defines can enabled/disabled by changing the following build configuration file:
open-amp/cmake/platform/dra7xx-c6x-tirtos.cmake.
To inter-operate with A15 running the openAMP stack: (NOTE: current test uses Linux kernel implementation for virtio), it is recommended to disable these defines:"NS_2_0" "RPMSG_PROTO_WORKAROUND".
Testing procedure[edit]
This sections describes the procedure used to test OpenAMP running on the C6x DSP on AM57X platform with the Host processor running TI Linux.
Step 1 :
To run the demo, the first step is to make sure there is no other default applications using the same resources.
For example, the following command is needed to disable the default OpenCL applications.
systemctl disable ti-mct-daemon.service
Step 2:
Switch the firmware link for DSP.
This can be done by using the following steps.
- Get DSP Image on the filesystem.
This can be done using many ways. For example the image can be brought in using a tftp server as follows. (Or refer to Moving_Files_to_the_Target_System on how to get a file on the filesystem)
cd /home/root tftp -g -r echo_testd.out <tftp_server_ip_addr>
- Update firmware symbolic link
ln -sf /home/root/echo_testd.out /lib/firmware/dra7-dsp1-fw.xe66
Step 3:
Reboot the system by typing "reboot". After the reboot now the new DSP image will be automatically loaded by the remoteproc driver.
Step 4:
Run the Host side application.
- Get the Host side application on the filesytem.
This can be done using may ways. For example the image can be brought in using a tftp server as follows. (Or refer to Moving_Files_to_the_Target_System on how to get a file on the filesystem)
cd /home/root tftp -g -r rpmsg_proto_socket_test <tftp_server_ip_addr> chmod +x rpmsg_proto_socket_test
- Now the Host side application can be run using the following command
/home/root/rpmsg_proto_socket_test
Here is a sample log.
root@am57xx-evm:~# ./rpmsg_proto_socket_test Start of testTx Socket create success !! Connected over sock: 3 dst vproc_id: 2, dst addr: 61 src vproc_id: -1, src addr: 1024 Connect Tx Socket success !! Rx Socket create success !! socket_bind_addr: bound sock: 4 to dst vproc_id: 2, src addr: 0 src vproc_id: -1, src addr: 0 Socket Bind success !! rpmsg send init message:0 success; size 12!! rpmsg send init message:1 success; size 12!! ti_rpmsg_send:0 success! Size 480!! ti_rpmsg_recv: receive dummy message success size 12!! ti_rpmsg_recv: receive success! Size 480!! Check receive msg complete !! Test Pass: Messages match size 480, status 0 !! root@am57xx-evm:~#