This page gives an overview of how to build the software for the WRSv4. Further information on simulation and the directory structure can be found on the WRSv3 Wiki.
Prerequisites
To build the software the following tools is required:
- PC running Ubuntu 22.02 or higher
- git
- Xilinx Vivado 2022.2
- arm-gnu-toolchain-13.2
- riscv-gnu-toolchain
Download sources
git clone https://ohwr.org/project/wr-switch-sw.git --recurse-submodules --branch wrs-v4-dev
Build boot image
Export hardware from Vivado
- Build the gateware: https://ohwr.org/project/wr-switch-hdl/wikis/ForDevelopersWRSv4
- Export hardware in Vivado: File -> Export -> Export Hardware...
- Tick "include bitstream"
- Copy top_wrapper.xsa in wr-switch-sw/boot/hardware
Extract FSBL, PMUFW and bitstream
cd wr-switch-sw/boot/hardware
./hsi_generate.sh
This should:
- Extract bitstream top_wrapper.bit in wr-switch-sw/boot/hardware
- Extract FSBL sources under wr-switch-sw/boot/fsbl
- Extract PMUFW sources under wr-switch-sw/boot/pmufw
Build FSBL
cd wr-switch-sw/boot/fsbl
./build_fsbl.sh
Build PMUFW
cd wr-switch-sw/boot/pmufw
./build_pmufw
Download and build ARM Trusted Firmware
cd wr-switch-sw/boot/arm-trusted-firmware
./build_atf.sh
Download and build u-boot-xilinx
cd wr-switch-sw/boot/u-boot-xlnx
./build_u-boot.sh
Building boot image
To build the boot image, the following files are required:
- FSBL binary: fsbl/executable.elf
- PMUFW binary: pmufw/executable.elf
- Bitstream: hardware/top_wrapper.bit
- ARM Trusted firmware binary: arm-trusted-firmware/build/zynqmp/bl31.elf
- U-Boot Xilinx image: u-boot-xlnx/u-boot.elf
If all these files have been generated, then build the boot image:
cd wr-switch-sw/boot
./build_boot.sh
This should build the BOOT.bin file which is the boot image
Building FEC-OS kernel
Download the sources
git clone https://gitlab.cern.ch/be-cem-edl/fec/operating-system/fec-os-kernel.git --recurse-submodules
Build the kernel
cd fec-os-kernel
make ARCH=arm64 CROSS_COMPILE=/path/to/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf- -j8
Build kernel image (binary device tree + kernel)
cd wr-switch-sw/boot/kernel
./build_image.sh full
Building OpenWRT
Download the sources
git clone https://github.com/openwrt/openwrt.git --recurse-submodules
cd openwrt
Configure build for ARM64 target
make menuconfig
- Target System: Arm SystemReady (EFI) compliant
- Subtarget: 64-bit (armv8) machines
Build OpenWRT
make -j8
Building WRSv4 development software
Build kernel drivers:
cd wr-switch-sw/kernel
./build_all.sh
Build userspace programs:
cd wr-switch-sw/userspace
./build.sh
Build WRSv4 RT subsystem firmware
Download sources
git clone https://ohwr.org/project/wrpc-sw.git --recurse-submodules
cd wrpc-sw
git checkout wrs-v4-dev
Build RT CPU firmware
./build_rt_cpu.sh
Deployment of the binaries
TODO