summaryrefslogtreecommitdiff
path: root/arch/x86/lib/e820.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-09-10 08:52:00 -0400
committerTom Rini <trini@konsulko.com>2019-09-10 08:52:00 -0400
commit001c8ea94ae710d8340829237a7d788b25ce2ae7 (patch)
treebbc7a63fc5958c9f1aa7715809d13407dcaa390d /arch/x86/lib/e820.c
parent3aec234e3f0a35c5d07ae5bb8d4c8dfea4aaf204 (diff)
parentdd4faa964f0741c314b4f1c09f27c07aedc5cdf0 (diff)
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
- Tangier ACPI table fixes - Support getting high memory size on QEMU x86 - Show UEFI images involved in crash for x86 - EFI loader conventional memory map fix
Diffstat (limited to 'arch/x86/lib/e820.c')
-rw-r--r--arch/x86/lib/e820.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/arch/x86/lib/e820.c b/arch/x86/lib/e820.c
index d6ae2c4e9d7..26da4d2f278 100644
--- a/arch/x86/lib/e820.c
+++ b/arch/x86/lib/e820.c
@@ -41,14 +41,17 @@ void efi_add_known_memory(void)
{
struct e820_entry e820[E820MAX];
unsigned int i, num;
- u64 start, pages;
+ u64 start, pages, ram_top;
int type;
num = install_e820_map(ARRAY_SIZE(e820), e820);
+ ram_top = (u64)gd->ram_top & ~EFI_PAGE_MASK;
+ if (!ram_top)
+ ram_top = 0x100000000ULL;
+
for (i = 0; i < num; ++i) {
start = e820[i].addr;
- pages = ALIGN(e820[i].size, EFI_PAGE_SIZE) >> EFI_PAGE_SHIFT;
switch (e820[i].type) {
case E820_RAM:
@@ -69,7 +72,15 @@ void efi_add_known_memory(void)
break;
}
- efi_add_memory_map(start, pages, type, false);
+ if (type == EFI_CONVENTIONAL_MEMORY) {
+ efi_add_conventional_memory_map(start,
+ start + e820[i].size,
+ ram_top);
+ } else {
+ pages = ALIGN(e820[i].size, EFI_PAGE_SIZE)
+ >> EFI_PAGE_SHIFT;
+ efi_add_memory_map(start, pages, type, false);
+ }
}
}
#endif /* CONFIG_IS_ENABLED(EFI_LOADER) */