Skip to content

Commit 3ddfd17

Browse files
galakMaureenHelm
authored andcommitted
ext: Import libmetal for IPC/open-amp
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 Signed-off-by: Kumar Gala <[email protected]>
1 parent aa26289 commit 3ddfd17

File tree

184 files changed

+12668
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+12668
-0
lines changed

ext/lib/ipc/README.libmetal

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
libmetal
2+
#####################
3+
4+
Origin:
5+
https://github.com/OpenAMP/libmetal
6+
7+
Status:
8+
606c31438025b9fb1515dace1c642d5835d8d33c [v2018.04]
9+
10+
When we import libmetal we removed the tests/ and examples/ dir to reduce
11+
the amount of code imported.
12+
13+
Purpose:
14+
HAL abstraction layer used by open-amp
15+
16+
Description:
17+
Libmetal provides common user APIs to access devices, handle device
18+
interrupts and request memory across the following operating environments:
19+
20+
* Linux user space (based on UIO and VFIO support in the kernel)
21+
* RTOS (with and without virtual memory)
22+
* Bare-metal environments
23+
24+
Dependencies:
25+
Depends on Zephyr itself as it utilizes Zephyr's APIs to provide an
26+
abstraction to open-amp.
27+
28+
URL:
29+
https://github.com/OpenAMP/libmetal
30+
31+
commit:
32+
606c31438025b9fb1515dace1c642d5835d8d33c
33+
34+
Maintained-by:
35+
External
36+
37+
License:
38+
BSD-3-Clause
39+
40+
License Link:
41+
https://github.com/OpenAMP/libmetal/blob/master/LICENSE.md

ext/lib/ipc/libmetal.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
include(ExternalProject)
2+
3+
ExternalProject_Add(
4+
libmetal # Name for custom target
5+
SOURCE_DIR $ENV{ZEPHYR_BASE}/ext/lib/ipc/libmetal/
6+
INSTALL_COMMAND "" # This particular build system has no install command
7+
CMAKE_ARGS -DWITH_ZEPHYR=ON -DBOARD=${BOARD} -DWITH_DEFAULT_LOGGER=OFF -DWITH_DOC=OFF
8+
)
9+
10+
ExternalProject_Get_property(libmetal BINARY_DIR)
11+
set(LIBMETAL_INCLUDE_DIR ${BINARY_DIR}/lib/include)
12+
set(LIBMETAL_LIBRARY ${BINARY_DIR}/lib/libmetal.a)

ext/lib/ipc/libmetal/.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*.o
2+
*~
3+
!libs/system/zc702evk/linux/lib/*/*.a
4+
*.bin
5+
*.map
6+
*.out
7+
*.log
8+
*.swp
9+
*.swo
10+
*.d
11+
build*/
12+
13+
/tags
14+
/TAGS
15+
16+
# cscope files
17+
cscope.*
18+
ncscope.*

ext/lib/ipc/libmetal/.travis.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
language: minimal # setting language to C will override cross-compiler and fail
2+
3+
compiler:
4+
- gcc
5+
6+
sudo: required
7+
dist: trusty
8+
9+
env:
10+
global:
11+
- ZEPHYR_GCC_VARIANT=zephyr
12+
- ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk
13+
- ZEPHYR_BASE=$TRAVIS_BUILD_DIR/deps/zephyr
14+
- ZEPHYR_SDK_VERSION=0.9.2
15+
- ZEPHYR_SDK_DOWNLOAD_FOLDER=https://github.com/zephyrproject-rtos/meta-zephyr-sdk/releases/download/$ZEPHYR_SDK_VERSION
16+
- ZEPHYR_SDK_SETUP_BINARY=zephyr-sdk-$ZEPHYR_SDK_VERSION-setup.run
17+
- ZEPHYR_SDK_DOWNLOAD_URL=$ZEPHYR_SDK_DOWNLOAD_FOLDER/$ZEPHYR_SDK_SETUP_BINARY
18+
- FREERTOS_ZIP_URL=https://downloads.sourceforge.net/project/freertos/FreeRTOS/V10.0.1/FreeRTOSv10.0.1.zip
19+
20+
matrix:
21+
fast_finish: true
22+
include:
23+
- os: linux
24+
env: TARGET="zephyr"
25+
- os: linux
26+
env: TARGET="linux"
27+
- os: linux
28+
env: TARGET="generic"
29+
- os: linux
30+
env: TARGET="freertos"
31+
32+
cache:
33+
directories:
34+
- $ZEPHYR_SDK_INSTALL_DIR
35+
- /usr/local/bin
36+
37+
before_install:
38+
- if [[ "$TARGET" == "zephyr" ]]; then
39+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test &&
40+
sudo apt-get update -qq &&
41+
sudo apt-get install libc6-dev-i386 make gperf gcc g++ python3-ply python3-yaml python3-pip device-tree-compiler ncurses-dev uglifyjs -qq &&
42+
sudo pip3 install pyelftools;
43+
fi
44+
- if [[ "$TARGET" == "linux" ]]; then
45+
sudo apt-get update -qq &&
46+
sudo apt-get install libsysfs-dev libhugetlbfs-dev make gcc;
47+
fi
48+
# This is to kick start CI on generic platform. Will need to have a proper way to get the required packages
49+
- if [[ "$TARGET" == "generic" || "$TARGET" == "freertos" ]]; then
50+
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 &&
51+
sudo dpkg -i gcc-arm-embedded_7-2017q4-1~trusty3_amd64.deb;
52+
fi
53+
- if [[ "$TARGET" == "freertos" ]]; then
54+
wget $FREERTOS_ZIP_URL &&
55+
pwd && ls &&
56+
unzip FreeRTOSv10.0.1.zip > /dev/null;
57+
fi
58+
59+
install: >
60+
if [[ "$TARGET" == "zephyr" && "$(cat $ZEPHYR_SDK_INSTALL_DIR/sdk_version)" != "$ZEPHYR_SDK_VERSION" ]]; then
61+
wget $ZEPHYR_SDK_DOWNLOAD_URL &&
62+
chmod +x $ZEPHYR_SDK_SETUP_BINARY &&
63+
rm -rf $ZEPHYR_SDK_INSTALL_DIR &&
64+
./$ZEPHYR_SDK_SETUP_BINARY --quiet -- -y -d $ZEPHYR_SDK_INSTALL_DIR > /dev/null;
65+
fi
66+
67+
before_script: >
68+
if [[ "$TARGET" == "zephyr" ]]; then
69+
cd .. &&
70+
git clone --depth=1 https://github.com/zephyrproject-rtos/zephyr.git &&
71+
cd zephyr &&
72+
source zephyr-env.sh;
73+
fi
74+
75+
script:
76+
- if [[ "$TARGET" == "zephyr" ]]; then
77+
mkdir -p ../libmetal/build-zephyr &&
78+
cd ../libmetal/build-zephyr &&
79+
cmake .. -DWITH_ZEPHYR=on -DBOARD=qemu_cortex_m3 -DWITH_TESTS=on &&
80+
make VERBOSE=1;
81+
fi
82+
- if [[ "$TARGET" == "linux" ]]; then
83+
mkdir -p build-linux &&
84+
cd build-linux &&
85+
cmake .. -DWITH_TESTS_EXEC=on &&
86+
make VERBOSE=1 all test;
87+
fi
88+
- if [[ "$TARGET" == "generic" ]]; then
89+
mkdir -p build-generic &&
90+
cd build-generic &&
91+
cmake .. -DCMAKE_TOOLCHAIN_FILE=template-generic &&
92+
make VERBOSE=1;
93+
fi
94+
- if [[ "$TARGET" == "freertos" ]]; then
95+
mkdir -p build-freertos &&
96+
cd build-freertos &&
97+
export &&
98+
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" &&
99+
make VERBOSE=1;
100+
fi
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
cmake_minimum_required (VERSION 2.6)
2+
3+
list (APPEND CMAKE_MODULE_PATH
4+
"${CMAKE_SOURCE_DIR}/cmake"
5+
"${CMAKE_SOURCE_DIR}/cmake/modules"
6+
"${CMAKE_SOURCE_DIR}/cmake/platforms")
7+
8+
include (syscheck)
9+
project (metal C)
10+
11+
include (CheckIncludeFiles)
12+
include (CheckCSourceCompiles)
13+
include (collect)
14+
include (options)
15+
include (depends)
16+
17+
foreach(_inc_path ${CMAKE_INCLUDE_PATH})
18+
collect (PROJECT_INC_DIRS "${_inc_path}")
19+
endforeach()
20+
21+
enable_testing ()
22+
23+
add_subdirectory (lib)
24+
25+
if (WITH_TESTS)
26+
add_subdirectory (test)
27+
endif (WITH_TESTS)
28+
29+
if (WITH_DOC)
30+
add_subdirectory (doc)
31+
endif (WITH_DOC)
32+
33+
if (WITH_EXAMPLES)
34+
add_subdirectory (examples)
35+
endif (WITH_EXAMPLES)
36+
37+
# vim: expandtab:ts=2:sw=2:smartindent

ext/lib/ipc/libmetal/LICENSE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Software License Agreement (BSD License)
2+
========================================
3+
4+
Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of Xilinx nor the names of its contributors may be used
17+
to endorse or promote products derived from this software without
18+
specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
POSSIBILITY OF SUCH DAMAGE.
31+
32+
33+
Notes
34+
=========================================
35+
Use the following tag instead of the full license text in the individual files:
36+
37+
SPDX-License-Identifier: BSD-3-Clause
38+
39+
This enables machine processing of license information based on the SPDX
40+
License Identifiers that are here available: http://spdx.org/licenses/
41+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# libmetal Maintainers
2+
3+
libmetal project is maintained by the OpenAMP open source community.
4+
Everyone is encouraged to submit issues and changes to improve libmetal.
5+
6+
The intention of this file is to provide a set of names that developers can
7+
consult when they have a question about OpenAMP and to provide a a set of
8+
names to be CC'd when submitting a patch.
9+
10+
## Project Administration
11+
Wendy Liang <[email protected]>
12+
13+
### All patches CC here
14+
15+
16+
## Machines
17+
### Xilinx Platform - Zynq-7000
18+
Wendy Liang <[email protected]>
19+
20+
### Xilinx Platform - Zynq UltraScale+ MPSoC
21+
Wendy Liang <[email protected]>

0 commit comments

Comments
 (0)