blob: 682ceb220d8959c1f99edf2b6f135658da3ca37a [file] [log] [blame]
Maksims Svecovs308bb342022-06-28 14:27:07 +01001#!/bin/bash
2#
3# Copyright (c) 2022 Arm Limited. All rights reserved.
4#
5# SPDX-License-Identifier: BSD-3-Clause
6#
Maksims Svecovs308bb342022-06-28 14:27:07 +01007
J-Alvesa00cb202024-07-09 11:42:45 +01008set -ex
9
10# Build TF-A project.
11# Argument $1 provides the sp layout file to be used.
12# Argument $2 provides the spmc manifest to be used.
13build_tfa() {
14 local SP_LAYOUT=$1
15 local SPMC_MANIFEST=$2
16
17 echo "Building TF-A."
18 make -C ${WORKSPACE}/trusted-firmware-a \
19 CROSS_COMPILE=aarch64-none-elf- \
20 PLAT=fvp \
21 DEBUG=1 \
22 BL33=${WORKSPACE}/ff-a-acs/build/output/vm1.bin \
23 BL32=${WORKSPACE}/hafnium/out/reference/secure_aem_v8a_fvp_vhe_clang/hafnium.bin \
24 SP_LAYOUT_FILE=${SP_LAYOUT} \
25 ARM_SPMC_MANIFEST_DTS=${SPMC_MANIFEST} \
26 ARM_ARCH_MAJOR=8 \
27 ARM_ARCH_MINOR=5 \
28 BRANCH_PROTECTION=1 \
29 GIC_EXT_INTID=1 \
30 PLAT_TEST_SPM=1 \
31 ENABLE_FEAT_MTE2=1 \
32 SPD=spmd \
33 ARM_BL2_SP_LIST_DTS=${WORKSPACE}/trusted-firmware-a/build/fvp/debug/sp_list_fragment.dts \
34 all fip -j8
35}
36
37# Copy the generated FIP image from TF-A project.
38# Argument $1 contains the output file.
39copy_tfa_fip() {
40 cp ${WORKSPACE}/trusted-firmware-a/build/fvp/debug/fip.bin $1
41}
42
43# Builds the ACS suite, assuming the repo has been setup.
44# Argument $1 contains the exception level for the SPs, which should be 0 or 1.
45build_acs() {
46 cd ${WORKSPACE}/ff-a-acs/build
47 cmake ../ -G"Unix Makefiles" \
48 -DCROSS_COMPILE=aarch64-none-elf- \
49 -DTARGET=tgt_tfa_fvp \
50 -DPLATFORM_FFA_V_ALL=1 \
51 -DPLATFORM_NS_HYPERVISOR_PRESENT=0 \
52 -DPLATFORM_SP_EL=$1 \
53 -DENABLE_BTI=ON \
54 -DCMAKE_BUILD_TYPE=Debug \
55 -DSUITE=all
56 make
57}
58
59# Build Hafnium.
60export PATH=${WORKSPACE}/hafnium/prebuilts/linux-x64/dtc:$PATH
61echo "Building Hafnium."
62make -C ${WORKSPACE}/hafnium PLATFORM=secure_aem_v8a_fvp_vhe
63
64# Setup the ACS test suite.
Maksims Svecovs308bb342022-06-28 14:27:07 +010065cd ${WORKSPACE}/ff-a-acs
66mkdir build
J-Alvesaaece902024-07-09 09:55:28 +010067
J-Alvesa00cb202024-07-09 11:42:45 +010068echo "Building ACS test suite (S-EL1 targets)."
69build_acs 1
70build_tfa ${WORKSPACE}/ff-a-acs/platform/manifest/tgt_tfa_fvp/sp_layout.json ${WORKSPACE}/ff-a-acs/platform/manifest/tgt_tfa_fvp/fvp_spmc_manifest.dts
71copy_tfa_fip ${WORKSPACE}/fip_sp_sel1.bin
Maksims Svecovs308bb342022-06-28 14:27:07 +010072
73echo "Finished building all targets."
74cd ${WORKSPACE}