summaryrefslogtreecommitdiff
path: root/lib/psci
diff options
context:
space:
mode:
authordavidcunado-arm <david.cunado@arm.com>2017-05-11 16:04:52 +0100
committerGitHub <noreply@github.com>2017-05-11 16:04:52 +0100
commitd6104f5ab4e68f92cf97f6a3e55395c71ed137ac (patch)
tree4c9488add4622ce77fc328e34efe6f4bb7289873 /lib/psci
parent78b7134927422425bcad3413cf78783e3eaf633c (diff)
parentb10d44995eb652675863c2cc6a7726683613da0d (diff)
Merge pull request #927 from jeenu-arm/state-switch
Execution state switch
Diffstat (limited to 'lib/psci')
-rw-r--r--lib/psci/psci_common.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c
index 5b0e314f..763de046 100644
--- a/lib/psci/psci_common.c
+++ b/lib/psci/psci_common.c
@@ -892,6 +892,27 @@ void psci_print_power_domain_map(void)
#endif
}
+/******************************************************************************
+ * Return whether any secondaries were powered up with CPU_ON call. A CPU that
+ * have ever been powered up would have set its MPDIR value to something other
+ * than PSCI_INVALID_MPIDR. Note that MPDIR isn't reset back to
+ * PSCI_INVALID_MPIDR when a CPU is powered down later, so the return value is
+ * meaningful only when called on the primary CPU during early boot.
+ *****************************************************************************/
+int psci_secondaries_brought_up(void)
+{
+ int idx, n_valid = 0;
+
+ for (idx = 0; idx < ARRAY_SIZE(psci_cpu_pd_nodes); idx++) {
+ if (psci_cpu_pd_nodes[idx].mpidr != PSCI_INVALID_MPIDR)
+ n_valid++;
+ }
+
+ assert(n_valid);
+
+ return (n_valid > 1);
+}
+
#if ENABLE_PLAT_COMPAT
/*******************************************************************************
* PSCI Compatibility helper function to return the 'power_state' parameter of