From: "PierreGondois" <pierre.gondois@arm.com>
To: devel@edk2.groups.io
Cc: Sami Mujawar <sami.mujawar@arm.com>,
Thomas Abraham <thomas.abraham@arm.com>,
Pierre Gondois <pierre.gondois@arm.com>
Subject: [edk2-devel] [PATCH v5 4/4] Platform/ARM: Juno: Use Pcd for _CPC generation
Date: Thu, 25 Jan 2024 16:21:43 +0100 [thread overview]
Message-ID: <20240125152143.624231-5-Pierre.Gondois@arm.com> (raw)
In-Reply-To: <20240125152143.624231-1-Pierre.Gondois@arm.com>
From: Pierre Gondois <pierre.gondois@arm.com>
Make use of the newly added PcdDevelopmentPlatformRelaxations
to decide to try generating _CPC information.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
Platform/ARM/JunoPkg/ArmJuno.dsc | 5 +++++
.../ConfigurationManagerDxe/ConfigurationManager.c | 11 ++++++++++-
.../ConfigurationManagerDxe.inf | 2 ++
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index 1ea0aba2655f..76f85e4c0c04 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -202,6 +202,11 @@ [PcdsFixedAtBuild.common]
# ACPI Table Version
#
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
+ #
+ # Allow some relaxation on some specific points for the platforms that desire it.
+ # BIT0: Allow the absence of some registers in the _CPC object.
+ #
+ gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdDevelopmentPlatformRelaxations|0x0
[PcdsPatchableInModule]
# Console Resolution (Full HD)
diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index d92a08749e87..875263f138ab 100644
--- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -1089,9 +1089,18 @@ InitializePlatformRepository (
DEBUG ((DEBUG_INFO, "Juno Rev = 0x%x\n", PlatformRepo->JunoRevision));
///
+ /// 1.
/// _CPC was only tested on Juno R2, so only enable support for this version.
///
- if ((ArmJunoPlatformRepositoryInfo.JunoRevision == JUNO_REVISION_R2)) {
+ /// 2.
+ /// Some _CPC registers cannot be populated for the Juno:
+ /// - PerformanceLimitedRegister
+ /// - ReferencePerformanceCounterRegister
+ /// - DeliveredPerformanceCounterRegister
+ /// Only build _CPC objects if relaxation regarding these registers
+ /// is allowed.
+ if ((ArmJunoPlatformRepositoryInfo.JunoRevision == JUNO_REVISION_R2) &&
+ (PcdGet64(PcdDevelopmentPlatformRelaxations) & BIT0)) {
PopulateCpcObjects ();
}
diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
index 53060bf56531..dea475375688 100644
--- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
@@ -77,6 +77,8 @@ [FixedPcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
+ gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdDevelopmentPlatformRelaxations
+
[Pcd]
[Depex]
--
2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114426): https://edk2.groups.io/g/devel/message/114426
Mute This Topic: https://groups.io/mt/103955623/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
prev parent reply other threads:[~2024-01-25 15:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 15:21 [edk2-devel] [PATCH v5 0/4] Platform/ARM: Enable _CPC/_PSD generation on Juno-r2 PierreGondois
2024-01-25 15:21 ` [edk2-devel] [PATCH v5 1/4] Platform/ARM: Juno: Fix typo PierreGondois
2024-01-25 15:21 ` [edk2-devel] [PATCH v5 2/4] Platform/ARM: Juno: Generate _PSD objects PierreGondois
2024-01-25 15:21 ` [edk2-devel] [PATCH v5 3/4] Platform/ARM: Juno: Generate _CPC objects for JunoR2 PierreGondois
2024-01-25 15:21 ` PierreGondois [this message]
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=20240125152143.624231-5-Pierre.Gondois@arm.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