Skip to content

openamp sample integration/app #7416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions boards/arm/lpcxpresso54114_m0/lpcxpresso54114_m0_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ CONFIG_SERIAL=n
CONFIG_CORTEX_M_SYSTICK=y
CONFIG_GPIO=n
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000

# Heap is needed by OpenAMP:
CONFIG_HEAP_MEM_POOL_SIZE=4096

4 changes: 4 additions & 0 deletions boards/arm/lpcxpresso54114_m4/lpcxpresso54114_m4_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ CONFIG_CORTEX_M_SYSTICK=y
CONFIG_GPIO=y
CONFIG_PINMUX=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000

# Heap is needed by OpenAMP:
CONFIG_HEAP_MEM_POOL_SIZE=4096

41 changes: 41 additions & 0 deletions ext/lib/ipc/README.libmetal
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
libmetal
#####################

Origin:
https://github.com/OpenAMP/libmetal

Status:
606c31438025b9fb1515dace1c642d5835d8d33c [v2018.04]

When we import libmetal we removed the tests/ and examples/ dir to reduce
the amount of code imported.

Purpose:
HAL abstraction layer used by open-amp

Description:
Libmetal provides common user APIs to access devices, handle device
interrupts and request memory across the following operating environments:

* Linux user space (based on UIO and VFIO support in the kernel)
* RTOS (with and without virtual memory)
* Bare-metal environments

Dependencies:
Depends on Zephyr itself as it utilizes Zephyr's APIs to provide an
abstraction to open-amp.

URL:
https://github.com/OpenAMP/libmetal

commit:
606c31438025b9fb1515dace1c642d5835d8d33c

Maintained-by:
External

License:
BSD-3-Clause

License Link:
https://github.com/OpenAMP/libmetal/blob/master/LICENSE.md
54 changes: 54 additions & 0 deletions ext/lib/ipc/README.open-amp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
OpenAMP
#####################

Origin:
https://github.com/OpenAMP/open-amp

Status:
de361adee09cd31793c60218a0ec49bc307a7410 [v2018.04]

When we import open-amp we removed the apps dir to reduce the amount of
code imported.

Purpose:
IPC layer that implements rpmsg communication between cores.

Description:

This repository is the home for the Open Asymmetric Multi Processing (OpenAMP)
framework project. The OpenAMP framework provides software components that
enable development of software applications for Asymmetric Multiprocessing
(AMP) systems. The framework provides the following key capabilities.

* Provides Life Cycle Management, and Inter Processor Communication capabilities
for management of remote compute resources and their associated software
contexts.
* Provides a stand alone library usable with RTOS and Baremetal software
environments
* Compatibility with upstream Linux remoteproc and rpmsg components
* Following AMP configurations supported:
a. Linux master/Generic(Baremetal) remote
b. Generic(Baremetal) master/Linux remote
* Proxy infrastructure and supplied demos showcase ability of proxy on master
to handle printf, scanf, open, close, read, write calls from Bare metal
based remote contexts.

Dependencies:
libmetal (https://github.com/OpenAMP/libmetal) - provides HAL layer
between OpenAMP and RTOS or OS environment.

URL:
https://github.com/OpenAMP/open-amp/

commit:
de361adee09cd31793c60218a0ec49bc307a7410

Maintained-by:
External

License:
BSD-3-Clause
BSD-2-Clause

License Link:
https://github.com/OpenAMP/open-amp/blob/master/LICENSE.md
12 changes: 12 additions & 0 deletions ext/lib/ipc/libmetal.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
include(ExternalProject)

ExternalProject_Add(
libmetal # Name for custom target
SOURCE_DIR $ENV{ZEPHYR_BASE}/ext/lib/ipc/libmetal/
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_ARGS -DWITH_ZEPHYR=ON -DBOARD=${BOARD} -DWITH_DEFAULT_LOGGER=OFF -DWITH_DOC=OFF
)

ExternalProject_Get_property(libmetal BINARY_DIR)
set(LIBMETAL_INCLUDE_DIR ${BINARY_DIR}/lib/include)
set(LIBMETAL_LIBRARY ${BINARY_DIR}/lib/libmetal.a)
18 changes: 18 additions & 0 deletions ext/lib/ipc/libmetal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
*.o
*~
!libs/system/zc702evk/linux/lib/*/*.a
*.bin
*.map
*.out
*.log
*.swp
*.swo
*.d
build*/

/tags
/TAGS

# cscope files
cscope.*
ncscope.*
100 changes: 100 additions & 0 deletions ext/lib/ipc/libmetal/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
language: minimal # setting language to C will override cross-compiler and fail

compiler:
- gcc

sudo: required
dist: trusty

env:
global:
- ZEPHYR_GCC_VARIANT=zephyr
- ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk
- ZEPHYR_BASE=$TRAVIS_BUILD_DIR/deps/zephyr
- ZEPHYR_SDK_VERSION=0.9.2
- ZEPHYR_SDK_DOWNLOAD_FOLDER=https://github.com/zephyrproject-rtos/meta-zephyr-sdk/releases/download/$ZEPHYR_SDK_VERSION
- ZEPHYR_SDK_SETUP_BINARY=zephyr-sdk-$ZEPHYR_SDK_VERSION-setup.run
- ZEPHYR_SDK_DOWNLOAD_URL=$ZEPHYR_SDK_DOWNLOAD_FOLDER/$ZEPHYR_SDK_SETUP_BINARY
- FREERTOS_ZIP_URL=https://downloads.sourceforge.net/project/freertos/FreeRTOS/V10.0.1/FreeRTOSv10.0.1.zip

matrix:
fast_finish: true
include:
- os: linux
env: TARGET="zephyr"
- os: linux
env: TARGET="linux"
- os: linux
env: TARGET="generic"
- os: linux
env: TARGET="freertos"

cache:
directories:
- $ZEPHYR_SDK_INSTALL_DIR
- /usr/local/bin

before_install:
- if [[ "$TARGET" == "zephyr" ]]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test &&
sudo apt-get update -qq &&
sudo apt-get install libc6-dev-i386 make gperf gcc g++ python3-ply python3-yaml python3-pip device-tree-compiler ncurses-dev uglifyjs -qq &&
sudo pip3 install pyelftools;
fi
- if [[ "$TARGET" == "linux" ]]; then
sudo apt-get update -qq &&
sudo apt-get install libsysfs-dev libhugetlbfs-dev make gcc;
fi
# This is to kick start CI on generic platform. Will need to have a proper way to get the required packages
- if [[ "$TARGET" == "generic" || "$TARGET" == "freertos" ]]; then
wget http://ppa.launchpad.net/team-gcc-arm-embedded/ppa/ubuntu/pool/main/g/gcc-arm-none-eabi/gcc-arm-embedded_7-2017q4-1~trusty3_amd64.deb &&
sudo dpkg -i gcc-arm-embedded_7-2017q4-1~trusty3_amd64.deb;
fi
- if [[ "$TARGET" == "freertos" ]]; then
wget $FREERTOS_ZIP_URL &&
pwd && ls &&
unzip FreeRTOSv10.0.1.zip > /dev/null;
fi

install: >
if [[ "$TARGET" == "zephyr" && "$(cat $ZEPHYR_SDK_INSTALL_DIR/sdk_version)" != "$ZEPHYR_SDK_VERSION" ]]; then
wget $ZEPHYR_SDK_DOWNLOAD_URL &&
chmod +x $ZEPHYR_SDK_SETUP_BINARY &&
rm -rf $ZEPHYR_SDK_INSTALL_DIR &&
./$ZEPHYR_SDK_SETUP_BINARY --quiet -- -y -d $ZEPHYR_SDK_INSTALL_DIR > /dev/null;
fi

before_script: >
if [[ "$TARGET" == "zephyr" ]]; then
cd .. &&
git clone --depth=1 https://github.com/zephyrproject-rtos/zephyr.git &&
cd zephyr &&
source zephyr-env.sh;
fi

script:
- if [[ "$TARGET" == "zephyr" ]]; then
mkdir -p ../libmetal/build-zephyr &&
cd ../libmetal/build-zephyr &&
cmake .. -DWITH_ZEPHYR=on -DBOARD=qemu_cortex_m3 -DWITH_TESTS=on &&
make VERBOSE=1;
fi
- if [[ "$TARGET" == "linux" ]]; then
mkdir -p build-linux &&
cd build-linux &&
cmake .. -DWITH_TESTS_EXEC=on &&
make VERBOSE=1 all test;
fi
- if [[ "$TARGET" == "generic" ]]; then
mkdir -p build-generic &&
cd build-generic &&
cmake .. -DCMAKE_TOOLCHAIN_FILE=template-generic &&
make VERBOSE=1;
fi
- if [[ "$TARGET" == "freertos" ]]; then
mkdir -p build-freertos &&
cd build-freertos &&
export &&
cmake .. -DCMAKE_TOOLCHAIN_FILE=template-freertos -DCMAKE_C_FLAGS="-I$PWD/../FreeRTOSv10.0.1/FreeRTOS/Source/include/ -I$PWD/../FreeRTOSv10.0.1/FreeRTOS/Demo/CORTEX_STM32F107_GCC_Rowley -I$PWD/../FreeRTOSv10.0.1/FreeRTOS/Source/portable/GCC/ARM_CM3" &&
make VERBOSE=1;
fi
37 changes: 37 additions & 0 deletions ext/lib/ipc/libmetal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
cmake_minimum_required (VERSION 2.6)

list (APPEND CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/cmake"
"${CMAKE_SOURCE_DIR}/cmake/modules"
"${CMAKE_SOURCE_DIR}/cmake/platforms")

include (syscheck)
project (metal C)

include (CheckIncludeFiles)
include (CheckCSourceCompiles)
include (collect)
include (options)
include (depends)

foreach(_inc_path ${CMAKE_INCLUDE_PATH})
collect (PROJECT_INC_DIRS "${_inc_path}")
endforeach()

enable_testing ()

add_subdirectory (lib)

if (WITH_TESTS)
add_subdirectory (test)
endif (WITH_TESTS)

if (WITH_DOC)
add_subdirectory (doc)
endif (WITH_DOC)

if (WITH_EXAMPLES)
add_subdirectory (examples)
endif (WITH_EXAMPLES)

# vim: expandtab:ts=2:sw=2:smartindent
41 changes: 41 additions & 0 deletions ext/lib/ipc/libmetal/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Software License Agreement (BSD License)
========================================

Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of Xilinx nor the names of its contributors may be used
to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.


Notes
=========================================
Use the following tag instead of the full license text in the individual files:

SPDX-License-Identifier: BSD-3-Clause

This enables machine processing of license information based on the SPDX
License Identifiers that are here available: http://spdx.org/licenses/

21 changes: 21 additions & 0 deletions ext/lib/ipc/libmetal/MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# libmetal Maintainers

libmetal project is maintained by the OpenAMP open source community.
Everyone is encouraged to submit issues and changes to improve libmetal.

The intention of this file is to provide a set of names that developers can
consult when they have a question about OpenAMP and to provide a a set of
names to be CC'd when submitting a patch.

## Project Administration
Wendy Liang <[email protected]>

### All patches CC here
[email protected]

## Machines
### Xilinx Platform - Zynq-7000
Wendy Liang <[email protected]>

### Xilinx Platform - Zynq UltraScale+ MPSoC
Wendy Liang <[email protected]>
Loading