Yocto Project BSP meta-layer for Intel (ALTERA) SoC-FPGAs (SoCFPGA) - with step by step guide
With this layer the board support package (BSP) for ARM based Intel (ALTERA) SoC-FPGAs (SoCFPGA) is added to the Yocto Project.
It can bring with the rstools useful tools to interact with the FPGA fabric (e.g. Changing the FPGA configuration or accessing all ARM AXI Bride interfaces).
In addition, is the ARM Development Studio (DS-5) Streamline Server gator included.
Usually the Yocto Project can generate all required components (rootfs, device tree, bootloaders,…) to boot up a final embedded Linux. But this is not compatible with Intel’s Boot flow.
This Bootflow uses the Intel Embedded Design Suite (EDS) to build the device tree and all necessary bootloaders.
For that reason, I designed a version that is compatible with Intel’s development tools.
This includes the board specific u-boot- and device tree-generation and the support for only the .tar.gz-file type for the rootfs.
I used this layer to build rsyocto, an open source embedded Linux Distribution for Intel SoC-FPGAs, by myself.
The flexibility of my own rsyocto build system allows you to use it for your own projects with your custom embedded Linux.
For instance with a single Linux shell command (FPGA-writeConfig
) of the rstools it is possible to change FPGA configuration of a Intel Cyclone V SoC-FPGA:
More rstools examples are available here inside my rsyocto guide.
Note: Right now only are the rstools for the Intel Cyclone V- and Intel Arria 10 SX- SoC-FPGA available.
Device Family | Architecture | Machine Name |
---|---|---|
Intel (ALTERA) Cylone V SoC-FPGA | ARMv7A | MACHINE =”cyclone5” |
Intel (ALTERA) Arria 10 SoC-FPGA | ARMv7A | MACHINE =”arria10” |
Linux Version Name | Version Type | Supported Linux Kernel Versions |
---|---|---|
“linux-altera” | Regular Linux Version | 5.8 , 6.0 , 6.1 , 6.2 , 6.5 , 6.6 , 6.7 |
“linux-altera-lts” | Long term stable Linux Version (LTS) | 5.4.54 ,5.10.60 ,5.10.100 , 5.15.70 , 5.15.80 , 5.15.90 , 5.15.100 , 6.1.20 , 6.1.38 , 6.1.55 , 6.1.68 |
The Linux Kernel source code is available on the official Intel (ALTERA) repository.
Linux Command Name | Description | CV | A10 | Bitbake value |
---|---|---|---|---|
FPGA-status |
Reading the Status of the FPGA fabric | ![]() |
![]() |
statusfpga |
FPGA-readMSEL |
Reading the Configuration mode of the FPGA (selected with the MSEL-Bit Switch) | ![]() |
![]() |
mselfpga |
FPGA-dumpbridge |
Reading a address span from an address of an AXI Bridge interface or SDRAM | ![]() |
![]() |
dumpbridge |
FPGA-resetFabric |
Resetting the FPGA fabric (remove the FPGA running configuration) | ![]() |
![]() |
resetfabricfpga |
FPGA-writeConfig |
Writing a new FPGA configuration with a configuration file | ![]() |
![]() |
writeconfigfpga |
FPGA-readBridge |
Reading from an address of an AXI Bridge interface (Lightweight HPS2FPGA or HPS2FPGA) or form the MPU Address space | ![]() |
![]() |
readbridgesfpga |
FPGA-writeBridge |
Writing to an address of an AXI Bridge interface (Lightweight HPS2FPGA or HPS2FPGA) or form the MPU Address space | ![]() |
![]() |
writebridgefpga |
FPGA-gpiRead |
Reading the 32 Bit direct access general purpose input Register (GPI) (written by the FPGA) | ![]() |
![]() |
readfgpipga |
FPGA-gpoWrite |
Writing the 32 Bit direct access general purpose output Register (GPO) | ![]() |
![]() |
writegpofpga |
The source code of the rstools is available here: For the Intel Cyclone V SoC-FPGA and For the Intel Arria 10 SoC-FPGA
Component Name | Description | Bitbake value |
---|---|---|
gator |
ARM Development Studio (DS-5) Streamline server | gator |
initscript |
Enables to execute various init scripts during Linux booting at different booting levels | initscript |
A Linux Kernel Configuration with an appropriate configuration to enable all ARM Core-Sight Debugging features for ARM Streamline will be automatically loaded.
Gator Version | Compatible ARM Streamline Version | Expression |
---|---|---|
8.6.0 |
Streamline 8.6.0 |
PREFERRED_VERSION:gator = “8.6.0” |
8.0.0 |
Streamline 8.0.0 |
PREFERRED_VERSION:gator = “8.0.0” |
7.8.0 |
Streamline 7.8.0 |
PREFERRED_VERSION:gator = “7.8.0” |
OS
Yocto Project Releases
Note: Select the dedicated branch for the Yocto Project Release you want to use in this repository.
The following step by step guide shows how to use this layer to build a Yocto-based Linux System for an Intel SoC-FPGA:
Step: Install the latest Version of the OpenEmbedded Yocto Project
sudo apt-get -y install gawk wget libgmp3-dev libmpc-dev \
git diffstat unzip texinfo gcc-multilib build-essential \
chrpath socat xterm libsdl2-image-2.0-0 u-boot-tools \
python3 python3-pip python3-pexpect \
python3-git python3-jinja2 libncurses-dev zstd lz4
sudo locale-gen en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Optional: Ubuntu Linux for usage of the Arm Development Studio (DS-5)
sudo apt-get install libncurses5
sudo apt-get install zlib1g:i386
wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu60_60.2-3ubuntu3_amd64.deb
sudo apt install ./libicu60_60.2-3ubuntu3_amd64.deb
wget http://de.archive.ubuntu.com/ubuntu/pool/universe/w/webkitgtk/libjavascriptcoregtk-1.0-0_2.4.11-3ubuntu3_amd64.deb
sudo apt install ./libjavascriptcoregtk-1.0-0_2.4.11-3ubuntu3_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/w/webkitgtk/libwebkitgtk-1.0-0_2.4.11-3ubuntu3_amd64.deb
sudo apt install ./libwebkitgtk-1.0-0_2.4.11-3ubuntu3_amd64.deb
sudo apt-get install -y libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi libncurses5-dev build-essential bison flex libssl-dev bc
sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
git --version
Check your gcc version (it should be >13.2.0)
gcc --version
Install the Yocto Project itself in Release 5.0 “scarthgap”
cd && git clone -b scarthgap git://git.yoctoproject.org/poky.git
cd ~/poky && wget https://downloads.yoctoproject.org/releases/yocto/yocto-5.0/buildtools/x86_64-buildtools-nativesdk-standalone-5.0.sh && sh x86_64-buildtools-nativesdk-standalone-5.0.sh
source /opt/poky/5.0/environment-setup-x86_64-pokysdk-linux
Step: Download this BSP-layer
cd poky/ && git clone https://github.com/robseb/meta-intelfpga.git
Step: Run the bitbake initialization script
source oe-init-build-env
/build
“Step: Add this BSP-layer to your Yocto Project solution
code conf/bblayers.conf
/home/vm/poky/meta-intelfpga \
Now should the “bblayers.conf”-file look like this:
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/home/vm/poky/meta \
/home/vm/poky/meta-poky \
/home/vm/poky/meta-yocto-bsp\
/home/vm/poky/meta-intelfpga \
"
Step: Configure the machine type and Linux Version
code conf/local.conf
MACHINE ="cyclone5"
# MACHINE ??= "qemux86-64"
PREFERRED_PROVIDER_virtual/kernel = "linux-altera"
PREFERRED_PROVIDER_virtual/kernel = "linux-altera-lts"
Select the Linux Kernel Version
With following code line it is possible to select the preferred Linux Kernel Version (here with Version 6.1
)
PREFERRED_VERSION_linux-altera = "6.1%"
Alternatively, to select the Long term stable Linux Version (LTS) 6.1.68
PREFERRED_VERSION_linux-altera = "6.1.68%"
DEFAULTTUNE = "cortexa9hf-neon"
Step: Check if your settings are vialed and executable
bitbake-layers show-layers
bitbake --show-versions | grep linux
Step: Optional: Change the Linux Kernel configuration
bitbake -c savedefconfig virtual/kernel
Read and change the Linux Kernel with menueconfig
bitbake -c menuconfig -f virtual/kernel
A window like this should appear:
Here it is possible to change any kernel settings, ARM-Platform specific settings or enable or disable some peripherel components
bitbake -f -c compile virtual/kernel && bitbake -f -c deploy virtual/kernel
gator
Server insert the following line to local.conf (poky/build/conf/local.conf)
IMAGE_INSTALL:append = " gator "
IMAGE_INSTALL:append = " mselfpga readbridgesfpga resetfabricfpga statusfpga writebridgefpga writeconfigfpga writegpofpga readfgpipga "
BusyBox
is a Linux Software that can bring the typical Linux Console envivonment as simple In-/Output interface to enable a basic user interactionBusyBox
with a basic set of classical commands, such as ls
, cd
BusyBox
bitbake -c menuconfig busybox
busybox
, the configuration file is written to a location as follows: ~/poky/build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/busybox/1.31.1-r0/busybox-1.31.1/
Step: Build the entire Yocto Project
bitbake core-image-minimal
For an Intel Arria 10 SoC-FPGA the following start print should appear:
This signaled that bitbake was able to decode the previously shown configuration
poky/build/tmp/delopy/images/cyclone5/
poky/build/tmp/delopy/images/arria10/
At this point a Linux for an Intel SoC-FPGA is generated. Unfortunately to boot this up also a Linux Device Tree, a primary- and secondary bootloader and for Intel Arria and Intel Stratix SoC-FPGAs two FPGA configuration files must be required.
Inside my “Mapping HPS Peripherels, like I²C or CAN, over the FPGA fabric to FPGA I/O and using embedded Linux to control them”-guide I show that in details
(see here).
I also wrote a python script to pre-install Python pip (PyPI)- Packages within a final Yocto Project Linux Image automatically
(see here).
Build System: Use your Intel Quartus Prime FPGA project to create your own rsyocto with your FPGA Configuration
I designed a Python script that can automate the boot image desgin with a specifiable partition table.
It can generate a bootable image file with Kernel-,bootloader- and user-files. With the flexibility of this script it is compatible with Intel SoC-EDS build flow for example it can pre-install FPGA configuration files.
Tools like “rufus” can write for instance a SD-card to enable the booting of a Linux Distribution.
(see here LinuxBootImageGenerator).
The rsyocto build system can use the information provided by the Intel Quartus Prime FPGA project to compile and configure the bootloader (u-boot) to boot up an embedded Linux and to configure the FPGA Fabric with the Intel Quartus Prime FPGA project. The build system changes the rootfs of the embedded Linux und uses XML-files for configuration to automate every essential step to achieve a good experience of a modern Linux Distribution.
It can directly use output files of the Yocto Project to generate a custom bootable Linux Distribution for Intel Cylone V- and Intel Arria 10 SX SoC-FPGAs.
Please follow my detailed guide.
For commercial users, please visit the rsyocto embedded service provider website:
rsyocto.com