summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2014-11-05 10:23:33 -0600
committerPatrick Georgi <pgeorgi@google.com>2015-04-10 11:57:05 +0200
commitf793d432b9ef562c1a609261faf627d5936d9331 (patch)
tree85843c5eefb27646e3c77489315c26cd84e6e9f7
parent1707a164c9c3d92c0fbbc25efcc392420cc5d1e6 (diff)
arm64: secmon: wait for all CPUs to enter secmon
There is state within the system that relies on having all CPUs present in order to proceed with initialization. The current expectation is that all CPUs are online and entering the secure monitor. Therefore, wait until all CONFIG_MAX_CPUs show up. BUG=chrome-os-partner:32112 BRANCH=None TEST=Can get all CPUs up in kernel using PSCI. Change-Id: I741a09128e99e0cb0c9f4046b1c0d27582fda963 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 030535b7c9821b40bf4a51f88e289eab8af9aa13 Original-Change-Id: Ia0f744c93766efc694b522ab0af9aedf7329ac43 Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/227547 Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: http://review.coreboot.org/9394 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r--src/arch/arm64/armv8/secmon/secmon_init.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/arch/arm64/armv8/secmon/secmon_init.c b/src/arch/arm64/armv8/secmon/secmon_init.c
index 2ec2f136f7..fb3422f48b 100644
--- a/src/arch/arm64/armv8/secmon/secmon_init.c
+++ b/src/arch/arm64/armv8/secmon/secmon_init.c
@@ -53,6 +53,24 @@ static void cpu_init(int bsp)
cpu_set_bsp();
}
+static void wait_for_all_cpus(void)
+{
+ int all_online;
+
+ while (1) {
+ int i;
+
+ all_online = 1;
+ for (i = 0; i < CONFIG_MAX_CPUS; i++) {
+ if (!cpu_online(cpu_info_for_cpu(i)))
+ all_online = 0;
+ }
+
+ if (all_online)
+ break;
+ }
+}
+
static void secmon_init(struct secmon_params *params, int bsp)
{
struct cpu_action action = {
@@ -67,6 +85,9 @@ static void secmon_init(struct secmon_params *params, int bsp)
if (!cpu_is_bsp())
secmon_wait_for_action();
+ /* Wait for all CPUs to enter secmon. */
+ wait_for_all_cpus();
+
smc_init();
psci_init();