UefiPayloadPkg: Parse fdt and create smbios table

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
This commit is contained in:
Dhaval 2024-08-29 14:50:55 +05:30 committed by mergify[bot]
parent 4d35077048
commit 9fff9912fd

View File

@ -234,6 +234,7 @@ ParseReservedMemory (
UINT64 StartAddress;
UINT64 NumberOfBytes;
UNIVERSAL_PAYLOAD_ACPI_TABLE *PlatformAcpiTable;
UNIVERSAL_PAYLOAD_SMBIOS_TABLE *SmbiosTable;
FDT_NODE_HEADER *NodePtr;
PlatformAcpiTable = NULL;
@ -282,6 +283,15 @@ ParseReservedMemory (
PlatformAcpiTable->Header.Revision = UNIVERSAL_PAYLOAD_ACPI_TABLE_REVISION;
PlatformAcpiTable->Header.Length = sizeof (UNIVERSAL_PAYLOAD_ACPI_TABLE);
}
} else if (AsciiStrnCmp (TempStr, "smbios", AsciiStrLen ("smbios")) == 0) {
DEBUG ((DEBUG_INFO, " build smbios, NumberOfBytes:%x", NumberOfBytes));
BuildMemoryAllocationHob (StartAddress, NumberOfBytes, EfiBootServicesData);
SmbiosTable = BuildGuidHob (&gUniversalPayloadSmbios3TableGuid, sizeof (UNIVERSAL_PAYLOAD_SMBIOS_TABLE));
if (SmbiosTable != NULL) {
SmbiosTable->Header.Revision = UNIVERSAL_PAYLOAD_SMBIOS_TABLE_REVISION;
SmbiosTable->Header.Length = sizeof (UNIVERSAL_PAYLOAD_SMBIOS_TABLE);
SmbiosTable->SmBiosEntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)(StartAddress);
}
} else if (AsciiStrnCmp (TempStr, "acpi-nvs", AsciiStrLen ("acpi-nvs")) == 0) {
DEBUG ((DEBUG_INFO, " acpi-nvs"));
BuildMemoryAllocationHob (StartAddress, NumberOfBytes, EfiACPIMemoryNVS);
@ -840,8 +850,10 @@ ParseDtb (
} // end of memory node
else {
PropertyPtr = FdtGetProperty (Fdt, Node, "compatible", &TempLen);
if (PropertyPtr == NULL)
if (PropertyPtr == NULL) {
continue;
}
TempStr = (CHAR8 *)(PropertyPtr->Data);
if (AsciiStrnCmp (TempStr, "pci-rb", AsciiStrLen ("pci-rb")) == 0) {
RootBridgeCount++;