This document describes how to build the SCP and MCP firmware and run it with a tested set of other software components using defined configurations on supported Arm platforms. While it is possible to use other software components, configurations and platforms, how to do so is outside the scope of this document.
Running SCP-firmware on Fixed Virtual Platform (FVP) models requires at least 12GB of available memory. A multicore CPU is highly recommended to maintain smooth operation.
This software has been tested on Ubuntu 16.04 LTS (64-bit).
To build the SCP/MCP firmware for a target product, the following tools are required:
Additionally, the firmware may be built using one of two compilers:
- GNU Arm Embedded Toolchain (6-2017-q2-update or later)
- Arm Compiler 6 (6.10 or later)
The following tools are recommended but not required:
- Doxygen (1.8.0 or later): Required to generate supporting documentation
- GNU GCC (6.0 or later): Required to build framework tests that run on the host system
If building for an Arm FVP platform, you will need to ensure you have the relevant FVP.
The FVPs also have a soft dependency on the following tools:
- xterm: Required to view UART output
The instructions provided as a part of this guide assume you have Git (2.13 or later) available in your environment.
Installing these prerequisites can be done on any standard Debian-based system with the following:
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt update
sudo apt install build-essential doxygen gcc-arm-embedded git python3
For the FVP prerequisites:
sudo apt install xterm
The SCP-firmware source code can be cloned from the official GitHub repository:
git clone --recurse-submodules https://github.com/ARM-software/SCP-firmware.git ${SCP_PATH}
Under certain configurations the SCP-firmware has a dependency on the CMSIS-Core and CMSIS-RTOS2 projects, which are part of the Cortex Microcontroller System Interface Standard (CMSIS) software pack. The source tree for this software is included with the firmware as a Git submodule. You can fetch all submodules from within the source directory with the following:
git submodule update --init
If Doxygen is available on the host system then comprehensive documentation can
be generated. The complete set of documentation is compiled into bundles in
HTML, LaTeX, and XML formats and placed in the build/doc
directory. This
documentation includes:
- A README section
- The BSD-3-Clause license under which this software and supporting files are distributed
- The SCP-firmware user guide (the content of this file)
- An overview of the framework on which SCP-firmware is written, including information on how components of the software must interact with the framework and with each other
- An overview of the build system and the project directory structure
- The project's coding style
- Source documentation for the SCP-firmware framework
- Source documentation for modules that are included in the currently supported products
From within the SCP-firmware root directory Doxygen can be invoked using the top-level Makefile:
make doc
To build SCP-firmware for a specific product the basic command format for
invoking make
(from within the source directory) is:
make CC=<COMPILER> PRODUCT=<PRODUCT> [OPTIONS] [TARGET]
For example, to build the RAM firmware for SGM-775 in debug mode, use the following:
make CC=arm-none-eabi-gcc PRODUCT=sgm775 MODE=debug firmware-scp_ramfw
The all
target will be used if [TARGET]
is omitted, which will build all the
firmware defined by the product.
The help
target provides further information on the arguments that can be
given:
make help
The framework includes a suite of tests that validate its core functionality. If you installed the native GCC prerequisite, these can be run on the host system using:
make test
For all products other than host
, the code needs to be compiled by a
cross-compiler. The toolchain is derived from the CC
variable, which should
point to the cross-compiler executable. It can be set as an environment variable
before invoking make
, or provided as part of the build command:
make CC=<path to the cross compiler> ...
For more guidance and information on the build system, refer to the full set of documentation included in the Build System chapter of the Doxygen-generated documentation.
For an introduction to the System Guidance for Mobile (SGM) platforms, please refer to the Arm Developer documentation.
The instructions within this section use SGM-775 as an example platform, but they are relevant for all SGM platforms.
The build system generates firmware images per the product.mk
file associated
with the product. For SGM platforms, two firmware images are built:
scp_romfw.bin
: SCP ROM firmware image - handles the transfer of the RAM firmware to private SRAM and jumps to itscp_ramfw.bin
: SCP RAM firmware image - manages the system runtime services
cd ${SCP_PATH} && \
make CC=arm-none-eabi-gcc PRODUCT=sgm775 MODE=debug
export SCP_ROM_PATH=${SCP_PATH}/build/product/sgm775/scp_romfw/debug/bin/scp_romfw.bin
export SCP_RAM_PATH=${SCP_PATH}/build/product/sgm775/scp_ramfw/debug/bin/scp_ramfw.bin
In order for the scp_ramfw.bin
firmware image to be loaded, an application
processor secure world firmware needs to be available to load it. Arm maintains
the Arm Trusted Firmware-A (TF-A)
project, which handles this case. The remaining instructions assume you are
using Trusted Firmware-A.
On SGM platforms, the SCP images are given alternative names when used in the context of TF-A:
scp_romfw.bin
has the alternative namescp_bl1
scp_ramfw.bin
has the alternative namescp_bl2
To boot the SCP firmware on SGM platforms with TF-A, you will need at minimum three additional images:
bl1
: BL1 - first-stage bootloader stored in the system ROMbl2
: BL2 - second-stage bootloader loaded bybl1
, responsible for handing overscp_bl2
to the SCPfip
: FIP - firmware image package containingbl2
andscp_bl2
The FIP format acts as a container for a number of commonly-used images in the TF-A boot flow. Documentation for the FIP format can be found in the TF-A firmware design documentation.
An example command line to build Arm Trusted Firmware-A for AArch64 is given below. Note that you will need to have installed the prerequisites for building Arm Trusted Firmware-A for SGM-775.
git clone -b v2.1 https://github.com/ARM-software/arm-trusted-firmware.git ${TFA_PATH}
export BL1_PATH=${TFA_PATH}/build/sgm775/debug/bl1.bin
export BL2_PATH=${TFA_PATH}/build/sgm775/debug/bl2.bin
export FIP_PATH=/tmp/fip.bin
cd ${TFA_PATH} && \
make CROSS_COMPILE=aarch64-linux-gnu- DEBUG=1 LOG_LEVEL=30 PLAT=sgm775 CSS_USE_SCMI_SDS_DRIVER=1 \
bl1 bl2 fiptool && \
./tools/fiptool/fiptool create \
--tb-fw ${BL2_PATH} \
--scp-fw ${SCP_RAM_PATH} \
${FIP_PATH}
Note that CSS_USE_SCMI_SDS_DRIVER
is a work-around for the fact that the v2.1
utilises SCPI instead of SCMI by default, which is not a supported
configuration for SCP-firmware.
To simulate the basic SCP boot flow on the SGM-775 FVP, use the following command line:
FVP_CSS_SGM-775 \
-C css.trustedBootROMloader.fname=${BL1_PATH} \
-C css.scp.ROMloader.fname=${SCP_ROM_PATH} \
-C board.flashloader0.fname=${FIP_PATH}
Note that it's expected that TF-A will crash, as we have not provided the full bootloader image chain.
For an introduction to the System Guidance for Infrastructure (SGI) platforms, please refer to System Guidance for Infrastructure (SGI).
For an introduction to the Neoverse Reference Design (RD) platforms, please refer to Neoverse Reference Designs.
The instructions within this section use SGI-575 as an example platform, but they are relevant for all SGI and Neoverse Reference Design platforms.
The build system generates firmware images per the product.mk
file associated
with the product. For SGI and Neoverse Reference Design platforms, three
firmware images are built:
scp_romfw.bin
: SCP ROM firmware image - loads the SCP RAM firmware from NOR flash into private SRAM and jumps to itscp_ramfw.bin
: SCP RAM firmware image - manages the system runtime servicesmcp_romfw.bin
: MCP ROM firmware image
cd ${SCP_PATH} && \
make CC=arm-none-eabi-gcc PRODUCT=sgi575 MODE=debug
export SCP_ROM_PATH=${SCP_PATH}/build/product/sgi575/scp_romfw/debug/bin/scp_romfw.bin
export SCP_RAM_PATH=${SCP_PATH}/build/product/sgi575/scp_ramfw/debug/bin/scp_ramfw.bin
export MCP_ROM_PATH=${SCP_PATH}/build/product/sgi575/mcp_romfw/debug/bin/mcp_romfw.bin
Unlike in the System Guidance for Mobile platforms, a secure-world application processor firmware is not required to load the SCP firmware. Instead, the SCP ROM firmware loads the SCP RAM firmware directly from NOR flash memory at a fixed address.
To create a NOR flash image containing only the SCP RAM firmware, use:
export NOR_PATH=/tmp/nor.bin
dd if=/dev/zero of=${NOR_PATH} bs=1024 count=62976 && \
cat ${SCP_RAM_PATH} >> ${NOR_PATH}
To simulate the basic SCP boot flow on the SGI-575 FVP, use the following command line:
FVP_CSS_SGI-575 \
-C css.scp.ROMloader.fname=${SCP_ROM_PATH} \
-C css.mcp.ROMloader.fname=${MCP_ROM_PATH} \
-C board.flashloader0.fname=${NOR_PATH}
Arm provides a super-project with guides for building and running a full software stack on Arm platforms. This project provides a convenient wrapper around the various build systems involved in the software stack, including for SCP-firmware.