Update OVMF Platform PEI to declare IO and MMIO resources.

Update default memory type information to reduce EFI Memory Map fragmentation.


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10657 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
mdkinney 2010-07-16 19:04:41 +00:00
parent 1beb1af938
commit 991d956362
1 changed files with 28 additions and 23 deletions

View File

@ -34,11 +34,12 @@
EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {
{ EfiACPIMemoryNVS, 0x004 },
{ EfiACPIReclaimMemory, 0x01C },
{ EfiRuntimeServicesData, 0x050 },
{ EfiRuntimeServicesCode, 0x020 },
{ EfiBootServicesCode, 0x0F0 },
{ EfiBootServicesData, 0xA00 },
{ EfiACPIReclaimMemory, 0x008 },
{ EfiReservedMemoryType, 0x004 },
{ EfiRuntimeServicesData, 0x024 },
{ EfiRuntimeServicesCode, 0x030 },
{ EfiBootServicesCode, 0x180 },
{ EfiBootServicesData, 0xF00 },
{ EfiMaxMemoryType, 0x000 }
};
@ -49,17 +50,12 @@ AddIoMemoryBaseSizeHob (
UINT64 MemorySize
)
{
STATIC EFI_RESOURCE_ATTRIBUTE_TYPE Attributes =
(
BuildResourceDescriptorHob (
EFI_RESOURCE_MEMORY_MAPPED_IO,
EFI_RESOURCE_ATTRIBUTE_PRESENT |
EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
EFI_RESOURCE_ATTRIBUTE_TESTED
);
BuildResourceDescriptorHob (
EFI_RESOURCE_MEMORY_MAPPED_IO,
Attributes,
EFI_RESOURCE_ATTRIBUTE_TESTED,
MemoryBase,
MemorySize
);
@ -82,20 +78,15 @@ AddMemoryBaseSizeHob (
UINT64 MemorySize
)
{
STATIC EFI_RESOURCE_ATTRIBUTE_TYPE Attributes =
(
BuildResourceDescriptorHob (
EFI_RESOURCE_SYSTEM_MEMORY,
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
);
BuildResourceDescriptorHob (
EFI_RESOURCE_SYSTEM_MEMORY,
Attributes,
EFI_RESOURCE_ATTRIBUTE_TESTED,
MemoryBase,
MemorySize
);
@ -111,7 +102,6 @@ AddMemoryRangeHob (
AddMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryBase));
}
VOID
MemMapInitialization (
)
@ -125,6 +115,22 @@ MemMapInitialization (
sizeof(mDefaultMemoryTypeInformation)
);
//
// Add PCI IO Port space available for PCI resource allocations.
//
BuildResourceDescriptorHob (
EFI_RESOURCE_IO,
EFI_RESOURCE_ATTRIBUTE_PRESENT |
EFI_RESOURCE_ATTRIBUTE_INITIALIZED,
0x1000,
0xF000
);
//
// Add PCI MMIO space available to PCI resource allocations
//
AddIoMemoryBaseSizeHob (0x80000000, 0xFEC00000 - 0x80000000);
//
// Local APIC range
//
@ -214,4 +220,3 @@ InitializePlatform (
return EFI_SUCCESS;
}