diff options
author | Aaron Durbin <adurbin@chromium.org> | 2014-09-18 13:48:49 -0500 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-03-28 07:05:35 +0100 |
commit | dee1996d6c3b4006f4e1d93ab1ffbcb98e30800f (patch) | |
tree | 44c348c2a3ebab967142f742414dea5b2d7b6d1b /src/arch/arm64/c_entry.c | |
parent | b30c9b1c9a676c3b85ac1de9cbc1c5f4424d6297 (diff) |
arm64: provide entry points for BSP and non-BSP
It's helpful to differentiate the startup paths for
the BSP and the non-BSP. Therefore have c_entry
be an 2 element array of function pointers. The
non-BSP paths have an entry point one instruction after
stage/module entry.
BUG=chrome-os-partner:30785
BRANCH=None
TEST=Built and booted to kernel.
Change-Id: I40bb40462906f1b1eaf2db8584985095e8ac0bae
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: ce10f954041b3fd581ad8a3d82dee567b68637fe
Original-Change-Id: Ia573b1095dca5f69e371bf1ddf6b6df72fa3b52e
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/218844
Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/9090
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch/arm64/c_entry.c')
-rw-r--r-- | src/arch/arm64/c_entry.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/arch/arm64/c_entry.c b/src/arch/arm64/c_entry.c index f4a9848ee1..5e3dfe871d 100644 --- a/src/arch/arm64/c_entry.c +++ b/src/arch/arm64/c_entry.c @@ -24,13 +24,6 @@ #include <arch/stages.h> #include "cpu-internal.h" -/* - * This variable holds entry point for CPUs starting up. Before the other - * CPUs are brought up this value will change to provide the secondary - * code path. - */ -void (*c_entry)(void) = &arm64_init; - void __attribute__((weak)) arm64_soc_init(void) { /* Default weak implementation does nothing. */ @@ -54,7 +47,7 @@ static void seed_stack(void) *slot++ = 0xdeadbeefdeadbeefULL; } -void arm64_init(void) +static void arm64_init(void) { cpu_set_bsp(); seed_stack(); @@ -71,11 +64,15 @@ static void secondary_cpu_start(void) arch_secondary_cpu_init(); } +/* + * This variable holds entry point for CPUs starting up. The first + * element is the BSP path, and the second is the non-BSP path. + */ +void (*c_entry[2])(void) = { &arm64_init, &secondary_cpu_start }; + extern void arm64_cpu_startup(void); + void *prepare_secondary_cpu_startup(void) { - c_entry = &secondary_cpu_start; - dcache_clean_invalidate_by_mva(c_entry, sizeof(c_entry)); - - return &arm64_cpu_startup; + return secondary_entry_point(&arm64_cpu_startup); } |