diff options
author | Julius Werner <jwerner@chromium.org> | 2015-05-07 16:59:31 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-05-19 20:33:40 +0200 |
commit | 786b1224795b76889e5eb10644b5102646f4c24b (patch) | |
tree | dc6f27b1f8095bf4f1cc29fbf064433a31f37572 /src/arch | |
parent | f1df50edf3dd9b605f35495287101e8708a69d33 (diff) |
arm64: Reorganize payload entry code and related Kconfigs
This patch slightly reorganizes arm64/boot.c with the aim of being more
readable: the secure monitor entry is now guarded by an explicit if
statement for its Kconfig rather than hiding than in the corresponding
header file. This makes it clear that there are two (soon three)
separate code paths here.
Change-Id: I44993da7a982b08f485b93ffc522d193bb3fa118
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 5067e47bc03f04ad2dba044f022716e0fc62bb9e
Original-Change-Id: I1b2038acc0d054716a3c580ce97ea8e9a45abfa2
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/270783
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/10243
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm64/boot.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/arch/arm64/boot.c b/src/arch/arm64/boot.c index f62ceb66ef..1fdc234fd1 100644 --- a/src/arch/arm64/boot.c +++ b/src/arch/arm64/boot.c @@ -40,27 +40,29 @@ static void run_payload(struct prog *prog) printk(BIOS_SPEW, "entry = %p\n", doit); - secmon_run(doit, arg); + if (IS_ENABLED(CONFIG_ARM64_USE_SECURE_MONITOR)) + secmon_run(doit, arg); + else { + /* Start the other CPUs spinning. */ + spintable_start(); - /* Start the other CPUs spinning. */ - spintable_start(); + /* If current EL is not EL3, jump to payload at same EL. */ + if (current_el != EL3) { + cache_sync_instructions(); + /* Point of no-return */ + doit(arg); + } - /* If current EL is not EL3, jump to payload at same EL. */ - if (current_el != EL3) { - cache_sync_instructions(); - /* Point of no-return */ - doit(arg); - } - - /* If current EL is EL3, we transition to payload in EL2. */ - struct exc_state exc_state; + /* If current EL is EL3, we transition to payload in EL2. */ + struct exc_state exc_state; - memset(&exc_state, 0, sizeof(exc_state)); + memset(&exc_state, 0, sizeof(exc_state)); - exc_state.elx.spsr = get_eret_el(EL2, SPSR_USE_L); + exc_state.elx.spsr = get_eret_el(EL2, SPSR_USE_L); - cache_sync_instructions(); - transition_with_entry(doit, arg, &exc_state); + cache_sync_instructions(); + transition_with_entry(doit, arg, &exc_state); + } } void arch_prog_run(struct prog *prog) |