public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms][PATCH 1/1] AmpereAltraPkg: Update Memory Type Information hob
@ 2022-12-21  5:07 Nhi Pham
  0 siblings, 0 replies; only message in thread
From: Nhi Pham @ 2022-12-21  5:07 UTC (permalink / raw)
  To: devel; +Cc: patches, quic_llindhol, ardb+tianocore, Vu Nguyen, Nhi Pham

From: Vu Nguyen <vunguyen@os.amperecomputing.com>

The hob was built but wasn't consumed yet. This change will let the DXE
Main shift the memory space consumed by DXE modules to the region
specified by the PcdSystemMemoryBase and PcdSystemMemorySize.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
 .../Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc | 16 ++++++++--------
 .../Library/MemoryInitPeiLib/MemoryInitPeiLib.c  | 10 ++++++++++
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
index 1e378e37e2b8..bf23edc50349 100644
--- a/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
+++ b/Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dsc.inc
@@ -371,14 +371,14 @@ [PcdsFixedAtBuild.common]
   # (the memory used, and the free memory that was prereserved
   # but not used).
   #
-  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0
-  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0
-  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0
-  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|80
-  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|65
-  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode|400
-  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData|20000
-  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode|20
+  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0x10
+  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0x60
+  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x30
+  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0x20
+  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0x30
+  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode|0
+  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData|0
+  gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode|0
   gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData|0
 
   gArmTokenSpaceGuid.PcdVFPEnabled|1
diff --git a/Silicon/Ampere/AmpereAltraPkg/Library/MemoryInitPeiLib/MemoryInitPeiLib.c b/Silicon/Ampere/AmpereAltraPkg/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
index 98aa1e77b3b4..cdefa521dab3 100644
--- a/Silicon/Ampere/AmpereAltraPkg/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
+++ b/Silicon/Ampere/AmpereAltraPkg/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
@@ -15,6 +15,11 @@
 #include <Library/MemoryAllocationLib.h>
 #include <Library/PcdLib.h>
 
+VOID
+BuildMemoryTypeInformationHob (
+  VOID
+  );
+
 STATIC
 VOID
 InitMmu (
@@ -89,5 +94,10 @@ MemoryPeim (
 
   InitMmu (MemoryTable);
 
+  if (FeaturePcdGet (PcdPrePiProduceMemoryTypeInformationHob)) {
+    // Optional feature that helps prevent EFI memory map fragmentation.
+    BuildMemoryTypeInformationHob ();
+  }
+
   return EFI_SUCCESS;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-21  5:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-21  5:07 [edk2-platforms][PATCH 1/1] AmpereAltraPkg: Update Memory Type Information hob Nhi Pham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox