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 --- .../PrePi/PrePiArmPlatformGlobalVariableLib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib') diff --git a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c index 47430e302b..02cbb00daf 100644 --- a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c +++ b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c @@ -19,8 +19,8 @@ #include #include -#define IS_XIP() (((UINT32)PcdGet32 (PcdFdBaseAddress) > (UINT32)(PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize))) || \ - ((PcdGet32 (PcdFdBaseAddress) + PcdGet32 (PcdFdSize)) < PcdGet32 (PcdSystemMemoryBase))) +#define IS_XIP() (((UINT32)PcdGet32 (PcdFdBaseAddress) > (UINT32)(PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize))) || \ + ((PcdGet32 (PcdFdBaseAddress) + PcdGet32 (PcdFdSize)) < PcdGet64 (PcdSystemMemoryBase))) // Declared by ArmPlatformPkg/PrePi Module extern UINTN mGlobalVariableBase; @@ -40,7 +40,7 @@ ArmPlatformGetGlobalVariable ( if (IS_XIP()) { // In Case of XIP, we expect the Primary Stack at the top of the System Memory // The size must be 64bit aligned to allow 64bit variable to be aligned - GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8); + GlobalVariableBase = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8); } else { GlobalVariableBase = mGlobalVariableBase; } @@ -69,7 +69,7 @@ ArmPlatformSetGlobalVariable ( if (IS_XIP()) { // In Case of XIP, we expect the Primary Stack at the top of the System Memory // The size must be 64bit aligned to allow 64bit variable to be aligned - GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8); + GlobalVariableBase = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8); } else { GlobalVariableBase = mGlobalVariableBase; } @@ -96,7 +96,7 @@ ArmPlatformGetGlobalVariableAddress ( if (IS_XIP()) { // In Case of XIP, we expect the Primary Stack at the top of the System Memory // The size must be 64bit aligned to allow 64bit variable to be aligned - GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8); + GlobalVariableBase = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8); } else { GlobalVariableBase = mGlobalVariableBase; } -- cgit v1.2.3