]> xenbits.xensource.com Git - people/aperard/ovmf.git/commitdiff
UefiPayloadPkg: Move FADT check to consumer coode.
authorChasel Chiu <chasel.chiu@intel.com>
Thu, 12 Sep 2024 22:42:41 +0000 (15:42 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 16 Sep 2024 16:34:04 +0000 (16:34 +0000)
ACPI FADT HW register interface fields are
optional but current UPL common entry code made it
as mandatory which caused compatibility issue on
some platforms.

Solution is to move those FADT HW register fields
check code to consumer code so only ASSERT when
those fields are consumed with error.

Currently only AcpiTimerLib and ResetSystemLib
consuming those register fields so if platforms
configured UPL to different library instances the
FADT HW register fields are not consumed thus will
not cause ASSERT.

Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.c
UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
UefiPayloadPkg/UefiPayloadEntry/AcpiTable.c

index 1ed589a6a2db824e1500b9eb3a5e9744e180ed70..8c4136609dbca9e0d3becef70454f11363c65c03 100644 (file)
@@ -47,6 +47,7 @@ AcpiTimerLibConstructor (
   pAcpiBoardInfo = (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);\r
 \r
   mPmTimerReg = (UINTN)pAcpiBoardInfo->PmTimerRegBase;\r
+  ASSERT (pAcpiBoardInfo->PmTimerRegBase != 0);\r
 \r
   return EFI_SUCCESS;\r
 }\r
index 1f2882069f3e3f0f60aece343698f816fb356821..f252855cfb2d3d4211b11df93fd1e1b66bc6d90c 100644 (file)
@@ -40,6 +40,12 @@ ResetSystemLibConstructor (
   AcpiBoardInfoPtr = (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);\r
   CopyMem (&mAcpiBoardInfo, AcpiBoardInfoPtr, sizeof (ACPI_BOARD_INFO));\r
 \r
+  ASSERT (mAcpiBoardInfo.ResetRegAddress != 0);\r
+  ASSERT (mAcpiBoardInfo.ResetValue != 0);\r
+  ASSERT (mAcpiBoardInfo.PmGpeEnBase != 0);\r
+  ASSERT (mAcpiBoardInfo.PmEvtBase != 0);\r
+  ASSERT (mAcpiBoardInfo.PmCtrlRegBase != 0);\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
index 8e3032b440c5ef08755982b369b77ba59cb2cbea..a7ee00f3e9d6976d5aa8918aba14f691939fcd42 100644 (file)
@@ -125,15 +125,6 @@ Done:
   DEBUG ((DEBUG_INFO, "PcieBaseAddr 0x%lx\n", AcpiBoardInfo->PcieBaseAddress));\r
   DEBUG ((DEBUG_INFO, "PcieBaseSize 0x%lx\n", AcpiBoardInfo->PcieBaseSize));\r
 \r
-  //\r
-  // Verify values for proper operation\r
-  //\r
-  // ASSERT (Fadt->Pm1aCntBlk != 0);\r
-  // ASSERT (Fadt->PmTmrBlk != 0);\r
-  // ASSERT (Fadt->ResetReg.Address != 0);\r
-  // ASSERT (Fadt->Pm1aEvtBlk != 0);\r
-  // ASSERT (Fadt->Gpe0Blk != 0);\r
-\r
   return RETURN_SUCCESS;\r
 }\r
 \r