public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI
@ 2024-01-25 15:18 PierreGondois
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION PierreGondois
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

v1:
- https://edk2.groups.io/g/devel/message/104115
v2:
- https://edk2.groups.io/g/devel/message/104115
- Rebase patches on latest version.
v3:
- https://edk2.groups.io/g/devel/message/111567
[PATCH 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION
- Note the referenced spec spec is SCMI v3.2
[PATCH 02/11] ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support
- Note the referenced spec spec is SCMI v3.2
- Move SCMI_MESSAGE_ID_PERFORMANCE enum definition out of #pragma pack(1)
[PATCH 03/11] MdePkg/Acpi65: Add _PSD/_CPC/State Coordination Types macros
- Macros used to be added to ACPI 6.4 definition file, move them to the
  latest ACPI 6.5 definition file
[PATCH 10/11] DynamicTablesPkg: Add DynamicTablesScmiInfoLib
- Renamed ArmScmiInfoLib to DynamicTablesScmiInfoLib
[PATCH 11/11] DynamicTablesPkg: Remove check for _CPC field
- Add warning when missing one of the bypassed field
All patches:
- Rebase on latest master
- Use ACPI 6.5 definitions instead of 6.4 previously
v4:
- https://edk2.groups.io/g/devel/message/112378
- Extracted and submitted patch:
  - MdePkg/IndustryStandard: Add _PSD/_CPC/Coord types definitions
  separately at: [1]
v5:
[PATCH v4 05/10] DynamicTablesPkg: Add CM_ARM_PSD_INFO object
- Updated format from "0x%llx" -> "0x%x"
[PATCH v4 07/10] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD
- Corrected error handling
[PATCH v4 09/10] DynamicTablesPkg: Add DynamicTablesScmiInfoLib
- Moved DynamicTablesScmiInfoLib library to AARCH64 section
[PATCH v4 10/10] DynamicTablesPkg: Remove check for _CPC field
- Added a patch 'DynamicTablesPkg: Add PcdDevelopmentPlatformRelaxations Pcd'
  and make use of the new Pcd

The SCMI performance protocol allows to query the Operating Performance
Points (OPPs) available for each performance domain. Each OPP has a
specific frequency/power consumption/performance.

On Device Tree (DT) based platforms, the SCMI protocol is directly
available from the OS.
On ACPI based platforms, the _PSD objects allows to identify CPUs
belonging
to the same performance domain. CPUs belonging to the same performance
domain have the same frequency. The _CPC object allows to
describe/control the performance level/frequency of a CPU (i.e. its
frequency).

This patchset:
- Add support for 'DescribeFastchannel' SCMI performance protocol
- Add a object to the DynamicTablesPkg to describe the PSD information
- Allows to generate _PSD objects in the SsdtCpuTopologyGenerator
- Add a ArmScmiInfoLib library populating DynamicTablesPkg CPC objects,
  relying on the SCMI protocol to fetch the relevant information

A patchset for Juno-r2 platforms will be submitted to demonstrate
this functionality.

[1] https://edk2.groups.io/g/devel/message/111901

Pierre Gondois (11):
  ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION
  ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support
  DynamicTablesPkg: Use new CPC revision macro
  DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.h
  DynamicTablesPkg: Add CM_ARM_PSD_INFO object
  DynamicTablesPkg: Add PsdToken field to CM_ARM_GICC_INFO object
  DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD
  DynamicTablesPkg: Generate _PSD in SsdtCpuTopologyGenerator
  DynamicTablesPkg: Add DynamicTablesScmiInfoLib
  DynamicTablesPkg: Add PcdDevelopmentPlatformRelaxations Pcd
  DynamicTablesPkg: Exempt some _CPC field from checks

 .../ArmScmiDxe/ScmiPerformanceProtocol.c      |  80 ++++-
 .../Protocol/ArmScmiPerformanceProtocol.h     | 101 +++++-
 DynamicTablesPkg/DynamicTables.dsc.inc        |   3 +
 DynamicTablesPkg/DynamicTablesPkg.dec         |   8 +
 DynamicTablesPkg/DynamicTablesPkg.dsc         |   3 +
 .../Include/{AmlCpcInfo.h => AcpiObjects.h}   |  20 ++
 .../Include/ArmNameSpaceObjects.h             |  17 +-
 .../Include/Library/AmlLib/AmlLib.h           |  37 ++-
 .../Library/DynamicTablesScmiInfoLib.h        |  33 ++
 .../SsdtCpuTopologyGenerator.c                |  96 ++++++
 .../Library/Common/AmlLib/AmlLib.inf          |   3 +
 .../Common/AmlLib/CodeGen/AmlCodeGen.c        | 228 +++++++++++++-
 .../ConfigurationManagerObjectParser.c        |  14 +-
 .../DynamicTablesScmiInfoLib.c                | 297 ++++++++++++++++++
 .../DynamicTablesScmiInfoLib.inf              |  31 ++
 15 files changed, 941 insertions(+), 30 deletions(-)
 rename DynamicTablesPkg/Include/{AmlCpcInfo.h => AcpiObjects.h} (88%)
 create mode 100644 DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h
 create mode 100644 DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.c
 create mode 100644 DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf

-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114410): https://edk2.groups.io/g/devel/message/114410
Mute This Topic: https://groups.io/mt/103955491/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 18+ messages in thread

* [edk2-devel] [PATCH v5 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
@ 2024-01-25 15:18 ` PierreGondois
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 02/11] ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support PierreGondois
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

Rename PERFORMANCE_PROTOCOL_VERSION to reflect the different
versions of the protocol. The macro is neither used in edk2 nor
in edk2-platforms.

Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../Include/Protocol/ArmScmiPerformanceProtocol.h   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h b/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h
index 7e548e4765c2..a28f0f766e37 100644
--- a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h
+++ b/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h
@@ -1,12 +1,12 @@
 /** @file
 
-  Copyright (c) 2017-2021, Arm Limited. All rights reserved.
+  Copyright (c) 2017-2023, Arm Limited. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
-  System Control and Management Interface V1.0
-    http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
-    DEN0056A_System_Control_and_Management_Interface.pdf
+  System Control and Management Interface V3.2, latest version at:
+  - https://developer.arm.com/documentation/den0056/latest/
+
 **/
 
 #ifndef ARM_SCMI_PERFORMANCE_PROTOCOL_H_
@@ -14,7 +14,10 @@
 
 #include <Protocol/ArmScmi.h>
 
-#define PERFORMANCE_PROTOCOL_VERSION  0x10000
+/// Arm Scmi performance protocol versions.
+#define PERFORMANCE_PROTOCOL_VERSION_V1  0x10000
+#define PERFORMANCE_PROTOCOL_VERSION_V2  0x20000
+#define PERFORMANCE_PROTOCOL_VERSION_V3  0x30000
 
 #define ARM_SCMI_PERFORMANCE_PROTOCOL_GUID  { \
   0x9b8ba84, 0x3dd3, 0x49a6, {0xa0, 0x5a, 0x31, 0x34, 0xa5, 0xf0, 0x7b, 0xad} \
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114411): https://edk2.groups.io/g/devel/message/114411
Mute This Topic: https://groups.io/mt/103955492/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [edk2-devel] [PATCH v5 02/11] ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION PierreGondois
@ 2024-01-25 15:18 ` PierreGondois
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 03/11] DynamicTablesPkg: Use new CPC revision macro PierreGondois
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

The PERFORMANCE_DESCRIBE_FASTCHANNEL Scmi command is available
since SCMI v2.0 and allows to query information about the supported
fast-channels of the Scmi performance protocol.
Add support for this command.

Also move SCMI_MESSAGE_ID_PERFORMANCE enum definition up in the file
to use it in SCMI_PERFORMANCE_DESCRIBE_FASTCHANNEL function
declaration.

Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../ArmScmiDxe/ScmiPerformanceProtocol.c      | 80 +++++++++++++++--
 .../Protocol/ArmScmiPerformanceProtocol.h     | 88 +++++++++++++++++--
 2 files changed, 154 insertions(+), 14 deletions(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c b/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c
index 0f89808fbdf9..91efce4bf22d 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiPerformanceProtocol.c
@@ -1,12 +1,12 @@
 /** @file
 
-  Copyright (c) 2017-2021, Arm Limited. All rights reserved.<BR>
+  Copyright (c) 2017-2023, Arm Limited. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
-  System Control and Management Interface V1.0
-    http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
-    DEN0056A_System_Control_and_Management_Interface.pdf
+  System Control and Management Interface V3.2, latest version at:
+  - https://developer.arm.com/documentation/den0056/latest/
+
 **/
 
 #include <Library/BaseMemoryLib.h>
@@ -416,6 +416,75 @@ PerformanceLevelGet (
   return EFI_SUCCESS;
 }
 
+/** Discover the attributes of the FastChannel for the specified
+    performance domain and the specified message.
+
+  @param[in]  This        A Pointer to SCMI_PERFORMANCE_PROTOCOL Instance.
+  @param[in]  DomainId    Identifier for the performance domain.
+  @param[in]  MessageId   Message Id of the FastChannel to discover.
+                          Must be one of:
+                           - PERFORMANCE_LIMITS_SET
+                           - PERFORMANCE_LIMITS_GET
+                           - PERFORMANCE_LEVEL_SET
+                           - PERFORMANCE_LEVEL_GET
+  @param[out] FastChannel If success, contains the FastChannel description.
+
+  @retval EFI_SUCCESS             Performance level got successfully.
+  @retval EFI_DEVICE_ERROR        SCP returns an SCMI error.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_TIMEOUT             Time out.
+  @retval EFI_UNSUPPORTED         Unsupported.
+**/
+EFI_STATUS
+DescribeFastchannel (
+  IN  SCMI_PERFORMANCE_PROTOCOL     *This,
+  IN  UINT32                        DomainId,
+  IN  SCMI_MESSAGE_ID_PERFORMANCE   MessageId,
+  OUT SCMI_PERFORMANCE_FASTCHANNEL  *FastChannel
+  )
+{
+  EFI_STATUS    Status;
+  SCMI_COMMAND  Cmd;
+  UINT32        PayloadLength;
+  UINT32        *ReturnValues;
+  UINT32        *MessageParams;
+
+  if ((This == NULL)  ||
+      (FastChannel == NULL))
+  {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Status = ScmiCommandGetPayload (&MessageParams);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  *MessageParams++ = DomainId;
+  *MessageParams   = MessageId;
+
+  Cmd.ProtocolId = ScmiProtocolIdPerformance;
+  Cmd.MessageId  = ScmiMessageIdPerformanceDescribeFastchannel;
+  PayloadLength  = sizeof (DomainId) + sizeof (MessageId);
+
+  Status = ScmiCommandExecute (
+             &Cmd,
+             &PayloadLength,
+             &ReturnValues
+             );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  CopyMem (
+    FastChannel,
+    ReturnValues,
+    sizeof (SCMI_PERFORMANCE_FASTCHANNEL)
+    );
+
+  return Status;
+}
+
 // Instance of the SCMI performance management protocol.
 STATIC CONST SCMI_PERFORMANCE_PROTOCOL  PerformanceProtocol = {
   PerformanceGetVersion,
@@ -425,7 +494,8 @@ STATIC CONST SCMI_PERFORMANCE_PROTOCOL  PerformanceProtocol = {
   PerformanceLimitsSet,
   PerformanceLimitsGet,
   PerformanceLevelSet,
-  PerformanceLevelGet
+  PerformanceLevelGet,
+  DescribeFastchannel,
 };
 
 /** Initialize performance management protocol and install on a given Handle.
diff --git a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h b/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h
index a28f0f766e37..c69efe7408e1 100644
--- a/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h
+++ b/ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h
@@ -79,8 +79,58 @@ typedef struct {
   UINT32    RangeMin;
 } SCMI_PERFORMANCE_LIMITS;
 
+/// Doorbell Support bit.
+#define SCMI_PERF_FC_ATTRIB_HAS_DOORBELL  BIT0
+
+/// Performance protocol describe fastchannel
+typedef struct {
+  /// Attributes.
+  UINT32    Attributes;
+
+  /// Rate limit.
+  UINT32    RateLimit;
+
+  /// Lower 32 bits of the FastChannel address.
+  UINT32    ChanAddrLow;
+
+  /// Higher 32 bits of the FastChannel address.
+  UINT32    ChanAddrHigh;
+
+  /// Size of the FastChannel in bytes.
+  UINT32    ChanSize;
+
+  /// Lower 32 bits of the doorbell address.
+  UINT32    DoorbellAddrLow;
+
+  /// Higher 32 bits of the doorbell address.
+  UINT32    DoorbellAddrHigh;
+
+  /// Mask of lower 32 bits to set when writing to the doorbell register.
+  UINT32    DoorbellSetMaskLow;
+
+  /// Mask of higher 32 bits to set when writing to the doorbell register.
+  UINT32    DoorbellSetMaskHigh;
+
+  /// Mask of lower 32 bits to preserve when writing to the doorbell register.
+  UINT32    DoorbellPreserveMaskLow;
+
+  /// Mask of higher 32 bits to preserve when writing to the doorbell register.
+  UINT32    DoorbellPreserveMaskHigh;
+} SCMI_PERFORMANCE_FASTCHANNEL;
+
 #pragma pack()
 
+/// SCMI Message Ids for the Performance Protocol.
+typedef enum {
+  ScmiMessageIdPerformanceDomainAttributes    = 0x3,
+  ScmiMessageIdPerformanceDescribeLevels      = 0x4,
+  ScmiMessageIdPerformanceLimitsSet           = 0x5,
+  ScmiMessageIdPerformanceLimitsGet           = 0x6,
+  ScmiMessageIdPerformanceLevelSet            = 0x7,
+  ScmiMessageIdPerformanceLevelGet            = 0x8,
+  ScmiMessageIdPerformanceDescribeFastchannel = 0xB,
+} SCMI_MESSAGE_ID_PERFORMANCE;
+
 /** Return version of the performance management protocol supported by SCP.
    firmware.
 
@@ -238,6 +288,34 @@ EFI_STATUS
   OUT UINT32                    *Level
   );
 
+/** Discover the attributes of the FastChannel for the specified
+    performance domain and the specified message.
+
+  @param[in]  This        A Pointer to SCMI_PERFORMANCE_PROTOCOL Instance.
+  @param[in]  DomainId    Identifier for the performance domain.
+  @param[in]  MessageId   Message Id of the FastChannel to discover.
+                          Must be one of:
+                           - PERFORMANCE_LIMITS_SET
+                           - PERFORMANCE_LIMITS_GET
+                           - PERFORMANCE_LEVEL_SET
+                           - PERFORMANCE_LEVEL_GET
+  @param[out] FastChannel If success, contains the FastChannel description.
+
+  @retval EFI_SUCCESS             Performance level got successfully.
+  @retval EFI_DEVICE_ERROR        SCP returns an SCMI error.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_TIMEOUT             Time out.
+  @retval EFI_UNSUPPORTED         Unsupported.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *SCMI_PERFORMANCE_DESCRIBE_FASTCHANNEL)(
+  IN  SCMI_PERFORMANCE_PROTOCOL       *This,
+  IN  UINT32                          DomainId,
+  IN  SCMI_MESSAGE_ID_PERFORMANCE     MessageId,
+  OUT SCMI_PERFORMANCE_FASTCHANNEL    *FastChannel
+  );
+
 typedef struct _SCMI_PERFORMANCE_PROTOCOL {
   SCMI_PERFORMANCE_GET_VERSION              GetVersion;
   SCMI_PERFORMANCE_GET_ATTRIBUTES           GetProtocolAttributes;
@@ -247,15 +325,7 @@ typedef struct _SCMI_PERFORMANCE_PROTOCOL {
   SCMI_PERFORMANCE_LIMITS_GET               LimitsGet;
   SCMI_PERFORMANCE_LEVEL_SET                LevelSet;
   SCMI_PERFORMANCE_LEVEL_GET                LevelGet;
+  SCMI_PERFORMANCE_DESCRIBE_FASTCHANNEL     DescribeFastchannel;
 } SCMI_PERFORMANCE_PROTOCOL;
 
-typedef enum {
-  ScmiMessageIdPerformanceDomainAttributes = 0x3,
-  ScmiMessageIdPerformanceDescribeLevels   = 0x4,
-  ScmiMessageIdPerformanceLimitsSet        = 0x5,
-  ScmiMessageIdPerformanceLimitsGet        = 0x6,
-  ScmiMessageIdPerformanceLevelSet         = 0x7,
-  ScmiMessageIdPerformanceLevelGet         = 0x8,
-} SCMI_MESSAGE_ID_PERFORMANCE;
-
 #endif /* ARM_SCMI_PERFORMANCE_PROTOCOL_H_ */
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114412): https://edk2.groups.io/g/devel/message/114412
Mute This Topic: https://groups.io/mt/103955494/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [edk2-devel] [PATCH v5 03/11] DynamicTablesPkg: Use new CPC revision macro
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION PierreGondois
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 02/11] ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support PierreGondois
@ 2024-01-25 15:18 ` PierreGondois
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 04/11] DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.h PierreGondois
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

Make use of the newly added CPC revision macro.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
index d4e3e252cbe6..949aee2f6961 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
@@ -3524,7 +3524,7 @@ AmlCreateCpcNode (
   }
 
   // Revision 3 per ACPI 6.4 specification
-  if (CpcInfo->Revision == 3) {
+  if (CpcInfo->Revision == EFI_ACPI_6_5_AML_CPC_REVISION) {
     // NumEntries 23 per ACPI 6.4 specification
     NumberOfEntries = 23;
   } else {
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114413): https://edk2.groups.io/g/devel/message/114413
Mute This Topic: https://groups.io/mt/103955495/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [edk2-devel] [PATCH v5 04/11] DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.h
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
                   ` (2 preceding siblings ...)
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 03/11] DynamicTablesPkg: Use new CPC revision macro PierreGondois
@ 2024-01-25 15:18 ` PierreGondois
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 05/11] DynamicTablesPkg: Add CM_ARM_PSD_INFO object PierreGondois
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

The DynamicTables framework uses the AmlLib to generate some
Aml objects. It is done by using structured known by both
frameworks, e.g. the AML_CPC_INFO/CM_ARM_CPC_INFO structures.

To prepare adding similar structures (e.g. representing _PSD
information), rename AmlCpcInfo.h to AcpiObjects.h. This new
file will contain all the structures used by the AmlLib and
the DynamicTables framework.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 DynamicTablesPkg/Include/{AmlCpcInfo.h => AcpiObjects.h}    | 0
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h              | 2 +-
 DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h            | 2 +-
 DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c | 2 +-
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename DynamicTablesPkg/Include/{AmlCpcInfo.h => AcpiObjects.h} (100%)

diff --git a/DynamicTablesPkg/Include/AmlCpcInfo.h b/DynamicTablesPkg/Include/AcpiObjects.h
similarity index 100%
rename from DynamicTablesPkg/Include/AmlCpcInfo.h
rename to DynamicTablesPkg/Include/AcpiObjects.h
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 8c00bdac20bb..453cc3fe83fa 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -13,7 +13,7 @@
 #ifndef ARM_NAMESPACE_OBJECTS_H_
 #define ARM_NAMESPACE_OBJECTS_H_
 
-#include <AmlCpcInfo.h>
+#include <AcpiObjects.h>
 #include <StandardNameSpaceObjects.h>
 
 #pragma pack(1)
diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 043ec3d8428f..01e37b089897 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -37,7 +37,7 @@
   @}
 */
 
-#include <AmlCpcInfo.h>
+#include <AcpiObjects.h>
 #include <IndustryStandard/Acpi.h>
 
 #ifndef AML_HANDLE
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
index 949aee2f6961..9040192f8c3c 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
@@ -12,7 +12,7 @@
 #include <AcpiTableGenerator.h>
 
 #include <AmlCoreInterface.h>
-#include <AmlCpcInfo.h>
+#include <AcpiObjects.h>
 #include <AmlEncoding/Aml.h>
 #include <Api/AmlApiHelper.h>
 #include <CodeGen/AmlResourceDataCodeGen.h>
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114414): https://edk2.groups.io/g/devel/message/114414
Mute This Topic: https://groups.io/mt/103955498/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [edk2-devel] [PATCH v5 05/11] DynamicTablesPkg: Add CM_ARM_PSD_INFO object
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
                   ` (3 preceding siblings ...)
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 04/11] DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.h PierreGondois
@ 2024-01-25 15:18 ` PierreGondois
  2024-01-26 11:34   ` Sami Mujawar
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 06/11] DynamicTablesPkg: Add PsdToken field to CM_ARM_GICC_INFO object PierreGondois
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

Add an object describing _PSD information, cf. ACPI 6.5,
s8.4.5.5 _PSD (P-State Dependency).
Also add the corresponding CmObjParser.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 DynamicTablesPkg/Include/AcpiObjects.h        | 20 +++++++++++++++++++
 .../Include/ArmNameSpaceObjects.h             | 10 ++++++++++
 .../ConfigurationManagerObjectParser.c        | 11 ++++++++++
 3 files changed, 41 insertions(+)

diff --git a/DynamicTablesPkg/Include/AcpiObjects.h b/DynamicTablesPkg/Include/AcpiObjects.h
index 8981c229544a..2bdabb2724bd 100644
--- a/DynamicTablesPkg/Include/AcpiObjects.h
+++ b/DynamicTablesPkg/Include/AcpiObjects.h
@@ -1,6 +1,7 @@
 /** @file
 
   Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.<BR>
+  Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
@@ -119,6 +120,25 @@ typedef struct AmlCpcInfo {
   UINT32                                    NominalFrequencyInteger;
 } AML_CPC_INFO;
 
+/** A structure that describes a
+    P-State Dependency (PSD) Info.
+
+  Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency).
+*/
+typedef struct AmlPsdInfo {
+  /// Revision.
+  UINT8     Revision;
+
+  /// Domain Id.
+  UINT32    Domain;
+
+  /// Coordination type.
+  UINT32    CoordType;
+
+  /// Number of processors belonging to the Domain.
+  UINT32    NumProc;
+} AML_PSD_INFO;
+
 #pragma pack()
 
 #endif //AML_CPC_INFO_H_
diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 453cc3fe83fa..3748cb7c8085 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -72,6 +72,7 @@ typedef enum ArmObjectID {
   EArmObjPccSubspaceType4Info,                                 ///< 47 - Pcc Subspace Type 4 Info
   EArmObjPccSubspaceType5Info,                                 ///< 48 - Pcc Subspace Type 5 Info
   EArmObjEtInfo,                                               ///< 49 - Embedded Trace Extension/Module Info
+  EArmObjPsdInfo,                                              ///< 50 - P-State Dependency (PSD) Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -1327,6 +1328,15 @@ typedef struct CmArmEtInfo {
   ARM_ET_TYPE    EtType;
 } CM_ARM_ET_INFO;
 
+/** A structure that describes a
+    P-State Dependency (PSD) Info.
+
+    Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency).
+
+    ID: EArmObjPsdInfo
+*/
+typedef AML_PSD_INFO CM_ARM_PSD_INFO;
+
 #pragma pack()
 
 #endif // ARM_NAMESPACE_OBJECTS_H_
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index c1a752841943..dc60a75eabb1 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -669,6 +669,15 @@ STATIC CONST CM_OBJ_PARSER  CmArmEtInfo[] = {
   { "EtType", sizeof (ARM_ET_TYPE), "0x%x", NULL }
 };
 
+/** A parser for EArmObjPsdInfo.
+*/
+STATIC CONST CM_OBJ_PARSER  CmArmPsdInfoParser[] = {
+  { "Revision",  1, "0x%x", NULL },
+  { "DomainId",  4, "0x%x", NULL },
+  { "CoordType", 4, "0x%x", NULL },
+  { "NumProc",   4, "0x%x", NULL },
+};
+
 /** A parser for Arm namespace objects.
 */
 STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
@@ -767,6 +776,8 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
     ARRAY_SIZE (CmArmPccSubspaceType5InfoParser) },
   { "EArmObjEtInfo",                       CmArmEtInfo,
     ARRAY_SIZE (CmArmEtInfo) },
+  { "EArmObjPsdInfo",                      CmArmPsdInfoParser,
+    ARRAY_SIZE (CmArmPsdInfoParser) },
   { "EArmObjMax",                          NULL,                                  0                                },
 };
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114415): https://edk2.groups.io/g/devel/message/114415
Mute This Topic: https://groups.io/mt/103955499/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [edk2-devel] [PATCH v5 06/11] DynamicTablesPkg: Add PsdToken field to CM_ARM_GICC_INFO object
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
                   ` (4 preceding siblings ...)
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 05/11] DynamicTablesPkg: Add CM_ARM_PSD_INFO object PierreGondois
@ 2024-01-25 15:18 ` PierreGondois
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 07/11] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD PierreGondois
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

The _PSD object (cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency)
allows to describe CPU's power state dependencies. Add a PsdToken
field to the CM_ARM_GICC_INFO object so that interdependent CPUs
can reference the same CM_ARM_PSD_INFO object.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h               | 5 +++++
 .../Common/TableHelperLib/ConfigurationManagerObjectParser.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 3748cb7c8085..3805c5824773 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -218,6 +218,11 @@ typedef struct CmArmGicCInfo {
       i.e. a token referencing a CM_ARM_ET_INFO object.
   */
   CM_OBJECT_TOKEN    EtToken;
+
+  /** Optional field: Reference Token for the Psd info of this processor.
+      i.e. a token referencing a CM_ARM_PSD_INFO object.
+  */
+  CM_OBJECT_TOKEN    PsdToken;
 } CM_ARM_GICC_INFO;
 
 /** A structure that describes the
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index dc60a75eabb1..69b6eba23cf4 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -85,7 +85,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmGicCInfoParser[] = {
   { "AffinityFlags",                 4,                        "0x%x",   NULL },
   { "CpcToken",                      sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL },
   { "TRBEInterrupt",                 2,                        "0x%x",   NULL },
-  { "EtToken",                       sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL }
+  { "EtToken",                       sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL },
+  { "PsdToken",                      sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL },
 };
 
 /** A parser for EArmObjGicDInfo.
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114416): https://edk2.groups.io/g/devel/message/114416
Mute This Topic: https://groups.io/mt/103955503/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [edk2-devel] [PATCH v5 07/11] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
                   ` (5 preceding siblings ...)
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 06/11] DynamicTablesPkg: Add PsdToken field to CM_ARM_GICC_INFO object PierreGondois
@ 2024-01-25 15:18 ` PierreGondois
  2024-01-26 11:38   ` Sami Mujawar
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 08/11] DynamicTablesPkg: Generate _PSD in SsdtCpuTopologyGenerator PierreGondois
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

Add AmlCreatePsdNode() to the AmlLib to generate _PSD objects.
_PSD objects allow to describe 'performance control, P-state
or CPPC, logical processor dependency', Cf. ACPI 6.5,
s8.4.5.5 _PSD (P-State Dependency).

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../Include/Library/AmlLib/AmlLib.h           |  35 +++-
 .../Common/AmlLib/CodeGen/AmlCodeGen.c        | 188 +++++++++++++++++-
 2 files changed, 221 insertions(+), 2 deletions(-)

diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 01e37b089897..82d546408418 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -1,7 +1,7 @@
 /** @file
   AML Lib.
 
-  Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
+  Copyright (c) 2019 - 2023, Arm Limited. All rights reserved.<BR>
   Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -1805,4 +1805,37 @@ AmlCodeGenInvokeMethod (
   IN        AML_NODE_HANDLE   ParentNode
   );
 
+/** Create a _PSD node.
+
+  Creates and optionally adds the following node
+   Name(_PSD, Package()
+   {
+    NumEntries,  // Integer
+    Revision,    // Integer
+    Domain,      // Integer
+    CoordType,   // Integer
+    NumProc,     // Integer
+  })
+
+  Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency)
+
+  @ingroup CodeGenApis
+
+  @param [in]  PsdInfo      PsdInfo object
+  @param [in]  ParentNode   If provided, set ParentNode as the parent
+                            of the node created.
+  @param [out] NewPsdNode   If success and provided, contains the created node.
+
+  @retval EFI_SUCCESS             The function completed successfully.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AmlCreatePsdNode (
+  IN  AML_PSD_INFO            *PsdInfo,
+  IN  AML_NODE_HANDLE         ParentNode    OPTIONAL,
+  OUT AML_OBJECT_NODE_HANDLE  *NewPsdNode   OPTIONAL
+  );
+
 #endif // AML_LIB_H_
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
index 9040192f8c3c..6f3f46e3b1ed 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
@@ -1,7 +1,7 @@
 /** @file
   AML Code Generation.
 
-  Copyright (c) 2020 - 2022, Arm Limited. All rights reserved.<BR>
+  Copyright (c) 2020 - 2023, Arm Limited. All rights reserved.<BR>
   Copyright (C) 2023 - 2024, Advanced Micro Devices, Inc. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -4090,3 +4090,189 @@ exit_handler:
   FreePool (NodeStream);
   return Status;
 }
+
+/** Create a _PSD node.
+
+  Creates and optionally adds the following node
+   Name(_PSD, Package()
+   {
+    NumEntries,  // Integer
+    Revision,    // Integer
+    Domain,      // Integer
+    CoordType,   // Integer
+    NumProc,     // Integer
+  })
+
+  Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency)
+
+  @ingroup CodeGenApis
+
+  @param [in]  PsdInfo      PsdInfo object
+  @param [in]  ParentNode   If provided, set ParentNode as the parent
+                            of the node created.
+  @param [out] NewPsdNode   If success and provided, contains the created node.
+
+  @retval EFI_SUCCESS             The function completed successfully.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
+**/
+EFI_STATUS
+EFIAPI
+AmlCreatePsdNode (
+  IN  AML_PSD_INFO            *PsdInfo,
+  IN  AML_NODE_HANDLE         ParentNode    OPTIONAL,
+  OUT AML_OBJECT_NODE_HANDLE  *NewPsdNode   OPTIONAL
+  )
+{
+  EFI_STATUS              Status;
+  AML_OBJECT_NODE_HANDLE  PsdNode;
+  AML_OBJECT_NODE_HANDLE  PsdPackage;
+  AML_OBJECT_NODE_HANDLE  IntegerNode;
+  UINT32                  NumberOfEntries;
+
+  if ((PsdInfo == NULL) ||
+      ((ParentNode == NULL) && (NewPsdNode == NULL)))
+  {
+    Status = EFI_INVALID_PARAMETER;
+    ASSERT_EFI_ERROR (Status);
+    return Status;
+  }
+
+  // Revision 3 per ACPI 6.5 specification
+  if (PsdInfo->Revision == EFI_ACPI_6_5_AML_PSD_REVISION) {
+    // NumEntries 5 per ACPI 6.5 specification
+    NumberOfEntries = 5;
+  } else {
+    Status = EFI_INVALID_PARAMETER;
+    ASSERT_EFI_ERROR (Status);
+    return Status;
+  }
+
+  if (((PsdInfo->CoordType != ACPI_AML_COORD_TYPE_SW_ALL) &&
+       (PsdInfo->CoordType != ACPI_AML_COORD_TYPE_SW_ANY) &&
+       (PsdInfo->CoordType != ACPI_AML_COORD_TYPE_HW_ALL)) ||
+      (PsdInfo->NumProc == 0))
+  {
+    Status = EFI_INVALID_PARAMETER;
+    ASSERT_EFI_ERROR (Status);
+    return Status;
+  }
+
+  Status = AmlCodeGenNamePackage ("_PSD", NULL, &PsdNode);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    return Status;
+  }
+
+  // Get the Package object node of the _PSD node,
+  // which is the 2nd fixed argument (i.e. index 1).
+  PsdPackage = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
+                                         PsdNode,
+                                         EAmlParseIndexTerm1
+                                         );
+  if ((PsdPackage == NULL)                                              ||
+      (AmlGetNodeType ((AML_NODE_HANDLE)PsdPackage) != EAmlNodeObject)  ||
+      (!AmlNodeHasOpCode (PsdPackage, AML_PACKAGE_OP, 0)))
+  {
+    Status = EFI_INVALID_PARAMETER;
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  // NumEntries
+  Status = AmlCodeGenInteger (NumberOfEntries, &IntegerNode);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = AmlVarListAddTail (
+             (AML_NODE_HANDLE)PsdPackage,
+             (AML_NODE_HANDLE)IntegerNode
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    FreePool (IntegerNode);
+    goto error_handler;
+  }
+
+  // Revision
+  Status = AmlCodeGenInteger (PsdInfo->Revision, &IntegerNode);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = AmlVarListAddTail (
+             (AML_NODE_HANDLE)PsdPackage,
+             (AML_NODE_HANDLE)IntegerNode
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    FreePool (IntegerNode);
+    goto error_handler;
+  }
+
+  // Domain
+  Status = AmlCodeGenInteger (PsdInfo->Domain, &IntegerNode);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = AmlVarListAddTail (
+             (AML_NODE_HANDLE)PsdPackage,
+             (AML_NODE_HANDLE)IntegerNode
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    FreePool (IntegerNode);
+    goto error_handler;
+  }
+
+  // CoordType
+  Status = AmlCodeGenInteger (PsdInfo->CoordType, &IntegerNode);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = AmlVarListAddTail (
+             (AML_NODE_HANDLE)PsdPackage,
+             (AML_NODE_HANDLE)IntegerNode
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    FreePool (IntegerNode);
+    goto error_handler;
+  }
+
+  // Num Processors
+  Status = AmlCodeGenInteger (PsdInfo->NumProc, &IntegerNode);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = AmlVarListAddTail (
+             (AML_NODE_HANDLE)PsdPackage,
+             (AML_NODE_HANDLE)IntegerNode
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    FreePool (IntegerNode);
+    goto error_handler;
+  }
+
+  Status = LinkNode (PsdNode, ParentNode, NewPsdNode);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  return Status;
+
+error_handler:
+  AmlDeleteTree ((AML_NODE_HANDLE)PsdNode);
+  return Status;
+}
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114417): https://edk2.groups.io/g/devel/message/114417
Mute This Topic: https://groups.io/mt/103955504/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [edk2-devel] [PATCH v5 08/11] DynamicTablesPkg: Generate _PSD in SsdtCpuTopologyGenerator
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
                   ` (6 preceding siblings ...)
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 07/11] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD PierreGondois
@ 2024-01-25 15:18 ` PierreGondois
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 09/11] DynamicTablesPkg: Add DynamicTablesScmiInfoLib PierreGondois
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

Make use of the newly added AmlCreatePsdNode() to generate
_PSD objects.

_PSD objects allow to describe 'performance control, P-state
or CPPC, logical processor dependency', Cf. ACPI 6.4,
s8.4.5.5 _PSD (P-State Dependency).

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../SsdtCpuTopologyGenerator.c                | 96 +++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
index 724f33c660a8..9e3efb49e630 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
@@ -42,6 +42,7 @@ Requirements:
   - EArmObjCmRef (OPTIONAL)
   - EArmObjLpiInfo (OPTIONAL)
   - GetEArmObjEtInfo (OPTIONAL)
+  - EArmObjPsdInfo (OPTIONAL)
 */
 
 /** This macro expands to a function that retrieves the GIC
@@ -103,6 +104,16 @@ GET_OBJECT_LIST (
   CM_ARM_ET_INFO
   );
 
+/**
+  This macro expands to a function that retrieves the PSD
+  information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjPsdInfo,
+  CM_ARM_PSD_INFO
+  );
+
 /** Initialize the TokenTable.
 
   One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO
@@ -256,6 +267,75 @@ WriteAslName (
   return EFI_SUCCESS;
 }
 
+/** Create and add an _PSD Node to Cpu Node.
+
+  For instance, transform an AML node from:
+  Device (C002)
+  {
+      Name (_UID, 2)
+      Name (_HID, "ACPI0007")
+  }
+
+  To:
+  Device (C002)
+  {
+      Name (_UID, 2)
+      Name (_HID, "ACPI0007")
+      Name (_PSD, Package()
+      {
+        NumEntries,      // Integer
+        Revision,        // Integer
+        Domain,          // Integer
+        CoordType,       // Integer
+        NumProcessors,   // Integer
+      })
+  }
+
+  @param [in]  Generator              The SSDT Cpu Topology generator.
+  @param [in]  CfgMgrProtocol         Pointer to the Configuration Manager
+                                      Protocol Interface.
+  @param [in]  GicCInfo               Pointer to the CM_ARM_GICC_INFO object
+                                      describing the Cpu.
+  @param [in]  Node                   CPU Node to which the _CPC node is
+                                      attached.
+
+  @retval EFI_SUCCESS             The function completed successfully.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+CreateAmlPsdNode (
+  IN  ACPI_CPU_TOPOLOGY_GENERATOR                         *Generator,
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN  CM_ARM_GICC_INFO                                    *GicCInfo,
+  IN  AML_OBJECT_NODE_HANDLE                              *Node
+  )
+{
+  EFI_STATUS       Status;
+  CM_ARM_PSD_INFO  *PsdInfo;
+
+  Status = GetEArmObjPsdInfo (
+             CfgMgrProtocol,
+             GicCInfo->PsdToken,
+             &PsdInfo,
+             NULL
+             );
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    return Status;
+  }
+
+  Status = AmlCreatePsdNode (
+             PsdInfo,
+             Node,
+             NULL
+             );
+  ASSERT_EFI_ERROR (Status);
+  return Status;
+}
+
 /** Create and add an _CPC Node to Cpu Node.
 
   For instance, transform an AML node from:
@@ -842,6 +922,14 @@ CreateAmlCpuFromProcHierarchy (
     }
   }
 
+  if (GicCInfo->PsdToken != CM_NULL_TOKEN) {
+    Status = CreateAmlPsdNode (Generator, CfgMgrProtocol, GicCInfo, CpuNode);
+    if (EFI_ERROR (Status)) {
+      ASSERT_EFI_ERROR (Status);
+      return Status;
+    }
+  }
+
   // If a CPC info is associated with the
   // GicCinfo, create an _CPC method returning them.
   if (GicCInfo->CpcToken != CM_NULL_TOKEN) {
@@ -1299,6 +1387,14 @@ CreateTopologyFromGicC (
       break;
     }
 
+    if (GicCInfo->PsdToken != CM_NULL_TOKEN) {
+      Status = CreateAmlPsdNode (Generator, CfgMgrProtocol, GicCInfo, CpuNode);
+      if (EFI_ERROR (Status)) {
+        ASSERT_EFI_ERROR (Status);
+        return Status;
+      }
+    }
+
     // If a CPC info is associated with the
     // GicCinfo, create an _CPC method returning them.
     if (GicCInfo[Index].CpcToken != CM_NULL_TOKEN) {
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114418): https://edk2.groups.io/g/devel/message/114418
Mute This Topic: https://groups.io/mt/103955506/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [edk2-devel] [PATCH v5 09/11] DynamicTablesPkg: Add DynamicTablesScmiInfoLib
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
                   ` (7 preceding siblings ...)
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 08/11] DynamicTablesPkg: Generate _PSD in SsdtCpuTopologyGenerator PierreGondois
@ 2024-01-25 15:18 ` PierreGondois
  2024-01-29 14:29   ` Sami Mujawar
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 10/11] DynamicTablesPkg: Add PcdDevelopmentPlatformRelaxations Pcd PierreGondois
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

The SCP holds some power information that could be advertised
through the _CPC object. The communication with the SCP is done
through SCMI protocols (c.f. ArmScmiDxe).

Use the SCMI protocols to query information and feed it to
the DynamicTablesPkg.

Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 DynamicTablesPkg/DynamicTables.dsc.inc        |   3 +
 DynamicTablesPkg/DynamicTablesPkg.dec         |   4 +
 DynamicTablesPkg/DynamicTablesPkg.dsc         |   3 +
 .../Library/DynamicTablesScmiInfoLib.h        |  33 ++
 .../DynamicTablesScmiInfoLib.c                | 297 ++++++++++++++++++
 .../DynamicTablesScmiInfoLib.inf              |  31 ++
 6 files changed, 371 insertions(+)
 create mode 100644 DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h
 create mode 100644 DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.c
 create mode 100644 DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc b/DynamicTablesPkg/DynamicTables.dsc.inc
index 8c99574097ad..19ca62d6a85c 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -21,6 +21,9 @@ [LibraryClasses.common]
   TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
   SmbiosStringTableLib|DynamicTablesPkg/Library/Common/SmbiosStringTableLib/SmbiosStringTableLib.inf
 
+[LibraryClasses.AARCH64]
+  DynamicTablesScmiInfoLib|DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf
+
 [Components.common]
   #
   # Dynamic Tables Manager Dxe
diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec b/DynamicTablesPkg/DynamicTablesPkg.dec
index cfbcbb9569f1..25355ace884b 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dec
+++ b/DynamicTablesPkg/DynamicTablesPkg.dec
@@ -42,6 +42,10 @@ [LibraryClasses]
   ##  @libraryclass  Defines a set of SMBIOS string helper methods.
   SmbiosStringTableLib|Include/Library/SmbiosStringTableLib.h
 
+[LibraryClasses.AARCH64]
+  ##  @libraryclass  Defines a set of APIs to populate CmObj using SCMI.
+  DynamicTablesScmiInfoLib|Include/Library/DynamicTablesScmiInfoLib.h
+
 [Protocols]
   # Configuration Manager Protocol GUID
   gEdkiiConfigurationManagerProtocolGuid = { 0xd85a4835, 0x5a82, 0x4894, { 0xac, 0x2, 0x70, 0x6f, 0x43, 0xd5, 0x97, 0x8e } }
diff --git a/DynamicTablesPkg/DynamicTablesPkg.dsc b/DynamicTablesPkg/DynamicTablesPkg.dsc
index 2f35ac82f20b..cf06f0731a23 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dsc
+++ b/DynamicTablesPkg/DynamicTablesPkg.dsc
@@ -51,6 +51,9 @@ [Components.common]
 [Components.ARM, Components.AARCH64]
   DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf
 
+[Components.AARCH64]
+  DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf
+
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
 
diff --git a/DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h b/DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h
new file mode 100644
index 000000000000..ff6b47d51fe8
--- /dev/null
+++ b/DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h
@@ -0,0 +1,33 @@
+/** @file
+  Arm SCMI Info Library.
+
+  Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef ARM_SCMI_INFO_LIB_H_
+#define ARM_SCMI_INFO_LIB_H_
+
+#include <ConfigurationManagerObject.h>
+
+/** Populate a AML_CPC_INFO object based on SCMI information.
+
+  @param[in]  DomainId    Identifier for the performance domain.
+  @param[out] CpcInfo     If success, this structure was populated from
+                          information queried to the SCP.
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_DEVICE_ERROR        Device error.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_TIMEOUT             Time out.
+  @retval EFI_UNSUPPORTED         Unsupported.
+**/
+EFI_STATUS
+EFIAPI
+DynamicTablesScmiInfoGetFastChannel (
+  IN  UINT32        DomainId,
+  OUT AML_CPC_INFO  *CpcInfo
+  );
+
+#endif // ARM_SCMI_INFO_LIB_H_
diff --git a/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.c b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.c
new file mode 100644
index 000000000000..da5bc1895778
--- /dev/null
+++ b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.c
@@ -0,0 +1,297 @@
+/** @file
+  Arm SCMI Info Library.
+
+  Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.<BR>
+
+  Arm Functional Fixed Hardware Specification:
+  - https://developer.arm.com/documentation/den0048/latest/
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Library/AcpiLib.h>
+#include <Library/DynamicTablesScmiInfoLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Protocol/ArmScmi.h>
+#include <Protocol/ArmScmiPerformanceProtocol.h>
+
+/** Arm FFH registers
+
+  Cf. Arm Functional Fixed Hardware Specification
+  s3.2 Performance management and Collaborative Processor Performance Control
+*/
+#define ARM_FFH_DELIVERED_PERF_COUNTER_REGISTER  0x0
+#define ARM_FFH_REFERENCE_PERF_COUNTER_REGISTER  0x1
+
+/// Arm SCMI performance protocol.
+STATIC SCMI_PERFORMANCE_PROTOCOL  *ScmiPerfProtocol;
+
+/** Arm SCMI Info Library constructor.
+
+  @param  ImageHandle   Image of the loaded driver.
+  @param  SystemTable   Pointer to the System Table.
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_DEVICE_ERROR        Device error.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_NOT_FOUND           Not Found
+  @retval EFI_TIMEOUT             Timeout.
+  @retval EFI_UNSUPPORTED         Unsupported.
+**/
+EFI_STATUS
+EFIAPI
+DynamicTablesScmiInfoLibConstructor (
+  IN  EFI_HANDLE        ImageHandle,
+  IN  EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  EFI_STATUS  Status;
+  UINT32      Version;
+
+  Status = gBS->LocateProtocol (
+                  &gArmScmiPerformanceProtocolGuid,
+                  NULL,
+                  (VOID **)&ScmiPerfProtocol
+                  );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  Status = ScmiPerfProtocol->GetVersion (ScmiPerfProtocol, &Version);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  // FastChannels were added in SCMI v2.0 spec.
+  if (Version < PERFORMANCE_PROTOCOL_VERSION_V2) {
+    DEBUG ((
+      DEBUG_ERROR,
+      "DynamicTablesScmiInfoLib requires SCMI version > 2.0\n"
+      ));
+    return EFI_UNSUPPORTED;
+  }
+
+  return Status;
+}
+
+/** Get the OPPs/performance states of a power domain.
+
+  This function is a wrapper around the SCMI PERFORMANCE_DESCRIBE_LEVELS
+  command. The list of discrete performance states is returned in a buffer
+  that must be freed by the caller.
+
+  @param[in]  DomainId        Identifier for the performance domain.
+  @param[out] LevelArray      If success, pointer to the list of list of
+                              performance state. This memory must be freed by
+                              the caller.
+  @param[out] LevelArrayCount If success, contains the number of states in
+                              LevelArray.
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_DEVICE_ERROR        Device error.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_TIMEOUT             Time out.
+  @retval EFI_UNSUPPORTED         Unsupported.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+DynamicTablesScmiInfoDescribeLevels (
+  IN  UINT32                  DomainId,
+  OUT SCMI_PERFORMANCE_LEVEL  **LevelArray,
+  OUT UINT32                  *LevelArrayCount
+  )
+{
+  EFI_STATUS              Status;
+  SCMI_PERFORMANCE_LEVEL  *Array;
+  UINT32                  Count;
+  UINT32                  Size;
+
+  if ((ScmiPerfProtocol == NULL)  ||
+      (LevelArray == NULL)  ||
+      (LevelArrayCount == NULL))
+  {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  // First call to get the number of levels.
+  Size   = 0;
+  Status = ScmiPerfProtocol->DescribeLevels (
+                               ScmiPerfProtocol,
+                               DomainId,
+                               &Count,
+                               &Size,
+                               NULL
+                               );
+  if (Status != EFI_BUFFER_TOO_SMALL) {
+    // EFI_SUCCESS is not a valid option.
+    if (Status == EFI_SUCCESS) {
+      return EFI_INVALID_PARAMETER;
+    } else {
+      return Status;
+    }
+  }
+
+  Array = AllocateZeroPool (Size);
+  if (Array == NULL) {
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  // Second call to get the descriptions of the levels.
+  Status = ScmiPerfProtocol->DescribeLevels (
+                               ScmiPerfProtocol,
+                               DomainId,
+                               &Count,
+                               &Size,
+                               Array
+                               );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  *LevelArray      = Array;
+  *LevelArrayCount = Count;
+
+  return Status;
+}
+
+/** Populate a AML_CPC_INFO object based on SCMI information.
+
+  @param[in]  DomainId    Identifier for the performance domain.
+  @param[out] CpcInfo     If success, this structure was populated from
+                          information queried to the SCP.
+
+  @retval EFI_SUCCESS             Success.
+  @retval EFI_DEVICE_ERROR        Device error.
+  @retval EFI_INVALID_PARAMETER   Invalid parameter.
+  @retval EFI_TIMEOUT             Time out.
+  @retval EFI_UNSUPPORTED         Unsupported.
+**/
+EFI_STATUS
+EFIAPI
+DynamicTablesScmiInfoGetFastChannel (
+  IN  UINT32        DomainId,
+  OUT AML_CPC_INFO  *CpcInfo
+  )
+{
+  EFI_STATUS                          Status;
+  SCMI_PERFORMANCE_FASTCHANNEL        FcLevelGet;
+  SCMI_PERFORMANCE_FASTCHANNEL        FcLimitsSet;
+  SCMI_PERFORMANCE_DOMAIN_ATTRIBUTES  DomainAttributes;
+
+  SCMI_PERFORMANCE_LEVEL  *LevelArray;
+  UINT32                  LevelCount;
+
+  UINT64  FcLevelGetAddr;
+  UINT64  FcLimitsMaxSetAddr;
+  UINT64  FcLimitsMinSetAddr;
+
+  if ((ScmiPerfProtocol == NULL)  ||
+      (CpcInfo == NULL))
+  {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Status = ScmiPerfProtocol->DescribeFastchannel (
+                               ScmiPerfProtocol,
+                               DomainId,
+                               ScmiMessageIdPerformanceLevelSet,
+                               &FcLevelGet
+                               );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  Status = ScmiPerfProtocol->DescribeFastchannel (
+                               ScmiPerfProtocol,
+                               DomainId,
+                               ScmiMessageIdPerformanceLimitsSet,
+                               &FcLimitsSet
+                               );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  Status = ScmiPerfProtocol->GetDomainAttributes (
+                               ScmiPerfProtocol,
+                               DomainId,
+                               &DomainAttributes
+                               );
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  Status = DynamicTablesScmiInfoDescribeLevels (DomainId, &LevelArray, &LevelCount);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  /* Do some safety checks.
+     Only support FastChannels (and not doorbells) as this is
+     the only mechanism supported by SCP.
+     FcLimits[Get|Set] require 2 UINT32 values (max, then min) and
+     FcLimits[Get|Set] require 1 UINT32 value (level).
+  */
+  if ((FcLevelGet.ChanSize != sizeof (UINT32))  ||
+      ((FcLevelGet.Attributes & SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) ==
+       SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) ||
+      (FcLimitsSet.ChanSize != 2 * sizeof (UINT32)) ||
+      ((FcLimitsSet.Attributes & SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) ==
+       SCMI_PERF_FC_ATTRIB_HAS_DOORBELL))
+  {
+    Status = EFI_INVALID_PARAMETER;
+    goto exit_handler;
+  }
+
+  FcLevelGetAddr = ((UINT64)FcLevelGet.ChanAddrHigh << 32) |
+                   FcLevelGet.ChanAddrLow;
+  FcLimitsMaxSetAddr = ((UINT64)FcLimitsSet.ChanAddrHigh << 32) |
+                       FcLimitsSet.ChanAddrLow;
+  FcLimitsMinSetAddr = FcLimitsMaxSetAddr + 0x4;
+
+  CpcInfo->Revision                          = EFI_ACPI_6_5_AML_CPC_REVISION;
+  CpcInfo->HighestPerformanceInteger         = LevelArray[LevelCount - 1].Level;
+  CpcInfo->NominalPerformanceInteger         = DomainAttributes.SustainedPerfLevel;
+  CpcInfo->LowestNonlinearPerformanceInteger = LevelArray[0].Level;
+  CpcInfo->LowestPerformanceInteger          = LevelArray[0].Level;
+
+  CpcInfo->DesiredPerformanceRegister.AddressSpaceId    = EFI_ACPI_6_5_SYSTEM_MEMORY;
+  CpcInfo->DesiredPerformanceRegister.RegisterBitWidth  = 32;
+  CpcInfo->DesiredPerformanceRegister.RegisterBitOffset = 0;
+  CpcInfo->DesiredPerformanceRegister.AccessSize        = EFI_ACPI_6_5_DWORD;
+  CpcInfo->DesiredPerformanceRegister.Address           = FcLevelGetAddr;
+
+  CpcInfo->MinimumPerformanceRegister.AddressSpaceId    = EFI_ACPI_6_5_SYSTEM_MEMORY;
+  CpcInfo->MinimumPerformanceRegister.RegisterBitWidth  = 32;
+  CpcInfo->MinimumPerformanceRegister.RegisterBitOffset = 0;
+  CpcInfo->MinimumPerformanceRegister.AccessSize        = EFI_ACPI_6_5_DWORD;
+  CpcInfo->MinimumPerformanceRegister.Address           = FcLimitsMinSetAddr;
+
+  CpcInfo->MaximumPerformanceRegister.AddressSpaceId    = EFI_ACPI_6_5_SYSTEM_MEMORY;
+  CpcInfo->MaximumPerformanceRegister.RegisterBitWidth  = 32;
+  CpcInfo->MaximumPerformanceRegister.RegisterBitOffset = 0;
+  CpcInfo->MaximumPerformanceRegister.AccessSize        = EFI_ACPI_6_5_DWORD;
+  CpcInfo->MaximumPerformanceRegister.Address           = FcLimitsMaxSetAddr;
+
+  CpcInfo->ReferencePerformanceCounterRegister.AddressSpaceId    = EFI_ACPI_6_5_FUNCTIONAL_FIXED_HARDWARE;
+  CpcInfo->ReferencePerformanceCounterRegister.RegisterBitWidth  = 0x40;
+  CpcInfo->ReferencePerformanceCounterRegister.RegisterBitOffset = 0;
+  CpcInfo->ReferencePerformanceCounterRegister.AccessSize        = ARM_FFH_REFERENCE_PERF_COUNTER_REGISTER;
+  CpcInfo->ReferencePerformanceCounterRegister.Address           = 0x4;
+
+  CpcInfo->DeliveredPerformanceCounterRegister.AddressSpaceId    = EFI_ACPI_6_5_FUNCTIONAL_FIXED_HARDWARE;
+  CpcInfo->DeliveredPerformanceCounterRegister.RegisterBitWidth  = 0x40;
+  CpcInfo->DeliveredPerformanceCounterRegister.RegisterBitOffset = 0;
+  CpcInfo->DeliveredPerformanceCounterRegister.AccessSize        = ARM_FFH_DELIVERED_PERF_COUNTER_REGISTER;
+  CpcInfo->DeliveredPerformanceCounterRegister.Address           = 0x4;
+
+  // SCMI should advertise performance values on a unified scale. So frequency
+  // values are not available. LowestFrequencyInteger and
+  // NominalFrequencyInteger are populated in the ConfigurationManager.
+
+exit_handler:
+  FreePool (LevelArray);
+  return Status;
+}
diff --git a/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf
new file mode 100644
index 000000000000..d49277f82bc3
--- /dev/null
+++ b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf
@@ -0,0 +1,31 @@
+## @file
+#  Arm SCMI Info Library.
+#
+#  Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+  INF_VERSION    = 0x0001001B
+  BASE_NAME      = DynamicTablesScmiInfoLib
+  FILE_GUID      = 1A7CDB04-9FFC-40DA-A87C-A5ACADAF8136
+  VERSION_STRING = 1.0
+  MODULE_TYPE    = DXE_DRIVER
+  LIBRARY_CLASS  = DynamicTablesScmiInfoLib
+  CONSTRUCTOR    = DynamicTablesScmiInfoLibConstructor
+
+[Sources]
+  DynamicTablesScmiInfoLib.c
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdePkg/MdePkg.dec
+
+[Protocols]
+  gArmScmiPerformanceProtocolGuid   ## CONSUMES
+
+[Depex]
+  gArmScmiPerformanceProtocolGuid
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114419): https://edk2.groups.io/g/devel/message/114419
Mute This Topic: https://groups.io/mt/103955508/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [edk2-devel] [PATCH v5 10/11] DynamicTablesPkg: Add PcdDevelopmentPlatformRelaxations Pcd
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
                   ` (8 preceding siblings ...)
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 09/11] DynamicTablesPkg: Add DynamicTablesScmiInfoLib PierreGondois
@ 2024-01-25 15:18 ` PierreGondois
  2024-01-29 14:30   ` Sami Mujawar
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 11/11] DynamicTablesPkg: Exempt some _CPC field from checks PierreGondois
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

Some development platforms might not be compliant on some
points of some specifications. In order to have a generic code
accurately checking against specifications while still allowing
some relaxation on specific points for the platforms that desire
it, add a Pcd acting as a bitfield to warn instead of returning
an error in case of non-compliance.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 DynamicTablesPkg/DynamicTablesPkg.dec | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec b/DynamicTablesPkg/DynamicTablesPkg.dec
index 25355ace884b..2b3ad163191f 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dec
+++ b/DynamicTablesPkg/DynamicTablesPkg.dec
@@ -70,5 +70,9 @@ [PcdsFixedAtBuild]
   # Use PCI segment numbers as UID
   gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdPciUseSegmentAsUid|FALSE|BOOLEAN|0x40000009
 
+  # 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|0|UINT64|0x4000000A
+
 [Guids]
   gEdkiiDynamicTablesPkgTokenSpaceGuid = { 0xab226e66, 0x31d8, 0x4613, { 0x87, 0x9d, 0xd2, 0xfa, 0xb6, 0x10, 0x26, 0x3c } }
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114420): https://edk2.groups.io/g/devel/message/114420
Mute This Topic: https://groups.io/mt/103955509/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [edk2-devel] [PATCH v5 11/11] DynamicTablesPkg: Exempt some _CPC field from checks
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
                   ` (9 preceding siblings ...)
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 10/11] DynamicTablesPkg: Add PcdDevelopmentPlatformRelaxations Pcd PierreGondois
@ 2024-01-25 15:18 ` PierreGondois
  2024-01-25 15:57 ` [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI Ard Biesheuvel
  2024-01-30 14:30 ` Sami Mujawar
  12 siblings, 0 replies; 18+ messages in thread
From: PierreGondois @ 2024-01-25 15:18 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Leif Lindholm, Ard Biesheuvel, Pierre Gondois

When generating _CPC objects, some fields are mandatory by spec [1].
Some fields cannot be supported by a the Juno platform, which is used
to test the _CPC generation. Therefore, rely on the
PcdDevelopmentPlatformRelaxations Pcd to either:
- warn about the missing fields and and let the OS handle the
  missing information
- consider the missing fields as an error

_CPC fields that are exempted from checks when the Pcd is set:
- PerformanceLimitedRegister
- ReferencePerformanceCounterRegister
- DeliveredPerformanceCounterRegister

Also warn if one of the following optional fields is missing:
- HighestPerformance[Buffer|Integer]
- NominalPerformance[Buffer|Integer]

[1] Cf. non-optional fields in:
    ACPI 6.5, s8.4.6.1 '_CPC (Continuous Performance Control)'

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../Library/Common/AmlLib/AmlLib.inf          |  3 ++
 .../Common/AmlLib/CodeGen/AmlCodeGen.c        | 36 ++++++++++++++++---
 2 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf b/DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
index 6d0aa6ff934c..f269691864d4 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
+++ b/DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
@@ -71,6 +71,9 @@ [LibraryClasses]
   BaseLib
   MemoryAllocationLib
 
+[FixedPcd]
+  gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdDevelopmentPlatformRelaxations
+
 [BuildOptions]
   *_*_*_CC_FLAGS = -DAML_HANDLE
 
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
index 6f3f46e3b1ed..a04e652588d6 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
@@ -3532,6 +3532,28 @@ AmlCreateCpcNode (
     return EFI_INVALID_PARAMETER;
   }
 
+  /// The following fields are theoretically mandatory, but not supported
+  /// by some platforms.
+  /// - PerformanceLimitedRegister
+  /// - ReferencePerformanceCounterRegister
+  /// - DeliveredPerformanceCounterRegister
+  if (IsNullGenericAddress (&CpcInfo->PerformanceLimitedRegister) ||
+      IsNullGenericAddress (&CpcInfo->ReferencePerformanceCounterRegister) ||
+      IsNullGenericAddress (&CpcInfo->DeliveredPerformanceCounterRegister))
+  {
+    if (PcdGet64 (PcdDevelopmentPlatformRelaxations) & BIT0) {
+      /// Just warn if DEVELOPMENT_PLATFORM_RELAXATIONS is set.
+      DEBUG ((
+        DEBUG_WARN,
+        "Missing PerformanceLimited|ReferencePerformanceCounter|"
+        "DeliveredPerformanceCounter field in _CPC object\n"
+        ));
+    } else {
+      ASSERT (0);
+      return EFI_INVALID_PARAMETER;
+    }
+  }
+
   if ((IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) &&
        (CpcInfo->HighestPerformanceInteger == 0)) ||
       (IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) &&
@@ -3540,13 +3562,19 @@ AmlCreateCpcNode (
        (CpcInfo->LowestNonlinearPerformanceInteger == 0)) ||
       (IsNullGenericAddress (&CpcInfo->LowestPerformanceBuffer) &&
        (CpcInfo->LowestPerformanceInteger == 0)) ||
-      IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister) ||
-      IsNullGenericAddress (&CpcInfo->ReferencePerformanceCounterRegister) ||
-      IsNullGenericAddress (&CpcInfo->DeliveredPerformanceCounterRegister) ||
-      IsNullGenericAddress (&CpcInfo->PerformanceLimitedRegister))
+      IsNullGenericAddress (&CpcInfo->DesiredPerformanceRegister))
   {
     ASSERT (0);
     return EFI_INVALID_PARAMETER;
+  } else if ((IsNullGenericAddress (&CpcInfo->HighestPerformanceBuffer) &&
+              (CpcInfo->HighestPerformanceInteger == 0)) ||
+             (IsNullGenericAddress (&CpcInfo->NominalPerformanceBuffer) &&
+              (CpcInfo->NominalPerformanceInteger == 0)))
+  {
+    DEBUG ((
+      DEBUG_WARN,
+      "Missing Reference|Delivered performance field in _CPC object\n"
+      ));
   }
 
   CpcPackage = NULL;
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114421): https://edk2.groups.io/g/devel/message/114421
Mute This Topic: https://groups.io/mt/103955510/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
                   ` (10 preceding siblings ...)
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 11/11] DynamicTablesPkg: Exempt some _CPC field from checks PierreGondois
@ 2024-01-25 15:57 ` Ard Biesheuvel
  2024-01-30 14:30 ` Sami Mujawar
  12 siblings, 0 replies; 18+ messages in thread
From: Ard Biesheuvel @ 2024-01-25 15:57 UTC (permalink / raw)
  To: devel, pierre.gondois; +Cc: Sami Mujawar, Leif Lindholm

Hi Pierre,

On Thu, 25 Jan 2024 at 16:19, PierreGondois <pierre.gondois@arm.com> wrote:
>
> v1:
> - https://edk2.groups.io/g/devel/message/104115
> v2:
> - https://edk2.groups.io/g/devel/message/104115
> - Rebase patches on latest version.
> v3:
> - https://edk2.groups.io/g/devel/message/111567
> [PATCH 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION
> - Note the referenced spec spec is SCMI v3.2
> [PATCH 02/11] ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support
> - Note the referenced spec spec is SCMI v3.2
> - Move SCMI_MESSAGE_ID_PERFORMANCE enum definition out of #pragma pack(1)
> [PATCH 03/11] MdePkg/Acpi65: Add _PSD/_CPC/State Coordination Types macros
> - Macros used to be added to ACPI 6.4 definition file, move them to the
>   latest ACPI 6.5 definition file
> [PATCH 10/11] DynamicTablesPkg: Add DynamicTablesScmiInfoLib
> - Renamed ArmScmiInfoLib to DynamicTablesScmiInfoLib
> [PATCH 11/11] DynamicTablesPkg: Remove check for _CPC field
> - Add warning when missing one of the bypassed field
> All patches:
> - Rebase on latest master
> - Use ACPI 6.5 definitions instead of 6.4 previously
> v4:
> - https://edk2.groups.io/g/devel/message/112378
> - Extracted and submitted patch:
>   - MdePkg/IndustryStandard: Add _PSD/_CPC/Coord types definitions
>   separately at: [1]
> v5:
> [PATCH v4 05/10] DynamicTablesPkg: Add CM_ARM_PSD_INFO object
> - Updated format from "0x%llx" -> "0x%x"
> [PATCH v4 07/10] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD
> - Corrected error handling
> [PATCH v4 09/10] DynamicTablesPkg: Add DynamicTablesScmiInfoLib
> - Moved DynamicTablesScmiInfoLib library to AARCH64 section
> [PATCH v4 10/10] DynamicTablesPkg: Remove check for _CPC field
> - Added a patch 'DynamicTablesPkg: Add PcdDevelopmentPlatformRelaxations Pcd'
>   and make use of the new Pcd
>
> The SCMI performance protocol allows to query the Operating Performance
> Points (OPPs) available for each performance domain. Each OPP has a
> specific frequency/power consumption/performance.
>
> On Device Tree (DT) based platforms, the SCMI protocol is directly
> available from the OS.
> On ACPI based platforms, the _PSD objects allows to identify CPUs
> belonging
> to the same performance domain. CPUs belonging to the same performance
> domain have the same frequency. The _CPC object allows to
> describe/control the performance level/frequency of a CPU (i.e. its
> frequency).
>
> This patchset:
> - Add support for 'DescribeFastchannel' SCMI performance protocol
> - Add a object to the DynamicTablesPkg to describe the PSD information
> - Allows to generate _PSD objects in the SsdtCpuTopologyGenerator
> - Add a ArmScmiInfoLib library populating DynamicTablesPkg CPC objects,
>   relying on the SCMI protocol to fetch the relevant information
>
> A patchset for Juno-r2 platforms will be submitted to demonstrate
> this functionality.
>
> [1] https://edk2.groups.io/g/devel/message/111901
>
> Pierre Gondois (11):
>   ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION
>   ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support

For these,

Acked-by: Ard Biesheuvel <ardb@kernel.org>

Feel free to merge along with the rest of the series.

Thanks,


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114429): https://edk2.groups.io/g/devel/message/114429
Mute This Topic: https://groups.io/mt/103955491/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [edk2-devel] [PATCH v5 05/11] DynamicTablesPkg: Add CM_ARM_PSD_INFO object
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 05/11] DynamicTablesPkg: Add CM_ARM_PSD_INFO object PierreGondois
@ 2024-01-26 11:34   ` Sami Mujawar
  0 siblings, 0 replies; 18+ messages in thread
From: Sami Mujawar @ 2024-01-26 11:34 UTC (permalink / raw)
  To: Pierre Gondois, devel@edk2.groups.io; +Cc: Leif Lindholm, Ard Biesheuvel, nd

Hi Pierre,

Thank you for the updated patch.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 25/01/2024, 15:19, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:


Add an object describing _PSD information, cf. ACPI 6.5,
s8.4.5.5 _PSD (P-State Dependency).
Also add the corresponding CmObjParser.


Signed-off-by: Pierre Gondois <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>>
---
DynamicTablesPkg/Include/AcpiObjects.h | 20 +++++++++++++++++++
.../Include/ArmNameSpaceObjects.h | 10 ++++++++++
.../ConfigurationManagerObjectParser.c | 11 ++++++++++
3 files changed, 41 insertions(+)


diff --git a/DynamicTablesPkg/Include/AcpiObjects.h b/DynamicTablesPkg/Include/AcpiObjects.h
index 8981c229544a..2bdabb2724bd 100644
--- a/DynamicTablesPkg/Include/AcpiObjects.h
+++ b/DynamicTablesPkg/Include/AcpiObjects.h
@@ -1,6 +1,7 @@
/** @file






Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.<BR>


+ Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.<BR>






SPDX-License-Identifier: BSD-2-Clause-Patent


**/


@@ -119,6 +120,25 @@ typedef struct AmlCpcInfo {
UINT32 NominalFrequencyInteger;


} AML_CPC_INFO;






+/** A structure that describes a


+ P-State Dependency (PSD) Info.


+


+ Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency).


+*/


+typedef struct AmlPsdInfo {


+ /// Revision.


+ UINT8 Revision;


+


+ /// Domain Id.


+ UINT32 Domain;


+


+ /// Coordination type.


+ UINT32 CoordType;


+


+ /// Number of processors belonging to the Domain.


+ UINT32 NumProc;


+} AML_PSD_INFO;


+


#pragma pack()






#endif //AML_CPC_INFO_H_


diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 453cc3fe83fa..3748cb7c8085 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -72,6 +72,7 @@ typedef enum ArmObjectID {
EArmObjPccSubspaceType4Info, ///< 47 - Pcc Subspace Type 4 Info


EArmObjPccSubspaceType5Info, ///< 48 - Pcc Subspace Type 5 Info


EArmObjEtInfo, ///< 49 - Embedded Trace Extension/Module Info


+ EArmObjPsdInfo, ///< 50 - P-State Dependency (PSD) Info


EArmObjMax


} EARM_OBJECT_ID;






@@ -1327,6 +1328,15 @@ typedef struct CmArmEtInfo {
ARM_ET_TYPE EtType;


} CM_ARM_ET_INFO;






+/** A structure that describes a


+ P-State Dependency (PSD) Info.


+


+ Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency).


+


+ ID: EArmObjPsdInfo


+*/


+typedef AML_PSD_INFO CM_ARM_PSD_INFO;


+


#pragma pack()






#endif // ARM_NAMESPACE_OBJECTS_H_


diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index c1a752841943..dc60a75eabb1 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -669,6 +669,15 @@ STATIC CONST CM_OBJ_PARSER CmArmEtInfo[] = {
{ "EtType", sizeof (ARM_ET_TYPE), "0x%x", NULL }


};






+/** A parser for EArmObjPsdInfo.


+*/


+STATIC CONST CM_OBJ_PARSER CmArmPsdInfoParser[] = {


+ { "Revision", 1, "0x%x", NULL },


+ { "DomainId", 4, "0x%x", NULL },


+ { "CoordType", 4, "0x%x", NULL },


+ { "NumProc", 4, "0x%x", NULL },


+};


+


/** A parser for Arm namespace objects.


*/


STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = {


@@ -767,6 +776,8 @@ STATIC CONST CM_OBJ_PARSER_ARRAY ArmNamespaceObjectParser[] = {
ARRAY_SIZE (CmArmPccSubspaceType5InfoParser) },


{ "EArmObjEtInfo", CmArmEtInfo,


ARRAY_SIZE (CmArmEtInfo) },


+ { "EArmObjPsdInfo", CmArmPsdInfoParser,


+ ARRAY_SIZE (CmArmPsdInfoParser) },


{ "EArmObjMax", NULL, 0 },


};






-- 
2.25.1







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114574): https://edk2.groups.io/g/devel/message/114574
Mute This Topic: https://groups.io/mt/103955499/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [edk2-devel] [PATCH v5 07/11] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 07/11] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD PierreGondois
@ 2024-01-26 11:38   ` Sami Mujawar
  0 siblings, 0 replies; 18+ messages in thread
From: Sami Mujawar @ 2024-01-26 11:38 UTC (permalink / raw)
  To: Pierre Gondois, devel@edk2.groups.io; +Cc: Leif Lindholm, Ard Biesheuvel, nd

Hi Pierre,

Thank you for the updated patch.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 25/01/2024, 15:19, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:


Add AmlCreatePsdNode() to the AmlLib to generate _PSD objects.
_PSD objects allow to describe 'performance control, P-state
or CPPC, logical processor dependency', Cf. ACPI 6.5,
s8.4.5.5 _PSD (P-State Dependency).


Signed-off-by: Pierre Gondois <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>>
---
.../Include/Library/AmlLib/AmlLib.h | 35 +++-
.../Common/AmlLib/CodeGen/AmlCodeGen.c | 188 +++++++++++++++++-
2 files changed, 221 insertions(+), 2 deletions(-)


diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 01e37b089897..82d546408418 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -1,7 +1,7 @@
/** @file


AML Lib.






- Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>


+ Copyright (c) 2019 - 2023, Arm Limited. All rights reserved.<BR>


Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>






SPDX-License-Identifier: BSD-2-Clause-Patent


@@ -1805,4 +1805,37 @@ AmlCodeGenInvokeMethod (
IN AML_NODE_HANDLE ParentNode


);






+/** Create a _PSD node.


+


+ Creates and optionally adds the following node


+ Name(_PSD, Package()


+ {


+ NumEntries, // Integer


+ Revision, // Integer


+ Domain, // Integer


+ CoordType, // Integer


+ NumProc, // Integer


+ })


+


+ Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency)


+


+ @ingroup CodeGenApis


+


+ @param [in] PsdInfo PsdInfo object


+ @param [in] ParentNode If provided, set ParentNode as the parent


+ of the node created.


+ @param [out] NewPsdNode If success and provided, contains the created node.


+


+ @retval EFI_SUCCESS The function completed successfully.


+ @retval EFI_INVALID_PARAMETER Invalid parameter.


+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.


+**/


+EFI_STATUS


+EFIAPI


+AmlCreatePsdNode (


+ IN AML_PSD_INFO *PsdInfo,


+ IN AML_NODE_HANDLE ParentNode OPTIONAL,


+ OUT AML_OBJECT_NODE_HANDLE *NewPsdNode OPTIONAL


+ );


+


#endif // AML_LIB_H_


diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
index 9040192f8c3c..6f3f46e3b1ed 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
@@ -1,7 +1,7 @@
/** @file


AML Code Generation.






- Copyright (c) 2020 - 2022, Arm Limited. All rights reserved.<BR>


+ Copyright (c) 2020 - 2023, Arm Limited. All rights reserved.<BR>


Copyright (C) 2023 - 2024, Advanced Micro Devices, Inc. All rights reserved.<BR>






SPDX-License-Identifier: BSD-2-Clause-Patent


@@ -4090,3 +4090,189 @@ exit_handler:
FreePool (NodeStream);


return Status;


}


+


+/** Create a _PSD node.


+


+ Creates and optionally adds the following node


+ Name(_PSD, Package()


+ {


+ NumEntries, // Integer


+ Revision, // Integer


+ Domain, // Integer


+ CoordType, // Integer


+ NumProc, // Integer


+ })


+


+ Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency)


+


+ @ingroup CodeGenApis


+


+ @param [in] PsdInfo PsdInfo object


+ @param [in] ParentNode If provided, set ParentNode as the parent


+ of the node created.


+ @param [out] NewPsdNode If success and provided, contains the created node.


+


+ @retval EFI_SUCCESS The function completed successfully.


+ @retval EFI_INVALID_PARAMETER Invalid parameter.


+ @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.


+**/


+EFI_STATUS


+EFIAPI


+AmlCreatePsdNode (


+ IN AML_PSD_INFO *PsdInfo,


+ IN AML_NODE_HANDLE ParentNode OPTIONAL,


+ OUT AML_OBJECT_NODE_HANDLE *NewPsdNode OPTIONAL


+ )


+{


+ EFI_STATUS Status;


+ AML_OBJECT_NODE_HANDLE PsdNode;


+ AML_OBJECT_NODE_HANDLE PsdPackage;


+ AML_OBJECT_NODE_HANDLE IntegerNode;


+ UINT32 NumberOfEntries;


+


+ if ((PsdInfo == NULL) ||


+ ((ParentNode == NULL) && (NewPsdNode == NULL)))


+ {


+ Status = EFI_INVALID_PARAMETER;


+ ASSERT_EFI_ERROR (Status);


+ return Status;


+ }


+


+ // Revision 3 per ACPI 6.5 specification


+ if (PsdInfo->Revision == EFI_ACPI_6_5_AML_PSD_REVISION) {


+ // NumEntries 5 per ACPI 6.5 specification


+ NumberOfEntries = 5;


+ } else {


+ Status = EFI_INVALID_PARAMETER;


+ ASSERT_EFI_ERROR (Status);


+ return Status;


+ }


+


+ if (((PsdInfo->CoordType != ACPI_AML_COORD_TYPE_SW_ALL) &&


+ (PsdInfo->CoordType != ACPI_AML_COORD_TYPE_SW_ANY) &&


+ (PsdInfo->CoordType != ACPI_AML_COORD_TYPE_HW_ALL)) ||


+ (PsdInfo->NumProc == 0))


+ {


+ Status = EFI_INVALID_PARAMETER;


+ ASSERT_EFI_ERROR (Status);


+ return Status;


+ }


+


+ Status = AmlCodeGenNamePackage ("_PSD", NULL, &PsdNode);


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ return Status;


+ }


+


+ // Get the Package object node of the _PSD node,


+ // which is the 2nd fixed argument (i.e. index 1).


+ PsdPackage = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (


+ PsdNode,


+ EAmlParseIndexTerm1


+ );


+ if ((PsdPackage == NULL) ||


+ (AmlGetNodeType ((AML_NODE_HANDLE)PsdPackage) != EAmlNodeObject) ||


+ (!AmlNodeHasOpCode (PsdPackage, AML_PACKAGE_OP, 0)))


+ {


+ Status = EFI_INVALID_PARAMETER;


+ ASSERT_EFI_ERROR (Status);


+ goto error_handler;


+ }


+


+ // NumEntries


+ Status = AmlCodeGenInteger (NumberOfEntries, &IntegerNode);


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ goto error_handler;


+ }


+


+ Status = AmlVarListAddTail (


+ (AML_NODE_HANDLE)PsdPackage,


+ (AML_NODE_HANDLE)IntegerNode


+ );


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ FreePool (IntegerNode);


+ goto error_handler;


+ }


+


+ // Revision


+ Status = AmlCodeGenInteger (PsdInfo->Revision, &IntegerNode);


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ goto error_handler;


+ }


+


+ Status = AmlVarListAddTail (


+ (AML_NODE_HANDLE)PsdPackage,


+ (AML_NODE_HANDLE)IntegerNode


+ );


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ FreePool (IntegerNode);


+ goto error_handler;


+ }


+


+ // Domain


+ Status = AmlCodeGenInteger (PsdInfo->Domain, &IntegerNode);


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ goto error_handler;


+ }


+


+ Status = AmlVarListAddTail (


+ (AML_NODE_HANDLE)PsdPackage,


+ (AML_NODE_HANDLE)IntegerNode


+ );


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ FreePool (IntegerNode);


+ goto error_handler;


+ }


+


+ // CoordType


+ Status = AmlCodeGenInteger (PsdInfo->CoordType, &IntegerNode);


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ goto error_handler;


+ }


+


+ Status = AmlVarListAddTail (


+ (AML_NODE_HANDLE)PsdPackage,


+ (AML_NODE_HANDLE)IntegerNode


+ );


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ FreePool (IntegerNode);


+ goto error_handler;


+ }


+


+ // Num Processors


+ Status = AmlCodeGenInteger (PsdInfo->NumProc, &IntegerNode);


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ goto error_handler;


+ }


+


+ Status = AmlVarListAddTail (


+ (AML_NODE_HANDLE)PsdPackage,


+ (AML_NODE_HANDLE)IntegerNode


+ );


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ FreePool (IntegerNode);


+ goto error_handler;


+ }


+


+ Status = LinkNode (PsdNode, ParentNode, NewPsdNode);


+ if (EFI_ERROR (Status)) {


+ ASSERT_EFI_ERROR (Status);


+ goto error_handler;


+ }


+


+ return Status;


+


+error_handler:


+ AmlDeleteTree ((AML_NODE_HANDLE)PsdNode);


+ return Status;


+}


-- 
2.25.1







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114575): https://edk2.groups.io/g/devel/message/114575
Mute This Topic: https://groups.io/mt/103955504/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [edk2-devel] [PATCH v5 09/11] DynamicTablesPkg: Add DynamicTablesScmiInfoLib
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 09/11] DynamicTablesPkg: Add DynamicTablesScmiInfoLib PierreGondois
@ 2024-01-29 14:29   ` Sami Mujawar
  0 siblings, 0 replies; 18+ messages in thread
From: Sami Mujawar @ 2024-01-29 14:29 UTC (permalink / raw)
  To: Pierre Gondois, devel@edk2.groups.io; +Cc: Leif Lindholm, Ard Biesheuvel, nd

Hi Pierre,

Thank you for this patch.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 25/01/2024, 15:19, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:


The SCP holds some power information that could be advertised
through the _CPC object. The communication with the SCP is done
through SCMI protocols (c.f. ArmScmiDxe).


Use the SCMI protocols to query information and feed it to
the DynamicTablesPkg.


Acked-by: Leif Lindholm <quic_llindhol@quicinc.com <mailto:quic_llindhol@quicinc.com>>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>>
---
DynamicTablesPkg/DynamicTables.dsc.inc | 3 +
DynamicTablesPkg/DynamicTablesPkg.dec | 4 +
DynamicTablesPkg/DynamicTablesPkg.dsc | 3 +
.../Library/DynamicTablesScmiInfoLib.h | 33 ++
.../DynamicTablesScmiInfoLib.c | 297 ++++++++++++++++++
.../DynamicTablesScmiInfoLib.inf | 31 ++
6 files changed, 371 insertions(+)
create mode 100644 DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h
create mode 100644 DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.c
create mode 100644 DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf


diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc b/DynamicTablesPkg/DynamicTables.dsc.inc
index 8c99574097ad..19ca62d6a85c 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -21,6 +21,9 @@ [LibraryClasses.common]
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf


SmbiosStringTableLib|DynamicTablesPkg/Library/Common/SmbiosStringTableLib/SmbiosStringTableLib.inf






+[LibraryClasses.AARCH64]


+ DynamicTablesScmiInfoLib|DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf


+


[Components.common]


#


# Dynamic Tables Manager Dxe


diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec b/DynamicTablesPkg/DynamicTablesPkg.dec
index cfbcbb9569f1..25355ace884b 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dec
+++ b/DynamicTablesPkg/DynamicTablesPkg.dec
@@ -42,6 +42,10 @@ [LibraryClasses]
## @libraryclass Defines a set of SMBIOS string helper methods.


SmbiosStringTableLib|Include/Library/SmbiosStringTableLib.h






+[LibraryClasses.AARCH64]


+ ## @libraryclass Defines a set of APIs to populate CmObj using SCMI.


+ DynamicTablesScmiInfoLib|Include/Library/DynamicTablesScmiInfoLib.h


+


[Protocols]


# Configuration Manager Protocol GUID


gEdkiiConfigurationManagerProtocolGuid = { 0xd85a4835, 0x5a82, 0x4894, { 0xac, 0x2, 0x70, 0x6f, 0x43, 0xd5, 0x97, 0x8e } }


diff --git a/DynamicTablesPkg/DynamicTablesPkg.dsc b/DynamicTablesPkg/DynamicTablesPkg.dsc
index 2f35ac82f20b..cf06f0731a23 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dsc
+++ b/DynamicTablesPkg/DynamicTablesPkg.dsc
@@ -51,6 +51,9 @@ [Components.common]
[Components.ARM, Components.AARCH64]


DynamicTablesPkg/Library/FdtHwInfoParserLib/FdtHwInfoParserLib.inf






+[Components.AARCH64]


+ DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf


+


[BuildOptions]


*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES






diff --git a/DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h b/DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h
new file mode 100644
index 000000000000..ff6b47d51fe8
--- /dev/null
+++ b/DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h
@@ -0,0 +1,33 @@
+/** @file


+ Arm SCMI Info Library.


+


+ Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.<BR>


+


+ SPDX-License-Identifier: BSD-2-Clause-Patent


+**/


+


+#ifndef ARM_SCMI_INFO_LIB_H_


+#define ARM_SCMI_INFO_LIB_H_


+


+#include <ConfigurationManagerObject.h>


+


+/** Populate a AML_CPC_INFO object based on SCMI information.


+


+ @param[in] DomainId Identifier for the performance domain.


+ @param[out] CpcInfo If success, this structure was populated from


+ information queried to the SCP.


+


+ @retval EFI_SUCCESS Success.


+ @retval EFI_DEVICE_ERROR Device error.


+ @retval EFI_INVALID_PARAMETER Invalid parameter.


+ @retval EFI_TIMEOUT Time out.


+ @retval EFI_UNSUPPORTED Unsupported.


+**/


+EFI_STATUS


+EFIAPI


+DynamicTablesScmiInfoGetFastChannel (


+ IN UINT32 DomainId,


+ OUT AML_CPC_INFO *CpcInfo


+ );


+


+#endif // ARM_SCMI_INFO_LIB_H_


diff --git a/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.c b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.c
new file mode 100644
index 000000000000..da5bc1895778
--- /dev/null
+++ b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.c
@@ -0,0 +1,297 @@
+/** @file


+ Arm SCMI Info Library.


+


+ Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.<BR>


+


+ Arm Functional Fixed Hardware Specification:


+ - https://developer.arm.com/documentation/den0048/latest/ <https://developer.arm.com/documentation/den0048/latest/>


+


+ SPDX-License-Identifier: BSD-2-Clause-Patent


+**/


+


+#include <Library/AcpiLib.h>


+#include <Library/DynamicTablesScmiInfoLib.h>


+#include <Library/DebugLib.h>


+#include <Library/MemoryAllocationLib.h>


+#include <Library/UefiBootServicesTableLib.h>


+#include <Protocol/ArmScmi.h>


+#include <Protocol/ArmScmiPerformanceProtocol.h>


+


+/** Arm FFH registers


+


+ Cf. Arm Functional Fixed Hardware Specification


+ s3.2 Performance management and Collaborative Processor Performance Control


+*/


+#define ARM_FFH_DELIVERED_PERF_COUNTER_REGISTER 0x0


+#define ARM_FFH_REFERENCE_PERF_COUNTER_REGISTER 0x1


+


+/// Arm SCMI performance protocol.


+STATIC SCMI_PERFORMANCE_PROTOCOL *ScmiPerfProtocol;


+


+/** Arm SCMI Info Library constructor.


+


+ @param ImageHandle Image of the loaded driver.


+ @param SystemTable Pointer to the System Table.


+


+ @retval EFI_SUCCESS Success.


+ @retval EFI_DEVICE_ERROR Device error.


+ @retval EFI_INVALID_PARAMETER Invalid parameter.


+ @retval EFI_NOT_FOUND Not Found


+ @retval EFI_TIMEOUT Timeout.


+ @retval EFI_UNSUPPORTED Unsupported.


+**/


+EFI_STATUS


+EFIAPI


+DynamicTablesScmiInfoLibConstructor (


+ IN EFI_HANDLE ImageHandle,


+ IN EFI_SYSTEM_TABLE *SystemTable


+ )


+{


+ EFI_STATUS Status;


+ UINT32 Version;


+


+ Status = gBS->LocateProtocol (


+ &gArmScmiPerformanceProtocolGuid,


+ NULL,


+ (VOID **)&ScmiPerfProtocol


+ );


+ if (EFI_ERROR (Status)) {


+ return Status;


+ }


+


+ Status = ScmiPerfProtocol->GetVersion (ScmiPerfProtocol, &Version);


+ if (EFI_ERROR (Status)) {


+ return Status;


+ }


+


+ // FastChannels were added in SCMI v2.0 spec.


+ if (Version < PERFORMANCE_PROTOCOL_VERSION_V2) {


+ DEBUG ((


+ DEBUG_ERROR,


+ "DynamicTablesScmiInfoLib requires SCMI version > 2.0\n"


+ ));


+ return EFI_UNSUPPORTED;


+ }


+


+ return Status;


+}


+


+/** Get the OPPs/performance states of a power domain.


+


+ This function is a wrapper around the SCMI PERFORMANCE_DESCRIBE_LEVELS


+ command. The list of discrete performance states is returned in a buffer


+ that must be freed by the caller.


+


+ @param[in] DomainId Identifier for the performance domain.


+ @param[out] LevelArray If success, pointer to the list of list of


+ performance state. This memory must be freed by


+ the caller.


+ @param[out] LevelArrayCount If success, contains the number of states in


+ LevelArray.


+


+ @retval EFI_SUCCESS Success.


+ @retval EFI_DEVICE_ERROR Device error.


+ @retval EFI_INVALID_PARAMETER Invalid parameter.


+ @retval EFI_TIMEOUT Time out.


+ @retval EFI_UNSUPPORTED Unsupported.


+**/


+STATIC


+EFI_STATUS


+EFIAPI


+DynamicTablesScmiInfoDescribeLevels (


+ IN UINT32 DomainId,


+ OUT SCMI_PERFORMANCE_LEVEL **LevelArray,


+ OUT UINT32 *LevelArrayCount


+ )


+{


+ EFI_STATUS Status;


+ SCMI_PERFORMANCE_LEVEL *Array;


+ UINT32 Count;


+ UINT32 Size;


+


+ if ((ScmiPerfProtocol == NULL) ||


+ (LevelArray == NULL) ||


+ (LevelArrayCount == NULL))


+ {


+ return EFI_INVALID_PARAMETER;


+ }


+


+ // First call to get the number of levels.


+ Size = 0;


+ Status = ScmiPerfProtocol->DescribeLevels (


+ ScmiPerfProtocol,


+ DomainId,


+ &Count,


+ &Size,


+ NULL


+ );


+ if (Status != EFI_BUFFER_TOO_SMALL) {


+ // EFI_SUCCESS is not a valid option.


+ if (Status == EFI_SUCCESS) {


+ return EFI_INVALID_PARAMETER;


+ } else {


+ return Status;


+ }


+ }


+


+ Array = AllocateZeroPool (Size);


+ if (Array == NULL) {


+ return EFI_OUT_OF_RESOURCES;


+ }


+


+ // Second call to get the descriptions of the levels.


+ Status = ScmiPerfProtocol->DescribeLevels (


+ ScmiPerfProtocol,


+ DomainId,


+ &Count,


+ &Size,


+ Array


+ );


+ if (EFI_ERROR (Status)) {


+ return Status;


+ }


+


+ *LevelArray = Array;


+ *LevelArrayCount = Count;


+


+ return Status;


+}


+


+/** Populate a AML_CPC_INFO object based on SCMI information.


+


+ @param[in] DomainId Identifier for the performance domain.


+ @param[out] CpcInfo If success, this structure was populated from


+ information queried to the SCP.


+


+ @retval EFI_SUCCESS Success.


+ @retval EFI_DEVICE_ERROR Device error.


+ @retval EFI_INVALID_PARAMETER Invalid parameter.


+ @retval EFI_TIMEOUT Time out.


+ @retval EFI_UNSUPPORTED Unsupported.


+**/


+EFI_STATUS


+EFIAPI


+DynamicTablesScmiInfoGetFastChannel (


+ IN UINT32 DomainId,


+ OUT AML_CPC_INFO *CpcInfo


+ )


+{


+ EFI_STATUS Status;


+ SCMI_PERFORMANCE_FASTCHANNEL FcLevelGet;


+ SCMI_PERFORMANCE_FASTCHANNEL FcLimitsSet;


+ SCMI_PERFORMANCE_DOMAIN_ATTRIBUTES DomainAttributes;


+


+ SCMI_PERFORMANCE_LEVEL *LevelArray;


+ UINT32 LevelCount;


+


+ UINT64 FcLevelGetAddr;


+ UINT64 FcLimitsMaxSetAddr;


+ UINT64 FcLimitsMinSetAddr;


+


+ if ((ScmiPerfProtocol == NULL) ||


+ (CpcInfo == NULL))


+ {


+ return EFI_INVALID_PARAMETER;


+ }


+


+ Status = ScmiPerfProtocol->DescribeFastchannel (


+ ScmiPerfProtocol,


+ DomainId,


+ ScmiMessageIdPerformanceLevelSet,


+ &FcLevelGet


+ );


+ if (EFI_ERROR (Status)) {


+ return Status;


+ }


+


+ Status = ScmiPerfProtocol->DescribeFastchannel (


+ ScmiPerfProtocol,


+ DomainId,


+ ScmiMessageIdPerformanceLimitsSet,


+ &FcLimitsSet


+ );


+ if (EFI_ERROR (Status)) {


+ return Status;


+ }


+


+ Status = ScmiPerfProtocol->GetDomainAttributes (


+ ScmiPerfProtocol,


+ DomainId,


+ &DomainAttributes


+ );


+ if (EFI_ERROR (Status)) {


+ return Status;


+ }


+


+ Status = DynamicTablesScmiInfoDescribeLevels (DomainId, &LevelArray, &LevelCount);


+ if (EFI_ERROR (Status)) {


+ return Status;


+ }


+


+ /* Do some safety checks.


+ Only support FastChannels (and not doorbells) as this is


+ the only mechanism supported by SCP.


+ FcLimits[Get|Set] require 2 UINT32 values (max, then min) and


+ FcLimits[Get|Set] require 1 UINT32 value (level).


+ */


+ if ((FcLevelGet.ChanSize != sizeof (UINT32)) ||


+ ((FcLevelGet.Attributes & SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) ==


+ SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) ||


+ (FcLimitsSet.ChanSize != 2 * sizeof (UINT32)) ||


+ ((FcLimitsSet.Attributes & SCMI_PERF_FC_ATTRIB_HAS_DOORBELL) ==


+ SCMI_PERF_FC_ATTRIB_HAS_DOORBELL))


+ {


+ Status = EFI_INVALID_PARAMETER;


+ goto exit_handler;


+ }


+


+ FcLevelGetAddr = ((UINT64)FcLevelGet.ChanAddrHigh << 32) |


+ FcLevelGet.ChanAddrLow;


+ FcLimitsMaxSetAddr = ((UINT64)FcLimitsSet.ChanAddrHigh << 32) |


+ FcLimitsSet.ChanAddrLow;


+ FcLimitsMinSetAddr = FcLimitsMaxSetAddr + 0x4;


+


+ CpcInfo->Revision = EFI_ACPI_6_5_AML_CPC_REVISION;


+ CpcInfo->HighestPerformanceInteger = LevelArray[LevelCount - 1].Level;


+ CpcInfo->NominalPerformanceInteger = DomainAttributes.SustainedPerfLevel;


+ CpcInfo->LowestNonlinearPerformanceInteger = LevelArray[0].Level;


+ CpcInfo->LowestPerformanceInteger = LevelArray[0].Level;


+


+ CpcInfo->DesiredPerformanceRegister.AddressSpaceId = EFI_ACPI_6_5_SYSTEM_MEMORY;


+ CpcInfo->DesiredPerformanceRegister.RegisterBitWidth = 32;


+ CpcInfo->DesiredPerformanceRegister.RegisterBitOffset = 0;


+ CpcInfo->DesiredPerformanceRegister.AccessSize = EFI_ACPI_6_5_DWORD;


+ CpcInfo->DesiredPerformanceRegister.Address = FcLevelGetAddr;


+


+ CpcInfo->MinimumPerformanceRegister.AddressSpaceId = EFI_ACPI_6_5_SYSTEM_MEMORY;


+ CpcInfo->MinimumPerformanceRegister.RegisterBitWidth = 32;


+ CpcInfo->MinimumPerformanceRegister.RegisterBitOffset = 0;


+ CpcInfo->MinimumPerformanceRegister.AccessSize = EFI_ACPI_6_5_DWORD;


+ CpcInfo->MinimumPerformanceRegister.Address = FcLimitsMinSetAddr;


+


+ CpcInfo->MaximumPerformanceRegister.AddressSpaceId = EFI_ACPI_6_5_SYSTEM_MEMORY;


+ CpcInfo->MaximumPerformanceRegister.RegisterBitWidth = 32;


+ CpcInfo->MaximumPerformanceRegister.RegisterBitOffset = 0;


+ CpcInfo->MaximumPerformanceRegister.AccessSize = EFI_ACPI_6_5_DWORD;


+ CpcInfo->MaximumPerformanceRegister.Address = FcLimitsMaxSetAddr;

[SAMI] I see why ARM_GAS32() macro cannot be used here. Please ignore my previous comment.
+


+ CpcInfo->ReferencePerformanceCounterRegister.AddressSpaceId = EFI_ACPI_6_5_FUNCTIONAL_FIXED_HARDWARE;


+ CpcInfo->ReferencePerformanceCounterRegister.RegisterBitWidth = 0x40;


+ CpcInfo->ReferencePerformanceCounterRegister.RegisterBitOffset = 0;


+ CpcInfo->ReferencePerformanceCounterRegister.AccessSize = ARM_FFH_REFERENCE_PERF_COUNTER_REGISTER;


+ CpcInfo->ReferencePerformanceCounterRegister.Address = 0x4;


+


+ CpcInfo->DeliveredPerformanceCounterRegister.AddressSpaceId = EFI_ACPI_6_5_FUNCTIONAL_FIXED_HARDWARE;


+ CpcInfo->DeliveredPerformanceCounterRegister.RegisterBitWidth = 0x40;


+ CpcInfo->DeliveredPerformanceCounterRegister.RegisterBitOffset = 0;


+ CpcInfo->DeliveredPerformanceCounterRegister.AccessSize = ARM_FFH_DELIVERED_PERF_COUNTER_REGISTER;


+ CpcInfo->DeliveredPerformanceCounterRegister.Address = 0x4;


+


+ // SCMI should advertise performance values on a unified scale. So frequency


+ // values are not available. LowestFrequencyInteger and


+ // NominalFrequencyInteger are populated in the ConfigurationManager.


+


+exit_handler:


+ FreePool (LevelArray);


+ return Status;


+}


diff --git a/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf
new file mode 100644
index 000000000000..d49277f82bc3
--- /dev/null
+++ b/DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf
@@ -0,0 +1,31 @@
+## @file


+# Arm SCMI Info Library.


+#


+# Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.


+#


+# SPDX-License-Identifier: BSD-2-Clause-Patent


+##


+


+[Defines]


+ INF_VERSION = 0x0001001B


+ BASE_NAME = DynamicTablesScmiInfoLib


+ FILE_GUID = 1A7CDB04-9FFC-40DA-A87C-A5ACADAF8136


+ VERSION_STRING = 1.0


+ MODULE_TYPE = DXE_DRIVER


+ LIBRARY_CLASS = DynamicTablesScmiInfoLib


+ CONSTRUCTOR = DynamicTablesScmiInfoLibConstructor


+


+[Sources]


+ DynamicTablesScmiInfoLib.c


+


+[Packages]


+ ArmPkg/ArmPkg.dec


+ DynamicTablesPkg/DynamicTablesPkg.dec


+ EmbeddedPkg/EmbeddedPkg.dec


+ MdePkg/MdePkg.dec


+


+[Protocols]


+ gArmScmiPerformanceProtocolGuid ## CONSUMES


+


+[Depex]


+ gArmScmiPerformanceProtocolGuid


-- 
2.25.1







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114703): https://edk2.groups.io/g/devel/message/114703
Mute This Topic: https://groups.io/mt/103955508/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [edk2-devel] [PATCH v5 10/11] DynamicTablesPkg: Add PcdDevelopmentPlatformRelaxations Pcd
  2024-01-25 15:18 ` [edk2-devel] [PATCH v5 10/11] DynamicTablesPkg: Add PcdDevelopmentPlatformRelaxations Pcd PierreGondois
@ 2024-01-29 14:30   ` Sami Mujawar
  0 siblings, 0 replies; 18+ messages in thread
From: Sami Mujawar @ 2024-01-29 14:30 UTC (permalink / raw)
  To: Pierre Gondois, devel@edk2.groups.io; +Cc: Leif Lindholm, Ard Biesheuvel, nd

Hi Pierre,

Thank you for this patch.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 25/01/2024, 15:19, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:


Some development platforms might not be compliant on some
points of some specifications. In order to have a generic code
accurately checking against specifications while still allowing
some relaxation on specific points for the platforms that desire
it, add a Pcd acting as a bitfield to warn instead of returning
an error in case of non-compliance.


Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com <mailto:Pierre.Gondois@arm.com>>
---
DynamicTablesPkg/DynamicTablesPkg.dec | 4 ++++
1 file changed, 4 insertions(+)


diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec b/DynamicTablesPkg/DynamicTablesPkg.dec
index 25355ace884b..2b3ad163191f 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dec
+++ b/DynamicTablesPkg/DynamicTablesPkg.dec
@@ -70,5 +70,9 @@ [PcdsFixedAtBuild]
# Use PCI segment numbers as UID


gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdPciUseSegmentAsUid|FALSE|BOOLEAN|0x40000009






+ # 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|0|UINT64|0x4000000A


+


[Guids]


gEdkiiDynamicTablesPkgTokenSpaceGuid = { 0xab226e66, 0x31d8, 0x4613, { 0x87, 0x9d, 0xd2, 0xfa, 0xb6, 0x10, 0x26, 0x3c } }


-- 
2.25.1







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114704): https://edk2.groups.io/g/devel/message/114704
Mute This Topic: https://groups.io/mt/103955509/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI
  2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
                   ` (11 preceding siblings ...)
  2024-01-25 15:57 ` [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI Ard Biesheuvel
@ 2024-01-30 14:30 ` Sami Mujawar
  12 siblings, 0 replies; 18+ messages in thread
From: Sami Mujawar @ 2024-01-30 14:30 UTC (permalink / raw)
  To: Pierre Gondois, devel@edk2.groups.io; +Cc: Leif Lindholm, Ard Biesheuvel, nd

Hi Pierre,

Thank you for adding this feature.

Merged in edk2 as 4c43209a740d..dc3339470166.

Regards,

Sami Mujawar

On 25/01/2024, 15:19, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:


v1:
- https://edk2.groups.io/g/devel/message/104115 <https://edk2.groups.io/g/devel/message/104115>
v2:
- https://edk2.groups.io/g/devel/message/104115 <https://edk2.groups.io/g/devel/message/104115>
- Rebase patches on latest version.
v3:
- https://edk2.groups.io/g/devel/message/111567 <https://edk2.groups.io/g/devel/message/111567>
[PATCH 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION
- Note the referenced spec spec is SCMI v3.2
[PATCH 02/11] ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support
- Note the referenced spec spec is SCMI v3.2
- Move SCMI_MESSAGE_ID_PERFORMANCE enum definition out of #pragma pack(1)
[PATCH 03/11] MdePkg/Acpi65: Add _PSD/_CPC/State Coordination Types macros
- Macros used to be added to ACPI 6.4 definition file, move them to the
latest ACPI 6.5 definition file
[PATCH 10/11] DynamicTablesPkg: Add DynamicTablesScmiInfoLib
- Renamed ArmScmiInfoLib to DynamicTablesScmiInfoLib
[PATCH 11/11] DynamicTablesPkg: Remove check for _CPC field
- Add warning when missing one of the bypassed field
All patches:
- Rebase on latest master
- Use ACPI 6.5 definitions instead of 6.4 previously
v4:
- https://edk2.groups.io/g/devel/message/112378 <https://edk2.groups.io/g/devel/message/112378>
- Extracted and submitted patch:
- MdePkg/IndustryStandard: Add _PSD/_CPC/Coord types definitions
separately at: [1]
v5:
[PATCH v4 05/10] DynamicTablesPkg: Add CM_ARM_PSD_INFO object
- Updated format from "0x%llx" -> "0x%x"
[PATCH v4 07/10] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD
- Corrected error handling
[PATCH v4 09/10] DynamicTablesPkg: Add DynamicTablesScmiInfoLib
- Moved DynamicTablesScmiInfoLib library to AARCH64 section
[PATCH v4 10/10] DynamicTablesPkg: Remove check for _CPC field
- Added a patch 'DynamicTablesPkg: Add PcdDevelopmentPlatformRelaxations Pcd'
and make use of the new Pcd


The SCMI performance protocol allows to query the Operating Performance
Points (OPPs) available for each performance domain. Each OPP has a
specific frequency/power consumption/performance.


On Device Tree (DT) based platforms, the SCMI protocol is directly
available from the OS.
On ACPI based platforms, the _PSD objects allows to identify CPUs
belonging
to the same performance domain. CPUs belonging to the same performance
domain have the same frequency. The _CPC object allows to
describe/control the performance level/frequency of a CPU (i.e. its
frequency).


This patchset:
- Add support for 'DescribeFastchannel' SCMI performance protocol
- Add a object to the DynamicTablesPkg to describe the PSD information
- Allows to generate _PSD objects in the SsdtCpuTopologyGenerator
- Add a ArmScmiInfoLib library populating DynamicTablesPkg CPC objects,
relying on the SCMI protocol to fetch the relevant information


A patchset for Juno-r2 platforms will be submitted to demonstrate
this functionality.


[1] https://edk2.groups.io/g/devel/message/111901 <https://edk2.groups.io/g/devel/message/111901>


Pierre Gondois (11):
ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION
ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support
DynamicTablesPkg: Use new CPC revision macro
DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.h
DynamicTablesPkg: Add CM_ARM_PSD_INFO object
DynamicTablesPkg: Add PsdToken field to CM_ARM_GICC_INFO object
DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD
DynamicTablesPkg: Generate _PSD in SsdtCpuTopologyGenerator
DynamicTablesPkg: Add DynamicTablesScmiInfoLib
DynamicTablesPkg: Add PcdDevelopmentPlatformRelaxations Pcd
DynamicTablesPkg: Exempt some _CPC field from checks


.../ArmScmiDxe/ScmiPerformanceProtocol.c | 80 ++++-
.../Protocol/ArmScmiPerformanceProtocol.h | 101 +++++-
DynamicTablesPkg/DynamicTables.dsc.inc | 3 +
DynamicTablesPkg/DynamicTablesPkg.dec | 8 +
DynamicTablesPkg/DynamicTablesPkg.dsc | 3 +
.../Include/{AmlCpcInfo.h => AcpiObjects.h} | 20 ++
.../Include/ArmNameSpaceObjects.h | 17 +-
.../Include/Library/AmlLib/AmlLib.h | 37 ++-
.../Library/DynamicTablesScmiInfoLib.h | 33 ++
.../SsdtCpuTopologyGenerator.c | 96 ++++++
.../Library/Common/AmlLib/AmlLib.inf | 3 +
.../Common/AmlLib/CodeGen/AmlCodeGen.c | 228 +++++++++++++-
.../ConfigurationManagerObjectParser.c | 14 +-
.../DynamicTablesScmiInfoLib.c | 297 ++++++++++++++++++
.../DynamicTablesScmiInfoLib.inf | 31 ++
15 files changed, 941 insertions(+), 30 deletions(-)
rename DynamicTablesPkg/Include/{AmlCpcInfo.h => AcpiObjects.h} (88%)
create mode 100644 DynamicTablesPkg/Include/Library/DynamicTablesScmiInfoLib.h
create mode 100644 DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.c
create mode 100644 DynamicTablesPkg/Library/DynamicTablesScmiInfoLib/DynamicTablesScmiInfoLib.inf


-- 
2.25.1







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114787): https://edk2.groups.io/g/devel/message/114787
Mute This Topic: https://groups.io/mt/103955491/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-01-30 14:30 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-25 15:18 [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI PierreGondois
2024-01-25 15:18 ` [edk2-devel] [PATCH v5 01/11] ArmPkg/ArmScmiDxe: Rename PERFORMANCE_PROTOCOL_VERSION PierreGondois
2024-01-25 15:18 ` [edk2-devel] [PATCH v5 02/11] ArmPkg/ArmScmiDxe: Add PERFORMANCE_DESCRIBE_FASTCHANNEL support PierreGondois
2024-01-25 15:18 ` [edk2-devel] [PATCH v5 03/11] DynamicTablesPkg: Use new CPC revision macro PierreGondois
2024-01-25 15:18 ` [edk2-devel] [PATCH v5 04/11] DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.h PierreGondois
2024-01-25 15:18 ` [edk2-devel] [PATCH v5 05/11] DynamicTablesPkg: Add CM_ARM_PSD_INFO object PierreGondois
2024-01-26 11:34   ` Sami Mujawar
2024-01-25 15:18 ` [edk2-devel] [PATCH v5 06/11] DynamicTablesPkg: Add PsdToken field to CM_ARM_GICC_INFO object PierreGondois
2024-01-25 15:18 ` [edk2-devel] [PATCH v5 07/11] DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSD PierreGondois
2024-01-26 11:38   ` Sami Mujawar
2024-01-25 15:18 ` [edk2-devel] [PATCH v5 08/11] DynamicTablesPkg: Generate _PSD in SsdtCpuTopologyGenerator PierreGondois
2024-01-25 15:18 ` [edk2-devel] [PATCH v5 09/11] DynamicTablesPkg: Add DynamicTablesScmiInfoLib PierreGondois
2024-01-29 14:29   ` Sami Mujawar
2024-01-25 15:18 ` [edk2-devel] [PATCH v5 10/11] DynamicTablesPkg: Add PcdDevelopmentPlatformRelaxations Pcd PierreGondois
2024-01-29 14:30   ` Sami Mujawar
2024-01-25 15:18 ` [edk2-devel] [PATCH v5 11/11] DynamicTablesPkg: Exempt some _CPC field from checks PierreGondois
2024-01-25 15:57 ` [edk2-devel] [PATCH v5 00/11] DynamicTablesPkg: Enable _PSD/_CPC generation using SCMI Ard Biesheuvel
2024-01-30 14:30 ` Sami Mujawar

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