summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_memory.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-11-14 09:48:26 -0500
committerTom Rini <trini@konsulko.com>2019-11-14 09:51:39 -0500
commit14b254b5f5a841e1227e3667cf94fbcdadaf720e (patch)
tree644eb1e21e312831970bbd682bd2fa3a6378e5c1 /lib/efi_loader/efi_memory.c
parentcffda7ddb84e4b1d99777f362410cedf058108f0 (diff)
parent2e716b8e299309139daa9513707951c622fc2bdf (diff)
Merge tag 'efi-2020-01-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2020-01-rc3 The following changes for the UEFI subsystem are provided: * allow building UEFI binaries on the sandbox * enable access to file systems without partition tables * correctly check the return value of efi_dp_from_file()
Diffstat (limited to 'lib/efi_loader/efi_memory.c')
-rw-r--r--lib/efi_loader/efi_memory.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 83cbc9154f3..d46001f608b 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -738,8 +738,10 @@ static void add_u_boot_and_runtime(void)
unsigned long uboot_stack_size = 16 * 1024 * 1024;
/* Add U-Boot */
- uboot_start = (gd->start_addr_sp - uboot_stack_size) & ~EFI_PAGE_MASK;
- uboot_pages = (gd->ram_top - uboot_start) >> EFI_PAGE_SHIFT;
+ uboot_start = ((uintptr_t)map_sysmem(gd->start_addr_sp, 0) -
+ uboot_stack_size) & ~EFI_PAGE_MASK;
+ uboot_pages = ((uintptr_t)map_sysmem(gd->ram_top - 1, 0) -
+ uboot_start + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
efi_add_memory_map(uboot_start, uboot_pages, EFI_LOADER_DATA, false);
#if defined(__aarch64__)
@@ -767,8 +769,7 @@ int efi_memory_init(void)
{
efi_add_known_memory();
- if (!IS_ENABLED(CONFIG_SANDBOX))
- add_u_boot_and_runtime();
+ add_u_boot_and_runtime();
#ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER
/* Request a 32bit 64MB bounce buffer region */