You've already forked edk2-platforms
mirror of
https://github.com/Dasharo/edk2-platforms.git
synced 2026-03-06 14:51:43 -08:00
This patch improves memory initialization for the Raspberry Pi Platform by: Using VideoCore mailbox data to reserve only the regions that are actually mapped. Especially, besides the base RAM size, which was already set using VideoCore data, we can set the GPU/VideoCore base address as well as the extended RAM, which is the memory beyond 1 GB that is available on models such as the Raspberry Pi 4 (for the 2GB or 4GB versions). Introducing a new PcdExtendedMemoryBase PCD for the base address of the extended memory region, which currently cannot be retrieved from VideoCore (MBOX_GET_ARM_MEMSIZE still only returns a single region on Bcm2711). Introducing a new RpiPlatformGetVirtualMemoryInfo() companion call to ArmPlatformGetVirtualMemoryMap() that allows us greatly simplify the registration of each segment in MemoryPeim() as well as making it easier to maintain for future models. We also fix SoC register space that should have been marked as reserved but wasn't until now and remove the unreferenced mSystemMemoryEnd extern in MemoryInitPeiLib.c. RaspberryPiMem.c incorporates some code from ArmJunoMem.c. Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
47 lines
1.0 KiB
INI
47 lines
1.0 KiB
INI
#/** @file
|
|
#
|
|
# Copyright (c) 2016, Linaro, Ltd. All rights reserved.
|
|
# Copyright (c) 2011-2014, ARM Ltd. All rights reserved.
|
|
#
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
#
|
|
#**/
|
|
|
|
[Defines]
|
|
INF_VERSION = 0x0001001A
|
|
BASE_NAME = MemoryInitPeiLib
|
|
FILE_GUID = 4bbc9c10-a100-43fb-8311-332ba497d1b4
|
|
MODULE_TYPE = BASE
|
|
VERSION_STRING = 1.0
|
|
LIBRARY_CLASS = MemoryInitPeiLib|SEC PEIM
|
|
|
|
[Sources]
|
|
MemoryInitPeiLib.c
|
|
|
|
[Packages]
|
|
MdePkg/MdePkg.dec
|
|
MdeModulePkg/MdeModulePkg.dec
|
|
EmbeddedPkg/EmbeddedPkg.dec
|
|
ArmPkg/ArmPkg.dec
|
|
ArmPlatformPkg/ArmPlatformPkg.dec
|
|
Platform/RaspberryPi/RaspberryPi.dec
|
|
|
|
[LibraryClasses]
|
|
DebugLib
|
|
HobLib
|
|
ArmMmuLib
|
|
ArmPlatformLib
|
|
|
|
[Guids]
|
|
gEfiMemoryTypeInformationGuid
|
|
|
|
[FeaturePcd]
|
|
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob
|
|
|
|
[FixedPcd]
|
|
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
|
gArmTokenSpaceGuid.PcdSystemMemorySize
|
|
|
|
[Depex]
|
|
TRUE
|