ArmPkg,ArmPlatformPkg: Allow dynamic PCDs for memory base and size

This changes the definition and a bunch of references to
gArmTokenSpaceGuid.PcdSystemMemoryBase and
gArmTokenSpaceGuid.PcdSystemMemorySize so they can be declared as dynamic PCDs
by the platform. Also, move the non-SEC call to
ArmPlatformInitializeSystemMemory() earlier, so a platform has a chance to set
these PCDs before they are first referenced.

The purpose is allowing dynamically instantiated virtual machines to declare
the system memory by passing a device tree.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16079 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Ard Biesheuvel
2014-09-09 16:11:30 +00:00
committed by oliviermartin
parent 4f6d34b434
commit f8d7d6e151
7 changed files with 35 additions and 29 deletions

View File

@@ -103,14 +103,6 @@ InitializeMemory (
DEBUG ((EFI_D_ERROR, "Memory Init PEIM Loaded\n"));
// Ensure PcdSystemMemorySize has been set
ASSERT (FixedPcdGet64 (PcdSystemMemorySize) != 0);
SystemMemoryBase = (UINTN)FixedPcdGet64 (PcdSystemMemoryBase);
SystemMemoryTop = SystemMemoryBase + (UINTN)FixedPcdGet64 (PcdSystemMemorySize);
FdBase = (UINTN)PcdGet32 (PcdFdBaseAddress);
FdTop = FdBase + (UINTN)PcdGet32 (PcdFdSize);
//
// Initialize the System Memory (DRAM)
//
@@ -119,6 +111,14 @@ InitializeMemory (
ArmPlatformInitializeSystemMemory ();
}
// Ensure PcdSystemMemorySize has been set
ASSERT (PcdGet64 (PcdSystemMemorySize) != 0);
SystemMemoryBase = (UINTN)PcdGet64 (PcdSystemMemoryBase);
SystemMemoryTop = SystemMemoryBase + (UINTN)PcdGet64 (PcdSystemMemorySize);
FdBase = (UINTN)PcdGet32 (PcdFdBaseAddress);
FdTop = FdBase + (UINTN)PcdGet32 (PcdFdSize);
//
// Declare the UEFI memory to PEI
//