Skip to content

Commit

Permalink
UefiPayloadPkg: Handle simple reserved ranges from DT
Browse files Browse the repository at this point in the history
DT has a way to provide reserved images in a simpler tabular
manner. UPL should be able to support that.

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
  • Loading branch information
dhaval-rivos committed Aug 29, 2024
1 parent e9f82b0 commit f40e737
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,9 @@ ParseDtb (
UINT8 NodeType;
EFI_BOOT_MODE BootMode;
CHAR8 *GmaStr;
INTN NumRsv;
EFI_PHYSICAL_ADDRESS Addr;
UINT64 Size;

Fdt = FdtBase;
Depth = 0;
Expand Down Expand Up @@ -880,6 +883,16 @@ ParseDtb (
}
}

NumRsv = FdtNumRsv (Fdt);
/* Look for an existing entry and add it to the efi mem map. */
for (index = 0; index < NumRsv; index++) {
if (FdtGetMemRsv (Fdt, index, &Addr, &Size) != 0) {
continue;
}

BuildMemoryAllocationHob (Addr, Size, EfiReservedMemoryType);
}

index = RootBridgeCount - 1;
Depth = 0;
for (Node = FdtNextNode (Fdt, 0, &Depth); Node >= 0; Node = FdtNextNode (Fdt, Node, &Depth)) {
Expand Down

0 comments on commit f40e737

Please sign in to comment.