ArmPlatformPkg: Increase more ARM address Pcd entries to 64-bit.
Some AArch64 platforms have RAM and flash devices >4GB. Update some additional Pcd entries to 64-bit, and change the corresponding PcdGet32 calls to PcdGet64. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16325 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
committed by
oliviermartin
parent
2a7e98a8cc
commit
bb5420bb2b
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011, ARM Limited. All rights reserved.
|
||||
* Copyright (c) 2011-2014, ARM Limited. All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are licensed and made available under the terms and conditions of the BSD License
|
||||
@@ -102,33 +102,33 @@ MemoryPeim (
|
||||
);
|
||||
|
||||
SystemMemoryTop = (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdSystemMemoryBase) + (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdSystemMemorySize);
|
||||
FdTop = (EFI_PHYSICAL_ADDRESS)PcdGet32(PcdFdBaseAddress) + (EFI_PHYSICAL_ADDRESS)PcdGet32(PcdFdSize);
|
||||
FdTop = (EFI_PHYSICAL_ADDRESS)PcdGet64 (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) >= PcdGet64 (PcdSystemMemoryBase)) && (FdTop <= SystemMemoryTop)) {
|
||||
if ((PcdGet64 (PcdFdBaseAddress) >= PcdGet64 (PcdSystemMemoryBase)) && (FdTop <= SystemMemoryTop)) {
|
||||
Found = FALSE;
|
||||
|
||||
// Search for System Memory Hob that contains the firmware
|
||||
NextHob.Raw = GetHobList ();
|
||||
while ((NextHob.Raw = GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, NextHob.Raw)) != NULL) {
|
||||
if ((NextHob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) &&
|
||||
(PcdGet32(PcdFdBaseAddress) >= NextHob.ResourceDescriptor->PhysicalStart) &&
|
||||
(PcdGet64 (PcdFdBaseAddress) >= NextHob.ResourceDescriptor->PhysicalStart) &&
|
||||
(FdTop <= NextHob.ResourceDescriptor->PhysicalStart + NextHob.ResourceDescriptor->ResourceLength))
|
||||
{
|
||||
ResourceAttributes = NextHob.ResourceDescriptor->ResourceAttribute;
|
||||
ResourceLength = NextHob.ResourceDescriptor->ResourceLength;
|
||||
ResourceTop = NextHob.ResourceDescriptor->PhysicalStart + ResourceLength;
|
||||
|
||||
if (PcdGet32(PcdFdBaseAddress) == NextHob.ResourceDescriptor->PhysicalStart) {
|
||||
if (PcdGet64 (PcdFdBaseAddress) == NextHob.ResourceDescriptor->PhysicalStart) {
|
||||
if (SystemMemoryTop == FdTop) {
|
||||
NextHob.ResourceDescriptor->ResourceAttribute = ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT;
|
||||
} else {
|
||||
// Create the System Memory HOB for the firmware with the non-present attribute
|
||||
BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
|
||||
ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT,
|
||||
PcdGet32(PcdFdBaseAddress),
|
||||
PcdGet32(PcdFdSize));
|
||||
PcdGet64 (PcdFdBaseAddress),
|
||||
PcdGet32 (PcdFdSize));
|
||||
|
||||
// Top of the FD is system memory available for UEFI
|
||||
NextHob.ResourceDescriptor->PhysicalStart += PcdGet32(PcdFdSize);
|
||||
@@ -138,11 +138,11 @@ MemoryPeim (
|
||||
// Create the System Memory HOB for the firmware with the non-present attribute
|
||||
BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY,
|
||||
ResourceAttributes & ~EFI_RESOURCE_ATTRIBUTE_PRESENT,
|
||||
PcdGet32(PcdFdBaseAddress),
|
||||
PcdGet32(PcdFdSize));
|
||||
PcdGet64 (PcdFdBaseAddress),
|
||||
PcdGet32 (PcdFdSize));
|
||||
|
||||
// Update the HOB
|
||||
NextHob.ResourceDescriptor->ResourceLength = PcdGet32(PcdFdBaseAddress) - NextHob.ResourceDescriptor->PhysicalStart;
|
||||
NextHob.ResourceDescriptor->ResourceLength = PcdGet64 (PcdFdBaseAddress) - NextHob.ResourceDescriptor->PhysicalStart;
|
||||
|
||||
// If there is some memory available on the top of the FD then create a HOB
|
||||
if (FdTop < NextHob.ResourceDescriptor->PhysicalStart + ResourceLength) {
|
||||
|
Reference in New Issue
Block a user