[U-Boot] mvebu: reserve SRAM memory on Marvell Armada 3700/7K/8K

Patrick Wildt patrick at blueri.se
Tue Jun 11 11:00:37 UTC 2019


The ARM-TF and the optional OP-TEE use the memory region 0x4000000
to 0x5400000 and should be reserved in the memory map, otherwise the
OS might wrongly assume that it can use that memory area for itself.
This has also been done in EDK2 [0].

[0] https://github.com/tianocore/edk2-platforms/commit/bf1c4a2cf8024669d1748e78c7e417433f85707e

Signed-off-by: Patrick Wildt <patrick at blueri.se>

diff --git a/arch/arm/mach-mvebu/arm64-common.c b/arch/arm/mach-mvebu/arm64-common.c
index aaf7b7c447..7572aad8c9 100644
--- a/arch/arm/mach-mvebu/arm64-common.c
+++ b/arch/arm/mach-mvebu/arm64-common.c
@@ -14,6 +14,7 @@
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/armv8/mmu.h>
+#include <efi_loader.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -142,5 +143,11 @@ int arch_early_init_r(void)
 	pci_init();
 #endif
 
+#ifdef CONFIG_EFI_LOADER
+	/* Reserve trusted SRAM section */
+	efi_add_memory_map(0x04000000, 0x01400000 >> EFI_PAGE_SHIFT,
+			   EFI_RESERVED_MEMORY_TYPE, false);
+#endif
+
 	return 0;
 }


More information about the U-Boot mailing list