UefiPayloadPkg: Handle ordering issue with option node

Option node provides info that is to be consumed by during
metadata creation for other nodes like root bridge; pci-enum-done
etc. Handle that dependency by storing option values in a variable
and then apply it during post processing. Ideally such cross node
dependency should be avoided in design. Scope for futher improvements.

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
This commit is contained in:
Dhaval 2024-08-30 20:26:34 +05:30 committed by mergify[bot]
parent 121af960e2
commit ed665ef38c
1 changed files with 6 additions and 3 deletions

View File

@ -623,7 +623,6 @@ VOID
ParsePciRootBridge ( ParsePciRootBridge (
IN VOID *Fdt, IN VOID *Fdt,
IN INT32 Node, IN INT32 Node,
IN UINT8 PciEnumDone,
IN UINT8 RootBridgeCount, IN UINT8 RootBridgeCount,
IN CHAR8 *GmaStr, IN CHAR8 *GmaStr,
IN UINT8 *index IN UINT8 *index
@ -658,7 +657,7 @@ ParsePciRootBridge (
mPciRootBridgeInfo->Header.Length = sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES); mPciRootBridgeInfo->Header.Length = sizeof (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES);
mPciRootBridgeInfo->Header.Revision = UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES_REVISION; mPciRootBridgeInfo->Header.Revision = UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES_REVISION;
mPciRootBridgeInfo->Count = RootBridgeCount; mPciRootBridgeInfo->Count = RootBridgeCount;
mPciRootBridgeInfo->ResourceAssigned = (BOOLEAN)PciEnumDone; mPciRootBridgeInfo->ResourceAssigned = FALSE;
} }
for (SubNode = FdtFirstSubnode (Fdt, Node); SubNode >= 0; SubNode = FdtNextSubnode (Fdt, SubNode)) { for (SubNode = FdtFirstSubnode (Fdt, Node); SubNode >= 0; SubNode = FdtNextSubnode (Fdt, SubNode)) {
@ -876,7 +875,7 @@ ParseDtb (
break; break;
case PciRootBridge: case PciRootBridge:
DEBUG ((DEBUG_INFO, "ParsePciRootBridge, index :%x\n", index)); DEBUG ((DEBUG_INFO, "ParsePciRootBridge, index :%x\n", index));
ParsePciRootBridge (Fdt, Node, PciEnumDone, RootBridgeCount, GmaStr, &index); ParsePciRootBridge (Fdt, Node, RootBridgeCount, GmaStr, &index);
DEBUG ((DEBUG_INFO, "After ParsePciRootBridge, index :%x\n", index)); DEBUG ((DEBUG_INFO, "After ParsePciRootBridge, index :%x\n", index));
break; break;
case Options: case Options:
@ -889,6 +888,10 @@ ParseDtb (
} }
} }
// Post processing: TODO: Need to look into it. Such cross dependency on DT nodes
// may not be good idea. Instead have this prop part of RB
mPciRootBridgeInfo->ResourceAssigned = (BOOLEAN)PciEnumDone;
((EFI_HOB_HANDOFF_INFO_TABLE *)(mHobList))->BootMode = BootMode; ((EFI_HOB_HANDOFF_INFO_TABLE *)(mHobList))->BootMode = BootMode;
DEBUG ((DEBUG_INFO, "\n")); DEBUG ((DEBUG_INFO, "\n"));