From 931a218d685610d85b570b72889b341270e2d00a Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 5 Nov 2014 11:19:21 -0600 Subject: arm64: secmon: pass online CPUs to secmon Instead of relying on CONFIG_MAX_CPUS to be the number of CPUs running a platform pass the number of online cpus from coreboot secmon. That allows for actually enabled CPUs < CONFIG_MAX_CPUS. BUG=chrome-os-partner:32112 BRANCH=None TEST=Booted SMP kernel. Change-Id: Iaf1591e77fcb5ccf5fe271b6c84ea8866e19c59d Signed-off-by: Patrick Georgi Original-Commit-Id: 3827af876c247fc42cd6be5dd67f8517457b36e7 Original-Change-Id: Ice10b8ab45bb1190a42678e67776846eec4eb79a Original-Signed-off-by: Aaron Durbin Original-Reviewed-on: https://chromium-review.googlesource.com/227529 Original-Reviewed-by: Furquan Shaikh Reviewed-on: http://review.coreboot.org/9397 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/arch/arm64/armv8/secmon/secmon_init.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/arch/arm64/armv8/secmon') diff --git a/src/arch/arm64/armv8/secmon/secmon_init.c b/src/arch/arm64/armv8/secmon/secmon_init.c index 9e104c759b..3405027f2f 100644 --- a/src/arch/arm64/armv8/secmon/secmon_init.c +++ b/src/arch/arm64/armv8/secmon/secmon_init.c @@ -58,22 +58,10 @@ static void cpu_init(int bsp) cpu_set_bsp(); } -static void wait_for_all_cpus(void) +static void wait_for_all_cpus(size_t expected) { - 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; - } + while (cpus_online() != expected) + ; } static void secmon_init(struct secmon_params *params, int bsp) @@ -90,7 +78,7 @@ static void secmon_init(struct secmon_params *params, int bsp) secmon_wait_for_action(); /* Wait for all CPUs to enter secmon. */ - wait_for_all_cpus(); + wait_for_all_cpus(params->online_cpus); smc_init(); psci_init(); -- cgit v1.2.3