1 . Introduction
This article introduces the use of Arm® Trusted Firmware (hereafter ATF) to circumvent the GPL license and the ATF environment construction flow.
As a prerequisite, there are two HPS boot flows for Agilex™ 5, one using U-Boot and the other using ATF.
Figures 1 and 2 show the U-Boot and ATF boot flows for Linux, respectively.
Boot flow using U-Boot
Figure 1]Example of boot flow using U-Boot Reference: Hard Processor System Booting User Guide: Agilex™ 5 SoCs
Boot Flow with ATF
Figure 2. Figure 2] Example of boot flow using ATF Figure 2] Example of boot flow using ATF Reference: Hard Processor System Booting User Guide: Agilex™ 5 SoCs
Since U-Boot is under the GPL license, there is an obligation to disclose the source code if necessary. On the other hand, ATF is BSD licensed, so the GPL license can be circumvented.
We hope you will refer to this article when you consider avoiding the GPL license. 2.
2. license of ATF
The source of ATF can be obtained from Github below. Reference:altera opensource - Arm Trusted Firmware
Note: The github where you can obtain the ATF mentioned above is currently at the latest revision. Therefore, please refer to the most current version when you check the github.
The following link describes the license of ATF, which is a BSD license. Reference:altera opensource - Arm Trusted Firmware - license.rst
Note: The following is an excerpt from the license.rst file.
| The software is provided under a BSD-3-Clause license (below). Contributions to this project are accepted under the same license with developer sign-off as described in the :ref:`Contributor's Guide` . . |
Note: The terms and handling of OSS licenses such as BSD-3-Clause and GPL are at your own discretion.
3 . Introduction to ATF Environment Creation Flow
The following document from the manufacturer introduces a flow for creating a bare-metal environment (Hello World) using ATF.
Reference: Altera FPGA Developer Site - Baremetal Hello World Example
The following is an excerpt from the reference document where the ATF is built, with comments.
# Get the ATF source:
git clone -b QPDS24.3_REL_GSRD_PR https://github.com/altera-opensource/arm-trusted-firmware atf
# Create fiptool.
make -C atf fiptool
# Build ATF.
make -C atf bl2 bl31 PLAT=agilex5 DEBUG=1 SOCFPGA_BOOT_SOURCE_QSPI=1 LOG_LEVEL=50The following file will be generated by executing this command.
. /arm-trusted-firmware-qspi/build/agilex5/release/bl2 .bin
. /arm-trusted-firmware-qspi/build/agilex5/release/bl31 .bin
. /fiptool
These files are generated and used in the areas indicated by the red boxes in the Build Flow below.
Figure 3] Build Flow of Hello World Bare Metal Sample Reference: Altera FPGA Developer Site - Baremetal Hello World Example
Note: Supplementation of bl2.bin file and bl31.bin file
bl2.bin file: First Stage Bootloader (FSBL) is stored in sof/jic file.
bl31.bin file: Second Stage Bootloader (SSBL) is stored in flash memory (QSPI in this reference). bl31.bin file: Stored in flash memory (QSPI in this reference) as Second Stage Bootloader (SSBL).
⇒Boot ATF by writing bl2.bin file and bl31.bin file.
If you want to confirm the boot process, please refer to the reference material for the procedure. You can use fiptool, a utility included in the ATF source tree, to generate a Flash image for booting.
Note: Supplemental information on fiptool
fiptool is a Python utility for manipulating Firmware Image Package (FIP) files. In the reference material, fiptool is used to package the bare-metal app binary (hello_world.bin file) and the bl31.bin file into one file.
4 . Notes.
Although you can avoid the GPL license by using ATF, you will not be able to use the console that you could use with U-Boot.
The U-Boot console is very useful for debugging, so please be aware that you will not be able to use the console.
5 . Conclusion
We have explained how to avoid the GPL license by using ATF and the ATF build flow.
Although there is a caveat that the console cannot be used by using ATF, we hope that you will consider using ATF if you wish to avoid the GPL license.