]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiPayloadPkg: Remove assert when reserve MMIO/IO resource for devices
authorZhiguang Liu <zhiguang.liu@intel.com>
Thu, 17 Jun 2021 01:20:57 +0000 (09:20 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 24 Jun 2021 09:16:22 +0000 (09:16 +0000)
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>
UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c

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