diff options
Diffstat (limited to 'ArmVirtPkg')
-rw-r--r-- | ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf | 1 | ||||
-rw-r--r-- | ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf b/ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf index 22ee3625c3..3cb3fb1f3a 100644 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf +++ b/ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf @@ -61,3 +61,4 @@ gArmTokenSpaceGuid.PcdArmPrimaryCore
gArmTokenSpaceGuid.PcdFdBaseAddress
gArmTokenSpaceGuid.PcdFdSize
+ gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize
diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c b/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c index 530f7d608e..e5536ecd8e 100644 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c +++ b/ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c @@ -97,7 +97,9 @@ ArmPlatformGetVirtualMemoryMap ( // Peripheral space after DRAM
VirtualMemoryTable[2].PhysicalBase = VirtualMemoryTable[0].Length + VirtualMemoryTable[1].Length;
VirtualMemoryTable[2].VirtualBase = VirtualMemoryTable[2].PhysicalBase;
- VirtualMemoryTable[2].Length = ArmGetPhysAddrTop () - VirtualMemoryTable[2].PhysicalBase;
+ VirtualMemoryTable[2].Length = MIN (1ULL << FixedPcdGet8 (PcdPrePiCpuMemorySize),
+ ArmGetPhysAddrTop ()) -
+ VirtualMemoryTable[2].PhysicalBase;
VirtualMemoryTable[2].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
// Remap the FD region as normal executable memory
|