summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2023-05-05 15:44:26 +0200
committerSandrine Bailleux <sandrine.bailleux@arm.com>2023-05-15 13:02:24 +0200
commit4eefbf1bf73aed1f48c0dbb06577625d2d0ce953 (patch)
treebe00f68512babfd33912cad17db850411f821060
parent57cc12c85c789f4aef0bf67caa9d984639f916f2 (diff)
downloadarm-trusted-firmware-4eefbf1bf73aed1f48c0dbb06577625d2d0ce953.tar.gz
test(tc): move platform tests in their own function
This is a bit cleaner, as it avoids cluttering the normal boot execution path. It also gives us the opportunity to mark the tests function with the __dead2 attribute, which inform both the compiler and the developer that the test function never returns (since it suspends booting). Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com> Change-Id: I082a34a840ef791a2ac4c1f59b19b32aeb0a9ec7
-rw-r--r--plat/arm/board/tc/tc_bl31_setup.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/plat/arm/board/tc/tc_bl31_setup.c b/plat/arm/board/tc/tc_bl31_setup.c
index ec28f3a1f..184791edc 100644
--- a/plat/arm/board/tc/tc_bl31_setup.c
+++ b/plat/arm/board/tc/tc_bl31_setup.c
@@ -49,11 +49,9 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
fconf_populate("FW_CONFIG", arg1);
}
-void tc_bl31_common_platform_setup(void)
-{
- arm_bl31_platform_setup();
-
#ifdef PLATFORM_TESTS
+static __dead2 void tc_run_platform_tests(void)
+{
#ifdef PLATFORM_TEST_NV_COUNTERS
nv_counter_test();
#elif PLATFORM_TEST_TFM_TESTSUITE
@@ -61,6 +59,15 @@ void tc_bl31_common_platform_setup(void)
#endif
/* Suspend booting, no matter the tests outcome. */
plat_error_handler(-1);
+}
+#endif
+
+void tc_bl31_common_platform_setup(void)
+{
+ arm_bl31_platform_setup();
+
+#ifdef PLATFORM_TESTS
+ tc_run_platform_tests();
#endif
}