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 <[email protected]>
  • Loading branch information
dhaval-rivos authored and mergify[bot] committed Sep 14, 2024
1 parent 043045c commit 1f32b5a
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 @@ -816,6 +816,9 @@ ParseDtb (
UINT8 NodeType;
EFI_BOOT_MODE BootMode;
CHAR8 *GmaStr;
INTN NumRsv;
EFI_PHYSICAL_ADDRESS Addr;
UINT64 Size;
UINT16 SegmentNumber;
UINT64 CurrentPciBaseAddress;
UINT64 NextPciBaseAddress;
Expand Down Expand Up @@ -886,6 +889,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 1f32b5a

Please sign in to comment.