diff options
Diffstat (limited to 'src/arch/arm64/armv8')
-rw-r--r-- | src/arch/arm64/armv8/secmon/secmon_init.c | 20 | ||||
-rw-r--r-- | src/arch/arm64/armv8/secmon_loader.c | 2 |
2 files changed, 6 insertions, 16 deletions
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(); diff --git a/src/arch/arm64/armv8/secmon_loader.c b/src/arch/arm64/armv8/secmon_loader.c index 59a6ba7e6d..7a6e3ee738 100644 --- a/src/arch/arm64/armv8/secmon_loader.c +++ b/src/arch/arm64/armv8/secmon_loader.c @@ -116,6 +116,8 @@ static void fill_secmon_params(struct secmon_params *p, memset(p, 0, sizeof(*p)); + p->online_cpus = cpus_online(); + spin_attrs = spintable_get_attributes(); if (spin_attrs != NULL) { |