From c357fd6a1f79e2d7b0a1bd01994b8d33925bfff5 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Fri, 10 Jan 2014 11:27:31 +0000 Subject: ArmPkg/ArmPkg.dec: Redefined PcdSystemMemory(Base|Size) as UINT64 The System Memory region might be out of the 32-bit memory space. This change has been validated on the FVP AArch64 model using 4GB of DRAM at 0x8_0000_0000: - # System Memory (2GB) - gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000 - gArmTokenSpaceGuid.PcdSystemMemorySize|0x80000000 + # System Memory (4GB) + gArmTokenSpaceGuid.PcdSystemMemoryBase|0x800000000 + gArmTokenSpaceGuid.PcdSystemMemorySize|0x100000000 EFI Shell and Linux kernel boot successfully. Note: This change has not been validated on AArch32. I expect some early assembly code to not work. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15093 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c | 10 +++++----- ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'ArmPlatformPkg/MemoryInitPei') diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c index d1bf394c45..0214897d8b 100755 --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c @@ -78,7 +78,7 @@ MemoryPeim ( BOOLEAN Found; // Ensure PcdSystemMemorySize has been set - ASSERT (PcdGet32 (PcdSystemMemorySize) != 0); + ASSERT (PcdGet64 (PcdSystemMemorySize) != 0); // // Now, the permanent memory has been installed, we can call AllocatePages() @@ -97,16 +97,16 @@ MemoryPeim ( BuildResourceDescriptorHob ( EFI_RESOURCE_SYSTEM_MEMORY, ResourceAttributes, - PcdGet32 (PcdSystemMemoryBase), - PcdGet32 (PcdSystemMemorySize) + PcdGet64 (PcdSystemMemoryBase), + PcdGet64 (PcdSystemMemorySize) ); - SystemMemoryTop = (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdSystemMemoryBase) + (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdSystemMemorySize); + SystemMemoryTop = (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdSystemMemoryBase) + (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdSystemMemorySize); FdTop = (EFI_PHYSICAL_ADDRESS)PcdGet32(PcdFdBaseAddress) + (EFI_PHYSICAL_ADDRESS)PcdGet32(PcdFdSize); // EDK2 does not have the concept of boot firmware copied into DRAM. To avoid the DXE // core to overwrite this area we must mark the region with the attribute non-present - if ((PcdGet32 (PcdFdBaseAddress) >= PcdGet32 (PcdSystemMemoryBase)) && (FdTop <= SystemMemoryTop)) { + if ((PcdGet32 (PcdFdBaseAddress) >= PcdGet64 (PcdSystemMemoryBase)) && (FdTop <= SystemMemoryTop)) { Found = FALSE; // Search for System Memory Hob that contains the firmware diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c index 1de7d38078..c6a6fe64ba 100755 --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c @@ -104,10 +104,10 @@ InitializeMemory ( DEBUG ((EFI_D_ERROR, "Memory Init PEIM Loaded\n")); // Ensure PcdSystemMemorySize has been set - ASSERT (FixedPcdGet32 (PcdSystemMemorySize) != 0); + ASSERT (FixedPcdGet64 (PcdSystemMemorySize) != 0); - SystemMemoryBase = (UINTN)FixedPcdGet32 (PcdSystemMemoryBase); - SystemMemoryTop = SystemMemoryBase + (UINTN)FixedPcdGet32 (PcdSystemMemorySize); + SystemMemoryBase = (UINTN)FixedPcdGet64 (PcdSystemMemoryBase); + SystemMemoryTop = SystemMemoryBase + (UINTN)FixedPcdGet64 (PcdSystemMemorySize); FdBase = (UINTN)PcdGet32 (PcdFdBaseAddress); FdTop = FdBase + (UINTN)PcdGet32 (PcdFdSize); -- cgit v1.2.3