NXP provides the following software for i.MX8MP chips: - Real-time-edge-linux - GenAVB_TSN

Note, that for the Debix Model A board, certain modifications have to made to the device tree, e.g., for the onboard DAC or the Wifi module.

Note also, that when using the default Ubuntu image from debix, one might be confronted with the fact that the linked ld bails out with an error. This is because the libctf shared library is installed twice: in an old version (probably as cruft from an outdated debian package) under /usr/lib and -- installed from the libctf0 package -- in /usr/lib/aarch64-linux-gnu. Check the availability of the newer files and delete the old ones with sudo rm /usr/lib/libctf*.

NXP i.MX8MP kernel setup

Clone the real-time-edge-linux git repository:

git clone -b linux_6.1.22 https://github.com/nxp-real-time-edge-sw/real-time-edge-linux.git
cd real-time-edge-linux

Configure and build for i.MX8MP with AVB support. In case of cross-compilation, environment variables export ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- have to be set.

make imx_v8_defconfig
make imx_avb.config
make -j $(nproc)

Make debian binary distribution: make bindeb-pkg This results in four deb packages with specific version numbers:

linux-headers-6.1.22-rt8_6.1.22-rt8-4_arm64.deb
linux-image-6.1.22-rt8-dbg_6.1.22-rt8-4_arm64.deb
linux-image-6.1.22-rt8_6.1.22-rt8-4_arm64.deb
linux-libc-dev_6.1.22-rt8-4_arm64.deb              

Installing the image and headers packages on the target machine will populate /boot and /lib/modules folders. The vmlinuz-style gzipped kernel needs to be unzipped and renamed: zcat /boot/vmlinuz-6.1.22-rt8 > /boot/Image. The original Image will be overwritten – should probably have been saved before.

Additionally, the correct DTB file needs to be installed. The uboot boot loader will by default load imx8mp-evk.dtb, so we also need to rename our DTB accordingly: cp /usr/lib/linux-image-6.1.22-rt8/freescale/imx8mp-evk-avb.dtb /boot/imx8mp-evk.dtb.

Set up NXP GenAVB_TSN

Install some prerequisites:

sudo apt install build-essential cmake

Clone the GenAVB_TSN repository:

git clone -b 5_7 https://github.com/NXP/GenAVB_TSN.git
cd GenAVB_TSN

Build the AVB/TSN endpoint configuration:

cmake . -Bbuild -DTARGET=linux_imx8 -DCONFIG=endpoint_avb_tsn -DCMAKE_TOOLCHAIN_FILE=config_armgcc.cmake -DKERNELDIR=/lib/modules/$(uname -r)/build/
cd build
make -j $(nproc)

Install build

Install built binaries:

sudo cp build/apps/target/etc/genavb /etc/
sudo cp linux/configs/* /etc/genavb/
sudo install build/bin/* -D -t /usr/local/bin/
sudo install build/apps/target/usr/bin/* -D -t /usr/local/bin/
sudo install linux/scripts/*.sh -D -t /usr/local/bin/
sudo install linux/firmware/*.bin -D -t /lib/firmware/genavb/
sudo cp build/modules/*.ko /lib/modules/$(uname -r)/kernel/extra/
sudo depmod -a

Load modules:

sudo modprobe genavbtsn_net_avb
sudo modprobe genavbtsn_ipc

Edit config files: - /etc/genavb/system.cfg.avb: set to endpoint = eth1, endpoint_gptp_0 = /dev/ptp1 and endpoint_local = /dev/ptp1 - /etc/genavb/config: set GENAVB_TSN_CONFIG=2 for Endpoint AVB mode - /etc/genavb/config_avb: set PROFILE=22 for Milan live talker/listener - /etc/genavb/config_tsn: set PROFILE=2 for IO endpoint device

Start AVB/TSN:

sudo avb.sh start