From ba1fff5292f5d8b9d99bb98dbbc9c29c439727e1 Mon Sep 17 00:00:00 2001 From: Chris Fernald Date: Wed, 12 Jul 2023 15:30:06 -0700 Subject: [PATCH] Add the ability to configure the memory type used for the FD region (#140) ## Description Add the ability to configure the memory type used for the FD region on the non-secure UEFI side. - [x] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? ## How This Was Tested Tested on internal platform build. ## Integration Instructions N/A --- ArmPkg/ArmPkg.dec | 4 ++++ ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c | 2 +- ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index 5411b9d400..377f443780 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -223,6 +223,10 @@ gArmTokenSpaceGuid.PcdFdSize|0|UINT32|0x0000002C gArmTokenSpaceGuid.PcdFvSize|0|UINT32|0x0000002E + + # MU_CHANGE: PCD To configure memory type used for FD region allocation. Defaults to EfiBootServicesData + gArmTokenSpaceGuid.PcdFdMemoryType|4|UINT32|0x1000046 # MU_CHANGE + # # Value to add to a host address to obtain a device address, using # unsigned 64-bit integer arithmetic on both ARM and AArch64. This diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c index d7afccfb85..ac311dc501 100644 --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c @@ -181,7 +181,7 @@ MemoryPeim ( BuildMemoryAllocationHob ( PcdGet64 (PcdFdBaseAddress), PcdGet32 (PcdFdSize), - EfiBootServicesData + PcdGet32 (PcdFdMemoryType) // MU_CHANGE ); Found = TRUE; diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf index 7c71a5ff5d..71a105a5f5 100644 --- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf +++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf @@ -39,6 +39,7 @@ [FixedPcd] gArmTokenSpaceGuid.PcdFdBaseAddress gArmTokenSpaceGuid.PcdFdSize + gArmTokenSpaceGuid.PcdFdMemoryType # MU_CHANGE gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize