From: "Nhi Pham" <nhi@os.amperecomputing.com>
To: devel@edk2.groups.io
Cc: patches@amperecomputing.com, quic_llindhol@quicinc.com,
ardb+tianocore@kernel.org,
Vu Nguyen <vunguyen@os.amperecomputing.com>,
Nhi Pham <nhi@os.amperecomputing.com>
Subject: [edk2-platforms][PATCH 1/1] AmpereAltraPkg: Update Memory Type Information hob
Date: Wed, 21 Dec 2022 12:07:58 +0700 [thread overview]
Message-ID: <20221221050758.2298393-1-nhi@os.amperecomputing.com> (raw)
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
reply other threads:[~2022-12-21 5:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221221050758.2298393-1-nhi@os.amperecomputing.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox