summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg/Library
diff options
context:
space:
mode:
authorChasel Chiu <chasel.chiu@intel.com>2024-09-12 15:42:41 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-09-16 16:34:04 +0000
commit670e263419eb875fd8dce0c8d18dd3ab02b83ba0 (patch)
tree79794bcbd3a42a5b47430b38147aff6e11957625 /UefiPayloadPkg/Library
parent7843c8da060484cdb4239078544cab807377070d (diff)
downloadedk2-670e263419eb875fd8dce0c8d18dd3ab02b83ba0.tar.gz
edk2-670e263419eb875fd8dce0c8d18dd3ab02b83ba0.tar.bz2
edk2-670e263419eb875fd8dce0c8d18dd3ab02b83ba0.zip
UefiPayloadPkg: Move FADT check to consumer coode.
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>
Diffstat (limited to 'UefiPayloadPkg/Library')
-rw-r--r--UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.c1
-rw-r--r--UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.c b/UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.c
index 1ed589a6a2..8c4136609d 100644
--- a/UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.c
+++ b/UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.c
@@ -47,6 +47,7 @@ AcpiTimerLibConstructor (
pAcpiBoardInfo = (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);
mPmTimerReg = (UINTN)pAcpiBoardInfo->PmTimerRegBase;
+ ASSERT (pAcpiBoardInfo->PmTimerRegBase != 0);
return EFI_SUCCESS;
}
diff --git a/UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c b/UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
index 1f2882069f..f252855cfb 100644
--- a/UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ b/UefiPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
@@ -40,6 +40,12 @@ ResetSystemLibConstructor (
AcpiBoardInfoPtr = (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);
CopyMem (&mAcpiBoardInfo, AcpiBoardInfoPtr, sizeof (ACPI_BOARD_INFO));
+ ASSERT (mAcpiBoardInfo.ResetRegAddress != 0);
+ ASSERT (mAcpiBoardInfo.ResetValue != 0);
+ ASSERT (mAcpiBoardInfo.PmGpeEnBase != 0);
+ ASSERT (mAcpiBoardInfo.PmEvtBase != 0);
+ ASSERT (mAcpiBoardInfo.PmCtrlRegBase != 0);
+
return EFI_SUCCESS;
}