diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-05-04 11:47:48 +0200 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-05-07 21:10:03 +0200 |
commit | 52cbac9b06bf247dda8ff261b15e3c13f88188db (patch) | |
tree | 8e6cb4e6d687c637209ec86ee297d3d86f6dac24 /lib/efi_loader/efi_setup.c | |
parent | 44237e272f1eac3b026709e76333a07b2d3a3523 (diff) |
efi_loader: clean up UEFI sub-system initialization
allow_unaligned(), switch_to_non_secure_mode(), and efi_init_obj_list() are
called in sequence in multiple places.
Move calls to allow_unaligned() and switch_to_non_secure_mode() to
efi_init_obj_list().
Remove unused includes.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader/efi_setup.c')
-rw-r--r-- | lib/efi_loader/efi_setup.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c index 87db51cbb7..8691d686d2 100644 --- a/lib/efi_loader/efi_setup.c +++ b/lib/efi_loader/efi_setup.c @@ -6,12 +6,22 @@ */ #include <common.h> +#include <bootm.h> #include <efi_loader.h> #define OBJ_LIST_NOT_INITIALIZED 1 static efi_status_t efi_obj_list_initialized = OBJ_LIST_NOT_INITIALIZED; +/* + * Allow unaligned memory access. + * + * This routine is overridden by architectures providing this feature. + */ +void __weak allow_unaligned(void) +{ +} + /** * efi_init_platform_lang() - define supported languages * @@ -86,6 +96,12 @@ efi_status_t efi_init_obj_list(void) if (efi_obj_list_initialized != OBJ_LIST_NOT_INITIALIZED) return efi_obj_list_initialized; + /* Allow unaligned memory access */ + allow_unaligned(); + + /* On ARM switch from EL3 or secure mode to EL2 or non-secure mode */ + switch_to_non_secure_mode(); + /* Define supported languages */ ret = efi_init_platform_lang(); if (ret != EFI_SUCCESS) |