diff options
author | Dhaval <dhaval@rivosinc.com> | 2024-08-13 20:14:40 +0530 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-09-14 03:38:47 +0000 |
commit | 1f32b5a30e473d5e37881c3232f7226dd8311b44 (patch) | |
tree | 182a72afcfcf4a22a3ac8f7cb9cd00ae7ce189d7 /UefiPayloadPkg | |
parent | 043045cd6eb318451948f5fba7f9ef9e585a184f (diff) | |
download | edk2-1f32b5a30e473d5e37881c3232f7226dd8311b44.tar.gz edk2-1f32b5a30e473d5e37881c3232f7226dd8311b44.tar.bz2 edk2-1f32b5a30e473d5e37881c3232f7226dd8311b44.zip |
UefiPayloadPkg: Handle simple reserved ranges from DT
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>
Diffstat (limited to 'UefiPayloadPkg')
-rw-r--r-- | UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c b/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c index 93387e0ad5..09b7372b9a 100644 --- a/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c +++ b/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c @@ -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;
@@ -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)) {
|