diff options
-rw-r--r-- | src/arch/arm64/c_entry.c | 8 | ||||
-rw-r--r-- | src/arch/arm64/stage_entry.S | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/arch/arm64/c_entry.c b/src/arch/arm64/c_entry.c index f08a5853f4..3e9d44e4af 100644 --- a/src/arch/arm64/c_entry.c +++ b/src/arch/arm64/c_entry.c @@ -20,6 +20,14 @@ #include <arch/stages.h> #include <arch/cpu.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. */ diff --git a/src/arch/arm64/stage_entry.S b/src/arch/arm64/stage_entry.S index 86136555dc..e323de5d96 100644 --- a/src/arch/arm64/stage_entry.S +++ b/src/arch/arm64/stage_entry.S @@ -99,7 +99,13 @@ ENTRY(arm64_c_environment) bl cpu_get_stack mov sp, x0 - b arm64_init + /* Get entry point by dereferencing c_entry. */ + ldr x0, 1f + ldr x0, [x0] + br x0 +.align 3 + 1: + .quad c_entry ENDPROC(arm64_c_environment) CPU_RESET_ENTRY(arm64_cpu_startup) |