diff options
author | Dhaval <dhaval@rivosinc.com> | 2024-08-29 10:36:59 +0530 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-09-14 03:38:47 +0000 |
commit | c511663cfad216b4ec6a08be3c451784b0cb3ac5 (patch) | |
tree | 7e8b4d1f7a16ce6c12e64b7257165dda8b4f67c6 /UefiPayloadPkg | |
parent | 5cd9e7ce8752696ee3ccd8ec35670717364a6434 (diff) | |
download | edk2-c511663cfad216b4ec6a08be3c451784b0cb3ac5.tar.gz edk2-c511663cfad216b4ec6a08be3c451784b0cb3ac5.tar.bz2 edk2-c511663cfad216b4ec6a08be3c451784b0cb3ac5.zip |
UefiPayloadPkg: Add support for Special Purpose memory
We need to let UEFI know that there are cetain memory types
which are special purpose (CXL/HBM) etc and we may want to
avoid using them for UEFI purposes. Hence UPL needs to know
about such memory types.
Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Diffstat (limited to 'UefiPayloadPkg')
-rw-r--r-- | UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c b/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c index 4684f11497..24dd0be9ab 100644 --- a/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c +++ b/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c @@ -236,6 +236,7 @@ ParseReservedMemory ( UNIVERSAL_PAYLOAD_ACPI_TABLE *PlatformAcpiTable;
UNIVERSAL_PAYLOAD_SMBIOS_TABLE *SmbiosTable;
FDT_NODE_HEADER *NodePtr;
+ UINT32 Attribute;
PlatformAcpiTable = NULL;
@@ -273,6 +274,10 @@ ParseReservedMemory ( } else if (AsciiStrnCmp (TempStr, "runtime-data", AsciiStrLen ("runtime-data")) == 0) {
DEBUG ((DEBUG_INFO, " runtime-data"));
BuildMemoryAllocationHob (StartAddress, NumberOfBytes, EfiRuntimeServicesData);
+ } else if (AsciiStrnCmp (TempStr, "special-purpose", AsciiStrLen ("special-purpose")) == 0) {
+ Attribute = MEMORY_ATTRIBUTE_DEFAULT | EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE;
+ DEBUG ((DEBUG_INFO, " special-purpose memory"));
+ BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY, Attribute, StartAddress, NumberOfBytes);
} else if (AsciiStrnCmp (TempStr, "acpi", AsciiStrLen ("acpi")) == 0) {
DEBUG ((DEBUG_INFO, " acpi, StartAddress:%x, NumberOfBytes:%x", StartAddress, NumberOfBytes));
BuildMemoryAllocationHob (StartAddress, NumberOfBytes, EfiBootServicesData);
|