summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Mem.c
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-31 12:21:41 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-31 12:21:41 +0000
commit964680c124d0826c8e08b4c59cc4193e9a912ea1 (patch)
tree4eacf12cfc31413de33faf4bb5138ff9bc8d1482 /ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Mem.c
parenta534d7148079f71f932e963d836c731559491021 (diff)
downloadedk2-platforms-964680c124d0826c8e08b4c59cc4193e9a912ea1.tar.xz
ArmPlatformPkg/ArmPlatformLib: Move the UEFI memory partionning to MemoryInitPei
Formerly, each platform was responsible to declare the location of its UEFI memory region (used by PEI and DXE Foundations). The ArmPlatformLib was also declaring every region of its partitionned system memory with a System Resource HOB. In this new model, the MemoryInit expects the system memory to be declared with the PCDs gArmTokenSpaceGuid.PcdSystemMemoryBase/Size. These PCDs declare the largest continuous DRAM region. Additional regions can be declared with the ArmPLatformLib function ArmPlatformGetAdditionalSystemMemory(). Now, it is the PEIM that partitions the system memory for every platform. It installs a region of the size PcdSystemMemoryUefiRegionSize (default 128MB) for the PEI permanent memory at the top of the DRAM region. And a region of gArmPlatformTokenSpaceGuid.PcdSystemMemoryFixRegionSize (default 128MB) is declared at the base of the system memory. This region is used for the allocation that requires fixed address or have some constraints on their locations. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11481 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Mem.c')
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Mem.c89
1 files changed, 6 insertions, 83 deletions
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Mem.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Mem.c
index 8d1bf1f837..cd72f4af3c 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Mem.c
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Mem.c
@@ -25,26 +25,6 @@
#define DDR_ATTRIBUTES_SECURE_UNCACHED ARM_MEMORY_REGION_ATTRIBUTE_SECURE_UNCACHED_UNBUFFERED
/**
- Return the information about the memory region in permanent memory used by PEI
-
- One of the PEI Module must install the permament memory used by PEI. This function returns the
- information about this region for your platform to this PEIM module.
-
- @param[out] PeiMemoryBase Base of the memory region used by PEI core and modules
- @param[out] PeiMemorySize Size of the memory region used by PEI core and modules
-
-**/
-VOID ArmPlatformGetPeiMemory (
- OUT UINTN* PeiMemoryBase,
- OUT UINTN* PeiMemorySize
- ) {
- ASSERT((PeiMemoryBase != NULL) && (PeiMemorySize != NULL));
-
- *PeiMemoryBase = ARM_VE_DRAM_BASE + ARM_VE_EFI_FIX_ADDRESS_REGION_SZ;
- *PeiMemorySize = ARM_VE_EFI_MEMORY_REGION_SZ;
-}
-
-/**
Return the Virtual Memory Map of your platform
This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.
@@ -146,67 +126,10 @@ VOID ArmPlatformGetVirtualMemoryMap(ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemory
EFI Memory region. This array must be ended by a zero-filled entry
**/
-VOID ArmPlatformGetEfiMemoryMap (
- OUT ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR** EfiMemoryMap
-) {
- EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;
- UINT64 MemoryBase;
- UINTN Index = 0;
- ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR *EfiMemoryTable;
-
- ASSERT(EfiMemoryMap != NULL);
-
- EfiMemoryTable = (ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR*)AllocatePages(sizeof(ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR) * 6);
-
- Attributes =
- (
- EFI_RESOURCE_ATTRIBUTE_PRESENT |
- EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
- EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_TESTED
- );
- MemoryBase = ARM_VE_DRAM_BASE;
-
- // Memory Reserved for fixed address allocations (such as Exception Vector Table)
- EfiMemoryTable[Index].ResourceAttribute = Attributes;
- EfiMemoryTable[Index].PhysicalStart = MemoryBase;
- EfiMemoryTable[Index].NumberOfBytes = ARM_VE_EFI_FIX_ADDRESS_REGION_SZ;
-
- MemoryBase += ARM_VE_EFI_FIX_ADDRESS_REGION_SZ;
-
- // Memory declared to PEI as permanent memory for PEI and DXE
- EfiMemoryTable[++Index].ResourceAttribute = Attributes;
- EfiMemoryTable[Index].PhysicalStart = MemoryBase;
- EfiMemoryTable[Index].NumberOfBytes = ARM_VE_EFI_MEMORY_REGION_SZ;
-
- MemoryBase += ARM_VE_EFI_MEMORY_REGION_SZ;
-
- // We must reserve the memory used by the Firmware Volume copied in DRAM at 0x80000000
- if (FeaturePcdGet(PcdStandalone) == FALSE) {
- // Chunk between the EFI Memory region and the firmware
- EfiMemoryTable[++Index].ResourceAttribute = Attributes;
- EfiMemoryTable[Index].PhysicalStart = MemoryBase;
- EfiMemoryTable[Index].NumberOfBytes = PcdGet32(PcdNormalFdBaseAddress) - MemoryBase;
-
- // Chunk reserved by the firmware in DRAM
- EfiMemoryTable[++Index].ResourceAttribute = Attributes & (~EFI_RESOURCE_ATTRIBUTE_PRESENT);
- EfiMemoryTable[Index].PhysicalStart = PcdGet32(PcdNormalFdBaseAddress);
- EfiMemoryTable[Index].NumberOfBytes = PcdGet32(PcdNormalFdSize);
-
- MemoryBase = PcdGet32(PcdNormalFdBaseAddress) + PcdGet32(PcdNormalFdSize);
- }
-
- // We allocate all the remain memory as untested system memory
- EfiMemoryTable[++Index].ResourceAttribute = Attributes & (~EFI_RESOURCE_ATTRIBUTE_TESTED);
- EfiMemoryTable[Index].PhysicalStart = MemoryBase;
- EfiMemoryTable[Index].NumberOfBytes = ARM_VE_DRAM_SZ - (MemoryBase-ARM_VE_DRAM_BASE);
-
- EfiMemoryTable[++Index].ResourceAttribute = 0;
- EfiMemoryTable[Index].PhysicalStart = 0;
- EfiMemoryTable[Index].NumberOfBytes = 0;
-
- *EfiMemoryMap = EfiMemoryTable;
+EFI_STATUS
+ArmPlatformGetAdditionalSystemMemory (
+ OUT ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR** EfiMemoryMap
+ )
+{
+ return EFI_UNSUPPORTED;
}