Make GICv2 spurious interrupt test platform-agnostic
This test was pinned to Juno and was not included for other
platforms. In reality, it only relies on a GICv2 to be present but
does nothing specific to Juno beyond that.
Instead, we now dynamically detect the GIC version inside the test
function and skip it if it is not GICv2. The test is now part of the
generic TSP testsuite.
With the test being available to all platforms, the Juno tests XML
file is now empty, as it only contained this one test. Therefore, we
remove it.
Change-Id: I8b8f0eac905cfff8a87a2305cb2abf4bb9353ef1
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
diff --git a/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c b/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c
index fd6a14a..7674840 100644
--- a/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c
+++ b/tftf/tests/runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c
@@ -8,6 +8,7 @@
#include <arm_gic.h>
#include <debug.h>
#include <events.h>
+#include <gic_common.h>
#include <gic_v2.h>
#include <irq.h>
#include <plat_topology.h>
@@ -53,8 +54,8 @@
return 0;
}
-/* Helper function for test_juno_multicore_spurious_interrupt. */
-static test_result_t test_juno_multicore_spurious_interrupt_non_lead_fn(void)
+/* Helper function for test_multicore_spurious_interrupt. */
+static test_result_t test_multicore_spurious_interrupt_non_lead_fn(void)
{
test_result_t result = TEST_RESULT_SUCCESS;
u_register_t mpid = read_mpidr_el1() & MPID_MASK;
@@ -134,7 +135,7 @@
*
* Returns SUCCESS if all steps succeed, else failure.
*/
-test_result_t test_juno_multicore_spurious_interrupt(void)
+test_result_t test_multicore_spurious_interrupt(void)
{
int i, j;
u_register_t cpu_mpid;
@@ -148,6 +149,11 @@
SKIP_TEST_IF_TSP_NOT_PRESENT();
+ if (is_gicv3_mode()) {
+ tftf_testcase_printf("Detected GICv3. Need GICv2.\n");
+ return TEST_RESULT_SKIPPED;
+ }
+
ret = tftf_irq_register_handler(GIC_SPURIOUS_INTERRUPT,
test_spurious_handler);
if (ret != 0) {
@@ -178,7 +184,7 @@
continue;
psci_ret = tftf_cpu_on(cpu_mpid,
- (uintptr_t)test_juno_multicore_spurious_interrupt_non_lead_fn, 0);
+ (uintptr_t)test_multicore_spurious_interrupt_non_lead_fn, 0);
if (psci_ret != PSCI_E_SUCCESS) {
tftf_testcase_printf(
"Failed to power on CPU 0x%x (%d)\n",
diff --git a/tftf/tests/tests-tsp.xml b/tftf/tests/tests-tsp.xml
index e98df5f..7e1018e 100644
--- a/tftf/tests/tests-tsp.xml
+++ b/tftf/tests/tests-tsp.xml
@@ -21,6 +21,7 @@
<testcase name="Resume STD SMC from different CPUs" function="test_resume_different_cpu_preempted_std_smc" />
<testcase name="Resume preempted STD SMC after PSCI CPU OFF/ON cycle" function="test_psci_cpu_on_off_preempted_std_smc" />
<testcase name="Resume preempted STD SMC after PSCI SYSTEM SUSPEND" function="test_psci_system_suspend_preempted_std_smc" />
+ <testcase name="Multicore spurious interrupt test" function="test_multicore_spurious_interrupt" />
</testsuite>
<testsuite name="TSP handler standard functions result test" description="Validate TSP SMC standard function call">
diff --git a/tftf/tests/tests.mk b/tftf/tests/tests.mk
index 8ee8cc2..f3b7ab0 100644
--- a/tftf/tests/tests.mk
+++ b/tftf/tests/tests.mk
@@ -71,6 +71,7 @@
runtime_services/standard_service/sdei/system_tests/test_sdei.c \
runtime_services/standard_service/sdei/system_tests/test_sdei_state.c \
runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c \
+ runtime_services/trusted_os/tsp/test_irq_spurious_gicv2.c \
runtime_services/trusted_os/tsp/test_normal_int_switch.c \
runtime_services/trusted_os/tsp/test_smc_tsp_std_fn_call.c \
runtime_services/trusted_os/tsp/test_tsp_fast_smc.c \