diff options
Diffstat (limited to 'lib/efi')
-rw-r--r-- | lib/efi/Kconfig | 34 | ||||
-rw-r--r-- | lib/efi/efi.c | 9 | ||||
-rw-r--r-- | lib/efi/efi_app.c | 10 |
3 files changed, 45 insertions, 8 deletions
diff --git a/lib/efi/Kconfig b/lib/efi/Kconfig index 93b85644920..15ce99e1a74 100644 --- a/lib/efi/Kconfig +++ b/lib/efi/Kconfig @@ -26,18 +26,26 @@ config EFI_STUB endchoice -config EFI_RAM_SIZE - hex "Amount of EFI RAM for U-Boot" +choice + prompt "EFI app 32/64-bit selection" depends on EFI_APP - default 0x2000000 help - Set the amount of EFI RAM which is claimed by U-Boot for its own - use. U-Boot allocates this from EFI on start-up (along with a few - other smaller amounts) and it can never be increased after that. - It is used as the RAM size in with U-Boot. + EFI does not support mixing 32-bit and 64-bit modes. This is a + significant problem because it means that you must build a stub with + the correct type for EFI to load it correctly. If you are using + 32-bit EFI, select 32-bit here, else select 64-bit. Failure to do + this may produce no error message - it just won't start! + +config EFI_APP_32BIT + bool "Produce an app for running with 32-bit EFI" + +config EFI_APP_64BIT + bool "Produce an app for running with 64-bit EFI" + +endchoice choice - prompt "EFI 32/64-bit selection" + prompt "EFI stub 32/64-bit selection" depends on EFI_STUB help EFI does not support mixing 32-bit and 64-bit modes. This is a @@ -53,3 +61,13 @@ config EFI_STUB_64BIT bool "Produce a stub for running with 64-bit EFI" endchoice + +config EFI_RAM_SIZE + hex "Amount of EFI RAM for U-Boot" + depends on EFI_APP + default 0x10000000 + help + Set the amount of EFI RAM which is claimed by U-Boot for its own + use. U-Boot allocates this from EFI on start-up (along with a few + other smaller amounts) and it can never be increased after that. + It is used as the RAM size in with U-Boot. diff --git a/lib/efi/efi.c b/lib/efi/efi.c index 0c16a5fdd38..69e52e45748 100644 --- a/lib/efi/efi.c +++ b/lib/efi/efi.c @@ -18,6 +18,15 @@ #include <efi_api.h> /* + * Global declaration of gd. + * + * As we write to it before relocation we have to make sure it is not put into + * a .bss section which may overlap a .rela section. Initialization forces it + * into a .data section which cannot overlap any .rela section. + */ +struct global_data *global_data_ptr = (struct global_data *)~0; + +/* * Unfortunately we cannot access any code outside what is built especially * for the stub. lib/string.c is already being built for the U-Boot payload * so it uses the wrong compiler flags. Add our own memset() here. diff --git a/lib/efi/efi_app.c b/lib/efi/efi_app.c index 907bacd716a..f61665686c5 100644 --- a/lib/efi/efi_app.c +++ b/lib/efi/efi_app.c @@ -31,11 +31,21 @@ struct efi_system_table *efi_get_sys_table(void) return global_priv->sys_table; } +struct efi_boot_services *efi_get_boot(void) +{ + return global_priv->boot; +} + unsigned long efi_get_ram_base(void) { return global_priv->ram_base; } +int efi_info_get(enum efi_entry_t type, void **datap, int *sizep) +{ + return -ENOSYS; +} + static efi_status_t setup_memory(struct efi_priv *priv) { struct efi_boot_services *boot = priv->boot; |