test(psci): add test to validate "psci_is_last_cpu_to_idle_at_pwrlvl"
* This patch adds a test that suspends to affinity level 2 with another
CPU running in a different power domain.
* Previously with the bug identified and resolved in commit (01959a1),
the function "psci_is_last_cpu_to_idle_at_pwrlvl" checked only one
power domain when suspending to level2. This meant that if there was
a cpu running outside the power domain of the calling CPU, the suspend
request would be allowed. But in this case, the request should be
denied. This test case validates this behaviour and ensures the
request is denied.
* This patch also adds the following global variables to parameterise
and reuse the existing functions for the new test.
* test_should_suspend - an boolean array that allows you to leave
some CPUs running.
* test_should_deny - a boolean to specify if the suspend request
should be denied.
* cpu_finished - an array of events so that the running CPUs know
when to terminate.
* Additionally this patch also adds a function to get a CPU that is
in a different cluster to the lead CPU.
Refer to TF-A commit (01959a1) for more information on the bug.
Change-Id: Ib163aa8d5347baeaa47d1ae6f59599f1c68c11a8
Signed-off-by: Charlie Bareham <charlie.bareham@arm.com>
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
diff --git a/include/plat/common/plat_topology.h b/include/plat/common/plat_topology.h
index fbae878..ceb9eb5 100644
--- a/include/plat/common/plat_topology.h
+++ b/include/plat/common/plat_topology.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2025, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -181,6 +181,13 @@
unsigned int tftf_find_any_cpu_other_than(unsigned int exclude_mpid);
/*
+ * Query the platform topology to find another CPU that is in a different
+ * cluster to the one specified as an argument.
+ * Return the MPID of this other CPU, or INVALID_MPID if none could be found.
+ */
+unsigned int tftf_find_any_cpu_in_other_cluster(unsigned int exclude_mpid);
+
+/*
* Query the platform topology to find a random CPU other than the one specified
* as an argument.
* The difference between this function and tftf_find_any_cpu_other_than is