X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=cmd%2Fbootefi.c;h=3b777058f4a2432db90cc353e66b48f35820e9e9;hb=3b95902d47f89f95242ac143cd2a9ed1fd196157;hp=ca411702baed83b49c31186926d57bb963f8b2bc;hpb=c2cbd164ea5b5f564fcf03447c7bf9ec4a9f5699;p=oweals%2Fu-boot.git diff --git a/cmd/bootefi.c b/cmd/bootefi.c index ca411702ba..3b777058f4 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, 0, (ulong)efi_run_in_el2, + ES_TO_AARCH64); + + /* Should never reach here, efi exits with longjmp */ + while (1) { } } #endif @@ -304,7 +321,7 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path) char devname[32] = { 0 }; /* dp->str is u16[32] long */ char *colon; -#if defined(CONFIG_BLK) || defined(CONFIG_ISO_PARTITION) +#if defined(CONFIG_BLK) || CONFIG_IS_ENABLED(ISO_PARTITION) desc = blk_get_dev(dev, simple_strtol(devnr, NULL, 10)); #endif @@ -321,7 +338,7 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path) colon = strchr(devname, ':'); -#ifdef CONFIG_ISO_PARTITION +#if CONFIG_IS_ENABLED(ISO_PARTITION) /* For ISOs we create partition block devices */ if (desc && (desc->type != DEV_TYPE_UNKNOWN) && (desc->part_type == PART_TYPE_ISO)) {