diff options
author | Aaron Durbin <adurbin@chromium.org> | 2014-11-05 10:48:16 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-04-10 11:57:09 +0200 |
commit | be3e2387c6e01cf5dd2346aa0f12e35d8229f2a6 (patch) | |
tree | c2089ddeabf73413b2e0a2d657f619e5d54fc774 /src/arch/arm64/armv8/secmon/secmon_init.c | |
parent | f793d432b9ef562c1a609261faf627d5936d9331 (diff) |
arm64: secmon: prepare for passing more state into secmon
The current implementation of secmon assumes just entry/arg
are passed to secmon for starting up a CPU. That's lacking
in flexibility. Therefore change secmon_params to contain
both the BSP and secondary CPUs' entry/arg information.
That way more information can be added to secmon_params when
needed.
BUG=chrome-os-partner:32112
BRANCH=None
TEST=Built and booted SMP kernel using PSCI and spin table.
Change-Id: I84c478ccefdfa4580fcc078a2491f49f86a9757a
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: c5fb5bd857a4318174f5b9b48e28406e60a466f8
Original-Change-Id: Iafb82d5cabc806b6625799a6b3dff8d77bdb27e9
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/227548
Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/9395
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch/arm64/armv8/secmon/secmon_init.c')
-rw-r--r-- | src/arch/arm64/armv8/secmon/secmon_init.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/arch/arm64/armv8/secmon/secmon_init.c b/src/arch/arm64/armv8/secmon/secmon_init.c index fb3422f48b..8fd39176f8 100644 --- a/src/arch/arm64/armv8/secmon/secmon_init.c +++ b/src/arch/arm64/armv8/secmon/secmon_init.c @@ -30,16 +30,21 @@ #include <stddef.h> #include "secmon.h" -/* Save initial secmon params per CPU to handle turn up. */ -static struct secmon_params *init_params[CONFIG_MAX_CPUS]; - static void start_up_cpu(void *arg) { - struct secmon_params *params = init_params[cpu_info()->id]; + struct secmon_params *params = arg; + struct cpu_action *action; + + if (cpu_is_bsp()) + action = ¶ms->bsp; + else + action = ¶ms->secondary; + - if (params == NULL) + if (action->run == NULL) psci_turn_off_self(); - psci_turn_on_self(params->entry, params->arg); + + psci_turn_on_self(action->run, action->arg); } static void cpu_init(int bsp) @@ -75,13 +80,12 @@ static void secmon_init(struct secmon_params *params, int bsp) { struct cpu_action action = { .run = start_up_cpu, + .arg = params, }; exception_hwinit(); cpu_init(bsp); - init_params[cpu_info()->id] = params; - if (!cpu_is_bsp()) secmon_wait_for_action(); @@ -94,7 +98,7 @@ static void secmon_init(struct secmon_params *params, int bsp) /* Make sure all non-BSP CPUs take action before the BSP. */ arch_run_on_all_cpus_but_self_async(&action); /* Turn on BSP. */ - start_up_cpu(NULL); + start_up_cpu(params); printk(BIOS_ERR, "CPU turn on failed for BSP.\n"); while (1) |