efi: stub: add known memory to U-Boot's EFI memory map

When running U-Boot as an EFI payload with CONFIG_EFI_STUB, the reserved
regions from the previous stage EFI bootloader should be carried over
since they may not fully align with the reserved-memory regions in
devicetree.

Implement a helper to map these pages when the EFI subsystem starts up.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
This commit is contained in:
Caleb Connolly
2024-11-24 21:27:03 +01:00
committed by Simon Glass
parent 8cb8d63b43
commit de6dd73b4e
3 changed files with 43 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
#include <efi_loader.h>
#include <efi_log.h>
#include <efi_stub.h>
#include <init.h>
#include <lmb.h>
#include <log.h>
@@ -830,6 +831,10 @@ int efi_memory_init(void)
{
efi_add_known_memory();
#ifdef CONFIG_EFI_STUB
efi_add_known_memory_from_efi();
#endif
add_u_boot_and_runtime();
#ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER