mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 08:04:07 +02:00
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:
parent
4f6d34b434
commit
f8d7d6e151
@ -105,12 +105,6 @@
|
|||||||
gArmTokenSpaceGuid.PcdHypFvBaseAddress|0|UINT32|0x0000003C
|
gArmTokenSpaceGuid.PcdHypFvBaseAddress|0|UINT32|0x0000003C
|
||||||
gArmTokenSpaceGuid.PcdHypFvSize|0|UINT32|0x0000003D
|
gArmTokenSpaceGuid.PcdHypFvSize|0|UINT32|0x0000003D
|
||||||
|
|
||||||
# System Memory (DRAM): These PCDs define the region of in-built system memory
|
|
||||||
# Some platforms can get DRAM extensions, these additional regions will be declared
|
|
||||||
# to UEFI by ArmPlatformLib
|
|
||||||
gArmTokenSpaceGuid.PcdSystemMemoryBase|0|UINT64|0x00000029
|
|
||||||
gArmTokenSpaceGuid.PcdSystemMemorySize|0|UINT64|0x0000002A
|
|
||||||
|
|
||||||
# Use ClusterId + CoreId to identify the PrimaryCore
|
# Use ClusterId + CoreId to identify the PrimaryCore
|
||||||
gArmTokenSpaceGuid.PcdArmPrimaryCoreMask|0xF03|UINT32|0x00000031
|
gArmTokenSpaceGuid.PcdArmPrimaryCoreMask|0xF03|UINT32|0x00000031
|
||||||
# The Primary Core is ClusterId[0] & CoreId[0]
|
# The Primary Core is ClusterId[0] & CoreId[0]
|
||||||
@ -214,6 +208,12 @@
|
|||||||
# context of virtual machine.
|
# context of virtual machine.
|
||||||
#
|
#
|
||||||
[PcdsFixedAtBuild.common, PcdsDynamic.common]
|
[PcdsFixedAtBuild.common, PcdsDynamic.common]
|
||||||
|
# System Memory (DRAM): These PCDs define the region of in-built system memory
|
||||||
|
# Some platforms can get DRAM extensions, these additional regions will be declared
|
||||||
|
# to UEFI by ArmPlatformLib
|
||||||
|
gArmTokenSpaceGuid.PcdSystemMemoryBase|0|UINT64|0x00000029
|
||||||
|
gArmTokenSpaceGuid.PcdSystemMemorySize|0|UINT64|0x0000002A
|
||||||
|
|
||||||
#
|
#
|
||||||
# ARM Architectural Timer
|
# ARM Architectural Timer
|
||||||
#
|
#
|
||||||
|
@ -78,10 +78,11 @@
|
|||||||
[FeaturePcd]
|
[FeaturePcd]
|
||||||
gArmTokenSpaceGuid.PcdArmLinuxSpinTable
|
gArmTokenSpaceGuid.PcdArmLinuxSpinTable
|
||||||
|
|
||||||
[FixedPcd]
|
[Pcd]
|
||||||
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
||||||
gArmTokenSpaceGuid.PcdSystemMemorySize
|
gArmTokenSpaceGuid.PcdSystemMemorySize
|
||||||
|
|
||||||
|
[FixedPcd]
|
||||||
gArmTokenSpaceGuid.PcdArmMachineType
|
gArmTokenSpaceGuid.PcdArmMachineType
|
||||||
gArmTokenSpaceGuid.PcdArmLinuxFdtMaxOffset
|
gArmTokenSpaceGuid.PcdArmLinuxFdtMaxOffset
|
||||||
gArmTokenSpaceGuid.PcdArmLinuxFdtAlignment
|
gArmTokenSpaceGuid.PcdArmLinuxFdtAlignment
|
||||||
|
@ -37,9 +37,10 @@
|
|||||||
gArmTokenSpaceGuid.PcdFdBaseAddress
|
gArmTokenSpaceGuid.PcdFdBaseAddress
|
||||||
gArmTokenSpaceGuid.PcdFdSize
|
gArmTokenSpaceGuid.PcdFdSize
|
||||||
|
|
||||||
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
|
||||||
gArmTokenSpaceGuid.PcdSystemMemorySize
|
|
||||||
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
|
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
|
||||||
gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize
|
gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
||||||
|
gArmTokenSpaceGuid.PcdSystemMemorySize
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#/** @file
|
#/** @file
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>
|
# Copyright (c) 2011-2014, ARM Ltd. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -39,8 +39,6 @@
|
|||||||
[Guids]
|
[Guids]
|
||||||
gEfiMemoryTypeInformationGuid
|
gEfiMemoryTypeInformationGuid
|
||||||
|
|
||||||
[Ppis]
|
|
||||||
|
|
||||||
[FeaturePcd]
|
[FeaturePcd]
|
||||||
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob
|
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob
|
||||||
|
|
||||||
@ -48,8 +46,6 @@
|
|||||||
gArmTokenSpaceGuid.PcdFdBaseAddress
|
gArmTokenSpaceGuid.PcdFdBaseAddress
|
||||||
gArmTokenSpaceGuid.PcdFdSize
|
gArmTokenSpaceGuid.PcdFdSize
|
||||||
|
|
||||||
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
|
||||||
gArmTokenSpaceGuid.PcdSystemMemorySize
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
||||||
|
|
||||||
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory
|
||||||
@ -62,5 +58,9 @@
|
|||||||
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode
|
||||||
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData
|
||||||
|
|
||||||
[depex]
|
[Pcd]
|
||||||
|
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
||||||
|
gArmTokenSpaceGuid.PcdSystemMemorySize
|
||||||
|
|
||||||
|
[Depex]
|
||||||
TRUE
|
TRUE
|
||||||
|
@ -103,14 +103,6 @@ InitializeMemory (
|
|||||||
|
|
||||||
DEBUG ((EFI_D_ERROR, "Memory Init PEIM Loaded\n"));
|
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)
|
// Initialize the System Memory (DRAM)
|
||||||
//
|
//
|
||||||
@ -119,6 +111,14 @@ InitializeMemory (
|
|||||||
ArmPlatformInitializeSystemMemory ();
|
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
|
// Declare the UEFI memory to PEI
|
||||||
//
|
//
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#/** @file
|
#/** @file
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>
|
# Copyright (c) 2011-2014, ARM Ltd. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -55,8 +55,6 @@
|
|||||||
gArmTokenSpaceGuid.PcdFdBaseAddress
|
gArmTokenSpaceGuid.PcdFdBaseAddress
|
||||||
gArmTokenSpaceGuid.PcdFdSize
|
gArmTokenSpaceGuid.PcdFdSize
|
||||||
|
|
||||||
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
|
||||||
gArmTokenSpaceGuid.PcdSystemMemorySize
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
||||||
|
|
||||||
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory
|
||||||
@ -69,5 +67,9 @@
|
|||||||
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode
|
||||||
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
||||||
|
gArmTokenSpaceGuid.PcdSystemMemorySize
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
TRUE
|
TRUE
|
||||||
|
@ -88,8 +88,6 @@
|
|||||||
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize
|
gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize
|
||||||
|
|
||||||
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
|
||||||
gArmTokenSpaceGuid.PcdSystemMemorySize
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
||||||
|
|
||||||
gArmPlatformTokenSpaceGuid.PcdCoreCount
|
gArmPlatformTokenSpaceGuid.PcdCoreCount
|
||||||
@ -106,3 +104,7 @@
|
|||||||
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData
|
||||||
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode
|
||||||
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData
|
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gArmTokenSpaceGuid.PcdSystemMemoryBase
|
||||||
|
gArmTokenSpaceGuid.PcdSystemMemorySize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user