Skip to content

Commit

Permalink
GenAVB/TSN SDK release 5.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GhMarwen committed Mar 8, 2023
1 parent 7165af2 commit b0314e5
Show file tree
Hide file tree
Showing 847 changed files with 184,931 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#
# NOTE! Don't add files that are generated in specific
# subdirectories here. Add them in the ".gitignore" file
# in that subdirectory instead.
#
# NOTE! Please use 'git ls-files -i --exclude-standard'
# command after changing this file, to see if there are
# any tracked files which get ignored after the change.
#
# Normal rules
#
.*
*.o
*.o.*
*.a
*.s
*.ko
*.so
*.so.dbg
*.mod.c
*.i
*.lst
*.elf
*.bin
*.gz
*.bz2
*.lzma
*.xz
*.lzo
*.patch
*.gcno
*.orig
*.rej
*~

!.gitignore

# Default build directory
/build

# Generated include files
/common/version.h

# local config files
local_config*.mk

# CMake
local_config*.cmake
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps

# cscope files
cscope.*
0 README → CMakeLists.freertos
100755 → 100644
File renamed without changes.
51 changes: 51 additions & 0 deletions CMakeLists.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
option(BUILD_KERNEL_MODULE "Build kernel module" ON)
option(BUILD_APPS "Build example applications" ON)

set(modules_obj_dir ${CMAKE_BINARY_DIR}/modules)

set(modules_extra_flags
MAKEFLAGS=
KERNELDIR=${KERNELDIR}
GENAVB_INCLUDE=${TOPDIR}/include
MODULES_OBJ_DIR=${modules_obj_dir}
GENAVB_ROOT_DIR=${TOPDIR}
target=${TARGET}
config=${CONFIG}
PREFIX="\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}"
)

add_custom_target(modules-dir
COMMAND $(MAKE) -C ${CMAKE_SOURCE_DIR}/linux/modules modules_sources
${modules_extra_flags}
COMMENT "Generate modules src files"
)

if(${CMAKE_VERSION} VERSION_LESS "3.15.0")
set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${modules_obj_dir})
else()
set_property(TARGET modules-dir APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${modules_obj_dir})
endif()

if(BUILD_KERNEL_MODULE)

add_custom_target(modules ALL
COMMAND $(MAKE) -C ${CMAKE_SOURCE_DIR}/linux/modules modules
${modules_extra_flags}
DEPENDS modules-dir
COMMENT "Building modules"
)

add_custom_target(modules-install
COMMAND $(MAKE) -C ${CMAKE_SOURCE_DIR}/linux/modules modules_install
${modules_extra_flags}
DEPENDS modules-dir
COMMENT "Installing modules"
)

install(CODE "execute_process(COMMAND make -C ${CMAKE_SOURCE_DIR}/linux/modules modules_install ${modules_extra_flags})")

endif()

if(BUILD_APPS)
add_subdirectory(${CMAKE_SOURCE_DIR}/apps/linux)
endif()
56 changes: 56 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
cmake_minimum_required(VERSION 3.10)

project(GENAVB/TSN)

set(TOPDIR ${CMAKE_CURRENT_SOURCE_DIR})

set(VERSION_FILE common/version.h)

add_custom_target(stack)

if(NOT DEFINED TARGET)
message(FATAL_ERROR "Target not defined")
endif()
message(STATUS "TARGET: ${TARGET}")

set(target_file "${CMAKE_CURRENT_SOURCE_DIR}/config_${TARGET}.cmake")
if(NOT EXISTS ${target_file})
message(FATAL_ERROR "cannot find ${target_file}")
endif()

set(CMAKE_INSTALL_MESSAGE LAZY)
# If not explicetly defined, set install prefix to build directory
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/target"
CACHE PATH "default install path" FORCE)
endif()

include(configs/configs.cmake)
include(${target_file})
include(extensions.cmake)

list(APPEND maindirs
${TARGET_OS}
management
gptp
srp
maap
avtp
avdecc
api
public
common
)

foreach(dir ${maindirs})
include(${dir}/${dir}.cmake)
endforeach()

include(CMakeLists.${TARGET_OS})
include(doc/CMakeLists.txt)

genavb_generate_version()

genavb_generate_archives()

genavb_install()
150 changes: 150 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
GenAVB/TSN
----------
GenAVB/TSN is a generic AVB/TSN stack developed by NXP for NXP MCUs and MPUs.
It is cross-platform, currently supporting Linux and FreeRTOS.


Supported hardware targets and configurations
---------------------------------------------
This project supports several hardware targets and several different
configuration modes. The table below summarizes the supported combinations,
and their status for this specific release:
- **O**: supported by the project and validated for this release
- x: supported by the project, but not validated for this release
- empty cell: unsupported combination

| Compilation target | Hardware target | AVB endpoint | TSN endpoint | AVB/TSN bridge |
| :--------------------- | :--------------------------------------------- | :----------: | :----------: | :------------: |
| `linux i.MX6` | `i.MX 6Q`, `i.MX 6QP`, `i.MX 6D`, `i.MX 6SX` | x | | |
| `linux i.MX6ULL` | `i.MX 6ULL` | **O** | | |
| `linux i.MX8` | `i.MX 8MP`, `i.MX 8DXL`, `i.MX 93` | **O** | **O** | |
| `linux i.MX8` | `i.MX 8MM` | **O** | | |
| `linux LS1028` | `LS1028A` | | | **O** |
| `freertos RT1052` | `i.MX RT1052` | x | x | |
| `freertos RT1176` | `i.MX RT1176` | x | x | |
| `freertos RT1189 M33` | `i.MX RT1189` | | | x |
| `freertos i.MX8MM A53` | `i.MX 8MM` | **O** | **O** | |
| `freertos i.MX8MN A53` | `i.MX 8MN` | **O** | **O** | |
| `freertos i.MX8MP A53` | `i.MX 8MP` | **O** | **O** | |

Features
--------
- IEEE-802.1AS-2020 implementation, both time-aware Bridge and Endpoint support.
- IEEE-802.1Q-2018 (Clause 35) implementation, both Bridge and Endpoint Support
- IEEE-1722-2016 implementation, with MAAP support.
- IEEE-1722.1-2013 implementation, with support for Milan 1.1a mode.
- Binary protocol stacks running in standalone userspace processes.
- Public API provided by binary library plus header files.
- Example applications.


Repository structure
--------------------
- api: the public API
- apps: source code and makefiles for example applications
- avdecc: IEEE 1722.1-2013/Milan 1.1a component stack
- avtp: IEEE 1722-2016 component stack
- common: common code
- configs: configuration files
- doc: documentation
- gptp: IEEE 802.1AS-2020 component stack
- freertos: FreeRTOS specific code
- linux: Linux specific code
- maap: MAAP component code
- public: common code shared between applications and stack
- srp: IEEE 802.1Qat-2010 component stack


Build
-----
GenAVB/TSN is using Cmake to generate build system.

Some preliminary configuration is required to provide path to the toolchain,
staging directory and external components.

Local configuration files can be included by the build system in order to
to define some variables specific to the developer environment.
The local config file name is `./local_config_${target}.cmake`


Build requirements
------------------
- Linux host system and development tools (git, make, doxygen for the docs, ...)
- An ARM gcc toolchain is sufficient for the stack. However building the linux
applications requires a more complete cross-compilation SDK (because of
additional dependencies such as alsa, gstreamer and qt5/qt6).
- AVB endpoint builds depend on custom changes to the Linux kernel and specific Yocto distribution: https://www.nxp.com/design/software/development-software/real-time-edge-software:REALTIME-EDGE-SOFTWARE
- FreeRTOS builds require additional MCUXpresso SDK software: https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/wired-communications-middleware-for-nxp-microcontrollers:WIRED-COMM-MIDDLEWARE?fpsp=1&#avb-tsn

### FreeRTOS
Currently GenAVB/TSN stack support only ARM gcc toolchain for FreeRTOS targets.
To be able to build the stack, ARMGCC_DIR environement variable pointing
to arm-gcc toolchain must be defined.
```
export ARMGCC_DIR=/path/to/gcc-arm-none-eabi-xxx
```

The local config file should define:
```
set(FREERTOS_SDK "/path/to/freertos_MCUXpresso_SDK" CACHE PATH "Path to MCUXpresso SDK")
set(FREERTOS_APPS "/path/to/freertos_application" CACHE PATH "Path to FreeRTOS application repository")
```

### Linux
The Linux target is usually built using a complete toolchain, which helps
setting most of the environment variables required for cross-compilation.
In the case of a Yocto SDK/toolchain for example, the following command will
setup $CROSS_COMPILE as well as other related environment variables:

```
source /path/to/yocto/toolchain/environement-setup-xxx
```

The local config should however define:
```
set(KERNELDIR "/path/to/linux_avb" CACHE PATH "Path to Linux kernel")
```


Build commands
--------------
Syntax is:
```
cmake . -B<build directory> -DTARGET=<target name> -DCONFIG=<config name>
make -C <build directory> install
```

The GenAVB/TSN stack also provides a couple shell functions with auto-completion
to facilitate the build process.
Usage is
```
# Setup environment, see Build paragraph above
source environment-genavb
make_genavb [target] [config_list]
clean_genavb [target]
```
where target and config_list are optional. If no config_list is defined, all available
configurations for specified target are built. If no target is specified the default
is linux_imx6.
config_list is of the form: configA configB ..., with one or more members.

To generate doxygen HTML documentation:
```
cmake . -B<build directory> -DTARGET=<target name> -DCONFIG=<config name>
make -C <build directory> doc_doxygen
```

The generated documentation is available under `<build_directory>/doc`
To install documentation under a custom path: use cmake variable `-DDOC_OUTPUT_DIR=<custom absolute path>`

### Generated binaries
The generated binaries are installed under `<build directory>/`

### Installing binaries to target

#### Linux
Copy the content of `<build directory>/target/` to the root directory of the target filesystem

#### FreeRTOS
Refer to the FreeRTOS application README.

61 changes: 61 additions & 0 deletions SCR_genavb-release.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
NXP Software Content Register

Release Name: genavb-sdk
Version: GenAVB/TSN 5_4_0
Date Created: March-2023
Release Location: https://github.com/NXP/GenAVB_TSN
Description: GenAVB/TSN protocol stack for NXP MPUs and MCUs processors

----------------------------------------

Package: api
avdecc
avtp
common
configs
freertos
gptp
linux
maap
management
os
srp
Outgoing License: BSD-3-Clause
License File: licenses/BSD-3-Clause
Package Category: GenAVB/TSN Stack
Type of content: Source code
Description and comments: GenAVB/TSN library
Origin: NXP (BSD-3-Clause)

Package: include
Outgoing License: BSD-3-Clause
License File: licenses/BSD-3-Clause
Package Category: GenAVB/TSN Stack
Description and comments: GenAVB/TSN header files
Type of content: Source code
Origin: NXP (BSD-3-Clause)

Package: linux/modules
Outgoing License: GPL-2.0-or-later
License File: licenses/COPYING
Package Category: GenAVB/TSN Stack
Description and comments: Linux modules driver for GenAVB/TSN stack
Type of content: Source code
Origin: NXP (GPL-2.0-or-later)

Package: apps
public
Outgoing License: BSD-3-Clause
License File: licenses/BSD-3-Clause
Package Category: GenAVB/TSN Stack examples
Description and comments: GenAVB/TSN example applications
Type of content: Source code
Origin: NXP (BSD-3-Clause)

Package: apps/linux/genavb-gui-controller/src/resources/developpers_Play.png
apps/linux/genavb-gui-controller/src/resources/developpers_Stop.png
Outgoing License: Free For Commercial Use
Package Category: UI
Description and comments: Icons used for media application controls
Type of content: PNG files
Origin: www.iconfinder.com (Free For Commercial Use)
Loading

0 comments on commit b0314e5

Please sign in to comment.