From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Thu, 13 Jun 2019 07:48:09 +0200 Subject: [U-Boot] mvebu: reserve SRAM memory on Marvell Armada 3700/7K/8K In-Reply-To: <20190611110036.GA51937@thor.local> References: <63321798f8798524@bloch.sibelius.xs4all.nl> <20190204165100.GA5226@nyx.local> <11967db9-9a3c-178d-ffb1-9cb0d17118b5@suse.de> <20190611110036.GA51937@thor.local> Message-ID: <9d0fd783-70b3-1680-695c-a53951ca117f@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Added Heinrich to Cc (and use Alex's new address) On 11.06.19 13:00, Patrick Wildt wrote: > 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 > > 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 > #include > #include > +#include > > 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; > } > I would like to see some comments from the U-Boot "EFI guys", if this is the correct approach. I remember some discussions about using "reserved-memory" in the DT for this but I might be wrong here. Any comments? Thanks, Stefan