summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-11-25 17:39:54 -0500
committerTom Rini <trini@konsulko.com>2016-11-25 17:39:54 -0500
commited77ccd014b4073c4d282028cfb22f8d1742fec1 (patch)
tree0d3cf0fd0e45bf10c7897a24f3560589f7740e20 /cmd
parent136179bec19f4bc84227cba138214ea392a723ea (diff)
parent020198b0c7d251cf6bde76024ecf0ee711860534 (diff)
downloadu-boot-imx-ed77ccd014b4073c4d282028cfb22f8d1742fec1.zip
u-boot-imx-ed77ccd014b4073c4d282028cfb22f8d1742fec1.tar.gz
u-boot-imx-ed77ccd014b4073c4d282028cfb22f8d1742fec1.tar.bz2
Merge git://git.denx.de/u-boot-fsl-qoriq
Signed-off-by: Tom Rini <trini@konsulko.com> Conflicts: arch/arm/Kconfig
Diffstat (limited to 'cmd')
-rw-r--r--cmd/bootefi.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index ca41170..97a0fc9 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -141,6 +141,18 @@ static void *copy_fdt(void *fdt)
return new_fdt;
}
+#ifdef CONFIG_ARM64
+static unsigned long efi_run_in_el2(ulong (*entry)(void *image_handle,
+ struct efi_system_table *st), void *image_handle,
+ struct efi_system_table *st)
+{
+ /* Enable caches again */
+ dcache_enable();
+
+ return entry(image_handle, st);
+}
+#endif
+
/*
* Load an EFI payload into a newly allocated piece of memory, register all
* EFI objects it would want to access and jump to it.
@@ -231,9 +243,14 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
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();
+
+ /* Move into EL2 and keep running there */
+ armv8_switch_to_el2((ulong)entry, (ulong)&loaded_image_info,
+ (ulong)&systab, (ulong)efi_run_in_el2,
+ ES_TO_AARCH64);
+
+ /* Should never reach here, efi exits with longjmp */
+ while (1) { }
}
#endif