Skip to content
Snippets Groups Projects
Commit 69bd459d authored by Alexander Graf's avatar Alexander Graf
Browse files

efi_loader: AArch64: Run EFI payloads in EL2 if U-Boot runs in EL3


Some boards decided not to run ATF or other secure firmware in EL3, so
they instead run U-Boot there. The uEFI spec doesn't know what EL3 is
though - it only knows about EL2 and EL1. So if we see that we're running
in EL3, let's get into EL2 to make payloads happy.

Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
Reviewed-by: default avatarYork Sun <york.sun@nxp.com>
parent 58ad8628
No related branches found
No related tags found
No related merge requests found
......@@ -226,6 +226,17 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
return status == EFI_SUCCESS ? 0 : -EINVAL;
}
#ifdef CONFIG_ARM64
/* On AArch64 we need to make sure we call our payload in < EL3 */
if (current_el() == 3) {
smp_kick_all_cpus();
dcache_disable(); /* flush cache before switch to EL2 */
armv8_switch_to_el2();
/* Enable caches again */
dcache_enable();
}
#endif
return entry(&loaded_image_info, &systab);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment