i2c: synquacer: SNI Synquacer I2C controller
[platform/kernel/u-boot.git] / cmd / bootefi.c
index c8eb5c3..cba81ff 100644 (file)
@@ -8,6 +8,7 @@
 #define LOG_CATEGORY LOGC_EFI
 
 #include <common.h>
+#include <bootm.h>
 #include <charset.h>
 #include <command.h>
 #include <dm.h>
@@ -18,6 +19,7 @@
 #include <image.h>
 #include <log.h>
 #include <malloc.h>
+#include <asm/global_data.h>
 #include <linux/libfdt.h>
 #include <linux/libfdt_env.h>
 #include <mapmem.h>
@@ -71,7 +73,7 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path,
        /* Remember only PE-COFF and FIT images */
        if (efi_check_pe(buffer, buffer_size, NULL) != EFI_SUCCESS) {
 #ifdef CONFIG_FIT
-               if (!fit_check_format(buffer))
+               if (fit_check_format(buffer, IMAGE_SIZE_INVAL))
                        return;
                /*
                 * FIT images of type EFI_OS are started via command bootm.
@@ -338,6 +340,9 @@ static efi_status_t do_bootefi_exec(efi_handle_t handle, void *load_options)
        efi_uintn_t exit_data_size = 0;
        u16 *exit_data = NULL;
 
+       /* On ARM switch from EL3 or secure mode to EL2 or non-secure mode */
+       switch_to_non_secure_mode();
+
        /* Call our payload! */
        ret = EFI_CALL(efi_start_image(handle, &exit_data_size, &exit_data));
        if (ret != EFI_SUCCESS) {
@@ -353,6 +358,9 @@ static efi_status_t do_bootefi_exec(efi_handle_t handle, void *load_options)
 
        free(load_options);
 
+       if (IS_ENABLED(CONFIG_EFI_LOAD_FILE2_INITRD))
+               efi_initrd_deregister();
+
        return ret;
 }