summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg
diff options
context:
space:
mode:
authorLinus Liu <linus.liu@intel.com>2024-09-30 02:44:36 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-10-31 17:02:52 +0000
commitd13f31c3fe17eb532bf9016a2d8de3885642cba0 (patch)
treef396b4ecce38bfb6f0824fc47b525e2d439df173 /UefiPayloadPkg
parent60c6486f798f863a11fd96c4473375dfff51c498 (diff)
downloadedk2-d13f31c3fe17eb532bf9016a2d8de3885642cba0.tar.gz
edk2-d13f31c3fe17eb532bf9016a2d8de3885642cba0.tar.bz2
edk2-d13f31c3fe17eb532bf9016a2d8de3885642cba0.zip
UefiPayloadPkg :ACPI memory node
There are couples of gUniversalPayloadAcpiTableGuid in payload , only build one gUniversalPayloadAcpiTableGuid hob and acpi memory hob. when the reserved memory address matched the rsdp. Signed-off-by: Linus Liu <linus.liu@intel.com>
Diffstat (limited to 'UefiPayloadPkg')
-rw-r--r--UefiPayloadPkg/Library/BuildFdtLib/X86_BuildFdtLib.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/UefiPayloadPkg/Library/BuildFdtLib/X86_BuildFdtLib.c b/UefiPayloadPkg/Library/BuildFdtLib/X86_BuildFdtLib.c
index 3c190bf0d9..ddee8209b3 100644
--- a/UefiPayloadPkg/Library/BuildFdtLib/X86_BuildFdtLib.c
+++ b/UefiPayloadPkg/Library/BuildFdtLib/X86_BuildFdtLib.c
@@ -188,6 +188,11 @@ BuildFdtForMemAlloc (
ASSERT_EFI_ERROR (Status);
}
+ GuidHob = GetFirstGuidHob (&gUniversalPayloadAcpiTableGuid);
+ if (GuidHob != NULL) {
+ AcpiTable = (UNIVERSAL_PAYLOAD_ACPI_TABLE *)GET_GUID_HOB_DATA (GuidHob);
+ }
+
HobStart = GetFirstHob (EFI_HOB_TYPE_MEMORY_ALLOCATION);
//
// Scan memory allocation hobs to set memory type
@@ -265,7 +270,23 @@ BuildFdtForMemAlloc (
Status = FdtSetProperty (Fdt, TempNode, "reg", &RegTmp, sizeof (RegTmp));
ASSERT_EFI_ERROR (Status);
- if (!(AsciiStrCmp (mMemoryAllocType[AllocMemType], "mmio") == 0)) {
+ if ((AsciiStrCmp (mMemoryAllocType[AllocMemType], "mmio") == 0)) {
+ continue;
+ }
+
+ if (!(AsciiStrCmp (mMemoryAllocType[AllocMemType], "acpi-nvs") == 0) && (AsciiStrCmp (mMemoryAllocType[AllocMemType], "acpi") == 0)) {
+ DEBUG ((DEBUG_INFO, "find acpi memory hob MemoryBaseAddress:%x , AcpiTable->Rsdp :%x\n", Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress, AcpiTable->Rsdp));
+ if (Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress == AcpiTable->Rsdp) {
+ DEBUG ((DEBUG_INFO, "keep acpi memory hob \n"));
+ Status = FdtSetProperty (Fdt, TempNode, "compatible", mMemoryAllocType[AllocMemType], (UINT32)(AsciiStrLen (mMemoryAllocType[AllocMemType])+1));
+ ASSERT_EFI_ERROR (Status);
+ } else {
+ DEBUG ((DEBUG_INFO, "change acpi memory hob \n"));
+ Status = FdtSetProperty (Fdt, TempNode, "compatible", mMemoryAllocType[4], (UINT32)(AsciiStrLen (mMemoryAllocType[4])+1));
+ ASSERT_EFI_ERROR (Status);
+ }
+ } else {
+ DEBUG ((DEBUG_INFO, "other memory hob \n"));
Status = FdtSetProperty (Fdt, TempNode, "compatible", mMemoryAllocType[AllocMemType], (UINT32)(AsciiStrLen (mMemoryAllocType[AllocMemType])+1));
ASSERT_EFI_ERROR (Status);
}