mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
UefiPayloadPkg: Parse fdt and create smbios table
Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
This commit is contained in:
parent
4d35077048
commit
9fff9912fd
@ -226,15 +226,16 @@ ParseReservedMemory (
|
|||||||
IN INT32 Node
|
IN INT32 Node
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
INT32 SubNode;
|
INT32 SubNode;
|
||||||
INT32 TempLen;
|
INT32 TempLen;
|
||||||
CONST CHAR8 *TempStr;
|
CONST CHAR8 *TempStr;
|
||||||
CONST FDT_PROPERTY *PropertyPtr;
|
CONST FDT_PROPERTY *PropertyPtr;
|
||||||
UINT64 *Data64;
|
UINT64 *Data64;
|
||||||
UINT64 StartAddress;
|
UINT64 StartAddress;
|
||||||
UINT64 NumberOfBytes;
|
UINT64 NumberOfBytes;
|
||||||
UNIVERSAL_PAYLOAD_ACPI_TABLE *PlatformAcpiTable;
|
UNIVERSAL_PAYLOAD_ACPI_TABLE *PlatformAcpiTable;
|
||||||
FDT_NODE_HEADER *NodePtr;
|
UNIVERSAL_PAYLOAD_SMBIOS_TABLE *SmbiosTable;
|
||||||
|
FDT_NODE_HEADER *NodePtr;
|
||||||
|
|
||||||
PlatformAcpiTable = NULL;
|
PlatformAcpiTable = NULL;
|
||||||
|
|
||||||
@ -282,6 +283,15 @@ ParseReservedMemory (
|
|||||||
PlatformAcpiTable->Header.Revision = UNIVERSAL_PAYLOAD_ACPI_TABLE_REVISION;
|
PlatformAcpiTable->Header.Revision = UNIVERSAL_PAYLOAD_ACPI_TABLE_REVISION;
|
||||||
PlatformAcpiTable->Header.Length = sizeof (UNIVERSAL_PAYLOAD_ACPI_TABLE);
|
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) {
|
} else if (AsciiStrnCmp (TempStr, "acpi-nvs", AsciiStrLen ("acpi-nvs")) == 0) {
|
||||||
DEBUG ((DEBUG_INFO, " acpi-nvs"));
|
DEBUG ((DEBUG_INFO, " acpi-nvs"));
|
||||||
BuildMemoryAllocationHob (StartAddress, NumberOfBytes, EfiACPIMemoryNVS);
|
BuildMemoryAllocationHob (StartAddress, NumberOfBytes, EfiACPIMemoryNVS);
|
||||||
@ -840,9 +850,11 @@ ParseDtb (
|
|||||||
} // end of memory node
|
} // end of memory node
|
||||||
else {
|
else {
|
||||||
PropertyPtr = FdtGetProperty (Fdt, Node, "compatible", &TempLen);
|
PropertyPtr = FdtGetProperty (Fdt, Node, "compatible", &TempLen);
|
||||||
if (PropertyPtr == NULL)
|
if (PropertyPtr == NULL) {
|
||||||
continue;
|
continue;
|
||||||
TempStr = (CHAR8 *)(PropertyPtr->Data);
|
}
|
||||||
|
|
||||||
|
TempStr = (CHAR8 *)(PropertyPtr->Data);
|
||||||
if (AsciiStrnCmp (TempStr, "pci-rb", AsciiStrLen ("pci-rb")) == 0) {
|
if (AsciiStrnCmp (TempStr, "pci-rb", AsciiStrLen ("pci-rb")) == 0) {
|
||||||
RootBridgeCount++;
|
RootBridgeCount++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user