Commit 640af0ee authored by Sandrine Bailleux's avatar Sandrine Bailleux
Browse files

Update user guide to use Linaro releases

Linaro produce monthly software releases for the Juno and AEMv8-FVP
platforms. These provide an integrated set of software components
that have been tested together on these platforms.

From now on, it is recommend that Trusted Firmware developers use the
Linaro releases (currently 15.06) as a baseline for the dependent
software components: normal world firmware, Linux kernel and device
tree, file system as well as any additional micro-controller firmware
required by the platform.

This patch updates the user guide to document this new process. It
changes the instructions to get the source code of the full software
stack (including Trusted Firmware) and updates the dependency build
instructions to make use of the build scripts that the Linaro releases
provide.

Change-Id: Ia8bd043f4b74f1e1b10ef0d12cc8a56ed3c92b6e
parent 7bcbb962
...@@ -6,22 +6,25 @@ Contents : ...@@ -6,22 +6,25 @@ Contents :
1. [Introduction](#1--introduction) 1. [Introduction](#1--introduction)
2. [Host machine requirements](#2--host-machine-requirements) 2. [Host machine requirements](#2--host-machine-requirements)
3. [Tools](#3--tools) 3. [Tools](#3--tools)
4. [Building the Trusted Firmware](#4--building-the-trusted-firmware) 4. [Getting the Trusted Firmware source code](#4--getting-the-trusted-firmware-source-code)
5. [Obtaining the normal world software](#5--obtaining-the-normal-world-software) 5. [Building the Trusted Firmware](#5--building-the-trusted-firmware)
6. [Preparing the images to run on FVP](#6--preparing-the-images-to-run-on-fvp) 6. [Building the rest of the software stack](#6--building-the-rest-of-the-software-stack)
7. [Running the software on FVP](#7--running-the-software-on-fvp) 7. [Preparing the images to run on FVP](#7--preparing-the-images-to-run-on-fvp)
8. [Running the software on Juno](#8--running-the-software-on-juno) 8. [Running the software on FVP](#8--running-the-software-on-fvp)
9. [Running the software on Juno](#9--running-the-software-on-juno)
1. Introduction 1. Introduction
---------------- ----------------
This document describes how to build ARM Trusted Firmware and run it with a This document describes how to build ARM Trusted Firmware and run it with a
tested set of other software components using defined configurations on the Juno tested set of other software components using defined configurations on the Juno
ARM development platform and ARM Fixed Virtual Platform (FVP) models. It is ARM development platform and ARM Fixed Virtual Platform (FVP) models. It is
possible to use other software components, configurations and platforms but that possible to use other software components, configurations and platforms but that
is outside the scope of this document. is outside the scope of this document.
This document should be used in conjunction with the [Firmware Design]. This document should be used in conjunction with the [Firmware Design] and the
[Linaro release notes][Linaro releases].
2. Host machine requirements 2. Host machine requirements
...@@ -32,56 +35,78 @@ running the FVP models is a dual-core processor running at 2GHz with 12GB of ...@@ -32,56 +35,78 @@ running the FVP models is a dual-core processor running at 2GHz with 12GB of
RAM. For best performance, use a machine with a quad-core processor running at RAM. For best performance, use a machine with a quad-core processor running at
2.6GHz with 16GB of RAM. 2.6GHz with 16GB of RAM.
The software has been tested on Ubuntu 12.04.04 (64-bit). Packages used The software has been tested on Ubuntu 14.04 LTS (64-bit). Packages used for
for building the software were installed from that distribution unless building the software were installed from that distribution unless otherwise
otherwise specified. specified.
3. Tools 3. Tools
--------- ---------
The following tools are required to use the ARM Trusted Firmware: In addition to the prerequisite tools listed on the
[Linaro release notes][Linaro releases], the following tools are needed to use
* `git` package to obtain source code. the ARM Trusted Firmware:
* `build-essential`, `uuid-dev` and `iasl` packages for building UEFI and the
Firmware Image Package (FIP) tool.
* `bc` and `ncurses-dev` packages for building Linux.
* `device-tree-compiler` package for building the Flattened Device Tree (FDT) * `device-tree-compiler` package for building the Flattened Device Tree (FDT)
source files (`.dts` files) provided with this software. source files (`.dts` files) provided with this software.
* Baremetal GNU GCC tools. Verified packages can be downloaded from [Linaro]
[Linaro Toolchain]. The rest of this document assumes that the
`gcc-linaro-aarch64-none-elf-4.9-2014.07_linux.tar.xz` tools are used.
wget http://releases.linaro.org/14.07/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.9-2014.07_linux.tar.xz
tar -xf gcc-linaro-aarch64-none-elf-4.9-2014.07_linux.tar.xz
* `libssl-dev` package to build the certificate generation tool when support * `libssl-dev` package to build the certificate generation tool when support
for Trusted Board Boot is needed. for Trusted Board Boot is needed.
* (Optional) For debugging, ARM [Development Studio 5 (DS-5)][DS-5] v5.21. * (Optional) For debugging, ARM [Development Studio 5 (DS-5)][DS-5] v5.21.
4. Building the Trusted Firmware 4. Getting the Trusted Firmware source code
--------------------------------- --------------------------------------------
The Trusted Firmware source code can be obtained as part of the standard Linaro
releases, which provide a full software stack, including the Trusted Firmware,
normal world firmware, Linux kernel and device tree, file system as well as any
additional micro-controller firmware required by the platform. Please follow the
instructions on the [Linaro release notes][Linaro releases], section 2.2
"Downloading the software sources" and section 2.3 "Downloading the filesystem
binaries".
Note: Both the LSK kernel or the latest tracking kernel can be used along the
ARM Trusted Firmware, choose the one that best suits your needs.
The Trusted Firmware source code can then be found in the `arm-tf/` directory.
This is the full git repository cloned from Github. The revision checked out by
the `repo` tool is indicated by the manifest file. Depending on the manifest
file you're using, this might not be the latest development version. To
synchronize your copy of the repository and get the latest updates, use the
following commands:
# Change to the Trusted Firmware directory.
cd arm-tf
# Download the latest code from Github.
git fetch github
To build the Trusted Firmware images, follow these steps: # Update your working copy to the latest master.
# This command will create a local branch master that tracks the remote
# branch master from Github.
git checkout --track github/master
1. Clone the ARM Trusted Firmware repository from GitHub:
Alternatively, the Trusted Firmware source code can be fetched on its own
from GitHub:
git clone https://github.com/ARM-software/arm-trusted-firmware.git git clone https://github.com/ARM-software/arm-trusted-firmware.git
2. Change to the trusted firmware directory: However, the rest of this document assumes that you got the Trusted Firmware
as part of the Linaro release.
5. Building the Trusted Firmware
---------------------------------
cd arm-trusted-firmware To build the Trusted Firmware images, change to the root directory of the
Trusted Firmware source tree and follow these steps:
3. Set the compiler path, specify a Non-trusted Firmware image (BL3-3) and 1. Set the compiler path, specify a Non-trusted Firmware image (BL3-3) and
a valid platform, and then build: a valid platform, and then build:
CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \ CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-linux-gnu- \
BL33=<path-to>/<bl33_image> \ BL33=<path-to>/<bl33_image> \
make PLAT=<platform> all fip make PLAT=<platform> all fip
...@@ -90,7 +115,7 @@ To build the Trusted Firmware images, follow these steps: ...@@ -90,7 +115,7 @@ To build the Trusted Firmware images, follow these steps:
The BL3-3 image corresponds to the software that is executed after switching The BL3-3 image corresponds to the software that is executed after switching
to the non-secure world. UEFI can be used as the BL3-3 image. Refer to the to the non-secure world. UEFI can be used as the BL3-3 image. Refer to the
"Obtaining the normal world software" section below. "Building the rest of the software stack" section below.
The TSP (Test Secure Payload), corresponding to the BL3-2 image, is not The TSP (Test Secure Payload), corresponding to the BL3-2 image, is not
compiled in by default. Refer to the "Building the Test Secure Payload" compiled in by default. Refer to the "Building the Test Secure Payload"
...@@ -118,17 +143,17 @@ To build the Trusted Firmware images, follow these steps: ...@@ -118,17 +143,17 @@ To build the Trusted Firmware images, follow these steps:
For more information on FIPs, see the "Firmware Image Package" section in For more information on FIPs, see the "Firmware Image Package" section in
the [Firmware Design]. the [Firmware Design].
4. (Optional) Some platforms may require a BL3-0 image to boot. This image can 2. (Optional) Some platforms may require a BL3-0 image to boot. This image can
be included in the FIP when building the Trusted Firmware by specifying the be included in the FIP when building the Trusted Firmware by specifying the
`BL30` build option: `BL30` build option:
BL30=<path-to>/<bl30_image> BL30=<path-to>/<bl30_image>
5. Output binary files `bl1.bin` and `fip.bin` are both required to boot the 3. Output binary files `bl1.bin` and `fip.bin` are both required to boot the
system. How these files are used is platform specific. Refer to the system. How these files are used is platform specific. Refer to the
platform documentation on how to use the firmware images. platform documentation on how to use the firmware images.
6. (Optional) Build products for a specific build variant can be removed using: 4. (Optional) Build products for a specific build variant can be removed using:
make DEBUG=<D> PLAT=<platform> clean make DEBUG=<D> PLAT=<platform> clean
...@@ -138,7 +163,7 @@ To build the Trusted Firmware images, follow these steps: ...@@ -138,7 +163,7 @@ To build the Trusted Firmware images, follow these steps:
make realclean make realclean
7. (Optional) Path to binary for certain BL stages (BL2, BL3-1 and BL3-2) can be 5. (Optional) Path to binary for certain BL stages (BL2, BL3-1 and BL3-2) can be
provided by specifying the BLx=<path-to>/<blx_image> where BLx is the BL stage. provided by specifying the BLx=<path-to>/<blx_image> where BLx is the BL stage.
This will bypass the build of the BL component from source, but will include This will bypass the build of the BL component from source, but will include
the specified binary in the final FIP image. Please note that BL3-2 will be the specified binary in the final FIP image. Please note that BL3-2 will be
...@@ -424,7 +449,7 @@ Existing package entries can be individially updated: ...@@ -424,7 +449,7 @@ Existing package entries can be individially updated:
To compile a debug version and make the build more verbose use To compile a debug version and make the build more verbose use
CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \ CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-linux-gnu- \
BL33=<path-to>/<bl33_image> \ BL33=<path-to>/<bl33_image> \
make PLAT=<platform> DEBUG=1 V=1 all fip make PLAT=<platform> DEBUG=1 V=1 all fip
...@@ -444,7 +469,7 @@ platforms** section in the [Firmware Design]). ...@@ -444,7 +469,7 @@ platforms** section in the [Firmware Design]).
Extra debug options can be passed to the build system by setting `CFLAGS`: Extra debug options can be passed to the build system by setting `CFLAGS`:
CFLAGS='-O0 -gdwarf-2' \ CFLAGS='-O0 -gdwarf-2' \
CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \ CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-linux-gnu- \
BL33=<path-to>/<bl33_image> \ BL33=<path-to>/<bl33_image> \
make PLAT=<platform> DEBUG=1 V=1 all fip make PLAT=<platform> DEBUG=1 V=1 all fip
...@@ -459,7 +484,7 @@ must be recompiled as well. For more information on SPs and SPDs, see the ...@@ -459,7 +484,7 @@ must be recompiled as well. For more information on SPs and SPDs, see the
First clean the Trusted Firmware build directory to get rid of any previous First clean the Trusted Firmware build directory to get rid of any previous
BL3-1 binary. Then to build the TSP image and include it into the FIP use: BL3-1 binary. Then to build the TSP image and include it into the FIP use:
CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \ CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-linux-gnu- \
BL33=<path-to>/<bl33_image> \ BL33=<path-to>/<bl33_image> \
make PLAT=<platform> SPD=tspd all fip make PLAT=<platform> SPD=tspd all fip
...@@ -546,7 +571,7 @@ feature. ...@@ -546,7 +571,7 @@ feature.
Example of command line using RSA development keys: Example of command line using RSA development keys:
CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \ CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-linux-gnu- \
BL33=<path-to>/<bl33_image> \ BL33=<path-to>/<bl33_image> \
MBEDTLS_DIR=<path of the directory containing mbedTLS sources> \ MBEDTLS_DIR=<path of the directory containing mbedTLS sources> \
make PLAT=<platform> TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 \ make PLAT=<platform> TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 \
...@@ -583,121 +608,71 @@ set the `BASE_COMMIT` variable to your desired branch. By default, `BASE_COMMIT` ...@@ -583,121 +608,71 @@ set the `BASE_COMMIT` variable to your desired branch. By default, `BASE_COMMIT`
is set to `origin/master`. is set to `origin/master`.
5. Obtaining the normal world software 6. Building the rest of the software stack
--------------------------------------- -------------------------------------------
### Obtaining EDK2
Potentially any kind of non-trusted firmware may be used with the ARM Trusted
Firmware but the software has only been tested with the EFI Development Kit 2
(EDK2) open source implementation of the UEFI specification.
To build the software to be compatible with the Foundation and Base FVPs, or the The Linaro release provides a set of scripts that automate the process of
Juno platform, follow these steps: building all components of the software stack. However, the scripts only support
a limited number of Trusted Firmware build options. Therefore, it is recommended
to modify these scripts to build all components except Trusted Firmware, and
build Trusted Firmware separately as described in the section "Building the
Trusted Firmware" above.
1. Clone the [EDK2 source code][EDK2] from GitHub: The instructions below are targeted at an OpenEmbedded filesystem.
git clone -n https://github.com/tianocore/edk2.git 1. To exclude Trusted Firmware from the automated build process, edit the
variant file `build-scripts/variants/<platform>-oe`, where `<platform>`
is either `fvp` or `juno`. Add the following lines at the end of the file:
Not all required features are available in the EDK2 mainline yet. These can # Disable ARM Trusted Firmware build
be obtained from the ARM-software EDK2 repository instead: ARM_TF_BUILD_ENABLED=0
cd edk2 2. Launch the build script:
git remote add -f --tags arm-software https://github.com/ARM-software/edk2.git
git checkout --detach v3.0
2. Copy build config templates to local workspace CROSS_COMPILE=aarch64-linux-gnu- \
build-scripts/build-all.sh <platform>-oe
# in edk2/ ### Preparing the Firmware Image Package
. edksetup.sh
3. Build the EDK2 host tools The EDK2 binary should be specified as `BL33` in the `make` command line when
building the Trusted Firmware. See the "Building the Trusted Firmware" section
above. The EDK2 binary for use with the ARM Trusted Firmware can be found here:
make -C BaseTools clean uefi/edk2/Build/ArmVExpress-FVP-AArch64-Minimal/DEBUG_GCC49/FV/FVP_AARCH64_EFI.fd [for FVP]
make -C BaseTools uefi/edk2/Build/ArmJuno/DEBUG_GCC49/FV/BL33_AP_UEFI.fd [for Juno]
4. Build the EDK2 software ### Building an alternative EDK2
1. Build for FVP * By default, EDK2 is built in debug mode. To build a release version instead,
change the following line in the variant file:
GCC49_AARCH64_PREFIX=<absolute-path-to-aarch64-gcc>/bin/aarch64-none-elf- \ UEFI_BUILD_MODE=DEBUG
make -f ArmPlatformPkg/Scripts/Makefile EDK2_ARCH=AARCH64 \
EDK2_DSC=ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc \
EDK2_TOOLCHAIN=GCC49 EDK2_BUILD=RELEASE \
EDK2_MACROS="-n 6 -D ARM_FOUNDATION_FVP=1"
The EDK2 binary for use with the ARM Trusted Firmware can then be found into:
here:
Build/ArmVExpress-FVP-AArch64/RELEASE_GCC49/FV/FVP_AARCH64_EFI.fd UEFI_BUILD_MODE=RELEASE
2. Build for Juno * On FVP, if legacy GICv2 locations are used, the EDK2 platform makefile must
be updated. This is required as EDK2 does not support probing for the GIC
location. To do this, first clean the EDK2 build directory:
GCC49_AARCH64_PREFIX=<absolute-path-to-aarch64-gcc>/bin/aarch64-none-elf- \ build-scripts/build-uefi.sh fvp-oe clean
make -f ArmPlatformPkg/ArmJunoPkg/Makefile EDK2_ARCH=AARCH64 \
EDK2_TOOLCHAIN=GCC49 EDK2_BUILD=RELEASE
The EDK2 binary for use with the ARM Trusted Firmware can then be found Then edit the following file:
here:
Build/ArmJuno/RELEASE_GCC49/FV/BL33_AP_UEFI.fd uefi/edk2/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.mak
The EDK2 binary should be specified as `BL33` in in the `make` command line and add the following build flag into the `EDK2_MACROS` variable:
when building the Trusted Firmware. See the "Building the Trusted Firmware"
section above.
5. (Optional) To build EDK2 in debug mode, remove `EDK2_BUILD=RELEASE` from the
command line.
6. (Optional) To boot Linux using a VirtioBlock file-system, the command line
passed from EDK2 to the Linux kernel must be modified as described in the
"Obtaining a root file-system" section below.
7. (Optional) If legacy GICv2 locations are used, the EDK2 platform description
must be updated. This is required as EDK2 does not support probing for the
GIC location. To do this, first clean the EDK2 build directory.
make -f ArmPlatformPkg/Scripts/Makefile EDK2_ARCH=AARCH64 \
EDK2_DSC=ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc \
EDK2_TOOLCHAIN=ARMGCC clean
Then rebuild EDK2 as described in step 3, using the following flag:
-D ARM_FVP_LEGACY_GICV2_LOCATION=1 -D ARM_FVP_LEGACY_GICV2_LOCATION=1
Then rebuild everything as described above in step 2.
Finally rebuild the Trusted Firmware to generate a new FIP using the Finally rebuild the Trusted Firmware to generate a new FIP using the
instructions in the "Building the Trusted Firmware" section. instructions in the "Building the Trusted Firmware" section.
### Obtaining a Linux kernel 7. Preparing the images to run on FVP
Preparing a Linux kernel for use on the FVPs can be done as follows
(GICv2 support only):
1. Clone Linux:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Not all required features are available in the kernel mainline yet. These
can be obtained from the ARM-software Linux repository instead:
cd linux
git remote add -f --tags arm-software https://github.com/ARM-software/linux.git
git checkout --detach 1.6-Juno
2. Build with the Linaro GCC tools.
# in linux/
make mrproper
make ARCH=arm64 defconfig
CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \
make -j6 ARCH=arm64
The compiled Linux image will now be found at `arch/arm64/boot/Image`.
6. Preparing the images to run on FVP
-------------------------------------- --------------------------------------
### Obtaining the Flattened Device Trees ### Obtaining the Flattened Device Trees
...@@ -708,6 +683,9 @@ the Trusted Firmware source directory under `fdts/`. The Foundation FVP has a ...@@ -708,6 +683,9 @@ the Trusted Firmware source directory under `fdts/`. The Foundation FVP has a
subset of the Base FVP components. For example, the Foundation FVP lacks CLCD subset of the Base FVP components. For example, the Foundation FVP lacks CLCD
and MMC support, and has only one CPU cluster. and MMC support, and has only one CPU cluster.
Note: It is not recommended to use the FDTs built along the kernel because not
all FDTs are available from there.
* `fvp-base-gicv2-psci.dtb` * `fvp-base-gicv2-psci.dtb`
(Default) For use with both AEMv8 and Cortex-A57-A53 Base FVPs with (Default) For use with both AEMv8 and Cortex-A57-A53 Base FVPs with
...@@ -735,110 +713,16 @@ and MMC support, and has only one CPU cluster. ...@@ -735,110 +713,16 @@ and MMC support, and has only one CPU cluster.
For use with Foundation FVP with Base memory map configuration and Linux For use with Foundation FVP with Base memory map configuration and Linux
GICv3 support. GICv3 support.
Copy the chosen FDT blob as `fdt.dtb` to the directory from which the FVP Copy the chosen FDT blob as `fdt.dtb` to the directory from which the FVP
is launched. Alternatively a symbolic link may be used. is launched. Alternatively a symbolic link may be used.
### Preparing the kernel image ### Preparing the kernel image
Copy the kernel image file `arch/arm64/boot/Image` to the directory from which Copy the kernel image file `linux/arch/arm64/boot/Image` to the directory from
the FVP is launched. Alternatively a symbolic link may be used. which the FVP is launched. Alternatively a symbolic link may be used.
### Obtaining a root file-system
To prepare a Linaro LAMP based Open Embedded file-system, the following
instructions can be used as a guide. The file-system can be provided to Linux
via VirtioBlock or as a RAM-disk. Both methods are described below.
#### Prepare VirtioBlock
To prepare a VirtioBlock file-system, do the following:
1. Download and unpack the disk image.
NOTE: The unpacked disk image grows to 3 GiB in size.
wget http://releases.linaro.org/15.03/members/arm/openembedded/aarch64/vexpress64-openembedded_lamp-armv8-gcc-4.9_20150324-715.img.gz
gunzip vexpress64-openembedded_lamp-armv8-gcc-4.9_20150324-715.img.gz
2. Make sure the Linux kernel has Virtio support enabled using
`make ARCH=arm64 menuconfig`.
Device Drivers ---> Virtio drivers ---> <*> Platform bus driver for memory mapped virtio devices
Device Drivers ---> [*] Block devices ---> <*> Virtio block driver
File systems ---> <*> The Extended 4 (ext4) filesystem
If some of these configurations are missing, enable them, save the kernel
configuration, then rebuild the kernel image using the instructions
provided in the section "Obtaining a Linux kernel".
3. Change the Kernel command line to include `root=/dev/vda2`. This can either
be done in the EDK2 boot menu or in the platform file. Editing the platform
file and rebuilding EDK2 will make the change persist. To do this:
1. In EDK2, edit the following file:
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc 8. Running the software on FVP
2. Add `root=/dev/vda2` to:
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|"<Other default options>"
3. Remove the entry:
gArmPlatformTokenSpaceGuid.PcdDefaultBootInitrdPath|""
4. Rebuild EDK2 (see "Obtaining UEFI" section above).
4. The file-system image file should be provided to the model environment by
passing it the correct command line option. In the FVPs the following
option should be provided in addition to the ones described in the
"Running the software on FVP" section below.
NOTE: A symbolic link to this file cannot be used with the FVP; the path
to the real file must be provided.
On the Base FVPs:
-C bp.virtioblockdevice.image_path="<path-to>/<file-system-image>"
On the Foundation FVP:
--block-device="<path-to>/<file-system-image>"
5. Ensure that the FVP doesn't output any error messages. If the following
error message is displayed:
ERROR: BlockDevice: Failed to open "<path-to>/<file-system-image>"!
then make sure the path to the file-system image in the model parameter is
correct and that read permission is correctly set on the file-system image
file.
#### Prepare RAM-disk
To prepare a RAM-disk root file-system, do the following:
1. Download the file-system image:
wget http://releases.linaro.org/15.03/members/arm/openembedded/aarch64/linaro-image-lamp-genericarmv8-20150323-747.rootfs.tar.gz
2. Modify the Linaro image:
# Prepare for use as RAM-disk. Normally use MMC, NFS or VirtioBlock.
# Be careful, otherwise you could damage your host file-system.
mkdir tmp; cd tmp
sudo sh -c "zcat ../linaro-image-lamp-genericarmv8-20150323-747.rootfs.tar.gz | cpio -id"
sudo ln -s sbin/init .
sudo sh -c "echo 'devtmpfs /dev devtmpfs mode=0755,nosuid 0 0' >> etc/fstab"
sudo sh -c "find . | cpio --quiet -H newc -o | gzip -3 -n > ../filesystem.cpio.gz"
cd ..
3. Copy the resultant `filesystem.cpio.gz` to the directory where the FVP is
launched from. Alternatively a symbolic link may be used.
7. Running the software on FVP
------------------------------- -------------------------------
This version of the ARM Trusted Firmware has been tested on the following ARM This version of the ARM Trusted Firmware has been tested on the following ARM
...@@ -871,29 +755,33 @@ downloaded for free from [ARM's website][ARM FVP website]. ...@@ -871,29 +755,33 @@ downloaded for free from [ARM's website][ARM FVP website].
The following `Foundation_Platform` parameters should be used to boot Linux with The following `Foundation_Platform` parameters should be used to boot Linux with
4 CPUs using the ARM Trusted Firmware. 4 CPUs using the ARM Trusted Firmware.
NOTE: Using the `--block-device` parameter is not necessary if a Linux RAM-disk
file-system is used (see the "Obtaining a File-system" section above).
NOTE: The `--data="<path to FIP binary>"@0x8000000` parameter is used to load a
Firmware Image Package at the start of NOR FLASH0 (see the "Building the
Trusted Firmware" section above).
<path-to>/Foundation_Platform \ <path-to>/Foundation_Platform \
--cores=4 \ --cores=4 \
--secure-memory \ --secure-memory \
--visualization \ --visualization \
--gicv3 \ --gicv3 \
--data="<path-to>/<bl1-binary>"@0x0 \ --data="<path-to>/<bl1-binary>"@0x0 \
--data="<path-to>/<FIP-binary>"@0x8000000 \ --data="<path-to>/<FIP-binary>"@0x08000000 \
--data="<path-to>/<fdt>"@0x83000000 \
--data="<path-to>/<kernel-binary>"@0x80080000 \
--block-device="<path-to>/<file-system-image>" --block-device="<path-to>/<file-system-image>"
1. The `--data="<path-to-some-binary>"@0x...` parameters are used to load
binaries into memory.
* BL1 is loaded at the start of the Trusted ROM.
* The Firmware Image Package is loaded at the start of NOR FLASH0.
* The Linux kernel image and device tree are loaded in DRAM.
2. The `--block-device` parameter is used to specify the path to the file
system image provided to Linux via VirtioBlock. Note that it must point to
the real file and that a symbolic link to this file cannot be used with the
FVP.
The default use-case for the Foundation FVP is to enable the GICv3 device in The default use-case for the Foundation FVP is to enable the GICv3 device in
the model but use the GICv2 FDT, in order for Linux to drive the GIC in GICv2 the model but use the GICv2 FDT, in order for Linux to drive the GIC in GICv2
emulation mode. emulation mode.
The memory mapped addresses `0x0` and `0x8000000` correspond to the start of
trusted ROM and NOR FLASH0 respectively.
### Notes regarding Base FVP configuration options ### Notes regarding Base FVP configuration options
Please refer to these notes in the subsequent "Running on the Base FVP" Please refer to these notes in the subsequent "Running on the Base FVP"
...@@ -907,9 +795,17 @@ sections. ...@@ -907,9 +795,17 @@ sections.
still work (and run much faster) without this option but this will hide any still work (and run much faster) without this option but this will hide any
cache maintenance defects in the software. cache maintenance defects in the software.
3. Using the `-C bp.virtioblockdevice.image_path` parameter is not necessary 3. The `-C bp.virtioblockdevice.image_path` parameter is used to specify the
if a Linux RAM-disk file-system is used (see the "Obtaining a root path to the file system image provided to Linux via VirtioBlock. Note that
file-system" section above). it must point to the real file and that a symbolic link to this file cannot
be used with the FVP. Ensure that the FVP doesn't output any error messages.
If the following error message is displayed:
ERROR: BlockDevice: Failed to open "<path-to>/<file-system-image>"!
then make sure the path to the file-system image in the model parameter is
correct and that read permission is correctly set on the file-system image
file.
4. Setting the `-C bp.secure_memory` parameter to `1` is only supported on 4. Setting the `-C bp.secure_memory` parameter to `1` is only supported on
Base FVP versions 5.4 and newer. Setting this parameter to `0` is also Base FVP versions 5.4 and newer. Setting this parameter to `0` is also
...@@ -917,30 +813,33 @@ sections. ...@@ -917,30 +813,33 @@ sections.
instructs the FVP to provide some helpful information if a secure memory instructs the FVP to provide some helpful information if a secure memory
violation occurs. violation occurs.
5. This and the following notes only apply when the firmware is built with 5. The `--data="<path-to-some-binary>"@<base-address-of-binary>` parameter is
used to load images into Base FVP memory. The base addresses used should
match the image base addresses used while linking the images. This parameter
is used to load the Linux kernel image and device tree into DRAM.
6. This and the following notes only apply when the firmware is built with
the `RESET_TO_BL31` option. the `RESET_TO_BL31` option.
The `--data="<path-to><bl31|bl32|bl33-binary>"@<base-address-of-binary>` The `--data="<path-to><bl31|bl32|bl33-binary>"@<base-address-of-binary>`
parameter is used to load bootloader images into Base FVP memory (see the parameter is needed to load the individual bootloader images in memory.
"Building the Trusted Firmware" section above). The base addresses used BL32 image is only needed if BL31 has been built to expect a Secure-EL1
should match the image base addresses in `platform_def.h` used while linking Payload.
the images. The BL3-2 image is only needed if BL3-1 has been built to expect
a Secure-EL1 Payload.
6. The `-C cluster<X>.cpu<Y>.RVBAR=@<base-address-of-bl31>` parameter, where 7. The `-C cluster<X>.cpu<Y>.RVBAR=@<base-address-of-bl31>` parameter, where
X and Y are the cluster and CPU numbers respectively, is used to set the X and Y are the cluster and CPU numbers respectively, is used to set the
reset vector for each core. reset vector for each core.
7. Changing the default value of `FVP_SHARED_DATA_LOCATION` will also require 8. Changing the default value of `FVP_SHARED_DATA_LOCATION` will also require
changing the value of changing the value of
`--data="<path-to><bl31-binary>"@<base-address-of-bl31>` and `--data="<path-to><bl31-binary>"@<base-address-of-bl31>` and
`-C cluster<X>.cpu<X>.RVBAR=@<base-address-of-bl31>`, to the new value of `-C cluster<X>.cpu<X>.RVBAR=@<base-address-of-bl31>`, to the new value of
`BL31_BASE` in `platform_def.h`. `BL31_BASE`.
8. Changing the default value of `FVP_TSP_RAM_LOCATION` will also require 9. Changing the default value of `FVP_TSP_RAM_LOCATION` will also require
changing the value of changing the value of
`--data="<path-to><bl32-binary>"@<base-address-of-bl32>` to the new value of `--data="<path-to><bl32-binary>"@<base-address-of-bl32>` to the new value of
`BL32_BASE` in `platform_def.h`. `BL32_BASE`.
### Running on the AEMv8 Base FVP with reset to BL1 entrypoint ### Running on the AEMv8 Base FVP with reset to BL1 entrypoint
...@@ -960,6 +859,8 @@ with 8 CPUs using the ARM Trusted Firmware. ...@@ -960,6 +859,8 @@ with 8 CPUs using the ARM Trusted Firmware.
-C cache_state_modelled=1 \ -C cache_state_modelled=1 \
-C bp.secureflashloader.fname="<path-to>/<bl1-binary>" \ -C bp.secureflashloader.fname="<path-to>/<bl1-binary>" \
-C bp.flashloader0.fname="<path-to>/<FIP-binary>" \ -C bp.flashloader0.fname="<path-to>/<FIP-binary>" \
--data cluster0.cpu0="<path-to>/<fdt>"@0x83000000 \
--data cluster0.cpu0="<path-to>/<kernel-binary>"@0x80080000 \
-C bp.virtioblockdevice.image_path="<path-to>/<file-system-image>" -C bp.virtioblockdevice.image_path="<path-to>/<file-system-image>"
### Running on the Cortex-A57-A53 Base FVP with reset to BL1 entrypoint ### Running on the Cortex-A57-A53 Base FVP with reset to BL1 entrypoint
...@@ -977,6 +878,8 @@ boot Linux with 8 CPUs using the ARM Trusted Firmware. ...@@ -977,6 +878,8 @@ boot Linux with 8 CPUs using the ARM Trusted Firmware.
-C cache_state_modelled=1 \ -C cache_state_modelled=1 \
-C bp.secureflashloader.fname="<path-to>/<bl1-binary>" \ -C bp.secureflashloader.fname="<path-to>/<bl1-binary>" \
-C bp.flashloader0.fname="<path-to>/<FIP-binary>" \ -C bp.flashloader0.fname="<path-to>/<FIP-binary>" \
--data cluster0.cpu0="<path-to>/<fdt>"@0x83000000 \
--data cluster0.cpu0="<path-to>/<kernel-binary>"@0x80080000 \
-C bp.virtioblockdevice.image_path="<path-to>/<file-system-image>" -C bp.virtioblockdevice.image_path="<path-to>/<file-system-image>"
### Running on the AEMv8 Base FVP with reset to BL3-1 entrypoint ### Running on the AEMv8 Base FVP with reset to BL3-1 entrypoint
...@@ -1005,6 +908,8 @@ with 8 CPUs using the ARM Trusted Firmware. ...@@ -1005,6 +908,8 @@ with 8 CPUs using the ARM Trusted Firmware.
--data cluster0.cpu0="<path-to>/<bl31-binary>"@0x04023000 \ --data cluster0.cpu0="<path-to>/<bl31-binary>"@0x04023000 \
--data cluster0.cpu0="<path-to>/<bl32-binary>"@0x04001000 \ --data cluster0.cpu0="<path-to>/<bl32-binary>"@0x04001000 \
--data cluster0.cpu0="<path-to>/<bl33-binary>"@0x88000000 \ --data cluster0.cpu0="<path-to>/<bl33-binary>"@0x88000000 \
--data cluster0.cpu0="<path-to>/<fdt>"@0x83000000 \
--data cluster0.cpu0="<path-to>/<kernel-binary>"@0x80080000 \
-C bp.virtioblockdevice.image_path="<path-to>/<file-system-image>" -C bp.virtioblockdevice.image_path="<path-to>/<file-system-image>"
### Running on the Cortex-A57-A53 Base FVP with reset to BL3-1 entrypoint ### Running on the Cortex-A57-A53 Base FVP with reset to BL3-1 entrypoint
...@@ -1031,6 +936,8 @@ boot Linux with 8 CPUs using the ARM Trusted Firmware. ...@@ -1031,6 +936,8 @@ boot Linux with 8 CPUs using the ARM Trusted Firmware.
--data cluster0.cpu0="<path-to>/<bl31-binary>"@0x04023000 \ --data cluster0.cpu0="<path-to>/<bl31-binary>"@0x04023000 \
--data cluster0.cpu0="<path-to>/<bl32-binary>"@0x04001000 \ --data cluster0.cpu0="<path-to>/<bl32-binary>"@0x04001000 \
--data cluster0.cpu0="<path-to>/<bl33-binary>"@0x88000000 \ --data cluster0.cpu0="<path-to>/<bl33-binary>"@0x88000000 \
--data cluster0.cpu0="<path-to>/<fdt>"@0x83000000 \
--data cluster0.cpu0="<path-to>/<kernel-binary>"@0x80080000 \
-C bp.virtioblockdevice.image_path="<path-to>/<file-system-image>" -C bp.virtioblockdevice.image_path="<path-to>/<file-system-image>"
### Configuring the GICv2 memory map ### Configuring the GICv2 memory map
...@@ -1115,48 +1022,38 @@ The `bp.variant` parameter corresponds to the build variant field of the ...@@ -1115,48 +1022,38 @@ The `bp.variant` parameter corresponds to the build variant field of the
detect the legacy VE memory map while configuring the GIC. detect the legacy VE memory map while configuring the GIC.
8. Running the software on Juno 9. Running the software on Juno
-------------------------------- --------------------------------
### Preparing Trusted Firmware images This version of the ARM Trusted Firmware has been tested on Juno r0 and Juno r1.
To execute the versions of software components on Juno referred to in this To execute the versions of software components on Juno referred to in this
document, the latest [Juno Board Recovery Image] must be installed. If you document, the latest Juno board recovery image must be installed. If you
have an earlier version installed or are unsure which version is installed, have an earlier version installed or are unsure which version is installed,
follow the recovery image update instructions in the [Juno Software Guide] follow the recovery image update instructions in the [Juno Software Guide]
on the [ARM Connected Community] website. on the [ARM Connected Community] website. The latest Juno board recovery image
can be obtained from [Linaro releases], see section 2.7 "Using prebuilt
binaries".
Note that you must use the board recovery image provided in the Juno R1 Initial ### Preparing Trusted Firmware images
Alpha release, even for Juno R0. This is because the Trusted Firmware now
supports the new [SCPI v1.0 final protocol][Juno SCP Protocols v1.0]
exclusively, which is not compatible with the SCP firmware provided in the
latest Juno R0 release. Although the Juno R1 Initial Alpha release is generally
not recommended for use with Juno R0 boards, it is suitable for Trusted Firmware
development.
The Juno platform requires a BL0 and a BL3-0 image to boot up. The BL0 image The Juno platform requires a BL0 and a BL30 image to boot up. The BL0 image
contains the ROM firmware that runs on the SCP (System Control Processor), contains the ROM firmware that runs on the SCP (System Control Processor),
whereas the BL3-0 image contains the SCP Runtime firmware. Both images are whereas the BL30 image contains the SCP Runtime firmware. Both images are
embedded within the [Juno Board Recovery Image] but they can also be downloaded embedded within the Juno board recovery image, these are the files `bl0.bin`
directly: [Juno SCP ROM Firmware] and [Juno SCP Runtime Firmware]. and `bl30.bin`.
Rebuild the Trusted Firmware specifying the BL3-0 image. Refer to the section
"Building the Trusted Firmware". Alternatively, the FIP image can be updated
manually with the BL3-0 image:
fip_create --dump --bl30 <path-to>/<bl30-binary> <path-to>/<FIP-binary> The BL30 file must be part of the FIP image. Therefore, its path must be
supplied using the `BL30` variable on the command line when building the
FIP. Please refer to the section "Building the Trusted Firmware".
### Obtaining the Flattened Device Tree After building Trusted Firmware, the files `bl1.bin` and `fip.bin` need copying
to the `SOFTWARE/` directory as explained in the [Juno Software Guide].
Juno's device tree blob is built along with the kernel. It is located in:
<path-to-linux>/arch/arm64/boot/dts/arm/juno.dtb
### Other Juno software information ### Other Juno software information
Please refer to the [Juno Software Guide] to: Please refer to the [Juno Software Guide] to:
* Deploy a root filesystem
* Install and run the Juno binaries on the board * Install and run the Juno binaries on the board
* Obtain any other Juno software information * Obtain any other Juno software information
...@@ -1166,17 +1063,11 @@ Please refer to the [Juno Software Guide] to: ...@@ -1166,17 +1063,11 @@ Please refer to the [Juno Software Guide] to:
_Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved._ _Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved._
[Firmware Design]: ./firmware-design.md [Firmware Design]: firmware-design.md
[Linaro releases]: http://releases.linaro.org/15.06/members/arm/platforms
[ARM FVP website]: http://www.arm.com/fvp [ARM FVP website]: http://www.arm.com/fvp
[ARM Connected Community]: http://community.arm.com [ARM Connected Community]: http://community.arm.com
[Juno Software Guide]: http://community.arm.com/docs/DOC-8396 [Juno Software Guide]: http://community.arm.com/docs/DOC-8396
[Juno Board Recovery Image]: http://community.arm.com/servlet/JiveServlet/download/10177-1-18236/board_recovery_image_0.11.3.zip
[Juno SCP ROM Firmware]: http://community.arm.com/servlet/JiveServlet/download/10177-1-18187/bl0.bin.zip
[Juno SCP Runtime Firmware]: http://community.arm.com/servlet/JiveServlet/download/10177-1-18193/bl30.bin.zip
[Juno SCP Protocols v1.0]: http://community.arm.com/servlet/JiveServlet/download/8401-40-18262/DUI0922A_scp_message_interface.pdf
[Linaro Toolchain]: http://releases.linaro.org/14.07/components/toolchain/binaries/
[EDK2]: http://github.com/tianocore/edk2
[DS-5]: http://www.arm.com/products/tools/software-tools/ds-5/index.php [DS-5]: http://www.arm.com/products/tools/software-tools/ds-5/index.php
[mbedTLS Repository]: https://github.com/ARMmbed/mbedtls.git [mbedTLS Repository]: https://github.com/ARMmbed/mbedtls.git
[Trusted Board Boot]: trusted-board-boot.md [Trusted Board Boot]: trusted-board-boot.md
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment