feat(cpus): add ENABLE_ERRATA_ALL flag
Now that all errata flags are all conveniently in a single list we can
make sweeping decisions about their values. The first use-case is to
enable all errata in TF-A. This is useful for CI runs where it is
impractical to list every single one. This should help with the long
standing issue of errata not being built or tested.
Also add missing CPUs with errata to `ENABLE_ERRATA_ALL` to enable all
errata builds in CI.
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I2b456d304d7bf3215c7c4f4fd70b56ecbcb09979
(cherry picked from commit 593ae35435f855ff3e48facc6a049261c0c37ea7)
diff --git a/Makefile b/Makefile
index b357b1d..ea380ee 100644
--- a/Makefile
+++ b/Makefile
@@ -1226,6 +1226,7 @@
ENABLE_MPMM_FCONF \
FEATURE_DETECTION \
TRNG_SUPPORT \
+ ENABLE_ERRATA_ALL \
ERRATA_ABI_SUPPORT \
ERRATA_NON_ARM_INTERCONNECT \
CONDITIONAL_CMO \
diff --git a/docs/getting_started/build-options.rst b/docs/getting_started/build-options.rst
index ab0b94d..bcef239 100644
--- a/docs/getting_started/build-options.rst
+++ b/docs/getting_started/build-options.rst
@@ -571,6 +571,11 @@
platform hook needs to be implemented. The value is passed as the last
component of the option ``-fstack-protector-$ENABLE_STACK_PROTECTOR``.
+- ``ENABLE_ERRATA_ALL``: This option is used only for testing purposes, Boolean
+ option to enable the workarounds for all errata that TF-A implements. Normally
+ they should be explicitly enabled depending on each platform's needs. Not
+ recommended for release builds. This option is default set to 0.
+
- ``ENCRYPT_BL31``: Binary flag to enable encryption of BL31 firmware. This
flag depends on ``DECRYPTION_SUPPORT`` build flag.
diff --git a/lib/cpus/cpu-ops.mk b/lib/cpus/cpu-ops.mk
index fb904e2..0db7e94 100644
--- a/lib/cpus/cpu-ops.mk
+++ b/lib/cpus/cpu-ops.mk
@@ -1081,7 +1081,11 @@
endif
# process all flags
+ifeq (${ENABLE_ERRATA_ALL},1)
+$(eval $(call default_ones, $(CPU_FLAG_LIST)))
+else
$(eval $(call default_zeros, $(CPU_FLAG_LIST)))
+endif
$(eval $(call add_defines, $(CPU_FLAG_LIST)))
$(eval $(call assert_booleans, $(CPU_FLAG_LIST)))
diff --git a/make_helpers/defaults.mk b/make_helpers/defaults.mk
index d6c09de..deb89ae 100644
--- a/make_helpers/defaults.mk
+++ b/make_helpers/defaults.mk
@@ -106,6 +106,10 @@
# Flag to enable exception handling in EL3
EL3_EXCEPTION_HANDLING := 0
+# Flag to include all errata for all CPUs TF-A implements workarounds for
+# Its supposed to be used only for testing.
+ENABLE_ERRATA_ALL := 0
+
# By default BL31 encryption disabled
ENCRYPT_BL31 := 0
diff --git a/plat/arm/board/fvp/platform.mk b/plat/arm/board/fvp/platform.mk
index 0156b31..47fd5d3 100644
--- a/plat/arm/board/fvp/platform.mk
+++ b/plat/arm/board/fvp/platform.mk
@@ -212,6 +212,20 @@
lib/cpus/aarch64/cortex_a75.S
endif
+#Include all CPUs to build to support all-errata build.
+ifeq (${ENABLE_ERRATA_ALL},1)
+ BUILD_CPUS_WITH_NO_FVP_MODEL = 1
+ FVP_CPU_LIBS += lib/cpus/aarch64/cortex_a510.S \
+ lib/cpus/aarch64/cortex_a520.S \
+ lib/cpus/aarch64/cortex_a725.S \
+ lib/cpus/aarch64/cortex_x1.S \
+ lib/cpus/aarch64/cortex_x3.S \
+ lib/cpus/aarch64/cortex_x925.S \
+ lib/cpus/aarch64/neoverse_n3.S \
+ lib/cpus/aarch64/neoverse_v2.S \
+ lib/cpus/aarch64/neoverse_v3.S
+endif
+
#Build AArch64-only CPUs with no FVP model yet.
ifeq (${BUILD_CPUS_WITH_NO_FVP_MODEL},1)
FVP_CPU_LIBS += lib/cpus/aarch64/neoverse_n3.S \