tf-a-next: changes to build TF-A from external repo
This is a first cut into the CI scripts to build RF-A the "new" way,
aligned with the changes proposed in RF-A change #36846. There are a
number of hacks (detailed below), which should be cleaned up in the
future, but this first set of changes will allow us to transition sooner
to the new RF-A repository before we get the final, proper solution
implemented.
Ultimately, the proper solution should introduce RF-A as a first-class
citizen component to build, alongside TF-A, TFTF, SPM and others. This
involves redefining the test configuration naming convention into
something like <tf-config>-<rfa-config>-<tftf-config>/<run_config>,
cloning the RF-A repository the proper way, and so on.
For now, this patch vampirizes most of TF-A build machinery, as
most of it can be reused for RF-A as well. Of course, some things need
to differ so the scripts need a way to know that they are actually
building RF-A, not TF-A. To do so, RF-A build configuration files
(under `tf_config/`) must contain `RUST=1`. Even though RF-A build
system no longer makes use of this build flag, the scripts now rely on
it for conditional logic like this:
if upon "$(get_tf_opt RUST)"; then
# Do something specific to RF-A.
# This code won't be executed for a TF-A build.
fi
Additionally, this patch removes the FIP building logic from the FVP
test configuration files (under group/) since RF-A's build system now
takes care of it.
Finally, add `TFA_FLAGS="FVP_TRUSTED_SRAM_SIZE=512"` into the FVP
platform build configuration file. This will make RF-A's build system
compile TF-A with `FVP_TRUSTED_SRAM_SIZE=512`, which is required for
debug builds of RF-A to fit in memory.
With all these changes, one can use the following command line to build
RF-A for FVP and QEMU through TF-A CI scripts:
TFA=</path/to/tfa/> \
tf_root=</path/to/rfa/> \
test_groups=tf-next-build \
dont_clean=0 \
run_test.sh
(`dont_clean=0` is required because neither TF-A nor RF-A build system
track build options changes, like `PLAT`),
And to build and run on FVP:
TFA=</path/to/tfa/> \
tf_root=</path/to/rfa/> \
test_groups=rfa-fvp/fvp-next:fvp-next \
run_test.sh
run_test.sh is a script wrapper over script/run_local_ci.sh, here is an example:
---8<---
export workspace="${workspace:-/tmp/ws}"
rm -rf $workspace
# Your Base FVP tree needs to be accessible through $nfs_volume/warehouse/
export nfs_volume="FILL ME"
export TFA="${TFA-/path/to/tfa}" # Leave empty if you want a fresh clone.
export tf_root="${tf_root-/path/to/rfa}" # Hack: This is RF-A, not TF-A!
export ci_root="${ci_root-/path/to/tf-a-ci-scripts}"
# Do not clone the other repositories below.
export tftf_root=none
export spm_root=none
export rmm_root=none
export scp_root=none
export tfm_tests_root=none
export tfm_extras_root=none
"$ci_root/script/run_local_ci.sh"
---8<---
The fact that tf_root must actually point to the RF-A repo (not the TF-A
one) is a consequence of some of the hacks to reuse TF-A build
machinery.
TFA variable might be omitted, in which case the scripts will clone the
TF-A repository for you. It will then appear under the workspace
(/tmp/ws/tfa by default).
Change-Id: Id19885b949643b680ef2026aaa192fd90203f943
Signed-off-by: Sandrine Afsa <sandrine.afsa@arm.com>
4 files changed