diff options
Diffstat (limited to 'OvmfPkg/PlatformPei/Platform.c')
-rw-r--r-- | OvmfPkg/PlatformPei/Platform.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index d35a1fbb5c..c379f88b4d 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -35,7 +35,7 @@ EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {
{ EfiACPIMemoryNVS, 0x004 },
{ EfiACPIReclaimMemory, 0x008 },
- { EfiReservedMemoryType, 0x004 },
+ { EfiReservedMemoryType, 0x004 },
{ EfiRuntimeServicesData, 0x024 },
{ EfiRuntimeServicesCode, 0x030 },
{ EfiBootServicesCode, 0x180 },
@@ -104,6 +104,7 @@ AddMemoryRangeHob ( VOID
MemMapInitialization (
+ EFI_PHYSICAL_ADDRESS TopOfMemory
)
{
//
@@ -129,22 +130,26 @@ MemMapInitialization ( //
// Add PCI MMIO space available to PCI resource allocations
//
- AddIoMemoryBaseSizeHob (0x80000000, 0xFEC00000 - 0x80000000);
+ if (TopOfMemory < BASE_2GB) {
+ AddIoMemoryBaseSizeHob (BASE_2GB, 0xFEC00000 - BASE_2GB);
+ } else {
+ AddIoMemoryBaseSizeHob (TopOfMemory, 0xFEC00000 - TopOfMemory);
+ }
//
// Local APIC range
//
- AddIoMemoryBaseSizeHob (0xFEC80000, 0x80000);
+ AddIoMemoryBaseSizeHob (0xFEC80000, SIZE_512KB);
//
// I/O APIC range
//
- AddIoMemoryBaseSizeHob (0xFEC00000, 0x80000);
+ AddIoMemoryBaseSizeHob (0xFEC00000, SIZE_512KB);
//
// Video memory + Legacy BIOS region
//
- AddIoMemoryRangeHob (0x0A0000, 0x100000);
+ AddIoMemoryRangeHob (0x0A0000, BASE_1MB);
}
@@ -155,7 +160,7 @@ MiscInitialization ( //
// Disable A20 Mask
//
- IoWrite8 (0x92, (UINT8) (IoRead8 (0x92) | 0x02));
+ IoOr8 (0x92, BIT1);
//
// Build the CPU hob with 36-bit addressing and 16-bits of IO space.
@@ -206,15 +211,17 @@ InitializePlatform ( IN CONST EFI_PEI_SERVICES **PeiServices
)
{
+ EFI_PHYSICAL_ADDRESS TopOfMemory;
+
DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));
- MemDetect ();
+ TopOfMemory = MemDetect ();
ReserveEmuVariableNvStore ();
PeiFvInitialization ();
- MemMapInitialization ();
+ MemMapInitialization (TopOfMemory);
MiscInitialization ();
|