UefiPayloadPkg: Remove assert when reserve MMIO/IO resource for devices

Some boot loader may already reserve MMIO/IO resource for IOAPIC and HPET,
so remove the assert when reserve MMIO/IO resource for IOAPIC and HPET

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
This commit is contained in:
Zhiguang Liu 2021-06-17 09:20:57 +08:00 committed by mergify[bot]
parent 6b69f73b59
commit 86e6948cfb

View File

@ -41,13 +41,12 @@ ReserveResourceInGcd (
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_WARN,
"Failed to add memory space :0x%lx 0x%lx\n", "Failed to add memory space :0x%lx 0x%lx\n",
BaseAddress, BaseAddress,
Length Length
)); ));
} }
ASSERT_EFI_ERROR (Status);
Status = gDS->AllocateMemorySpace ( Status = gDS->AllocateMemorySpace (
EfiGcdAllocateAddress, EfiGcdAllocateAddress,
GcdType, GcdType,
@ -57,14 +56,20 @@ ReserveResourceInGcd (
ImageHandle, ImageHandle,
NULL NULL
); );
ASSERT_EFI_ERROR (Status);
} else { } else {
Status = gDS->AddIoSpace ( Status = gDS->AddIoSpace (
GcdType, GcdType,
BaseAddress, BaseAddress,
Length Length
); );
ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_WARN,
"Failed to add IO space :0x%lx 0x%lx\n",
BaseAddress,
Length
));
}
Status = gDS->AllocateIoSpace ( Status = gDS->AllocateIoSpace (
EfiGcdAllocateAddress, EfiGcdAllocateAddress,
GcdType, GcdType,
@ -74,7 +79,6 @@ ReserveResourceInGcd (
ImageHandle, ImageHandle,
NULL NULL
); );
ASSERT_EFI_ERROR (Status);
} }
return Status; return Status;
} }
@ -106,11 +110,9 @@ BlDxeEntryPoint (
// //
// Report MMIO/IO Resources // Report MMIO/IO Resources
// //
Status = ReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFEC00000, SIZE_4KB, 0, ImageHandle); // IOAPIC ReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFEC00000, SIZE_4KB, 0, ImageHandle); // IOAPIC
ASSERT_EFI_ERROR (Status);
Status = ReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFED00000, SIZE_1KB, 0, ImageHandle); // HPET ReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFED00000, SIZE_1KB, 0, ImageHandle); // HPET
ASSERT_EFI_ERROR (Status);
// //
// Find the frame buffer information and update PCDs // Find the frame buffer information and update PCDs