public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 00/14] Add PCCT generator and various fixes
@ 2022-10-10  9:20 PierreGondois
  2022-10-10  9:20 ` [PATCH 01/14] DynamicTablesPkg: Use correct print formatter PierreGondois
                   ` (15 more replies)
  0 siblings, 16 replies; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

The Platform Communications Channel Table (Pcct) allows to communicate
by describing mailboxes. Make use of the DynamicTablesPkg to generate
this table.

This patch-set also contains:
- Fixes for the CmObjParser,
- Removal of deprecated APIs
- Renaming for some of the PCCT fields

Pierre Gondois (14):
  DynamicTablesPkg: Use correct print formatter
  DynamicTablesPkg: Add PrintString to CmObjParser
  DynamicTablesPkg: Update CmObjParser for IORT Rev E.d
  DynamicTablesPkg: Update CmObjParser for MinorRevision
  DynamicTablesPkg: Fix GTBlock and GTBlockTimerFrame CmObjParsers
  DynamicTablesPkg: Fix wrong/missing fields in CmObjParser
  DynamicTablesPkg: Remove deprecated APIs
  DynamicTablesPkg: FdtHwInfoParserLib: Remove wrong comment
  DynamicTablesPkg: Fix Ssdt PCI generation comments
  DynamicTablesPkg: Add PCCT related objects
  DynamicTablesPkg: Add PCCT Generator
  DynamicTablesPkg/AmlLib: Allow larger AccessSize for Pcc address space
  DynamicTablesPkg: Readme.md: Update available tables for generation
  ShellPkg/AcpiView: Update PCCT fields for ACPI 6.5

 DynamicTablesPkg/DynamicTables.dsc.inc        |    4 +-
 DynamicTablesPkg/Include/AcpiTableGenerator.h |    3 +-
 .../Include/ArmNameSpaceObjects.h             |  311 ++++-
 .../Include/Library/AmlLib/AmlLib.h           |  138 --
 .../Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf     |   30 +
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c   | 1186 +++++++++++++++++
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h   |   43 +
 .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c    |    8 +-
 .../Library/Common/AmlLib/Api/AmlApi.c        |   85 --
 .../AmlLib/CodeGen/AmlResourceDataCodeGen.c   |   83 +-
 .../ConfigurationManagerObjectParser.c        |  243 +++-
 .../FdtHwInfoParserLib/Gic/ArmGicCParser.c    |    3 -
 .../FdtHwInfoParserLib/Gic/ArmGicCParser.h    |    3 -
 DynamicTablesPkg/Readme.md                    |    3 +
 .../Parsers/Pcct/PcctParser.c                 |    6 +-
 15 files changed, 1734 insertions(+), 415 deletions(-)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
 create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h

-- 
2.25.1


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

* [PATCH 01/14] DynamicTablesPkg: Use correct print formatter
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:36   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 02/14] DynamicTablesPkg: Add PrintString to CmObjParser PierreGondois
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

In C, the 'long long' types are 64-bits. The 'll' printf length
specifier should be used to pring these values. Just '%x' allows to
print values that are on 16-bits or more. Use that instead.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../ConfigurationManagerObjectParser.c             | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 08b4f60dfbae..13e6c0e321c4 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -1,7 +1,7 @@
 /** @file
   Configuration Manager Object parser.
 
-  Copyright (c) 2021, ARM Limited. All rights reserved.<BR>
+  Copyright (c) 2021 - 2022, ARM Limited. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -384,12 +384,12 @@ STATIC CONST CM_OBJ_PARSER  AcpiGenericAddressParser[] = {
 /** A parser for EArmObjLpiInfo.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmLpiInfoParser[] = {
-  { "MinResidency",             4,                                               "0x%llx", NULL },
-  { "WorstCaseWakeLatency",     4,                                               "0x%llx", NULL },
-  { "Flags",                    4,                                               "0x%llx", NULL },
-  { "ArchFlags",                4,                                               "0x%llx", NULL },
-  { "ResCntFreq",               4,                                               "0x%llx", NULL },
-  { "EnableParentState",        4,                                               "0x%llx", NULL },
+  { "MinResidency",             4,                                               "0x%x",   NULL },
+  { "WorstCaseWakeLatency",     4,                                               "0x%x",   NULL },
+  { "Flags",                    4,                                               "0x%x",   NULL },
+  { "ArchFlags",                4,                                               "0x%x",   NULL },
+  { "ResCntFreq",               4,                                               "0x%x",   NULL },
+  { "EnableParentState",        4,                                               "0x%x",   NULL },
   { "IsInteger",                1,                                               "%d",     NULL },
   { "IntegerEntryMethod",       8,                                               "0x%llx", NULL },
   { "RegisterEntryMethod",      sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
-- 
2.25.1


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

* [PATCH 02/14] DynamicTablesPkg: Add PrintString to CmObjParser
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
  2022-10-10  9:20 ` [PATCH 01/14] DynamicTablesPkg: Use correct print formatter PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:36   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 03/14] DynamicTablesPkg: Update CmObjParser for IORT Rev E.d PierreGondois
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

Add a PrintString to print strings in the CmObjParser.
String must be NULL terminated and no buffer overrun check
is done by this function.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../ConfigurationManagerObjectParser.c        | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 13e6c0e321c4..b46f19693bb5 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -19,6 +19,14 @@ PrintOemId (
   UINT8        *Ptr
   );
 
+STATIC
+VOID
+EFIAPI
+PrintString (
+  CONST CHAR8  *Format,
+  UINT8        *Ptr
+  );
+
 /** A parser for EArmObjBootArchInfo.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmBootArchInfoParser[] = {
@@ -646,6 +654,24 @@ PrintOemId (
     ));
 }
 
+/** Print string.
+
+  The string must be NULL terminated.
+
+  @param [in]  Format  Format to print the Ptr.
+  @param [in]  Ptr     Pointer to the string.
+**/
+STATIC
+VOID
+EFIAPI
+PrintString (
+  CONST CHAR8  *Format,
+  UINT8        *Ptr
+  )
+{
+  DEBUG ((DEBUG_ERROR, "%a", Ptr));
+}
+
 /** Print fields of the objects.
 
   @param [in]  Data           Pointer to the object to print.
-- 
2.25.1


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

* [PATCH 03/14] DynamicTablesPkg: Update CmObjParser for IORT Rev E.d
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
  2022-10-10  9:20 ` [PATCH 01/14] DynamicTablesPkg: Use correct print formatter PierreGondois
  2022-10-10  9:20 ` [PATCH 02/14] DynamicTablesPkg: Add PrintString to CmObjParser PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:34   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 04/14] DynamicTablesPkg: Update CmObjParser for MinorRevision PierreGondois
                   ` (12 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

commit de200b7e2c3c ("DynamicTablesPkg: Update ArmNameSpaceObjects for
IORT Rev E.d")
adds new CmObj structures and fields to the ArmNameSpaceObjects.
Update the CmObjectParser accordingly.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../ConfigurationManagerObjectParser.c        | 59 ++++++++++++++-----
 1 file changed, 45 insertions(+), 14 deletions(-)

diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index b46f19693bb5..80ebb0708661 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -183,21 +183,23 @@ STATIC CONST CM_OBJ_PARSER  CmArmFixedFeatureFlagsParser[] = {
 STATIC CONST CM_OBJ_PARSER  CmArmItsGroupNodeParser[] = {
   { "Token",      sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "ItsIdCount", 4,                        "0x%x", NULL },
-  { "ItsIdToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }
+  { "ItsIdToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
+  { "Identifier", 4,                        "0x%x", NULL },
 };
 
 /** A parser for EArmObjNamedComponent.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmNamedComponentNodeParser[] = {
-  { "Token",             sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
-  { "IdMappingCount",    4,                        "0x%x", NULL },
-  { "IdMappingToken",    sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
-  { "Flags",             4,                        "0x%x", NULL },
-  { "CacheCoherent",     4,                        "0x%x", NULL },
-  { "AllocationHints",   1,                        "0x%x", NULL },
-  { "MemoryAccessFlags", 1,                        "0x%x", NULL },
-  { "AddressSizeLimit",  1,                        "0x%x", NULL },
-  { "ObjectName",        sizeof (CHAR8 *),         "%a",   NULL }
+  { "Token",             sizeof (CM_OBJECT_TOKEN), "0x%p", NULL        },
+  { "IdMappingCount",    4,                        "0x%x", NULL        },
+  { "IdMappingToken",    sizeof (CM_OBJECT_TOKEN), "0x%p", NULL        },
+  { "Flags",             4,                        "0x%x", NULL        },
+  { "CacheCoherent",     4,                        "0x%x", NULL        },
+  { "AllocationHints",   1,                        "0x%x", NULL        },
+  { "MemoryAccessFlags", 1,                        "0x%x", NULL        },
+  { "AddressSizeLimit",  1,                        "0x%x", NULL        },
+  { "ObjectName",        1,                        NULL,   PrintString },
+  { "Identifier",        4,                        "0x%x", NULL        },
 };
 
 /** A parser for EArmObjRootComplex.
@@ -211,7 +213,10 @@ STATIC CONST CM_OBJ_PARSER  CmArmRootComplexNodeParser[] = {
   { "MemoryAccessFlags", 1,                        "0x%x", NULL },
   { "AtsAttribute",      4,                        "0x%x", NULL },
   { "PciSegmentNumber",  4,                        "0x%x", NULL },
-  { "MemoryAddressSize", 1,                        "0x%x", NULL }
+  { "MemoryAddressSize", 1,                        "0x%x", NULL },
+  { "PasidCapabilities", 2,                        "0x%x", NULL },
+  { "Flags",             4,                        "0x%x", NULL },
+  { "Identifier",        4,                        "0x%x", NULL },
 };
 
 /** A parser for EArmObjSmmuV1SmmuV2.
@@ -231,7 +236,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmSmmuV1SmmuV2NodeParser[] = {
   { "SMMU_NSgIrpt",          4,                        "0x%x",   NULL },
   { "SMMU_NSgIrptFlags",     4,                        "0x%x",   NULL },
   { "SMMU_NSgCfgIrpt",       4,                        "0x%x",   NULL },
-  { "SMMU_NSgCfgIrptFlags",  4,                        "0x%x",   NULL }
+  { "SMMU_NSgCfgIrptFlags",  4,                        "0x%x",   NULL },
+  { "Identifier",            4,                        "0x%x",   NULL },
 };
 
 /** A parser for EArmObjSmmuV3.
@@ -249,7 +255,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmSmmuV3NodeParser[] = {
   { "GerrInterrupt",        4,                        "0x%x",   NULL },
   { "SyncInterrupt",        4,                        "0x%x",   NULL },
   { "ProximityDomain",      4,                        "0x%x",   NULL },
-  { "DeviceIdMappingIndex", 4,                        "0x%x",   NULL }
+  { "DeviceIdMappingIndex", 4,                        "0x%x",   NULL },
+  { "Identifier",           4,                        "0x%x",   NULL },
 };
 
 /** A parser for EArmObjPmcg.
@@ -261,7 +268,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmPmcgNodeParser[] = {
   { "BaseAddress",       8,                        "0x%llx", NULL },
   { "OverflowInterrupt", 4,                        "0x%x",   NULL },
   { "Page1BaseAddress",  8,                        "0x%llx", NULL },
-  { "ReferenceToken",    sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL }
+  { "ReferenceToken",    sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL },
+  { "Identifier",        4,                        "0x%x",   NULL },
 };
 
 /** A parser for EArmObjGicItsIdentifierArray.
@@ -432,6 +440,25 @@ STATIC CONST CM_OBJ_PARSER  CmPciInterruptMapInfoParser[] = {
     ARRAY_SIZE (CmArmGenericInterruptParser) },
 };
 
+/** A parser for EArmObjRmr.
+*/
+STATIC CONST CM_OBJ_PARSER  CmArmRmrInfoParser[] = {
+  { "Token",             sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
+  { "IdMappingCount",    4,                        "0x%x", NULL },
+  { "IdMappingToken",    sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
+  { "Identifier",        4,                        "0x%x", NULL },
+  { "Flags",             4,                        "0x%x", NULL },
+  { "MemRangeDescCount", 4,                        "0x%x", NULL },
+  { "MemRangeDescToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
+};
+
+/** A parser for EArmObjMemoryRangeDescriptor.
+*/
+STATIC CONST CM_OBJ_PARSER  CmArmMemoryRangeDescriptorInfoParser[] = {
+  { "BaseAddress", 8, "0x%llx", NULL },
+  { "Length",      8, "0x%llx", NULL },
+};
+
 /** A parser for EArmObjCpcInfo.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmCpcInfoParser[] = {
@@ -588,6 +615,10 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
     ARRAY_SIZE (CmArmPciAddressMapInfoParser) },
   { "EArmObjPciInterruptMapInfo",          CmPciInterruptMapInfoParser,
     ARRAY_SIZE (CmPciInterruptMapInfoParser) },
+  { "EArmObjRmr",                          CmArmRmrInfoParser,
+    ARRAY_SIZE (CmArmRmrInfoParser) },
+  { "EArmObjMemoryRangeDescriptor",        CmArmMemoryRangeDescriptorInfoParser,
+    ARRAY_SIZE (CmArmMemoryRangeDescriptorInfoParser) },
   { "EArmObjCpcInfo",                      CmArmCpcInfoParser,
     ARRAY_SIZE (CmArmCpcInfoParser) },
   { "EArmObjMax",                          NULL,                                  0                                },
-- 
2.25.1


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

* [PATCH 04/14] DynamicTablesPkg: Update CmObjParser for MinorRevision
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (2 preceding siblings ...)
  2022-10-10  9:20 ` [PATCH 03/14] DynamicTablesPkg: Update CmObjParser for IORT Rev E.d PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:36   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 05/14] DynamicTablesPkg: Fix GTBlock and GTBlockTimerFrame CmObjParsers PierreGondois
                   ` (11 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

commit 0d23c447d6f5 ("DynamicTablesPkg: Add support to specify FADT
minor revision")
adds new 'MinorRevision' field to CM_STD_OBJ_ACPI_TABLE_INFO.
Reflect the change in this patch to the CmObjectParser.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../Common/TableHelperLib/ConfigurationManagerObjectParser.c   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 80ebb0708661..f82541240ae0 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -639,7 +639,8 @@ STATIC CONST CM_OBJ_PARSER  StdObjAcpiTableInfoParser[] = {
   { "TableGeneratorId",   sizeof (ACPI_TABLE_GENERATOR_ID),       "0x%x",   NULL },
   { "AcpiTableData",      sizeof (EFI_ACPI_DESCRIPTION_HEADER *), "0x%p",   NULL },
   { "OemTableId",         8,                                      "0x%LLX", NULL },
-  { "OemRevision",        4,                                      "0x%x",   NULL }
+  { "OemRevision",        4,                                      "0x%x",   NULL },
+  { "MinorRevision",      1,                                      "0x%x",   NULL },
 };
 
 /** A parser for EStdObjSmbiosTableList.
-- 
2.25.1


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

* [PATCH 05/14] DynamicTablesPkg: Fix GTBlock and GTBlockTimerFrame CmObjParsers
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (3 preceding siblings ...)
  2022-10-10  9:20 ` [PATCH 04/14] DynamicTablesPkg: Update CmObjParser for MinorRevision PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:37   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 06/14] DynamicTablesPkg: Fix wrong/missing fields in CmObjParser PierreGondois
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

The CmObjParsers of the following objects was inverted, probably
due to a wrong ordering placement in the file defining the structures:
-EArmObjGTBlockTimerFrameInfo
-EArmObjPlatformGTBlockInfo

Assign the correct parser for each object, and re-order the
structures in the file defining them.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../Include/ArmNameSpaceObjects.h             | 32 +++++++++----------
 .../ConfigurationManagerObjectParser.c        | 22 ++++++-------
 2 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index c66b441d532d..cd39e609d6c4 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -353,6 +353,22 @@ typedef struct CmArmGenericTimerInfo {
   UINT32    VirtualPL2TimerFlags;
 } CM_ARM_GENERIC_TIMER_INFO;
 
+/** A structure that describes the
+    Platform Generic Block Timer information for the Platform.
+
+    ID: EArmObjPlatformGTBlockInfo
+*/
+typedef struct CmArmGTBlockInfo {
+  /// The physical base address for the GT Block Timer structure
+  UINT64             GTBlockPhysicalAddress;
+
+  /// The number of timer frames implemented in the GT Block
+  UINT32             GTBlockTimerFrameCount;
+
+  /// Reference token for the GT Block timer frame list
+  CM_OBJECT_TOKEN    GTBlockTimerFrameToken;
+} CM_ARM_GTBLOCK_INFO;
+
 /** A structure that describes the
     Platform Generic Block Timer Frame information for the Platform.
 
@@ -390,22 +406,6 @@ typedef struct CmArmGTBlockTimerFrameInfo {
   UINT32    CommonFlags;
 } CM_ARM_GTBLOCK_TIMER_FRAME_INFO;
 
-/** A structure that describes the
-    Platform Generic Block Timer information for the Platform.
-
-    ID: EArmObjPlatformGTBlockInfo
-*/
-typedef struct CmArmGTBlockInfo {
-  /// The physical base address for the GT Block Timer structure
-  UINT64             GTBlockPhysicalAddress;
-
-  /// The number of timer frames implemented in the GT Block
-  UINT32             GTBlockTimerFrameCount;
-
-  /// Reference token for the GT Block timer frame list
-  CM_OBJECT_TOKEN    GTBlockTimerFrameToken;
-} CM_ARM_GTBLOCK_INFO;
-
 /** A structure that describes the
     Arm Generic Watchdog information for the Platform.
 
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index f82541240ae0..040aaa4cbb17 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -127,6 +127,14 @@ STATIC CONST CM_OBJ_PARSER  CmArmGenericTimerInfoParser[] = {
 
 /** A parser for EArmObjPlatformGTBlockInfo.
 */
+STATIC CONST CM_OBJ_PARSER  CmArmGTBlockInfoParser[] = {
+  { "GTBlockPhysicalAddress", 8,                        "0x%llx", NULL },
+  { "GTBlockTimerFrameCount", 4,                        "0x%x",   NULL },
+  { "GTBlockTimerFrameToken", sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL }
+};
+
+/** A parser for EArmObjGTBlockTimerFrameInfo.
+*/
 STATIC CONST CM_OBJ_PARSER  CmArmGTBlockTimerFrameInfoParser[] = {
   { "FrameNumber",               1, "0x%x",   NULL },
   { "PhysicalAddressCntBase",    8, "0x%llx", NULL },
@@ -138,14 +146,6 @@ STATIC CONST CM_OBJ_PARSER  CmArmGTBlockTimerFrameInfoParser[] = {
   { "CommonFlags",               4, "0x%x",   NULL }
 };
 
-/** A parser for EArmObjGTBlockTimerFrameInfo.
-*/
-STATIC CONST CM_OBJ_PARSER  CmArmGTBlockInfoParser[] = {
-  { "GTBlockPhysicalAddress", 8,                        "0x%llx", NULL },
-  { "GTBlockTimerFrameCount", 4,                        "0x%x",   NULL },
-  { "GTBlockTimerFrameToken", sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL }
-};
-
 /** A parser for EArmObjPlatformGenericWatchdogInfo.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmGenericWatchdogInfoParser[] = {
@@ -560,10 +560,10 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
     ARRAY_SIZE (CmArmSerialPortInfoParser) },
   { "EArmObjGenericTimerInfo",             CmArmGenericTimerInfoParser,
     ARRAY_SIZE (CmArmGenericTimerInfoParser) },
-  { "EArmObjPlatformGTBlockInfo",          CmArmGTBlockTimerFrameInfoParser,
-    ARRAY_SIZE (CmArmGTBlockTimerFrameInfoParser) },
-  { "EArmObjGTBlockTimerFrameInfo",        CmArmGTBlockInfoParser,
+  { "EArmObjPlatformGTBlockInfo",          CmArmGTBlockInfoParser,
     ARRAY_SIZE (CmArmGTBlockInfoParser) },
+  { "EArmObjGTBlockTimerFrameInfo",        CmArmGTBlockTimerFrameInfoParser,
+    ARRAY_SIZE (CmArmGTBlockTimerFrameInfoParser) },
   { "EArmObjPlatformGenericWatchdogInfo",  CmArmGenericWatchdogInfoParser,
     ARRAY_SIZE (CmArmGenericWatchdogInfoParser) },
   { "EArmObjPciConfigSpaceInfo",           CmArmPciConfigSpaceInfoParser,
-- 
2.25.1


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

* [PATCH 06/14] DynamicTablesPkg: Fix wrong/missing fields in CmObjParser
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (4 preceding siblings ...)
  2022-10-10  9:20 ` [PATCH 05/14] DynamicTablesPkg: Fix GTBlock and GTBlockTimerFrame CmObjParsers PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:34   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 07/14] DynamicTablesPkg: Remove deprecated APIs PierreGondois
                   ` (9 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

Add missing fields to the following CmObjParser objects:
- EArmObjGicDInfo
- EArmObjCacheInfo
and fix wrong formatting of:
- EArmObjLpiInfo

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../ConfigurationManagerObjectParser.c        | 24 ++++++++++---------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 040aaa4cbb17..2126beba8b9f 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -303,7 +303,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmProcHierarchyInfoParser[] = {
   { "ParentToken",                sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "GicCToken",                  sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
   { "NoOfPrivateResources",       4,                        "0x%x", NULL },
-  { "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }
+  { "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
+  { "LpiToken",                   sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
 };
 
 /** A parser for EArmObjCacheInfo.
@@ -315,7 +316,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmCacheInfoParser[] = {
   { "NumberOfSets",          4,                        "0x%x", NULL },
   { "Associativity",         4,                        "0x%x", NULL },
   { "Attributes",            1,                        "0x%x", NULL },
-  { "LineSize",              2,                        "0x%x", NULL }
+  { "LineSize",              2,                        "0x%x", NULL },
+  { "CacheId",               4,                        "0x%x", NULL },
 };
 
 /** A parser for EArmObjProcNodeIdInfo.
@@ -400,14 +402,14 @@ STATIC CONST CM_OBJ_PARSER  AcpiGenericAddressParser[] = {
 /** A parser for EArmObjLpiInfo.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmLpiInfoParser[] = {
-  { "MinResidency",             4,                                               "0x%x",   NULL },
-  { "WorstCaseWakeLatency",     4,                                               "0x%x",   NULL },
-  { "Flags",                    4,                                               "0x%x",   NULL },
-  { "ArchFlags",                4,                                               "0x%x",   NULL },
-  { "ResCntFreq",               4,                                               "0x%x",   NULL },
-  { "EnableParentState",        4,                                               "0x%x",   NULL },
-  { "IsInteger",                1,                                               "%d",     NULL },
-  { "IntegerEntryMethod",       8,                                               "0x%llx", NULL },
+  { "MinResidency",             4,                                               "0x%x",   NULL        },
+  { "WorstCaseWakeLatency",     4,                                               "0x%x",   NULL        },
+  { "Flags",                    4,                                               "0x%x",   NULL        },
+  { "ArchFlags",                4,                                               "0x%x",   NULL        },
+  { "ResCntFreq",               4,                                               "0x%x",   NULL        },
+  { "EnableParentState",        4,                                               "0x%x",   NULL        },
+  { "IsInteger",                1,                                               "%d",     NULL        },
+  { "IntegerEntryMethod",       8,                                               "0x%llx", NULL        },
   { "RegisterEntryMethod",      sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
     NULL, NULL, AcpiGenericAddressParser,
     ARRAY_SIZE (AcpiGenericAddressParser) },
@@ -417,7 +419,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmLpiInfoParser[] = {
   { "UsageCounterRegister",     sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
     NULL, NULL, AcpiGenericAddressParser,
     ARRAY_SIZE (AcpiGenericAddressParser) },
-  { "StateName",                16,                                              "0x%a",   NULL },
+  { "StateName",                16,                                              "NULL",   PrintString },
 };
 
 /** A parser for EArmObjPciAddressMapInfo.
-- 
2.25.1


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

* [PATCH 07/14] DynamicTablesPkg: Remove deprecated APIs
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (5 preceding siblings ...)
  2022-10-10  9:20 ` [PATCH 06/14] DynamicTablesPkg: Fix wrong/missing fields in CmObjParser PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:37   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 08/14] DynamicTablesPkg: FdtHwInfoParserLib: Remove wrong comment PierreGondois
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

commit 691c5f776274 ("DynamicTablesPkg: Deprecate Crs specific methods
in AmlLib")
deprecates some APIs. Finally remove them.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../Include/Library/AmlLib/AmlLib.h           | 138 ------------------
 .../Library/Common/AmlLib/Api/AmlApi.c        |  85 -----------
 .../AmlLib/CodeGen/AmlResourceDataCodeGen.c   |  76 ----------
 3 files changed, 299 deletions(-)

diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 0d8446d78256..9210c5091548 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -1390,142 +1390,4 @@ AmlCreateCpcNode (
   OUT AML_OBJECT_NODE_HANDLE  *NewCpcNode   OPTIONAL
   );
 
-// DEPRECATED APIS
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/** DEPRECATED API
-
-  Get the first Resource Data element contained in a "_CRS" object.
-
-  In the following ASL code, the function will return the Resource Data
-  node corresponding to the "QWordMemory ()" ASL macro.
-  Name (_CRS, ResourceTemplate() {
-      QWordMemory (...) {...},
-      Interrupt (...) {...}
-    }
-  )
-
-  Note:
-   - The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
-   - "_CRS" declared using ASL "Method (Declare Control Method)" is not
-     supported.
-
-  @ingroup UserApis
-
-  @param  [in] NameOpCrsNode  NameOp object node defining a "_CRS" object.
-                              Must have an OpCode=AML_NAME_OP, SubOpCode=0.
-                              NameOp object nodes are defined in ASL
-                              using the "Name ()" function.
-  @param  [out] OutRdNode     Pointer to the first Resource Data element of
-                              the "_CRS" object. A Resource Data element
-                              is stored in a data node.
-
-  @retval EFI_SUCCESS             The function completed successfully.
-  @retval EFI_INVALID_PARAMETER   Invalid parameter.
-**/
-EFI_STATUS
-EFIAPI
-AmlNameOpCrsGetFirstRdNode (
-  IN  AML_OBJECT_NODE_HANDLE  NameOpCrsNode,
-  OUT AML_DATA_NODE_HANDLE    *OutRdNode
-  );
-
-/** DEPRECATED API
-
-  Get the Resource Data element following the CurrRdNode Resource Data.
-
-  In the following ASL code, if CurrRdNode corresponds to the first
-  "QWordMemory ()" ASL macro, the function will return the Resource Data
-  node corresponding to the "Interrupt ()" ASL macro.
-  Name (_CRS, ResourceTemplate() {
-      QwordMemory (...) {...},
-      Interrupt (...) {...}
-    }
-  )
-
-  The CurrRdNode Resource Data node must be defined in an object named "_CRS"
-  and defined by a "Name ()" ASL function.
-
-  @ingroup UserApis
-
-  @param  [in]  CurrRdNode   Pointer to the current Resource Data element of
-                             the "_CRS" variable.
-  @param  [out] OutRdNode    Pointer to the Resource Data element following
-                             the CurrRdNode.
-                             Contain a NULL pointer if CurrRdNode is the
-                             last Resource Data element in the list.
-                             The "End Tag" is not considered as a resource
-                             data element and is not returned.
-
-  @retval EFI_SUCCESS             The function completed successfully.
-  @retval EFI_INVALID_PARAMETER   Invalid parameter.
-**/
-EFI_STATUS
-EFIAPI
-AmlNameOpCrsGetNextRdNode (
-  IN  AML_DATA_NODE_HANDLE  CurrRdNode,
-  OUT AML_DATA_NODE_HANDLE  *OutRdNode
-  );
-
-/** DEPRECATED API
-
-  Add an Interrupt Resource Data node.
-
-  This function creates a Resource Data element corresponding to the
-  "Interrupt ()" ASL function, stores it in an AML Data Node.
-
-  It then adds it after the input CurrRdNode in the list of resource data
-  element.
-
-  The Resource Data effectively created is an Extended Interrupt Resource
-  Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
-  for more information about Extended Interrupt Resource Data.
-
-  The Extended Interrupt contains one single interrupt.
-
-  This function allocates memory to create a data node. It is the caller's
-  responsibility to either:
-   - attach this node to an AML tree;
-   - delete this node.
-
-  Note: The _CRS node must be defined using the ASL Name () function.
-        e.g. Name (_CRS, ResourceTemplate () {
-               ...
-             }
-
-  @ingroup CodeGenApis
-
-  @param  [in]  NameOpCrsNode    NameOp object node defining a "_CRS" object.
-                                 Must have an OpCode=AML_NAME_OP, SubOpCode=0.
-                                 NameOp object nodes are defined in ASL
-                                 using the "Name ()" function.
-  @param  [in]  ResourceConsumer The device consumes the specified interrupt
-                                 or produces it for use by a child device.
-  @param  [in]  EdgeTriggered    The interrupt is edge triggered or
-                                 level triggered.
-  @param  [in]  ActiveLow        The interrupt is active-high or active-low.
-  @param  [in]  Shared           The interrupt can be shared with other
-                                 devices or not (Exclusive).
-  @param  [in]  IrqList          Interrupt list. Must be non-NULL.
-  @param  [in]  IrqCount         Interrupt count. Must be non-zero.
-
-
-  @retval EFI_SUCCESS             The function completed successfully.
-  @retval EFI_INVALID_PARAMETER   Invalid parameter.
-  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.
-**/
-EFI_STATUS
-EFIAPI
-AmlCodeGenCrsAddRdInterrupt (
-  IN  AML_OBJECT_NODE_HANDLE  NameOpCrsNode,
-  IN  BOOLEAN                 ResourceConsumer,
-  IN  BOOLEAN                 EdgeTriggered,
-  IN  BOOLEAN                 ActiveLow,
-  IN  BOOLEAN                 Shared,
-  IN  UINT32                  *IrqList,
-  IN  UINT8                   IrqCount
-  );
-
-#endif // DISABLE_NEW_DEPRECATED_INTERFACES
-
 #endif // AML_LIB_H_
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApi.c b/DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApi.c
index 519afdc1eafa..9f162abe2d09 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApi.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApi.c
@@ -429,88 +429,3 @@ AmlAttachNode (
 {
   return AmlVarListAddTail (ParentNode, NewNode);
 }
-
-// DEPRECATED APIS
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/** DEPRECATED API
-
-  Get the first Resource Data element contained in a "_CRS" object.
-
-  In the following ASL code, the function will return the Resource Data
-  node corresponding to the "QWordMemory ()" ASL macro.
-  Name (_CRS, ResourceTemplate() {
-      QWordMemory (...) {...},
-      Interrupt (...) {...}
-    }
-  )
-
-  Note:
-   - The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
-   - "_CRS" declared using ASL "Method (Declare Control Method)" is not
-     supported.
-
-  @ingroup UserApis
-
-  @param  [in] NameOpCrsNode  NameOp object node defining a "_CRS" object.
-                              Must have an OpCode=AML_NAME_OP, SubOpCode=0.
-                              NameOp object nodes are defined in ASL
-                              using the "Name ()" function.
-  @param  [out] OutRdNode     Pointer to the first Resource Data element of
-                              the "_CRS" object. A Resource Data element
-                              is stored in a data node.
-
-  @retval EFI_SUCCESS             The function completed successfully.
-  @retval EFI_INVALID_PARAMETER   Invalid parameter.
-**/
-EFI_STATUS
-EFIAPI
-AmlNameOpCrsGetFirstRdNode (
-  IN  AML_OBJECT_NODE_HANDLE  NameOpCrsNode,
-  OUT AML_DATA_NODE_HANDLE    *OutRdNode
-  )
-{
-  return AmlNameOpGetFirstRdNode (NameOpCrsNode, OutRdNode);
-}
-
-/** DEPRECATED API
-
-  Get the Resource Data element following the CurrRdNode Resource Data.
-
-  In the following ASL code, if CurrRdNode corresponds to the first
-  "QWordMemory ()" ASL macro, the function will return the Resource Data
-  node corresponding to the "Interrupt ()" ASL macro.
-  Name (_CRS, ResourceTemplate() {
-      QwordMemory (...) {...},
-      Interrupt (...) {...}
-    }
-  )
-
-  The CurrRdNode Resource Data node must be defined in an object named "_CRS"
-  and defined by a "Name ()" ASL function.
-
-  @ingroup UserApis
-
-  @param  [in]  CurrRdNode   Pointer to the current Resource Data element of
-                             the "_CRS" variable.
-  @param  [out] OutRdNode    Pointer to the Resource Data element following
-                             the CurrRdNode.
-                             Contain a NULL pointer if CurrRdNode is the
-                             last Resource Data element in the list.
-                             The "End Tag" is not considered as a resource
-                             data element and is not returned.
-
-  @retval EFI_SUCCESS             The function completed successfully.
-  @retval EFI_INVALID_PARAMETER   Invalid parameter.
-**/
-EFI_STATUS
-EFIAPI
-AmlNameOpCrsGetNextRdNode (
-  IN  AML_DATA_NODE_HANDLE  CurrRdNode,
-  OUT AML_DATA_NODE_HANDLE  *OutRdNode
-  )
-{
-  return AmlNameOpGetNextRdNode (CurrRdNode, OutRdNode);
-}
-
-#endif // DISABLE_NEW_DEPRECATED_INTERFACES
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
index 32c3ab534d0b..332962bed441 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
@@ -1406,79 +1406,3 @@ error_handler:
 
   return Status;
 }
-
-// DEPRECATED APIS
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/** DEPRECATED API
-
-  Add an Interrupt Resource Data node.
-
-  This function creates a Resource Data element corresponding to the
-  "Interrupt ()" ASL function, stores it in an AML Data Node.
-
-  It then adds it after the input CurrRdNode in the list of resource data
-  element.
-
-  The Resource Data effectively created is an Extended Interrupt Resource
-  Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
-  for more information about Extended Interrupt Resource Data.
-
-  The Extended Interrupt contains one single interrupt.
-
-  This function allocates memory to create a data node. It is the caller's
-  responsibility to either:
-   - attach this node to an AML tree;
-   - delete this node.
-
-  Note: The _CRS node must be defined using the ASL Name () function.
-        e.g. Name (_CRS, ResourceTemplate () {
-               ...
-             }
-
-  @ingroup UserApis
-
-  @param  [in]  NameOpCrsNode    NameOp object node defining a "_CRS" object.
-                                 Must have an OpCode=AML_NAME_OP, SubOpCode=0.
-                                 NameOp object nodes are defined in ASL
-                                 using the "Name ()" function.
-  @param  [in]  ResourceConsumer The device consumes the specified interrupt
-                                 or produces it for use by a child device.
-  @param  [in]  EdgeTriggered    The interrupt is edge triggered or
-                                 level triggered.
-  @param  [in]  ActiveLow        The interrupt is active-high or active-low.
-  @param  [in]  Shared           The interrupt can be shared with other
-                                 devices or not (Exclusive).
-  @param  [in]  IrqList          Interrupt list. Must be non-NULL.
-  @param  [in]  IrqCount         Interrupt count. Must be non-zero.
-
-
-  @retval EFI_SUCCESS             The function completed successfully.
-  @retval EFI_INVALID_PARAMETER   Invalid parameter.
-  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.
-**/
-EFI_STATUS
-EFIAPI
-AmlCodeGenCrsAddRdInterrupt (
-  IN  AML_OBJECT_NODE_HANDLE  NameOpCrsNode,
-  IN  BOOLEAN                 ResourceConsumer,
-  IN  BOOLEAN                 EdgeTriggered,
-  IN  BOOLEAN                 ActiveLow,
-  IN  BOOLEAN                 Shared,
-  IN  UINT32                  *IrqList,
-  IN  UINT8                   IrqCount
-  )
-{
-  return AmlCodeGenRdInterrupt (
-           ResourceConsumer,
-           EdgeTriggered,
-           ActiveLow,
-           Shared,
-           IrqList,
-           IrqCount,
-           NameOpCrsNode,
-           NULL
-           );
-}
-
-#endif // DISABLE_NEW_DEPRECATED_INTERFACES
-- 
2.25.1


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

* [PATCH 08/14] DynamicTablesPkg: FdtHwInfoParserLib: Remove wrong comment
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (6 preceding siblings ...)
  2022-10-10  9:20 ` [PATCH 07/14] DynamicTablesPkg: Remove deprecated APIs PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:37   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 09/14] DynamicTablesPkg: Fix Ssdt PCI generation comments PierreGondois
                   ` (7 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

commit 13136cc3111f ("DynamicTablesPkg: FdtHwInfoParserLib:
Parse Pmu info")
adds support for pmu parsing. Thus, remove the wrong comment.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 .../Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c             | 3 ---
 .../Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h             | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c
index fb01aa0d19e2..2c72bd0c582e 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c
@@ -785,9 +785,6 @@ GicCPmuNodeParser (
     UINT32  AffinityFlags;                    // {default = 0}
   } CM_ARM_GICC_INFO;
 
-  The pmu information can be found in the pmu node. There is no support
-  for now.
-
   A parser parses a Device Tree to populate a specific CmObj type. None,
   one or many CmObj can be created by the parser.
   The created CmObj are then handed to the parser's caller through the
diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h
index fd980484a28d..539f39cecb22 100644
--- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h
+++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h
@@ -41,9 +41,6 @@
     UINT32  AffinityFlags;                    // {default = 0}
   } CM_ARM_GICC_INFO;
 
-  The pmu information can be found in the pmu node. There is no support
-  for now.
-
   A parser parses a Device Tree to populate a specific CmObj type. None,
   one or many CmObj can be created by the parser.
   The created CmObj are then handed to the parser's caller through the
-- 
2.25.1


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

* [PATCH 09/14] DynamicTablesPkg: Fix Ssdt PCI generation comments
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (7 preceding siblings ...)
  2022-10-10  9:20 ` [PATCH 08/14] DynamicTablesPkg: FdtHwInfoParserLib: Remove wrong comment PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:37   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 10/14] DynamicTablesPkg: Add PCCT related objects PierreGondois
                   ` (6 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

The second model of the _PRT object is used. Indeed:
- the interrupts described are not re-configurable
- OSes are aware of the polarity of PCI legacy interrupts,
  so there is no need to accurately describe the polarity.

Also, fix a comment for the CM_ARM_PCI_INTERRUPT_MAP_INFO obj.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h            | 2 +-
 .../Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c       | 8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index cd39e609d6c4..d711f3ec5938 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -1014,7 +1014,7 @@ typedef struct CmArmPciInterruptMapInfo {
   /// Value on 8 bits (max 255).
   UINT8    PciBus;
 
-  /// Pci Bus.
+  /// Pci Device.
   /// Value on 5 bits (max 31).
   UINT8    PciDevice;
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
index 85098752c614..c54ae6f551f6 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
@@ -288,12 +288,6 @@ GeneratePciDeviceInfo (
 
   Cf. ACPI 6.4 specification, s6.2.13 "_PRT (PCI Routing Table)"
 
-  The first model (defining a _CRS object) is used. This is necessary because
-  PCI legacy interrupts are active low and GICv2 SPI interrupts are active
-  high.
-  Even though PCI interrupts cannot be re-routed, only the first model allows
-  to specify the activation state (low/high).
-
   @param [in]       Generator       The SSDT Pci generator.
   @param [in]       CfgMgrProtocol  Pointer to the Configuration Manager
                                     Protocol interface.
@@ -397,6 +391,8 @@ GeneratePrt (
        High word-Device #, Low word-Function #. (for example, device 3,
        function 2 is 0x00030002). To refer to all the functions on a device #,
        use a function number of FFFF).
+
+      Use the second model for _PRT object and describe a hardwired interrupt.
     */
     Status = AmlAddPrtEntry (
                (IrqMapInfo->PciDevice << 16) | 0xFFFF,
-- 
2.25.1


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

* [PATCH 10/14] DynamicTablesPkg: Add PCCT related objects
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (8 preceding siblings ...)
  2022-10-10  9:20 ` [PATCH 09/14] DynamicTablesPkg: Fix Ssdt PCI generation comments PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:34   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 11/14] DynamicTablesPkg: Add PCCT Generator PierreGondois
                   ` (5 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

Introduce the following CmObj in the ArmNameSpaceObjects:
 - CM_ARM_MAILBOX_REGISTER_INFO
 - CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO
 - CM_ARM_PCC_SUBSPACE_GENERIC_INFO
 - CM_ARM_PCC_SUBPSACE_TYPE0_INFO
 - CM_ARM_PCC_SUBPSACE_TYPE1_INFO
 - CM_ARM_PCC_SUBPSACE_TYPE2_INFO
 - CM_ARM_PCC_SUBPSACE_TYPE3_INFO
 - CM_ARM_PCC_SUBPSACE_TYPE4_INFO
 - CM_ARM_PCC_SUBPSACE_TYPE5_INFO

These objects allow to describe mailbox registers, pcc timings
and PCCT subspaces. They prepare the enablement of a PCCT generator.

Also add the CmObjParsers associated to each object.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../Include/ArmNameSpaceObjects.h             | 277 +++++++++++++++---
 .../ConfigurationManagerObjectParser.c        | 107 +++++++
 2 files changed, 341 insertions(+), 43 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index d711f3ec5938..5d5a8ce92a09 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -22,49 +22,55 @@
     in the ARM Namespace
 */
 typedef enum ArmObjectID {
-  EArmObjReserved,                     ///<  0 - Reserved
-  EArmObjBootArchInfo,                 ///<  1 - Boot Architecture Info
-  EArmObjCpuInfo,                      ///<  2 - CPU Info
-  EArmObjPowerManagementProfileInfo,   ///<  3 - Power Management Profile Info
-  EArmObjGicCInfo,                     ///<  4 - GIC CPU Interface Info
-  EArmObjGicDInfo,                     ///<  5 - GIC Distributor Info
-  EArmObjGicMsiFrameInfo,              ///<  6 - GIC MSI Frame Info
-  EArmObjGicRedistributorInfo,         ///<  7 - GIC Redistributor Info
-  EArmObjGicItsInfo,                   ///<  8 - GIC ITS Info
-  EArmObjSerialConsolePortInfo,        ///<  9 - Serial Console Port Info
-  EArmObjSerialDebugPortInfo,          ///< 10 - Serial Debug Port Info
-  EArmObjGenericTimerInfo,             ///< 11 - Generic Timer Info
-  EArmObjPlatformGTBlockInfo,          ///< 12 - Platform GT Block Info
-  EArmObjGTBlockTimerFrameInfo,        ///< 13 - Generic Timer Block Frame Info
-  EArmObjPlatformGenericWatchdogInfo,  ///< 14 - Platform Generic Watchdog
-  EArmObjPciConfigSpaceInfo,           ///< 15 - PCI Configuration Space Info
-  EArmObjHypervisorVendorIdentity,     ///< 16 - Hypervisor Vendor Id
-  EArmObjFixedFeatureFlags,            ///< 17 - Fixed feature flags for FADT
-  EArmObjItsGroup,                     ///< 18 - ITS Group
-  EArmObjNamedComponent,               ///< 19 - Named Component
-  EArmObjRootComplex,                  ///< 20 - Root Complex
-  EArmObjSmmuV1SmmuV2,                 ///< 21 - SMMUv1 or SMMUv2
-  EArmObjSmmuV3,                       ///< 22 - SMMUv3
-  EArmObjPmcg,                         ///< 23 - PMCG
-  EArmObjGicItsIdentifierArray,        ///< 24 - GIC ITS Identifier Array
-  EArmObjIdMappingArray,               ///< 25 - ID Mapping Array
-  EArmObjSmmuInterruptArray,           ///< 26 - SMMU Interrupt Array
-  EArmObjProcHierarchyInfo,            ///< 27 - Processor Hierarchy Info
-  EArmObjCacheInfo,                    ///< 28 - Cache Info
-  EArmObjReserved29,                   ///< 29 - Reserved
-  EArmObjCmRef,                        ///< 30 - CM Object Reference
-  EArmObjMemoryAffinityInfo,           ///< 31 - Memory Affinity Info
-  EArmObjDeviceHandleAcpi,             ///< 32 - Device Handle Acpi
-  EArmObjDeviceHandlePci,              ///< 33 - Device Handle Pci
-  EArmObjGenericInitiatorAffinityInfo, ///< 34 - Generic Initiator Affinity
-  EArmObjSerialPortInfo,               ///< 35 - Generic Serial Port Info
-  EArmObjCmn600Info,                   ///< 36 - CMN-600 Info
-  EArmObjLpiInfo,                      ///< 37 - Lpi Info
-  EArmObjPciAddressMapInfo,            ///< 38 - Pci Address Map Info
-  EArmObjPciInterruptMapInfo,          ///< 39 - Pci Interrupt Map Info
-  EArmObjRmr,                          ///< 40 - Reserved Memory Range Node
-  EArmObjMemoryRangeDescriptor,        ///< 41 - Memory Range Descriptor
-  EArmObjCpcInfo,                      ///< 42 - Continuous Performance Control Info
+  EArmObjReserved,                                             ///<  0 - Reserved
+  EArmObjBootArchInfo,                                         ///<  1 - Boot Architecture Info
+  EArmObjCpuInfo,                                              ///<  2 - CPU Info
+  EArmObjPowerManagementProfileInfo,                           ///<  3 - Power Management Profile Info
+  EArmObjGicCInfo,                                             ///<  4 - GIC CPU Interface Info
+  EArmObjGicDInfo,                                             ///<  5 - GIC Distributor Info
+  EArmObjGicMsiFrameInfo,                                      ///<  6 - GIC MSI Frame Info
+  EArmObjGicRedistributorInfo,                                 ///<  7 - GIC Redistributor Info
+  EArmObjGicItsInfo,                                           ///<  8 - GIC ITS Info
+  EArmObjSerialConsolePortInfo,                                ///<  9 - Serial Console Port Info
+  EArmObjSerialDebugPortInfo,                                  ///< 10 - Serial Debug Port Info
+  EArmObjGenericTimerInfo,                                     ///< 11 - Generic Timer Info
+  EArmObjPlatformGTBlockInfo,                                  ///< 12 - Platform GT Block Info
+  EArmObjGTBlockTimerFrameInfo,                                ///< 13 - Generic Timer Block Frame Info
+  EArmObjPlatformGenericWatchdogInfo,                          ///< 14 - Platform Generic Watchdog
+  EArmObjPciConfigSpaceInfo,                                   ///< 15 - PCI Configuration Space Info
+  EArmObjHypervisorVendorIdentity,                             ///< 16 - Hypervisor Vendor Id
+  EArmObjFixedFeatureFlags,                                    ///< 17 - Fixed feature flags for FADT
+  EArmObjItsGroup,                                             ///< 18 - ITS Group
+  EArmObjNamedComponent,                                       ///< 19 - Named Component
+  EArmObjRootComplex,                                          ///< 20 - Root Complex
+  EArmObjSmmuV1SmmuV2,                                         ///< 21 - SMMUv1 or SMMUv2
+  EArmObjSmmuV3,                                               ///< 22 - SMMUv3
+  EArmObjPmcg,                                                 ///< 23 - PMCG
+  EArmObjGicItsIdentifierArray,                                ///< 24 - GIC ITS Identifier Array
+  EArmObjIdMappingArray,                                       ///< 25 - ID Mapping Array
+  EArmObjSmmuInterruptArray,                                   ///< 26 - SMMU Interrupt Array
+  EArmObjProcHierarchyInfo,                                    ///< 27 - Processor Hierarchy Info
+  EArmObjCacheInfo,                                            ///< 28 - Cache Info
+  EArmObjReserved29,                                           ///< 29 - Reserved
+  EArmObjCmRef,                                                ///< 30 - CM Object Reference
+  EArmObjMemoryAffinityInfo,                                   ///< 31 - Memory Affinity Info
+  EArmObjDeviceHandleAcpi,                                     ///< 32 - Device Handle Acpi
+  EArmObjDeviceHandlePci,                                      ///< 33 - Device Handle Pci
+  EArmObjGenericInitiatorAffinityInfo,                         ///< 34 - Generic Initiator Affinity
+  EArmObjSerialPortInfo,                                       ///< 35 - Generic Serial Port Info
+  EArmObjCmn600Info,                                           ///< 36 - CMN-600 Info
+  EArmObjLpiInfo,                                              ///< 37 - Lpi Info
+  EArmObjPciAddressMapInfo,                                    ///< 38 - Pci Address Map Info
+  EArmObjPciInterruptMapInfo,                                  ///< 39 - Pci Interrupt Map Info
+  EArmObjRmr,                                                  ///< 40 - Reserved Memory Range Node
+  EArmObjMemoryRangeDescriptor,                                ///< 41 - Memory Range Descriptor
+  EArmObjCpcInfo,                                              ///< 42 - Continuous Performance Control Info
+  EArmObjPccSubspaceType0Info,                                 ///< 43 - Pcc Subspace Type 0 Info
+  EArmObjPccSubspaceType1Info,                                 ///< 44 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType2Info,                                 ///< 45 - Pcc Subspace Type 2 Info
+  EArmObjPccSubspaceType3Info,                                 ///< 46 - Pcc Subspace Type 3 Info
+  EArmObjPccSubspaceType4Info,                                 ///< 47 - Pcc Subspace Type 4 Info
+  EArmObjPccSubspaceType5Info,                                 ///< 48 - Pcc Subspace Type 5 Info
   EArmObjMax
 } EARM_OBJECT_ID;
 
@@ -1095,6 +1101,191 @@ typedef struct CmArmRmrDescriptor {
 */
 typedef AML_CPC_INFO CM_ARM_CPC_INFO;
 
+/** A structure that describes a
+    PCC Mailbox Register.
+*/
+typedef struct PccMailboxRegisterInfo {
+  /// GAS describing the Register.
+  EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE    Register;
+
+  /** Mask of bits to preserve when writing.
+
+    This mask is also used for registers the Register is only read
+    and there is no write mask required. E.g.:
+    - Error Status mask (Cf. PCC Subspace types 3/4/5).
+    - Command Complete Check mask (Cf. PCC Subspace types 3/4/5).
+  */
+  UINT64    PreserveMask;
+
+  /// Mask of bits to set when writing.
+  UINT64    WriteMask;
+} PCC_MAILBOX_REGISTER_INFO;
+
+/** A structure that describes the
+    PCC Subspace CHannel Timings.
+*/
+typedef struct PccSubspaceChannelTimingInfo {
+  /// Expected latency to process a command, in microseconds.
+  UINT32    NominalLatency;
+
+  /** Maximum number of periodic requests that the subspace channel can
+      support, reported in commands per minute. 0 indicates no limitation.
+
+    This field is ignored for the PCC Subspace type 5 (HW Registers based).
+  */
+  UINT32    MaxPeriodicAccessRate;
+
+  /** Minimum amount of time that OSPM must wait after the completion
+      of a command before issuing the next command, in microseconds.
+  */
+  UINT16    MinRequestTurnaroundTime;
+} PCC_SUBSPACE_CHANNEL_TIMING_INFO;
+
+/** A structure that describes a
+    Generic PCC Subspace (Type 0).
+*/
+typedef struct CmArmPccSubspaceGenericInfo {
+  /** Subspace Id.
+
+  Cf. ACPI 6.4, s14.7 Referencing the PCC address space
+  Cf. s14.1.2 Platform Communications Channel Subspace Structures
+      The subspace ID of a PCC subspace is its index in the array of
+      subspace structures, starting with subspace 0.
+
+  At most 256 subspaces are supported.
+  */
+  UINT8                               SubspaceId;
+
+  /// Table type (or subspace).
+  UINT8                               Type;
+
+  /// Base address of the shared memory range.
+  /// This field is ignored for the PCC Subspace type 5 (HW Registers based).
+  UINT64                              BaseAddress;
+
+  /// Address length.
+  UINT64                              AddressLength;
+
+  /// Doorbell Register.
+  PCC_MAILBOX_REGISTER_INFO           DoorbellReg;
+
+  /// Mailbox Timings.
+  PCC_SUBSPACE_CHANNEL_TIMING_INFO    ChannelTiming;
+} PCC_SUBSPACE_GENERIC_INFO;
+
+/** A structure that describes a
+    PCC Subspace of type 0 (Generic).
+
+    ID: EArmObjPccSubspaceType0Info
+*/
+typedef PCC_SUBSPACE_GENERIC_INFO CM_ARM_PCC_SUBSPACE_TYPE0_INFO;
+
+/** A structure that describes a
+    PCC Subspace of type 1 (HW-Reduced).
+
+    ID: EArmObjPccSubspaceType1Info
+*/
+typedef struct CmArmPccSubspaceType1Info {
+  /** Generic Pcc information.
+
+    The Subspace of Type0 contains information that can be re-used
+    in other Subspace types.
+  */
+  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
+
+  /// Platform Interrupt.
+  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
+} CM_ARM_PCC_SUBSPACE_TYPE1_INFO;
+
+/** A structure that describes a
+    PCC Subspace of type 2 (HW-Reduced).
+
+    ID: EArmObjPccSubspaceType2Info
+*/
+typedef struct CmArmPccSubspaceType2Info {
+  /** Generic Pcc information.
+
+    The Subspace of Type0 contains information that can be re-used
+    in other Subspace types.
+  */
+  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
+
+  /// Platform Interrupt.
+  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
+
+  /// Platform Interrupt Register.
+  PCC_MAILBOX_REGISTER_INFO    PlatIrqAckReg;
+} CM_ARM_PCC_SUBSPACE_TYPE2_INFO;
+
+/** A structure that describes a
+    PCC Subspace of type 3 (Extended)
+
+    ID: EArmObjPccSubspaceType3Info
+*/
+typedef struct CmArmPccSubspaceType3Info {
+  /** Generic Pcc information.
+
+    The Subspace of Type0 contains information that can be re-used
+    in other Subspace types.
+  */
+  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
+
+  /// Platform Interrupt.
+  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
+
+  /// Platform Interrupt Register.
+  PCC_MAILBOX_REGISTER_INFO    PlatIrqAckReg;
+
+  /// Command Complete Check Register.
+  /// The WriteMask field is not used.
+  PCC_MAILBOX_REGISTER_INFO    CmdCompleteCheckReg;
+
+  /// Command Complete Update Register.
+  PCC_MAILBOX_REGISTER_INFO    CmdCompleteUpdateReg;
+
+  /// Error Status Register.
+  /// The WriteMask field is not used.
+  PCC_MAILBOX_REGISTER_INFO    ErrorStatusReg;
+} CM_ARM_PCC_SUBSPACE_TYPE3_INFO;
+
+/** A structure that describes a
+    PCC Subspace of type 4 (Extended)
+
+    ID: EArmObjPccSubspaceType4Info
+*/
+typedef CM_ARM_PCC_SUBSPACE_TYPE3_INFO CM_ARM_PCC_SUBSPACE_TYPE4_INFO;
+
+/** A structure that describes a
+    PCC Subspace of type 5 (HW-Registers).
+
+    ID: EArmObjPccSubspaceType5Info
+*/
+typedef struct CmArmPccSubspaceType5Info {
+  /** Generic Pcc information.
+
+    The Subspace of Type0 contains information that can be re-used
+    in other Subspace types.
+
+    MaximumPeriodicAccessRate doesn't need to be populated for
+    this structure.
+  */
+  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
+
+  /// Version.
+  UINT16                       Version;
+
+  /// Platform Interrupt.
+  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
+
+  /// Command Complete Check Register.
+  /// The WriteMask field is not used.
+  PCC_MAILBOX_REGISTER_INFO    CmdCompleteCheckReg;
+
+  /// Error Status Register.
+  /// The WriteMask field is not used.
+  PCC_MAILBOX_REGISTER_INFO    ErrorStatusReg;
+} CM_ARM_PCC_SUBSPACE_TYPE5_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 2126beba8b9f..21d1f3f08b16 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -539,6 +539,101 @@ STATIC CONST CM_OBJ_PARSER  CmArmCpcInfoParser[] = {
   { "NominalFrequencyInteger",               4,                                               "0x%lx", NULL },
 };
 
+/** A parser for the CM_ARM_MAILBOX_REGISTER_INFO struct.
+*/
+STATIC CONST CM_OBJ_PARSER  CmArmMailboxRegisterInfoParser[] = {
+  { "Register",     sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE), NULL,     NULL,
+    AcpiGenericAddressParser, ARRAY_SIZE (AcpiGenericAddressParser) },
+  { "PreserveMask", 8,                                               "0x%llx", NULL },
+  { "WriteMask",    8,                                               "0x%llx", NULL },
+};
+
+/** A parser for the CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO struct.
+*/
+STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceChannelTimingInfoParser[] = {
+  { "NominalLatency",           4, "0x%x", NULL },
+  { "MaxPeriodicAccessRate",    4, "0x%x", NULL },
+  { "MinRequestTurnaroundTime", 2, "0x%x", NULL },
+};
+
+/** A parser for EArmObjPccSubspaceType0Info.
+*/
+STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType0InfoParser[] = {
+  { "SubspaceId",    1,                                                "0x%x",   NULL },
+  { "Type",          1,                                                "0x%x",   NULL },
+  { "BaseAddress",   8,                                                "0x%llx", NULL },
+  { "AddressLength", 8,                                                "0x%llx", NULL },
+  { "DoorbellReg",   sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+    NULL, NULL, CmArmMailboxRegisterInfoParser,
+    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
+  { "DoorbellReg",   sizeof (CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO),
+    NULL, NULL, CmArmPccSubspaceChannelTimingInfoParser,
+    ARRAY_SIZE (CmArmPccSubspaceChannelTimingInfoParser) },
+};
+
+/** A parser for EArmObjPccSubspaceType1Info.
+*/
+STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
+  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
+    NULL, NULL, CmArmPccSubspaceType0InfoParser,
+    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
+  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),
+    NULL, NULL, CmArmGenericInterruptParser,
+    ARRAY_SIZE (CmArmGenericInterruptParser) },
+};
+
+/** A parser for EArmObjPccSubspaceType2Info.
+*/
+STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
+  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
+    NULL, NULL, CmArmPccSubspaceType0InfoParser,
+    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
+  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
+    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
+  { "PlatIrqAckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+    NULL, NULL, CmArmMailboxRegisterInfoParser,
+    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
+};
+
+/** A parser for EArmObjPccSubspaceType3Info or EArmObjPccSubspaceType4Info.
+*/
+STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
+  { "GenericPccInfo",       sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
+    NULL, NULL, CmArmPccSubspaceType0InfoParser,
+    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
+  { "PlatIrq",              sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
+    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
+  { "PlatIrqAckReg",        sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+    NULL, NULL, CmArmMailboxRegisterInfoParser,
+    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
+  { "CmdCompleteCheckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+    NULL, NULL, CmArmMailboxRegisterInfoParser,
+    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
+  { "CmdCompleteUpdateReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+    NULL, NULL, CmArmMailboxRegisterInfoParser,
+    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
+  { "ErrorStatusReg",       sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+    NULL, NULL, CmArmMailboxRegisterInfoParser,
+    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
+};
+
+/** A parser for EArmObjPccSubspaceType5Info.
+*/
+STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType5InfoParser[] = {
+  { "GenericPccInfo",      sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
+    NULL, NULL, CmArmPccSubspaceType0InfoParser,
+    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
+  { "Version",             2,                                        "0x%x",NULL },
+  { "PlatIrq",             sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,  NULL,
+    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
+  { "CmdCompleteCheckReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+    NULL, NULL, CmArmMailboxRegisterInfoParser,
+    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
+  { "ErrorStatusReg",      sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+    NULL, NULL, CmArmMailboxRegisterInfoParser,
+    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
+};
+
 /** A parser for Arm namespace objects.
 */
 STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
@@ -623,6 +718,18 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
     ARRAY_SIZE (CmArmMemoryRangeDescriptorInfoParser) },
   { "EArmObjCpcInfo",                      CmArmCpcInfoParser,
     ARRAY_SIZE (CmArmCpcInfoParser) },
+  { "EArmObjPccSubspaceType0Info",         CmArmPccSubspaceType0InfoParser,
+    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
+  { "EArmObjPccSubspaceType1Info",         CmArmPccSubspaceType1InfoParser,
+    ARRAY_SIZE (CmArmPccSubspaceType1InfoParser) },
+  { "EArmObjPccSubspaceType2Info",         CmArmPccSubspaceType2InfoParser,
+    ARRAY_SIZE (CmArmPccSubspaceType2InfoParser) },
+  { "EArmObjPccSubspaceType3Info",         CmArmPccSubspaceType34InfoParser,
+    ARRAY_SIZE (CmArmPccSubspaceType34InfoParser) },
+  { "EArmObjPccSubspaceType4Info",         CmArmPccSubspaceType34InfoParser,
+    ARRAY_SIZE (CmArmPccSubspaceType34InfoParser) },
+  { "EArmObjPccSubspaceType5Info",         CmArmPccSubspaceType5InfoParser,
+    ARRAY_SIZE (CmArmPccSubspaceType5InfoParser) },
   { "EArmObjMax",                          NULL,                                  0                                },
 };
 
-- 
2.25.1


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

* [PATCH 11/14] DynamicTablesPkg: Add PCCT Generator
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (9 preceding siblings ...)
  2022-10-10  9:20 ` [PATCH 10/14] DynamicTablesPkg: Add PCCT related objects PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:35   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 12/14] DynamicTablesPkg/AmlLib: Allow larger AccessSize for Pcc address space PierreGondois
                   ` (4 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

The Platform Communication Channel Table (PCCT) generator collates
the relevant information required for generating a PCCT table from
configuration manager using the configuration manager protocol.
The DynamicTablesManager then install the PCCT table.

>From ACPI 6.4, s14 PLATFORM COMMUNICATIONS CHANNEL (PCC):
  The platform communication channel (PCC) is a generic mechanism
  for OSPM to communicate with an entity in the platform.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 DynamicTablesPkg/DynamicTables.dsc.inc        |    4 +-
 DynamicTablesPkg/Include/AcpiTableGenerator.h |    3 +-
 .../Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf     |   30 +
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c   | 1186 +++++++++++++++++
 .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h   |   43 +
 .../ConfigurationManagerObjectParser.c        |   46 +-
 6 files changed, 1287 insertions(+), 25 deletions(-)
 create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
 create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
 create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc b/DynamicTablesPkg/DynamicTables.dsc.inc
index 3d4fa0c4c4b6..3e38fa0d0d99 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -1,7 +1,7 @@
 ## @file
 #  Dsc include file for Dynamic Tables Framework.
 #
-#  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
+#  Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -33,6 +33,7 @@ [Components.common]
   DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
   DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
   DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/AcpiSratLibArm.inf
+  DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
 
   # AML Fixup
   DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
@@ -57,6 +58,7 @@ [Components.common]
       NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
       NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
       NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/AcpiSratLibArm.inf
+      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
 
       # AML Fixup
       NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h b/DynamicTablesPkg/Include/AcpiTableGenerator.h
index f962dbff57df..d0eda011c301 100644
--- a/DynamicTablesPkg/Include/AcpiTableGenerator.h
+++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
+  Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -98,6 +98,7 @@ typedef enum StdAcpiTableId {
   EStdAcpiTableIdSsdtCmn600,                    ///< SSDT Cmn-600 Generator
   EStdAcpiTableIdSsdtCpuTopology,               ///< SSDT Cpu Topology
   EStdAcpiTableIdSsdtPciExpress,                ///< SSDT Pci Express Generator
+  EStdAcpiTableIdPcct,                          ///< PCCT Generator
   EStdAcpiTableIdMax
 } ESTD_ACPI_TABLE_ID;
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
new file mode 100644
index 000000000000..da54585c2dd9
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
@@ -0,0 +1,30 @@
+## @file
+#  Pcct Table Generator
+#
+#  Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+  INF_VERSION    = 0x0001001B
+  BASE_NAME      = AcpiPcctLibArm
+  FILE_GUID      = 38FE945C-D6ED-4CD6-8D20-FCEF3260D15A
+  VERSION_STRING = 1.0
+  MODULE_TYPE    = DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR    = AcpiPcctLibConstructor
+  DESTRUCTOR     = AcpiPcctLibDestructor
+
+[Sources]
+  PcctGenerator.c
+  PcctGenerator.h
+
+[Packages]
+  DynamicTablesPkg/DynamicTablesPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseLib
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
new file mode 100644
index 000000000000..36caf4aaeab7
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
@@ -0,0 +1,1186 @@
+/** @file
+  PCCT Table Generator
+
+  Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - ACPI 6.4 Specification - January 2021
+    s14 PLATFORM COMMUNICATIONS CHANNEL (PCC)
+
+**/
+
+#include <Library/AcpiLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Protocol/AcpiTable.h>
+
+// Module specific include files.
+#include <AcpiTableGenerator.h>
+#include <ConfigurationManagerObject.h>
+#include <ConfigurationManagerHelper.h>
+#include <Library/TableHelperLib.h>
+#include <Protocol/ConfigurationManagerProtocol.h>
+#include "PcctGenerator.h"
+
+/** ARM standard PCCT Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjPccSubspaceType0Info
+  - EArmObjPccSubspaceType1Info
+  - EArmObjPccSubspaceType2Info
+  - EArmObjPccSubspaceType3Info
+  - EArmObjPccSubspaceType4Info
+  - EArmObjPccSubspaceType5Info
+*/
+
+/** This macro expands to a function that retrieves the PCC
+    Subspace of Type 0 Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjPccSubspaceType0Info,
+  CM_ARM_PCC_SUBSPACE_TYPE0_INFO
+  );
+
+/** This macro expands to a function that retrieves the PCC
+    Subspace of Type 1 Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjPccSubspaceType1Info,
+  CM_ARM_PCC_SUBSPACE_TYPE1_INFO
+  );
+
+/** This macro expands to a function that retrieves the PCC
+    Subspace of Type 2 Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjPccSubspaceType2Info,
+  CM_ARM_PCC_SUBSPACE_TYPE2_INFO
+  );
+
+/** This macro expands to a function that retrieves the PCC
+    Subspace of Type 3 Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjPccSubspaceType3Info,
+  CM_ARM_PCC_SUBSPACE_TYPE3_INFO
+  );
+
+/** This macro expands to a function that retrieves the PCC
+    Subspace of Type 4 Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjPccSubspaceType4Info,
+  CM_ARM_PCC_SUBSPACE_TYPE4_INFO
+  );
+
+/** This macro expands to a function that retrieves the PCC
+    Subspace of Type 5 Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjPccSubspaceType5Info,
+  CM_ARM_PCC_SUBSPACE_TYPE5_INFO
+  );
+
+/** The Platform is capable of generating an interrupt
+    to indicate completion of a command.
+
+  Cf: s14.1.1 Platform Communications Channel Global Flags
+  Platform Interrupt flag
+  and s14.1.6 Extended PCC subspaces (types 3 and 4)
+    If a responder subspace is included in the PCCT,
+    then the global Platform Interrupt flag must be set to 1
+
+  Set this variable and populate the PCCT flag accordingly if either:
+   - One of the PCCT Subspace uses interrupts.
+   - A PCC Subspace of type 4 is used.
+*/
+STATIC BOOLEAN  mHasPlatformInterrupt;
+
+/** Initialize the MappingTable.
+
+  @param [in] MappingTable  The mapping table structure.
+  @param [in] Count         Number of entries to allocate in the
+                            MappingTable.
+
+  @retval EFI_SUCCESS            Success.
+  @retval EFI_INVALID_PARAMETER  Invalid parameter.
+  @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+MappingTableInitialize (
+  IN  MAPPING_TABLE  *MappingTable,
+  IN  UINT32         Count
+  )
+{
+  VOID  **Table;
+
+  if ((MappingTable == NULL)  ||
+      (Count == 0))
+  {
+    ASSERT (0);
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Table = AllocateZeroPool (sizeof (*Table) * Count);
+  if (Table == NULL) {
+    ASSERT (0);
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  MappingTable->Table    = Table;
+  MappingTable->MaxIndex = Count;
+
+  return EFI_SUCCESS;
+}
+
+/** Free the MappingTable.
+
+  @param [in, out]  MappingTable  The mapping table structure.
+**/
+STATIC
+VOID
+EFIAPI
+MappingTableFree (
+  IN  OUT MAPPING_TABLE  *MappingTable
+  )
+{
+  ASSERT (MappingTable != NULL);
+  ASSERT (MappingTable->Table != NULL);
+
+  if (MappingTable->Table != NULL) {
+    FreePool (MappingTable->Table);
+  }
+}
+
+/** Add a new entry for CmArmPccSubspace at Index.
+
+  @param [in] MappingTable      The mapping table structure.
+  @param [in] CmArmPccSubspace  Pointer to a CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO.
+  @param [in] Index             Index at which CmArmPccSubspace must be added.
+                                This is the Subspace Id.
+
+  @retval EFI_SUCCESS            Success.
+  @retval EFI_BUFFER_TOO_SMALL   Buffer too small.
+  @retval EFI_INVALID_PARAMETER  Invalid parameter.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+MappingTableAdd (
+  IN  MAPPING_TABLE  *MappingTable,
+  IN  VOID           *CmArmPccSubspace,
+  IN  UINT32         Index
+  )
+{
+  if ((MappingTable == NULL)        ||
+      (MappingTable->Table == NULL) ||
+      (CmArmPccSubspace == NULL))
+  {
+    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+    return EFI_INVALID_PARAMETER;
+  }
+
+  if ((Index >= MappingTable->MaxIndex) ||
+      (MappingTable->Table[Index] != 0))
+  {
+    ASSERT_EFI_ERROR (EFI_BUFFER_TOO_SMALL);
+    return EFI_BUFFER_TOO_SMALL;
+  }
+
+  // Just map the Pcc Subspace in the Table.
+  MappingTable->Table[Index] = CmArmPccSubspace;
+  return EFI_SUCCESS;
+}
+
+/** Parse the CmPccArray objects and add them to the MappingTable.
+
+  @param [in] MappingTable     The mapping table structure.
+  @param [in] CmPccArray       Pointer to an array of CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO.
+  @param [in] CmPccCount       Count of objects in CmPccArray.
+
+  @retval EFI_SUCCESS            Success.
+  @retval EFI_BUFFER_TOO_SMALL   Buffer too small.
+  @retval EFI_INVALID_PARAMETER  Invalid parameter.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+MapPccSubspaceId (
+  IN  MAPPING_TABLE  *MappingTable,
+  IN  VOID           *CmPccArray,
+  IN  UINT32         CmPccCount
+  )
+{
+  EFI_STATUS                 Status;
+  UINT8                      *PccBuffer;
+  UINT32                     Index;
+  UINT32                     CmObjSize;
+  PCC_SUBSPACE_GENERIC_INFO  *GenericPcc;
+
+  if (CmPccCount == 0) {
+    return EFI_SUCCESS;
+  }
+
+  if ((CmPccArray == NULL) || (MappingTable == NULL)) {
+    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+    return EFI_INVALID_PARAMETER;
+  }
+
+  GenericPcc = (PCC_SUBSPACE_GENERIC_INFO *)CmPccArray;
+
+  switch (GenericPcc->Type) {
+    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC:
+      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE0_INFO);
+      break;
+
+    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS:
+      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE1_INFO);
+      break;
+
+    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS:
+      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE2_INFO);
+      break;
+
+    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC:
+      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE3_INFO);
+      break;
+
+    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC:
+      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE4_INFO);
+      break;
+
+    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
+      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE5_INFO);
+      break;
+
+    default:
+      ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+      return EFI_INVALID_PARAMETER;
+  }
+
+  PccBuffer = (UINT8 *)CmPccArray;
+
+  // Map the Pcc channel to their Subspace Id.
+  for (Index = 0; Index < CmPccCount; Index++) {
+    GenericPcc = (PCC_SUBSPACE_GENERIC_INFO *)PccBuffer;
+
+    Status = MappingTableAdd (
+               MappingTable,
+               PccBuffer,
+               GenericPcc->SubspaceId
+               );
+    if (EFI_ERROR (Status)) {
+      ASSERT_EFI_ERROR (Status);
+      return Status;
+    }
+
+    PccBuffer += CmObjSize;
+  }
+
+  return EFI_SUCCESS;
+}
+
+/** Add one PCCT Subspace structure of Type 0 (Generic).
+
+  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
+  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+AddSubspaceStructType0 (
+  IN  CM_ARM_PCC_SUBSPACE_TYPE0_INFO      *PccCmObj,
+  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC  *PccAcpi
+  )
+{
+  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
+  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
+
+  if ((PccCmObj == NULL) ||
+      (PccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC)  ||
+      (PccAcpi == NULL))
+  {
+    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Doorbell      = &PccCmObj->DoorbellReg;
+  ChannelTiming = &PccCmObj->ChannelTiming;
+
+  PccAcpi->Type                    = PccCmObj->Type;
+  PccAcpi->Length                  = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC);
+  *(UINT32 *)&PccAcpi->Reserved[0] = EFI_ACPI_RESERVED_DWORD;
+  *(UINT16 *)&PccAcpi->Reserved[4] = EFI_ACPI_RESERVED_WORD;
+  PccAcpi->BaseAddress             = PccCmObj->BaseAddress;
+  PccAcpi->AddressLength           = PccCmObj->AddressLength;
+
+  CopyMem (
+    &PccAcpi->DoorbellRegister,
+    &Doorbell->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
+  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
+
+  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
+  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
+  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
+
+  return EFI_SUCCESS;
+}
+
+/** Add one PCCT subspace structure of Type 1 (HW-Reduced).
+
+  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
+  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+AddSubspaceStructType1 (
+  IN  CM_ARM_PCC_SUBSPACE_TYPE1_INFO                          *PccCmObj,
+  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS  *PccAcpi
+  )
+{
+  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
+  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
+  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
+
+  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
+
+  if ((PccCmObj == NULL) ||
+      (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS)  ||
+      (PccAcpi == NULL))
+  {
+    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Doorbell      = &GenericPccCmObj->DoorbellReg;
+  ChannelTiming = &GenericPccCmObj->ChannelTiming;
+
+  PccAcpi->Type                   = GenericPccCmObj->Type;
+  PccAcpi->Length                 = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS);
+  PccAcpi->PlatformInterrupt      = PccCmObj->PlatIrq.Interrupt;
+  PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
+  PccAcpi->Reserved               = EFI_ACPI_RESERVED_BYTE;
+  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
+  PccAcpi->AddressLength          = GenericPccCmObj->AddressLength;
+
+  CopyMem (
+    &PccAcpi->DoorbellRegister,
+    &Doorbell->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
+  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
+
+  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
+  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
+  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
+
+  if ((PccCmObj->PlatIrq.Interrupt != 0)) {
+    mHasPlatformInterrupt = TRUE;
+  }
+
+  return EFI_SUCCESS;
+}
+
+/** Add one PCCT subspace structure of Type 2 (HW-Reduced).
+
+  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
+  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+AddSubspaceStructType2 (
+  IN  CM_ARM_PCC_SUBSPACE_TYPE2_INFO                          *PccCmObj,
+  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS  *PccAcpi
+  )
+{
+  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
+  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
+  PCC_MAILBOX_REGISTER_INFO         *PlatIrqAck;
+  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
+
+  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
+
+  if ((PccCmObj == NULL) ||
+      (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS)  ||
+      (PccAcpi == NULL))
+  {
+    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Doorbell      = &GenericPccCmObj->DoorbellReg;
+  PlatIrqAck    = &PccCmObj->PlatIrqAckReg;
+  ChannelTiming = &GenericPccCmObj->ChannelTiming;
+
+  PccAcpi->Type                   = GenericPccCmObj->Type;
+  PccAcpi->Length                 = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS);
+  PccAcpi->PlatformInterrupt      = PccCmObj->PlatIrq.Interrupt;
+  PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
+  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
+  PccAcpi->Reserved               = EFI_ACPI_RESERVED_BYTE;
+  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
+  PccAcpi->AddressLength          = GenericPccCmObj->AddressLength;
+
+  CopyMem (
+    &PccAcpi->DoorbellRegister,
+    &Doorbell->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
+  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
+
+  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
+  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
+  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
+
+  CopyMem (
+    &PccAcpi->PlatformInterruptAckRegister,
+    &PlatIrqAck->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->PlatformInterruptAckPreserve = PlatIrqAck->PreserveMask;
+  PccAcpi->PlatformInterruptAckWrite    = PlatIrqAck->WriteMask;
+
+  if ((PccCmObj->PlatIrq.Interrupt != 0)) {
+    mHasPlatformInterrupt = TRUE;
+  }
+
+  return EFI_SUCCESS;
+}
+
+/** Add one PCCT subspace structure of Type 3 or 4 (Extended).
+
+  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
+  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+AddSubspaceStructType34 (
+  IN  CM_ARM_PCC_SUBSPACE_TYPE3_INFO             *PccCmObj,
+  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC  *PccAcpi
+  )
+{
+  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
+  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
+  PCC_MAILBOX_REGISTER_INFO         *PlatIrqAck;
+  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteCheck;
+  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteUpdate;
+  PCC_MAILBOX_REGISTER_INFO         *ErrorStatus;
+  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
+
+  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
+
+  if ((PccCmObj == NULL) ||
+      ((GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC) &&
+       (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC)) ||
+      (PccAcpi == NULL))
+  {
+    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Doorbell          = &GenericPccCmObj->DoorbellReg;
+  PlatIrqAck        = &PccCmObj->PlatIrqAckReg;
+  CmdCompleteCheck  = &PccCmObj->CmdCompleteCheckReg;
+  CmdCompleteUpdate = &PccCmObj->CmdCompleteUpdateReg;
+  ErrorStatus       = &PccCmObj->ErrorStatusReg;
+  ChannelTiming     = &GenericPccCmObj->ChannelTiming;
+
+  PccAcpi->Type                   = GenericPccCmObj->Type;
+  PccAcpi->Length                 = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC);
+  PccAcpi->PlatformInterrupt      = PccCmObj->PlatIrq.Interrupt;
+  PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
+  PccAcpi->Reserved               = EFI_ACPI_RESERVED_BYTE;
+  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
+  PccAcpi->AddressLength          = GenericPccCmObj->AddressLength;
+
+  CopyMem (
+    &PccAcpi->DoorbellRegister,
+    &Doorbell->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
+  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
+
+  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
+  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
+  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
+
+  CopyMem (
+    &PccAcpi->PlatformInterruptAckRegister,
+    &PlatIrqAck->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->PlatformInterruptAckPreserve = PlatIrqAck->PreserveMask;
+  PccAcpi->PlatformInterruptAckSet      = PlatIrqAck->WriteMask;
+
+  PccAcpi->Reserved1[0] = EFI_ACPI_RESERVED_BYTE;
+  PccAcpi->Reserved1[1] = EFI_ACPI_RESERVED_BYTE;
+  PccAcpi->Reserved1[1] = EFI_ACPI_RESERVED_BYTE;
+  PccAcpi->Reserved1[3] = EFI_ACPI_RESERVED_BYTE;
+  PccAcpi->Reserved1[4] = EFI_ACPI_RESERVED_BYTE;
+  PccAcpi->Reserved1[5] = EFI_ACPI_RESERVED_BYTE;
+  PccAcpi->Reserved1[6] = EFI_ACPI_RESERVED_BYTE;
+  PccAcpi->Reserved1[7] = EFI_ACPI_RESERVED_BYTE;
+
+  CopyMem (
+    &PccAcpi->CommandCompleteCheckRegister,
+    &CmdCompleteCheck->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->CommandCompleteCheckMask = CmdCompleteCheck->PreserveMask;
+  // No Write mask.
+
+  CopyMem (
+    &PccAcpi->CommandCompleteUpdateRegister,
+    &CmdCompleteUpdate->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->CommandCompleteUpdatePreserve = CmdCompleteUpdate->PreserveMask;
+  PccAcpi->CommandCompleteUpdateSet      = CmdCompleteUpdate->WriteMask;
+
+  CopyMem (
+    &PccAcpi->ErrorStatusRegister,
+    &ErrorStatus->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->ErrorStatusMask = ErrorStatus->PreserveMask;
+  // No Write mask.
+
+  if (GenericPccCmObj->Type == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
+    mHasPlatformInterrupt = TRUE;
+  } else if ((PccCmObj->PlatIrq.Interrupt != 0)) {
+    mHasPlatformInterrupt = TRUE;
+  }
+
+  return EFI_SUCCESS;
+}
+
+/** Add one PCCT subspace structure of Type 5 (HW-Registers).
+
+  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
+  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+AddSubspaceStructType5 (
+  IN  CM_ARM_PCC_SUBSPACE_TYPE5_INFO                            *PccCmObj,
+  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS  *PccAcpi
+  )
+{
+  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
+  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
+  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteCheck;
+  PCC_MAILBOX_REGISTER_INFO         *ErrorStatus;
+  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
+
+  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
+
+  if ((PccCmObj == NULL) ||
+      (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS)  ||
+      (PccAcpi == NULL))
+  {
+    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Doorbell         = &GenericPccCmObj->DoorbellReg;
+  CmdCompleteCheck = &PccCmObj->CmdCompleteCheckReg;
+  ErrorStatus      = &PccCmObj->ErrorStatusReg;
+  ChannelTiming    = &GenericPccCmObj->ChannelTiming;
+
+  PccAcpi->Type                    = GenericPccCmObj->Type;
+  PccAcpi->Length                  = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS);
+  PccAcpi->Version                 = PccCmObj->Version;
+  PccAcpi->BaseAddress             = GenericPccCmObj->BaseAddress;
+  PccAcpi->SharedMemoryRangeLength = GenericPccCmObj->AddressLength;
+
+  CopyMem (
+    &PccAcpi->DoorbellRegister,
+    &Doorbell->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
+  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
+
+  CopyMem (
+    &PccAcpi->CommandCompleteCheckRegister,
+    &CmdCompleteCheck->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->CommandCompleteCheckMask = CmdCompleteCheck->PreserveMask;
+  // No Write mask.
+
+  CopyMem (
+    &PccAcpi->ErrorStatusRegister,
+    &ErrorStatus->Register,
+    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
+    );
+  PccAcpi->ErrorStatusMask = ErrorStatus->PreserveMask;
+  // No Write mask.
+
+  PccAcpi->NominalLatency = ChannelTiming->NominalLatency;
+  // No MaximumPeriodicAccessRate.
+  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
+
+  return EFI_SUCCESS;
+}
+
+/** Populate the PCCT table using the MappingTable.
+
+  @param [in] MappingTable  The mapping table structure.
+  @param [in] Pcc           Pointer to an array of Pcc Subpace structures.
+  @param [in] Size          Size of the Pcc array.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+  @retval EFI_BUFFER_TOO_SMALL  Buffer too small.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+PopulatePcctTable (
+  IN  MAPPING_TABLE  *MappingTable,
+  IN  VOID           *Pcc,
+  IN  UINT32         Size
+  )
+{
+  EFI_STATUS  Status;
+  UINT8       *PccBuffer;
+  UINT32      CmObjSize;
+  UINT32      Index;
+  UINT32      MaxIndex;
+  VOID        **Table;
+  VOID        *CurrentPccSubspace;
+
+  ASSERT (MappingTable != NULL);
+  ASSERT (MappingTable->Table != NULL);
+
+  PccBuffer = Pcc;
+  MaxIndex  = MappingTable->MaxIndex;
+  Table     = MappingTable->Table;
+
+  for (Index = 0; Index < MaxIndex; Index++) {
+    CurrentPccSubspace = Table[Index];
+    if (CurrentPccSubspace == NULL) {
+      ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+      return EFI_INVALID_PARAMETER;
+    }
+
+    switch (((PCC_SUBSPACE_GENERIC_INFO *)CurrentPccSubspace)->Type) {
+      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC:
+        Status = AddSubspaceStructType0 (
+                   (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)CurrentPccSubspace,
+                   (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC *)PccBuffer
+                   );
+
+        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC);
+        break;
+
+      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS:
+        Status = AddSubspaceStructType1 (
+                   (CM_ARM_PCC_SUBSPACE_TYPE1_INFO *)CurrentPccSubspace,
+                   (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS *)PccBuffer
+                   );
+
+        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS);
+        break;
+
+      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS:
+        Status = AddSubspaceStructType2 (
+                   (CM_ARM_PCC_SUBSPACE_TYPE2_INFO *)CurrentPccSubspace,
+                   (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS *)PccBuffer
+                   );
+
+        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS);
+        break;
+
+      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC:
+        Status = AddSubspaceStructType34 (
+                   (CM_ARM_PCC_SUBSPACE_TYPE3_INFO *)CurrentPccSubspace,
+                   (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC *)PccBuffer
+                   );
+
+        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC);
+        break;
+
+      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC:
+        Status = AddSubspaceStructType34 (
+                   (CM_ARM_PCC_SUBSPACE_TYPE4_INFO *)CurrentPccSubspace,
+                   (EFI_ACPI_6_4_PCCT_SUBSPACE_4_EXTENDED_PCC *)PccBuffer
+                   );
+
+        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_4_EXTENDED_PCC);
+        break;
+
+      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
+        Status = AddSubspaceStructType5 (
+                   (CM_ARM_PCC_SUBSPACE_TYPE5_INFO *)CurrentPccSubspace,
+                   (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS *)PccBuffer
+                   );
+
+        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS);
+        break;
+
+      default:
+        ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+        return EFI_INVALID_PARAMETER;
+    } // switch
+
+    if (EFI_ERROR (Status)) {
+      ASSERT_EFI_ERROR (Status);
+      return Status;
+    }
+
+    if (Size < CmObjSize) {
+      ASSERT_EFI_ERROR (EFI_BUFFER_TOO_SMALL);
+      return EFI_BUFFER_TOO_SMALL;
+    }
+
+    PccBuffer += CmObjSize;
+    Size      -= CmObjSize;
+  } // for
+
+  return EFI_SUCCESS;
+}
+
+/** Construct the PCCT ACPI table.
+
+  Called by the Dynamic Table Manager, this function invokes the
+  Configuration Manager protocol interface to get the required hardware
+  information for generating the ACPI table.
+
+  If this function allocates any resources then they must be freed
+  in the FreeXXXXTableResources function.
+
+  @param [in]  This           Pointer to the table generator.
+  @param [in]  AcpiTableInfo  Pointer to the ACPI Table Info.
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
+                              Protocol Interface.
+  @param [out] Table          Pointer to the constructed ACPI Table.
+
+  @retval EFI_SUCCESS           Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND         The required object was not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+                                Manager is less than the Object size for the
+                                requested object.
+  @retval EFI_BUFFER_TOO_SMALL   Buffer too small.
+  @retval EFI_OUT_OF_RESOURCES  Memory allocation failed.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+BuildPcctTable (
+  IN  CONST ACPI_TABLE_GENERATOR                  *CONST  This,
+  IN  CONST CM_STD_OBJ_ACPI_TABLE_INFO            *CONST  AcpiTableInfo,
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  OUT       EFI_ACPI_DESCRIPTION_HEADER          **CONST  Table
+  )
+{
+  EFI_STATUS                                                Status;
+  ACPI_PCCT_GENERATOR                                       *Generator;
+  UINT32                                                    TableSize;
+  EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER  *Pcct;
+  UINT8                                                     *Buffer;
+
+  MAPPING_TABLE  *MappingTable;
+  UINT32         MappingTableCount;
+
+  CM_ARM_PCC_SUBSPACE_TYPE0_INFO  *PccType0;
+  UINT32                          PccType0Count;
+  CM_ARM_PCC_SUBSPACE_TYPE1_INFO  *PccType1;
+  UINT32                          PccType1Count;
+  CM_ARM_PCC_SUBSPACE_TYPE2_INFO  *PccType2;
+  UINT32                          PccType2Count;
+  CM_ARM_PCC_SUBSPACE_TYPE3_INFO  *PccType3;
+  UINT32                          PccType3Count;
+  CM_ARM_PCC_SUBSPACE_TYPE4_INFO  *PccType4;
+  UINT32                          PccType4Count;
+  CM_ARM_PCC_SUBSPACE_TYPE5_INFO  *PccType5;
+  UINT32                          PccType5Count;
+
+  ASSERT (This != NULL);
+  ASSERT (AcpiTableInfo != NULL);
+  ASSERT (CfgMgrProtocol != NULL);
+  ASSERT (Table != NULL);
+  ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
+  ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
+
+  if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
+      (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
+  {
+    DEBUG ((
+      DEBUG_ERROR,
+      "ERROR: PCCT: Requested table revision = %d, is not supported."
+      "Supported table revision: Minimum = %d, Maximum = %d\n",
+      AcpiTableInfo->AcpiTableRevision,
+      This->MinAcpiTableRevision,
+      This->AcpiTableRevision
+      ));
+    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Generator    = (ACPI_PCCT_GENERATOR *)This;
+  MappingTable = &Generator->MappingTable;
+  *Table       = NULL;
+
+  // First get all the Pcc Subpace CmObj of type X.
+
+  Status = GetEArmObjPccSubspaceType0Info (
+             CfgMgrProtocol,
+             CM_NULL_TOKEN,
+             &PccType0,
+             &PccType0Count
+             );
+  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = GetEArmObjPccSubspaceType1Info (
+             CfgMgrProtocol,
+             CM_NULL_TOKEN,
+             &PccType1,
+             &PccType1Count
+             );
+  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = GetEArmObjPccSubspaceType2Info (
+             CfgMgrProtocol,
+             CM_NULL_TOKEN,
+             &PccType2,
+             &PccType2Count
+             );
+  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = GetEArmObjPccSubspaceType3Info (
+             CfgMgrProtocol,
+             CM_NULL_TOKEN,
+             &PccType3,
+             &PccType3Count
+             );
+  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = GetEArmObjPccSubspaceType4Info (
+             CfgMgrProtocol,
+             CM_NULL_TOKEN,
+             &PccType4,
+             &PccType4Count
+             );
+  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = GetEArmObjPccSubspaceType5Info (
+             CfgMgrProtocol,
+             CM_NULL_TOKEN,
+             &PccType5,
+             &PccType5Count
+             );
+  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  // Count the number of Pcc Subspaces.
+  MappingTableCount  = PccType0Count;
+  MappingTableCount += PccType1Count;
+  MappingTableCount += PccType2Count;
+  MappingTableCount += PccType3Count;
+  MappingTableCount += PccType4Count;
+  MappingTableCount += PccType5Count;
+
+  Status = MappingTableInitialize (MappingTable, MappingTableCount);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  // Map the Subspace Ids for all types.
+
+  Status = MapPccSubspaceId (MappingTable, PccType0, PccType0Count);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = MapPccSubspaceId (MappingTable, PccType1, PccType1Count);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = MapPccSubspaceId (MappingTable, PccType2, PccType2Count);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = MapPccSubspaceId (MappingTable, PccType3, PccType3Count);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = MapPccSubspaceId (MappingTable, PccType4, PccType4Count);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Status = MapPccSubspaceId (MappingTable, PccType5, PccType5Count);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  // Compute the size of the PCCT table.
+  TableSize  = sizeof (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER);
+  TableSize += PccType0Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC);
+  TableSize += PccType1Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS);
+  TableSize += PccType2Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS);
+  TableSize += PccType3Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC);
+  TableSize += PccType4Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_4_EXTENDED_PCC);
+  TableSize += PccType5Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS);
+
+  // Allocate a Buffer for the PCCT table.
+  *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize);
+  if (*Table == NULL) {
+    Status = EFI_OUT_OF_RESOURCES;
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Pcct = (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER *)*Table;
+
+  Status = AddAcpiHeader (
+             CfgMgrProtocol,
+             This,
+             &Pcct->Header,
+             AcpiTableInfo,
+             TableSize
+             );
+  if (EFI_ERROR (Status)) {
+    DEBUG ((
+      DEBUG_ERROR,
+      "ERROR: PCCT: Failed to add ACPI header. Status = %r\n",
+      Status
+      ));
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  Buffer     = (UINT8 *)Pcct;
+  Buffer    += sizeof (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER);
+  TableSize -= sizeof (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER);
+
+  // Populate the PCCT table by following the Subspace Id mapping.
+  Status = PopulatePcctTable (MappingTable, Buffer, TableSize);
+  if (EFI_ERROR (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    goto error_handler;
+  }
+
+  // Setup the Reserved fields once mHasPlatformInterrupt hase been populated.
+  Pcct->Flags    = mHasPlatformInterrupt;
+  Pcct->Reserved = EFI_ACPI_RESERVED_QWORD;
+
+  MappingTableFree (MappingTable);
+
+  return Status;
+
+error_handler:
+  DEBUG ((
+    DEBUG_ERROR,
+    "ERROR: PCCT: Failed to install table. Status = %r\n",
+    Status
+    ));
+
+  if (*Table != NULL) {
+    FreePool (*Table);
+    *Table = NULL;
+  }
+
+  MappingTableFree (MappingTable);
+
+  return Status;
+}
+
+/** Free any resources allocated for constructing the PCCT.
+
+  @param [in]      This           Pointer to the table generator.
+  @param [in]      AcpiTableInfo  Pointer to the ACPI Table Info.
+  @param [in]      CfgMgrProtocol Pointer to the Configuration Manager
+                                  Protocol Interface.
+  @param [in, out] Table          Pointer to the ACPI Table.
+
+  @retval EFI_SUCCESS           The resources were freed successfully.
+  @retval EFI_INVALID_PARAMETER The table pointer is NULL or invalid.
+**/
+STATIC
+EFI_STATUS
+FreePcctTableResources (
+  IN      CONST ACPI_TABLE_GENERATOR                  *CONST  This,
+  IN      CONST CM_STD_OBJ_ACPI_TABLE_INFO            *CONST  AcpiTableInfo,
+  IN      CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
+  IN OUT        EFI_ACPI_DESCRIPTION_HEADER          **CONST  Table
+  )
+{
+  ASSERT (This != NULL);
+  ASSERT (AcpiTableInfo != NULL);
+  ASSERT (CfgMgrProtocol != NULL);
+  ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
+  ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
+
+  if ((Table == NULL) || (*Table == NULL)) {
+    DEBUG ((DEBUG_ERROR, "ERROR: PCCT: Invalid Table Pointer\n"));
+    ASSERT ((Table != NULL) && (*Table != NULL));
+    return EFI_INVALID_PARAMETER;
+  }
+
+  FreePool (*Table);
+  *Table = NULL;
+  return EFI_SUCCESS;
+}
+
+/** This macro defines the PCCT Table Generator revision.
+*/
+#define PCCT_GENERATOR_REVISION  CREATE_REVISION (1, 0)
+
+/** The interface for the PCCT Table Generator.
+*/
+STATIC
+ACPI_PCCT_GENERATOR  PcctGenerator = {
+  // ACPI table generator header
+  {
+    // Generator ID
+    CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdPcct),
+    // Generator Description
+    L"ACPI.STD.PCCT.GENERATOR",
+    // ACPI Table Signature
+    EFI_ACPI_6_4_PLATFORM_COMMUNICATIONS_CHANNEL_TABLE_SIGNATURE,
+    // ACPI Table Revision supported by this Generator
+    EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION,
+    // Minimum ACPI Table Revision supported by this Generator
+    EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION,
+    // Creator ID
+    TABLE_GENERATOR_CREATOR_ID_ARM,
+    // Creator Revision
+    PCCT_GENERATOR_REVISION,
+    // Build Table function
+    BuildPcctTable,
+    // Free Resource function
+    FreePcctTableResources,
+    // Extended build function not needed
+    NULL,
+    // Extended build function not implemented by the generator.
+    // Hence extended free resource function is not required.
+    NULL
+  },
+
+  // Private fields are defined from here.
+
+  // Mapping Table
+  {
+    // Table
+    NULL,
+    // MaxIndex
+    0,
+  },
+};
+
+/** Register the Generator with the ACPI Table Factory.
+
+  @param [in]  ImageHandle  The handle to the image.
+  @param [in]  SystemTable  Pointer to the System Table.
+
+  @retval EFI_SUCCESS           The Generator is registered.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_ALREADY_STARTED   The Generator for the Table ID
+                                is already registered.
+**/
+EFI_STATUS
+EFIAPI
+AcpiPcctLibConstructor (
+  IN  EFI_HANDLE        ImageHandle,
+  IN  EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  EFI_STATUS  Status;
+
+  Status = RegisterAcpiTableGenerator (&PcctGenerator.Header);
+  DEBUG ((DEBUG_INFO, "PCCT: Register Generator. Status = %r\n", Status));
+  ASSERT_EFI_ERROR (Status);
+  return Status;
+}
+
+/** Deregister the Generator from the ACPI Table Factory.
+
+  @param [in]  ImageHandle  The handle to the image.
+  @param [in]  SystemTable  Pointer to the System Table.
+
+  @retval EFI_SUCCESS           The Generator is deregistered.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND         The Generator is not registered.
+**/
+EFI_STATUS
+EFIAPI
+AcpiPcctLibDestructor (
+  IN  EFI_HANDLE        ImageHandle,
+  IN  EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  EFI_STATUS  Status;
+
+  Status = DeregisterAcpiTableGenerator (&PcctGenerator.Header);
+  DEBUG ((DEBUG_INFO, "PCCT: Deregister Generator. Status = %r\n", Status));
+  ASSERT_EFI_ERROR (Status);
+  return Status;
+}
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
new file mode 100644
index 000000000000..0631a1f5b74b
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
@@ -0,0 +1,43 @@
+/** @file
+  PCCT Table Generator
+
+  Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Reference(s):
+  - ACPI 6.4 Specification - January 2021
+    s14 PLATFORM COMMUNICATIONS CHANNEL (PCC)
+
+**/
+
+#ifndef PCCT_GENERATOR_H_
+#define PCCT_GENERATOR_H_
+
+#pragma pack(1)
+
+/** Structure used to map a Pcc Subspace to an index.
+*/
+typedef struct MappingTable {
+  /// Mapping table for Subspace Ids.
+  /// Subspace ID/Index <-> CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO pointer
+  VOID      **Table;
+
+  /// Number of entries in the Table.
+  UINT32    MaxIndex;
+} MAPPING_TABLE;
+
+/** A structure holding the Pcct generator and additional private data.
+*/
+typedef struct AcpiPcctGenerator {
+  /// ACPI Table generator header
+  ACPI_TABLE_GENERATOR    Header;
+
+  // Private fields are defined from here.
+
+  /// Table to map: Subspace ID/Index <-> CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO pointer
+  MAPPING_TABLE           MappingTable;
+} ACPI_PCCT_GENERATOR;
+
+#pragma pack()
+
+#endif // PCCT_GENERATOR_H_
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 21d1f3f08b16..4d7aa7963fae 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -539,7 +539,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmCpcInfoParser[] = {
   { "NominalFrequencyInteger",               4,                                               "0x%lx", NULL },
 };
 
-/** A parser for the CM_ARM_MAILBOX_REGISTER_INFO struct.
+/** A parser for the PCC_MAILBOX_REGISTER_INFO struct.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmMailboxRegisterInfoParser[] = {
   { "Register",     sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE), NULL,     NULL,
@@ -548,7 +548,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmMailboxRegisterInfoParser[] = {
   { "WriteMask",    8,                                               "0x%llx", NULL },
 };
 
-/** A parser for the CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO struct.
+/** A parser for the PCC_SUBSPACE_CHANNEL_TIMING_INFO struct.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceChannelTimingInfoParser[] = {
   { "NominalLatency",           4, "0x%x", NULL },
@@ -559,14 +559,14 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceChannelTimingInfoParser[] = {
 /** A parser for EArmObjPccSubspaceType0Info.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType0InfoParser[] = {
-  { "SubspaceId",    1,                                                "0x%x",   NULL },
-  { "Type",          1,                                                "0x%x",   NULL },
-  { "BaseAddress",   8,                                                "0x%llx", NULL },
-  { "AddressLength", 8,                                                "0x%llx", NULL },
-  { "DoorbellReg",   sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+  { "SubspaceId",    1,                                         "0x%x",   NULL },
+  { "Type",          1,                                         "0x%x",   NULL },
+  { "BaseAddress",   8,                                         "0x%llx", NULL },
+  { "AddressLength", 8,                                         "0x%llx", NULL },
+  { "DoorbellReg",   sizeof (PCC_MAILBOX_REGISTER_INFO),
     NULL, NULL, CmArmMailboxRegisterInfoParser,
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
-  { "DoorbellReg",   sizeof (CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO),
+  { "DoorbellReg",   sizeof (PCC_SUBSPACE_CHANNEL_TIMING_INFO),
     NULL, NULL, CmArmPccSubspaceChannelTimingInfoParser,
     ARRAY_SIZE (CmArmPccSubspaceChannelTimingInfoParser) },
 };
@@ -574,7 +574,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType0InfoParser[] = {
 /** A parser for EArmObjPccSubspaceType1Info.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
-  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
+  { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArmPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
   { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),
@@ -585,12 +585,12 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
 /** A parser for EArmObjPccSubspaceType2Info.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
-  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
+  { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArmPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
-  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
+  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,NULL,
     CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
-  { "PlatIrqAckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+  { "PlatIrqAckReg",  sizeof (PCC_MAILBOX_REGISTER_INFO),
     NULL, NULL, CmArmMailboxRegisterInfoParser,
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
 };
@@ -598,21 +598,21 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
 /** A parser for EArmObjPccSubspaceType3Info or EArmObjPccSubspaceType4Info.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
-  { "GenericPccInfo",       sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
+  { "GenericPccInfo",       sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArmPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
-  { "PlatIrq",              sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
+  { "PlatIrq",              sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,NULL,
     CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
-  { "PlatIrqAckReg",        sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+  { "PlatIrqAckReg",        sizeof (PCC_MAILBOX_REGISTER_INFO),
     NULL, NULL, CmArmMailboxRegisterInfoParser,
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
-  { "CmdCompleteCheckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+  { "CmdCompleteCheckReg",  sizeof (PCC_MAILBOX_REGISTER_INFO),
     NULL, NULL, CmArmMailboxRegisterInfoParser,
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
-  { "CmdCompleteUpdateReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+  { "CmdCompleteUpdateReg", sizeof (PCC_MAILBOX_REGISTER_INFO),
     NULL, NULL, CmArmMailboxRegisterInfoParser,
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
-  { "ErrorStatusReg",       sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+  { "ErrorStatusReg",       sizeof (PCC_MAILBOX_REGISTER_INFO),
     NULL, NULL, CmArmMailboxRegisterInfoParser,
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
 };
@@ -620,16 +620,16 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
 /** A parser for EArmObjPccSubspaceType5Info.
 */
 STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType5InfoParser[] = {
-  { "GenericPccInfo",      sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
+  { "GenericPccInfo",      sizeof (PCC_SUBSPACE_GENERIC_INFO),
     NULL, NULL, CmArmPccSubspaceType0InfoParser,
     ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
-  { "Version",             2,                                        "0x%x",NULL },
-  { "PlatIrq",             sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,  NULL,
+  { "Version",             2,                                 "0x%x",NULL },
+  { "PlatIrq",             sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,  NULL,
     CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
-  { "CmdCompleteCheckReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+  { "CmdCompleteCheckReg", sizeof (PCC_MAILBOX_REGISTER_INFO),
     NULL, NULL, CmArmMailboxRegisterInfoParser,
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
-  { "ErrorStatusReg",      sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
+  { "ErrorStatusReg",      sizeof (PCC_MAILBOX_REGISTER_INFO),
     NULL, NULL, CmArmMailboxRegisterInfoParser,
     ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
 };
-- 
2.25.1


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

* [PATCH 12/14] DynamicTablesPkg/AmlLib: Allow larger AccessSize for Pcc address space
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (10 preceding siblings ...)
  2022-10-10  9:20 ` [PATCH 11/14] DynamicTablesPkg: Add PCCT Generator PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:34   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 13/14] DynamicTablesPkg: Readme.md: Update available tables for generation PierreGondois
                   ` (3 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

For Pcc address space, the AccessSize field of a Register is
used to delcare the Pcc Subspace Id. This Id can be up to 256.

Cf. ACPI 6.4, s14.7 Referencing the PCC address space

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
index 332962bed441..3901b6e47333 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
@@ -1257,7 +1257,12 @@ AmlCodeGenRdRegister (
   AML_DATA_NODE                         *RdNode;
   EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR  RdRegister;
 
-  if ((AccessSize > EFI_ACPI_6_4_QWORD)  ||
+  // Cf Cf. ACPI 6.4, s14.7 Referencing the PCC address space
+  // The AccessSize represents the Subspace Id for the PCC address space.
+  if (((AddressSpace == EFI_ACPI_6_3_PLATFORM_COMMUNICATION_CHANNEL) &&
+       (AccessSize > 256)) ||
+      ((AddressSpace != EFI_ACPI_6_3_PLATFORM_COMMUNICATION_CHANNEL) &&
+       (AccessSize > EFI_ACPI_6_4_QWORD)) ||
       ((NameOpNode == NULL) && (NewRdNode == NULL)))
   {
     ASSERT (0);
-- 
2.25.1


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

* [PATCH 13/14] DynamicTablesPkg: Readme.md: Update available tables for generation
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (11 preceding siblings ...)
  2022-10-10  9:20 ` [PATCH 12/14] DynamicTablesPkg/AmlLib: Allow larger AccessSize for Pcc address space PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:07   ` Sami Mujawar
  2022-10-10  9:20 ` [PATCH 14/14] ShellPkg/AcpiView: Update PCCT fields for ACPI 6.5 PierreGondois
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

The following tables can now be generated by the DynamicTablesPkg:
 - PCCT
 - PPTT
 - SRAT

Update the documentation accordingly.

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

diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
index 5f92d4c6cb2e..6b0a6c7a4001 100644
--- a/DynamicTablesPkg/Readme.md
+++ b/DynamicTablesPkg/Readme.md
@@ -53,7 +53,10 @@ The framework currently supports the following table generators for ARM:
 * MADT - Multiple APIC Description Table
 * MCFG - PCI Express memory mapped configuration space base address
          Description Table
+* PCCT - Platform Communications Channel Table
+* PPTT - Processor Properties Topology Table
 * SPCR - Serial Port Console Redirection Table
+* SRAT - System Resource Affinity Table
 * SSDT - Secondary System Description Table. This is essentially
          a RAW table generator.
 
-- 
2.25.1


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

* [PATCH 14/14] ShellPkg/AcpiView: Update PCCT fields for ACPI 6.5
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (12 preceding siblings ...)
  2022-10-10  9:20 ` [PATCH 13/14] DynamicTablesPkg: Readme.md: Update available tables for generation PierreGondois
@ 2022-10-10  9:20 ` PierreGondois
  2022-10-26 12:06   ` Sami Mujawar
       [not found] ` <171CAABD595C9750.32766@groups.io>
  2022-10-31 13:34 ` [edk2-devel] [PATCH 00/14] Add PCCT generator and various fixes Sami Mujawar
  15 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:20 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov

From: Pierre Gondois <pierre.gondois@arm.com>

The ACPI specification updated some terms in accordance with:
s1.1.1 Principle of Inclusive Terminology

Update the PCCT parser accordincly with these new terms.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 .../UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
index 8cffdaaf0716..8ad39090afe3 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
@@ -146,7 +146,7 @@ ValidatePccDoorbellGas (
   IN VOID   *Context
   )
 {
-  // For slave subspaces this field is optional, if not present the field
+  // For responder subspaces this field is optional, if not present the field
   // should just contain zeros.
   if (*PccSubspaceType == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
     if (IsZeroBuffer (
@@ -214,7 +214,7 @@ ValidatePccErrStatusGas (
   IN VOID   *Context
   )
 {
-  // This field is ignored by the OSPM on slave channels.
+  // This field is ignored by the OSPM on responder channels.
   if (*PccSubspaceType == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
     return;
   }
@@ -237,7 +237,7 @@ ValidatePlatInterrupt (
   IN VOID   *Context
   )
 {
-  // If a slave subspace is present in the PCCT, then the global Platform
+  // If a responder subspace is present in the PCCT, then the global Platform
   // Interrupt flag must be set to 1.
   if ((*PccSubspaceType == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) &&
       ((*PccGlobalFlags & EFI_ACPI_6_4_PCCT_FLAGS_PLATFORM_INTERRUPT) !=
-- 
2.25.1


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

* Re: [edk2-devel] [PATCH 14/14] ShellPkg/AcpiView: Update PCCT fields for ACPI 6.5
       [not found] ` <171CAABD595C9750.32766@groups.io>
@ 2022-10-10  9:48   ` PierreGondois
  2022-10-11  1:41     ` Ni, Ray
  0 siblings, 1 reply; 37+ messages in thread
From: PierreGondois @ 2022-10-10  9:48 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov, ray.ni, zhichao.gao

+ Ray Ni
+ Zhichao Gao

as the patch wasn't sent to them.

On 10/10/22 11:20, PierreGondois via groups.io wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
> 
> The ACPI specification updated some terms in accordance with:
> s1.1.1 Principle of Inclusive Terminology
> 
> Update the PCCT parser accordincly with these new terms.
> 
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   .../UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c   | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
> index 8cffdaaf0716..8ad39090afe3 100644
> --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
> +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
> @@ -146,7 +146,7 @@ ValidatePccDoorbellGas (
>     IN VOID   *Context
>     )
>   {
> -  // For slave subspaces this field is optional, if not present the field
> +  // For responder subspaces this field is optional, if not present the field
>     // should just contain zeros.
>     if (*PccSubspaceType == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
>       if (IsZeroBuffer (
> @@ -214,7 +214,7 @@ ValidatePccErrStatusGas (
>     IN VOID   *Context
>     )
>   {
> -  // This field is ignored by the OSPM on slave channels.
> +  // This field is ignored by the OSPM on responder channels.
>     if (*PccSubspaceType == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
>       return;
>     }
> @@ -237,7 +237,7 @@ ValidatePlatInterrupt (
>     IN VOID   *Context
>     )
>   {
> -  // If a slave subspace is present in the PCCT, then the global Platform
> +  // If a responder subspace is present in the PCCT, then the global Platform
>     // Interrupt flag must be set to 1.
>     if ((*PccSubspaceType == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) &&
>         ((*PccGlobalFlags & EFI_ACPI_6_4_PCCT_FLAGS_PLATFORM_INTERRUPT) !=

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

* Re: [edk2-devel] [PATCH 14/14] ShellPkg/AcpiView: Update PCCT fields for ACPI 6.5
  2022-10-10  9:48   ` [edk2-devel] " PierreGondois
@ 2022-10-11  1:41     ` Ni, Ray
  0 siblings, 0 replies; 37+ messages in thread
From: Ni, Ray @ 2022-10-11  1:41 UTC (permalink / raw)
  To: devel@edk2.groups.io, pierre.gondois@arm.com
  Cc: Sami Mujawar, Alexei Fedorov, Gao, Zhichao

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> PierreGondois
> Sent: Monday, October 10, 2022 5:48 PM
> To: devel@edk2.groups.io
> Cc: Sami Mujawar <sami.mujawar@arm.com>; Alexei Fedorov
> <Alexei.Fedorov@arm.com>; Ni, Ray <ray.ni@intel.com>; Gao, Zhichao
> <zhichao.gao@intel.com>
> Subject: Re: [edk2-devel] [PATCH 14/14] ShellPkg/AcpiView: Update PCCT
> fields for ACPI 6.5
> 
> + Ray Ni
> + Zhichao Gao
> 
> as the patch wasn't sent to them.
> 
> On 10/10/22 11:20, PierreGondois via groups.io wrote:
> > From: Pierre Gondois <pierre.gondois@arm.com>
> >
> > The ACPI specification updated some terms in accordance with:
> > s1.1.1 Principle of Inclusive Terminology
> >
> > Update the PCCT parser accordincly with these new terms.
> >
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Zhichao Gao <zhichao.gao@intel.com>
> > Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> > ---
> >   .../UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c   | 6 +++---
> >   1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.
> c
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.
> c
> > index 8cffdaaf0716..8ad39090afe3 100644
> > ---
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.
> c
> > +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.
> c
> > @@ -146,7 +146,7 @@ ValidatePccDoorbellGas (
> >     IN VOID   *Context
> >     )
> >   {
> > -  // For slave subspaces this field is optional, if not present the field
> > +  // For responder subspaces this field is optional, if not present the field
> >     // should just contain zeros.
> >     if (*PccSubspaceType ==
> EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
> >       if (IsZeroBuffer (
> > @@ -214,7 +214,7 @@ ValidatePccErrStatusGas (
> >     IN VOID   *Context
> >     )
> >   {
> > -  // This field is ignored by the OSPM on slave channels.
> > +  // This field is ignored by the OSPM on responder channels.
> >     if (*PccSubspaceType ==
> EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
> >       return;
> >     }
> > @@ -237,7 +237,7 @@ ValidatePlatInterrupt (
> >     IN VOID   *Context
> >     )
> >   {
> > -  // If a slave subspace is present in the PCCT, then the global Platform
> > +  // If a responder subspace is present in the PCCT, then the global
> Platform
> >     // Interrupt flag must be set to 1.
> >     if ((*PccSubspaceType ==
> EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) &&
> >         ((*PccGlobalFlags &
> EFI_ACPI_6_4_PCCT_FLAGS_PLATFORM_INTERRUPT) !=
> 
> 
> 
> 


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

* Re: [PATCH 14/14] ShellPkg/AcpiView: Update PCCT fields for ACPI 6.5
  2022-10-10  9:20 ` [PATCH 14/14] ShellPkg/AcpiView: Update PCCT fields for ACPI 6.5 PierreGondois
@ 2022-10-26 12:06   ` Sami Mujawar
  0 siblings, 0 replies; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:06 UTC (permalink / raw)
  To: Pierre.Gondois, devel, Ray Ni, Zhichao Gao; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

Thank you for this patch.
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> The ACPI specification updated some terms in accordance with:
> s1.1.1 Principle of Inclusive Terminology
>
> Update the PCCT parser accordincly with these new terms.
>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   .../UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c   | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
> index 8cffdaaf0716..8ad39090afe3 100644
> --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
> +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
> @@ -146,7 +146,7 @@ ValidatePccDoorbellGas (
>     IN VOID   *Context
>     )
>   {
> -  // For slave subspaces this field is optional, if not present the field
> +  // For responder subspaces this field is optional, if not present the field
>     // should just contain zeros.
>     if (*PccSubspaceType == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
>       if (IsZeroBuffer (
> @@ -214,7 +214,7 @@ ValidatePccErrStatusGas (
>     IN VOID   *Context
>     )
>   {
> -  // This field is ignored by the OSPM on slave channels.
> +  // This field is ignored by the OSPM on responder channels.
>     if (*PccSubspaceType == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
>       return;
>     }
> @@ -237,7 +237,7 @@ ValidatePlatInterrupt (
>     IN VOID   *Context
>     )
>   {
> -  // If a slave subspace is present in the PCCT, then the global Platform
> +  // If a responder subspace is present in the PCCT, then the global Platform
>     // Interrupt flag must be set to 1.
>     if ((*PccSubspaceType == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) &&
>         ((*PccGlobalFlags & EFI_ACPI_6_4_PCCT_FLAGS_PLATFORM_INTERRUPT) !=

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

* Re: [PATCH 13/14] DynamicTablesPkg: Readme.md: Update available tables for generation
  2022-10-10  9:20 ` [PATCH 13/14] DynamicTablesPkg: Readme.md: Update available tables for generation PierreGondois
@ 2022-10-26 12:07   ` Sami Mujawar
  0 siblings, 0 replies; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:07 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

Thank you for this patch.

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

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> The following tables can now be generated by the DynamicTablesPkg:
>   - PCCT
>   - PPTT
>   - SRAT
>
> Update the documentation accordingly.
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   DynamicTablesPkg/Readme.md | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
> index 5f92d4c6cb2e..6b0a6c7a4001 100644
> --- a/DynamicTablesPkg/Readme.md
> +++ b/DynamicTablesPkg/Readme.md
> @@ -53,7 +53,10 @@ The framework currently supports the following table generators for ARM:
>   * MADT - Multiple APIC Description Table
>   * MCFG - PCI Express memory mapped configuration space base address
>            Description Table
> +* PCCT - Platform Communications Channel Table
> +* PPTT - Processor Properties Topology Table
>   * SPCR - Serial Port Console Redirection Table
> +* SRAT - System Resource Affinity Table
>   * SSDT - Secondary System Description Table. This is essentially
>            a RAW table generator.
>   

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

* Re: [PATCH 03/14] DynamicTablesPkg: Update CmObjParser for IORT Rev E.d
  2022-10-10  9:20 ` [PATCH 03/14] DynamicTablesPkg: Update CmObjParser for IORT Rev E.d PierreGondois
@ 2022-10-26 12:34   ` Sami Mujawar
  2022-10-28 10:05     ` PierreGondois
  0 siblings, 1 reply; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:34 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

I have one comment marked inline as [SAMI].

Other than that change this patch should be good.

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> commit de200b7e2c3c ("DynamicTablesPkg: Update ArmNameSpaceObjects for
> IORT Rev E.d")
> adds new CmObj structures and fields to the ArmNameSpaceObjects.
> Update the CmObjectParser accordingly.
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   .../ConfigurationManagerObjectParser.c        | 59 ++++++++++++++-----
>   1 file changed, 45 insertions(+), 14 deletions(-)
>
> diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> index b46f19693bb5..80ebb0708661 100644
> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> @@ -183,21 +183,23 @@ STATIC CONST CM_OBJ_PARSER  CmArmFixedFeatureFlagsParser[] = {
>   STATIC CONST CM_OBJ_PARSER  CmArmItsGroupNodeParser[] = {
>     { "Token",      sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>     { "ItsIdCount", 4,                        "0x%x", NULL },
> -  { "ItsIdToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }
> +  { "ItsIdToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
> +  { "Identifier", 4,                        "0x%x", NULL },
>   };
>   
>   /** A parser for EArmObjNamedComponent.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmNamedComponentNodeParser[] = {
> -  { "Token",             sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
> -  { "IdMappingCount",    4,                        "0x%x", NULL },
> -  { "IdMappingToken",    sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
> -  { "Flags",             4,                        "0x%x", NULL },
> -  { "CacheCoherent",     4,                        "0x%x", NULL },
> -  { "AllocationHints",   1,                        "0x%x", NULL },
> -  { "MemoryAccessFlags", 1,                        "0x%x", NULL },
> -  { "AddressSizeLimit",  1,                        "0x%x", NULL },
> -  { "ObjectName",        sizeof (CHAR8 *),         "%a",   NULL }
> +  { "Token",             sizeof (CM_OBJECT_TOKEN), "0x%p", NULL        },
> +  { "IdMappingCount",    4,                        "0x%x", NULL        },
> +  { "IdMappingToken",    sizeof (CM_OBJECT_TOKEN), "0x%p", NULL        },
> +  { "Flags",             4,                        "0x%x", NULL        },
> +  { "CacheCoherent",     4,                        "0x%x", NULL        },
> +  { "AllocationHints",   1,                        "0x%x", NULL        },
> +  { "MemoryAccessFlags", 1,                        "0x%x", NULL        },
> +  { "AddressSizeLimit",  1,                        "0x%x", NULL        },
> +  { "ObjectName",        1,                        NULL,   PrintString },

[SAMI] I think the Length field for ObjectName should be "sizeof (CHAR8 
*)" otherwise PrintCmObjDesc() would not advance to the next field 
correctly/

If you agree, I will make this change locally before pushing the patch.

[/SAMI]

> +  { "Identifier",        4,                        "0x%x", NULL        },
>   };
>   
>   /** A parser for EArmObjRootComplex.
> @@ -211,7 +213,10 @@ STATIC CONST CM_OBJ_PARSER  CmArmRootComplexNodeParser[] = {
>     { "MemoryAccessFlags", 1,                        "0x%x", NULL },
>     { "AtsAttribute",      4,                        "0x%x", NULL },
>     { "PciSegmentNumber",  4,                        "0x%x", NULL },
> -  { "MemoryAddressSize", 1,                        "0x%x", NULL }
> +  { "MemoryAddressSize", 1,                        "0x%x", NULL },
> +  { "PasidCapabilities", 2,                        "0x%x", NULL },
> +  { "Flags",             4,                        "0x%x", NULL },
> +  { "Identifier",        4,                        "0x%x", NULL },
>   };
>   
>   /** A parser for EArmObjSmmuV1SmmuV2.
> @@ -231,7 +236,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmSmmuV1SmmuV2NodeParser[] = {
>     { "SMMU_NSgIrpt",          4,                        "0x%x",   NULL },
>     { "SMMU_NSgIrptFlags",     4,                        "0x%x",   NULL },
>     { "SMMU_NSgCfgIrpt",       4,                        "0x%x",   NULL },
> -  { "SMMU_NSgCfgIrptFlags",  4,                        "0x%x",   NULL }
> +  { "SMMU_NSgCfgIrptFlags",  4,                        "0x%x",   NULL },
> +  { "Identifier",            4,                        "0x%x",   NULL },
>   };
>   
>   /** A parser for EArmObjSmmuV3.
> @@ -249,7 +255,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmSmmuV3NodeParser[] = {
>     { "GerrInterrupt",        4,                        "0x%x",   NULL },
>     { "SyncInterrupt",        4,                        "0x%x",   NULL },
>     { "ProximityDomain",      4,                        "0x%x",   NULL },
> -  { "DeviceIdMappingIndex", 4,                        "0x%x",   NULL }
> +  { "DeviceIdMappingIndex", 4,                        "0x%x",   NULL },
> +  { "Identifier",           4,                        "0x%x",   NULL },
>   };
>   
>   /** A parser for EArmObjPmcg.
> @@ -261,7 +268,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmPmcgNodeParser[] = {
>     { "BaseAddress",       8,                        "0x%llx", NULL },
>     { "OverflowInterrupt", 4,                        "0x%x",   NULL },
>     { "Page1BaseAddress",  8,                        "0x%llx", NULL },
> -  { "ReferenceToken",    sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL }
> +  { "ReferenceToken",    sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL },
> +  { "Identifier",        4,                        "0x%x",   NULL },
>   };
>   
>   /** A parser for EArmObjGicItsIdentifierArray.
> @@ -432,6 +440,25 @@ STATIC CONST CM_OBJ_PARSER  CmPciInterruptMapInfoParser[] = {
>       ARRAY_SIZE (CmArmGenericInterruptParser) },
>   };
>   
> +/** A parser for EArmObjRmr.
> +*/
> +STATIC CONST CM_OBJ_PARSER  CmArmRmrInfoParser[] = {
> +  { "Token",             sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
> +  { "IdMappingCount",    4,                        "0x%x", NULL },
> +  { "IdMappingToken",    sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
> +  { "Identifier",        4,                        "0x%x", NULL },
> +  { "Flags",             4,                        "0x%x", NULL },
> +  { "MemRangeDescCount", 4,                        "0x%x", NULL },
> +  { "MemRangeDescToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
> +};
> +
> +/** A parser for EArmObjMemoryRangeDescriptor.
> +*/
> +STATIC CONST CM_OBJ_PARSER  CmArmMemoryRangeDescriptorInfoParser[] = {
> +  { "BaseAddress", 8, "0x%llx", NULL },
> +  { "Length",      8, "0x%llx", NULL },
> +};
> +
>   /** A parser for EArmObjCpcInfo.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmCpcInfoParser[] = {
> @@ -588,6 +615,10 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
>       ARRAY_SIZE (CmArmPciAddressMapInfoParser) },
>     { "EArmObjPciInterruptMapInfo",          CmPciInterruptMapInfoParser,
>       ARRAY_SIZE (CmPciInterruptMapInfoParser) },
> +  { "EArmObjRmr",                          CmArmRmrInfoParser,
> +    ARRAY_SIZE (CmArmRmrInfoParser) },
> +  { "EArmObjMemoryRangeDescriptor",        CmArmMemoryRangeDescriptorInfoParser,
> +    ARRAY_SIZE (CmArmMemoryRangeDescriptorInfoParser) },
>     { "EArmObjCpcInfo",                      CmArmCpcInfoParser,
>       ARRAY_SIZE (CmArmCpcInfoParser) },
>     { "EArmObjMax",                          NULL,                                  0                                },

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

* Re: [PATCH 06/14] DynamicTablesPkg: Fix wrong/missing fields in CmObjParser
  2022-10-10  9:20 ` [PATCH 06/14] DynamicTablesPkg: Fix wrong/missing fields in CmObjParser PierreGondois
@ 2022-10-26 12:34   ` Sami Mujawar
  2022-10-28 10:05     ` PierreGondois
  0 siblings, 1 reply; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:34 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

I have one comment marked inline as [SAMI].

I believe other than that change this patch should be good.

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> Add missing fields to the following CmObjParser objects:
> - EArmObjGicDInfo
> - EArmObjCacheInfo
> and fix wrong formatting of:
> - EArmObjLpiInfo
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   .../ConfigurationManagerObjectParser.c        | 24 ++++++++++---------
>   1 file changed, 13 insertions(+), 11 deletions(-)
>
> diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> index 040aaa4cbb17..2126beba8b9f 100644
> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> @@ -303,7 +303,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmProcHierarchyInfoParser[] = {
>     { "ParentToken",                sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>     { "GicCToken",                  sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>     { "NoOfPrivateResources",       4,                        "0x%x", NULL },
> -  { "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }
> +  { "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
> +  { "LpiToken",                   sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>   };
>   
>   /** A parser for EArmObjCacheInfo.
> @@ -315,7 +316,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmCacheInfoParser[] = {
>     { "NumberOfSets",          4,                        "0x%x", NULL },
>     { "Associativity",         4,                        "0x%x", NULL },
>     { "Attributes",            1,                        "0x%x", NULL },
> -  { "LineSize",              2,                        "0x%x", NULL }
> +  { "LineSize",              2,                        "0x%x", NULL },
> +  { "CacheId",               4,                        "0x%x", NULL },
>   };
>   
>   /** A parser for EArmObjProcNodeIdInfo.
> @@ -400,14 +402,14 @@ STATIC CONST CM_OBJ_PARSER  AcpiGenericAddressParser[] = {
>   /** A parser for EArmObjLpiInfo.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmLpiInfoParser[] = {
> -  { "MinResidency",             4,                                               "0x%x",   NULL },
> -  { "WorstCaseWakeLatency",     4,                                               "0x%x",   NULL },
> -  { "Flags",                    4,                                               "0x%x",   NULL },
> -  { "ArchFlags",                4,                                               "0x%x",   NULL },
> -  { "ResCntFreq",               4,                                               "0x%x",   NULL },
> -  { "EnableParentState",        4,                                               "0x%x",   NULL },
> -  { "IsInteger",                1,                                               "%d",     NULL },
> -  { "IntegerEntryMethod",       8,                                               "0x%llx", NULL },
> +  { "MinResidency",             4,                                               "0x%x",   NULL        },
> +  { "WorstCaseWakeLatency",     4,                                               "0x%x",   NULL        },
> +  { "Flags",                    4,                                               "0x%x",   NULL        },
> +  { "ArchFlags",                4,                                               "0x%x",   NULL        },
> +  { "ResCntFreq",               4,                                               "0x%x",   NULL        },
> +  { "EnableParentState",        4,                                               "0x%x",   NULL        },
> +  { "IsInteger",                1,                                               "%d",     NULL        },
> +  { "IntegerEntryMethod",       8,                                               "0x%llx", NULL        },
>     { "RegisterEntryMethod",      sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
>       NULL, NULL, AcpiGenericAddressParser,
>       ARRAY_SIZE (AcpiGenericAddressParser) },
> @@ -417,7 +419,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmLpiInfoParser[] = {
>     { "UsageCounterRegister",     sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
>       NULL, NULL, AcpiGenericAddressParser,
>       ARRAY_SIZE (AcpiGenericAddressParser) },
> -  { "StateName",                16,                                              "0x%a",   NULL },
> +  { "StateName",                16,                                              "NULL",   PrintString },
[SAMI] I think the format specifier should be NULL and not enclosed in 
quotes. If you agree I will fix this before merging.
>   };
>   
>   /** A parser for EArmObjPciAddressMapInfo.

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

* Re: [PATCH 10/14] DynamicTablesPkg: Add PCCT related objects
  2022-10-10  9:20 ` [PATCH 10/14] DynamicTablesPkg: Add PCCT related objects PierreGondois
@ 2022-10-26 12:34   ` Sami Mujawar
  2022-10-28 10:04     ` PierreGondois
  0 siblings, 1 reply; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:34 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

[-- Attachment #1: Type: text/plain, Size: 22401 bytes --]

Hi Pierre,

There are some minor updates that are required for this patch marked 
inline as [SAMI].

If you agree, I will make these changes before merging.

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois<pierre.gondois@arm.com>
>
> Introduce the following CmObj in the ArmNameSpaceObjects:
>   - CM_ARM_MAILBOX_REGISTER_INFO
>   - CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO
>   - CM_ARM_PCC_SUBSPACE_GENERIC_INFO
>   - CM_ARM_PCC_SUBPSACE_TYPE0_INFO
>   - CM_ARM_PCC_SUBPSACE_TYPE1_INFO
>   - CM_ARM_PCC_SUBPSACE_TYPE2_INFO
>   - CM_ARM_PCC_SUBPSACE_TYPE3_INFO
>   - CM_ARM_PCC_SUBPSACE_TYPE4_INFO
>   - CM_ARM_PCC_SUBPSACE_TYPE5_INFO
>
> These objects allow to describe mailbox registers, pcc timings
> and PCCT subspaces. They prepare the enablement of a PCCT generator.
>
> Also add the CmObjParsers associated to each object.
>
> Signed-off-by: Pierre Gondois<Pierre.Gondois@arm.com>
> ---
>   .../Include/ArmNameSpaceObjects.h             | 277 +++++++++++++++---
>   .../ConfigurationManagerObjectParser.c        | 107 +++++++
>   2 files changed, 341 insertions(+), 43 deletions(-)
>
> diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> index d711f3ec5938..5d5a8ce92a09 100644
> --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> @@ -22,49 +22,55 @@
>       in the ARM Namespace
>   */
>   typedef enum ArmObjectID {
> -  EArmObjReserved,                     ///<  0 - Reserved
> -  EArmObjBootArchInfo,                 ///<  1 - Boot Architecture Info
> -  EArmObjCpuInfo,                      ///<  2 - CPU Info
> -  EArmObjPowerManagementProfileInfo,   ///<  3 - Power Management Profile Info
> -  EArmObjGicCInfo,                     ///<  4 - GIC CPU Interface Info
> -  EArmObjGicDInfo,                     ///<  5 - GIC Distributor Info
> -  EArmObjGicMsiFrameInfo,              ///<  6 - GIC MSI Frame Info
> -  EArmObjGicRedistributorInfo,         ///<  7 - GIC Redistributor Info
> -  EArmObjGicItsInfo,                   ///<  8 - GIC ITS Info
> -  EArmObjSerialConsolePortInfo,        ///<  9 - Serial Console Port Info
> -  EArmObjSerialDebugPortInfo,          ///< 10 - Serial Debug Port Info
> -  EArmObjGenericTimerInfo,             ///< 11 - Generic Timer Info
> -  EArmObjPlatformGTBlockInfo,          ///< 12 - Platform GT Block Info
> -  EArmObjGTBlockTimerFrameInfo,        ///< 13 - Generic Timer Block Frame Info
> -  EArmObjPlatformGenericWatchdogInfo,  ///< 14 - Platform Generic Watchdog
> -  EArmObjPciConfigSpaceInfo,           ///< 15 - PCI Configuration Space Info
> -  EArmObjHypervisorVendorIdentity,     ///< 16 - Hypervisor Vendor Id
> -  EArmObjFixedFeatureFlags,            ///< 17 - Fixed feature flags for FADT
> -  EArmObjItsGroup,                     ///< 18 - ITS Group
> -  EArmObjNamedComponent,               ///< 19 - Named Component
> -  EArmObjRootComplex,                  ///< 20 - Root Complex
> -  EArmObjSmmuV1SmmuV2,                 ///< 21 - SMMUv1 or SMMUv2
> -  EArmObjSmmuV3,                       ///< 22 - SMMUv3
> -  EArmObjPmcg,                         ///< 23 - PMCG
> -  EArmObjGicItsIdentifierArray,        ///< 24 - GIC ITS Identifier Array
> -  EArmObjIdMappingArray,               ///< 25 - ID Mapping Array
> -  EArmObjSmmuInterruptArray,           ///< 26 - SMMU Interrupt Array
> -  EArmObjProcHierarchyInfo,            ///< 27 - Processor Hierarchy Info
> -  EArmObjCacheInfo,                    ///< 28 - Cache Info
> -  EArmObjReserved29,                   ///< 29 - Reserved
> -  EArmObjCmRef,                        ///< 30 - CM Object Reference
> -  EArmObjMemoryAffinityInfo,           ///< 31 - Memory Affinity Info
> -  EArmObjDeviceHandleAcpi,             ///< 32 - Device Handle Acpi
> -  EArmObjDeviceHandlePci,              ///< 33 - Device Handle Pci
> -  EArmObjGenericInitiatorAffinityInfo, ///< 34 - Generic Initiator Affinity
> -  EArmObjSerialPortInfo,               ///< 35 - Generic Serial Port Info
> -  EArmObjCmn600Info,                   ///< 36 - CMN-600 Info
> -  EArmObjLpiInfo,                      ///< 37 - Lpi Info
> -  EArmObjPciAddressMapInfo,            ///< 38 - Pci Address Map Info
> -  EArmObjPciInterruptMapInfo,          ///< 39 - Pci Interrupt Map Info
> -  EArmObjRmr,                          ///< 40 - Reserved Memory Range Node
> -  EArmObjMemoryRangeDescriptor,        ///< 41 - Memory Range Descriptor
> -  EArmObjCpcInfo,                      ///< 42 - Continuous Performance Control Info
> +  EArmObjReserved,                                             ///<  0 - Reserved
> +  EArmObjBootArchInfo,                                         ///<  1 - Boot Architecture Info
> +  EArmObjCpuInfo,                                              ///<  2 - CPU Info
> +  EArmObjPowerManagementProfileInfo,                           ///<  3 - Power Management Profile Info
> +  EArmObjGicCInfo,                                             ///<  4 - GIC CPU Interface Info
> +  EArmObjGicDInfo,                                             ///<  5 - GIC Distributor Info
> +  EArmObjGicMsiFrameInfo,                                      ///<  6 - GIC MSI Frame Info
> +  EArmObjGicRedistributorInfo,                                 ///<  7 - GIC Redistributor Info
> +  EArmObjGicItsInfo,                                           ///<  8 - GIC ITS Info
> +  EArmObjSerialConsolePortInfo,                                ///<  9 - Serial Console Port Info
> +  EArmObjSerialDebugPortInfo,                                  ///< 10 - Serial Debug Port Info
> +  EArmObjGenericTimerInfo,                                     ///< 11 - Generic Timer Info
> +  EArmObjPlatformGTBlockInfo,                                  ///< 12 - Platform GT Block Info
> +  EArmObjGTBlockTimerFrameInfo,                                ///< 13 - Generic Timer Block Frame Info
> +  EArmObjPlatformGenericWatchdogInfo,                          ///< 14 - Platform Generic Watchdog
> +  EArmObjPciConfigSpaceInfo,                                   ///< 15 - PCI Configuration Space Info
> +  EArmObjHypervisorVendorIdentity,                             ///< 16 - Hypervisor Vendor Id
> +  EArmObjFixedFeatureFlags,                                    ///< 17 - Fixed feature flags for FADT
> +  EArmObjItsGroup,                                             ///< 18 - ITS Group
> +  EArmObjNamedComponent,                                       ///< 19 - Named Component
> +  EArmObjRootComplex,                                          ///< 20 - Root Complex
> +  EArmObjSmmuV1SmmuV2,                                         ///< 21 - SMMUv1 or SMMUv2
> +  EArmObjSmmuV3,                                               ///< 22 - SMMUv3
> +  EArmObjPmcg,                                                 ///< 23 - PMCG
> +  EArmObjGicItsIdentifierArray,                                ///< 24 - GIC ITS Identifier Array
> +  EArmObjIdMappingArray,                                       ///< 25 - ID Mapping Array
> +  EArmObjSmmuInterruptArray,                                   ///< 26 - SMMU Interrupt Array
> +  EArmObjProcHierarchyInfo,                                    ///< 27 - Processor Hierarchy Info
> +  EArmObjCacheInfo,                                            ///< 28 - Cache Info
> +  EArmObjReserved29,                                           ///< 29 - Reserved
> +  EArmObjCmRef,                                                ///< 30 - CM Object Reference
> +  EArmObjMemoryAffinityInfo,                                   ///< 31 - Memory Affinity Info
> +  EArmObjDeviceHandleAcpi,                                     ///< 32 - Device Handle Acpi
> +  EArmObjDeviceHandlePci,                                      ///< 33 - Device Handle Pci
> +  EArmObjGenericInitiatorAffinityInfo,                         ///< 34 - Generic Initiator Affinity
> +  EArmObjSerialPortInfo,                                       ///< 35 - Generic Serial Port Info
> +  EArmObjCmn600Info,                                           ///< 36 - CMN-600 Info
> +  EArmObjLpiInfo,                                              ///< 37 - Lpi Info
> +  EArmObjPciAddressMapInfo,                                    ///< 38 - Pci Address Map Info
> +  EArmObjPciInterruptMapInfo,                                  ///< 39 - Pci Interrupt Map Info
> +  EArmObjRmr,                                                  ///< 40 - Reserved Memory Range Node
> +  EArmObjMemoryRangeDescriptor,                                ///< 41 - Memory Range Descriptor
> +  EArmObjCpcInfo,                                              ///< 42 - Continuous Performance Control Info
> +  EArmObjPccSubspaceType0Info,                                 ///< 43 - Pcc Subspace Type 0 Info
> +  EArmObjPccSubspaceType1Info,                                 ///< 44 - Pcc Subspace Type 2 Info
> +  EArmObjPccSubspaceType2Info,                                 ///< 45 - Pcc Subspace Type 2 Info
> +  EArmObjPccSubspaceType3Info,                                 ///< 46 - Pcc Subspace Type 3 Info
> +  EArmObjPccSubspaceType4Info,                                 ///< 47 - Pcc Subspace Type 4 Info
> +  EArmObjPccSubspaceType5Info,                                 ///< 48 - Pcc Subspace Type 5 Info
>     EArmObjMax
>   } EARM_OBJECT_ID;
>   
> @@ -1095,6 +1101,191 @@ typedef struct CmArmRmrDescriptor {
>   */
>   typedef AML_CPC_INFO CM_ARM_CPC_INFO;
>   
> +/** A structure that describes a
> +    PCC Mailbox Register.
> +*/
> +typedef struct PccMailboxRegisterInfo {
> +  /// GAS describing the Register.
> +  EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE    Register;
> +
> +  /** Mask of bits to preserve when writing.
> +
> +    This mask is also used for registers the Register is only read

[SAMI] I think the above line should be

This mask is also used for registers. The Register is only read

[/SAMI]

> +    and there is no write mask required. E.g.:
> +    - Error Status mask (Cf. PCC Subspace types 3/4/5).
> +    - Command Complete Check mask (Cf. PCC Subspace types 3/4/5).
> +  */
> +  UINT64    PreserveMask;
> +
> +  /// Mask of bits to set when writing.
> +  UINT64    WriteMask;
> +} PCC_MAILBOX_REGISTER_INFO;
> +
> +/** A structure that describes the
> +    PCC Subspace CHannel Timings.
> +*/
> +typedef struct PccSubspaceChannelTimingInfo {
> +  /// Expected latency to process a command, in microseconds.
> +  UINT32    NominalLatency;
> +
> +  /** Maximum number of periodic requests that the subspace channel can
> +      support, reported in commands per minute. 0 indicates no limitation.
> +
> +    This field is ignored for the PCC Subspace type 5 (HW Registers based).
> +  */
> +  UINT32    MaxPeriodicAccessRate;
> +
> +  /** Minimum amount of time that OSPM must wait after the completion
> +      of a command before issuing the next command, in microseconds.
> +  */
> +  UINT16    MinRequestTurnaroundTime;
> +} PCC_SUBSPACE_CHANNEL_TIMING_INFO;
> +
> +/** A structure that describes a
> +    Generic PCC Subspace (Type 0).
> +*/
> +typedef struct CmArmPccSubspaceGenericInfo {
> +  /** Subspace Id.
> +
> +  Cf. ACPI 6.4, s14.7 Referencing the PCC address space
> +  Cf. s14.1.2 Platform Communications Channel Subspace Structures
> +      The subspace ID of a PCC subspace is its index in the array of
> +      subspace structures, starting with subspace 0.
> +
> +  At most 256 subspaces are supported.
> +  */
> +  UINT8                               SubspaceId;
> +
> +  /// Table type (or subspace).
> +  UINT8                               Type;
> +
> +  /// Base address of the shared memory range.
> +  /// This field is ignored for the PCC Subspace type 5 (HW Registers based).
> +  UINT64                              BaseAddress;
> +
> +  /// Address length.
> +  UINT64                              AddressLength;
> +
> +  /// Doorbell Register.
> +  PCC_MAILBOX_REGISTER_INFO           DoorbellReg;
> +
> +  /// Mailbox Timings.
> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO    ChannelTiming;
> +} PCC_SUBSPACE_GENERIC_INFO;
> +
> +/** A structure that describes a
> +    PCC Subspace of type 0 (Generic).
> +
> +    ID: EArmObjPccSubspaceType0Info
> +*/
> +typedef PCC_SUBSPACE_GENERIC_INFO CM_ARM_PCC_SUBSPACE_TYPE0_INFO;
> +
> +/** A structure that describes a
> +    PCC Subspace of type 1 (HW-Reduced).
> +
> +    ID: EArmObjPccSubspaceType1Info
> +*/
> +typedef struct CmArmPccSubspaceType1Info {
> +  /** Generic Pcc information.
> +
> +    The Subspace of Type0 contains information that can be re-used
> +    in other Subspace types.
> +  */
> +  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
> +
> +  /// Platform Interrupt.
> +  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
> +} CM_ARM_PCC_SUBSPACE_TYPE1_INFO;
> +
> +/** A structure that describes a
> +    PCC Subspace of type 2 (HW-Reduced).
> +
> +    ID: EArmObjPccSubspaceType2Info
> +*/
> +typedef struct CmArmPccSubspaceType2Info {
> +  /** Generic Pcc information.
> +
> +    The Subspace of Type0 contains information that can be re-used
> +    in other Subspace types.
> +  */
> +  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
> +
> +  /// Platform Interrupt.
> +  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
> +
> +  /// Platform Interrupt Register.
> +  PCC_MAILBOX_REGISTER_INFO    PlatIrqAckReg;
> +} CM_ARM_PCC_SUBSPACE_TYPE2_INFO;
> +
> +/** A structure that describes a
> +    PCC Subspace of type 3 (Extended)
> +
> +    ID: EArmObjPccSubspaceType3Info
> +*/
> +typedef struct CmArmPccSubspaceType3Info {
> +  /** Generic Pcc information.
> +
> +    The Subspace of Type0 contains information that can be re-used
> +    in other Subspace types.
> +  */
> +  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
> +
> +  /// Platform Interrupt.
> +  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
> +
> +  /// Platform Interrupt Register.
> +  PCC_MAILBOX_REGISTER_INFO    PlatIrqAckReg;
> +
> +  /// Command Complete Check Register.
> +  /// The WriteMask field is not used.
> +  PCC_MAILBOX_REGISTER_INFO    CmdCompleteCheckReg;
> +
> +  /// Command Complete Update Register.
> +  PCC_MAILBOX_REGISTER_INFO    CmdCompleteUpdateReg;
> +
> +  /// Error Status Register.
> +  /// The WriteMask field is not used.
> +  PCC_MAILBOX_REGISTER_INFO    ErrorStatusReg;
> +} CM_ARM_PCC_SUBSPACE_TYPE3_INFO;
> +
> +/** A structure that describes a
> +    PCC Subspace of type 4 (Extended)
> +
> +    ID: EArmObjPccSubspaceType4Info
> +*/
> +typedef CM_ARM_PCC_SUBSPACE_TYPE3_INFO CM_ARM_PCC_SUBSPACE_TYPE4_INFO;
> +
> +/** A structure that describes a
> +    PCC Subspace of type 5 (HW-Registers).
> +
> +    ID: EArmObjPccSubspaceType5Info
> +*/
> +typedef struct CmArmPccSubspaceType5Info {
> +  /** Generic Pcc information.
> +
> +    The Subspace of Type0 contains information that can be re-used
> +    in other Subspace types.
> +
> +    MaximumPeriodicAccessRate doesn't need to be populated for
> +    this structure.
> +  */
> +  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
> +
> +  /// Version.
> +  UINT16                       Version;
> +
> +  /// Platform Interrupt.
> +  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
> +
> +  /// Command Complete Check Register.
> +  /// The WriteMask field is not used.
> +  PCC_MAILBOX_REGISTER_INFO    CmdCompleteCheckReg;
> +
> +  /// Error Status Register.
> +  /// The WriteMask field is not used.
> +  PCC_MAILBOX_REGISTER_INFO    ErrorStatusReg;
> +} CM_ARM_PCC_SUBSPACE_TYPE5_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 2126beba8b9f..21d1f3f08b16 100644
> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> @@ -539,6 +539,101 @@ STATIC CONST CM_OBJ_PARSER  CmArmCpcInfoParser[] = {
>     { "NominalFrequencyInteger",               4,                                               "0x%lx", NULL },
>   };
>   
> +/** A parser for the CM_ARM_MAILBOX_REGISTER_INFO struct.
> +*/
> +STATIC CONST CM_OBJ_PARSER  CmArmMailboxRegisterInfoParser[] = {
> +  { "Register",     sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE), NULL,     NULL,
> +    AcpiGenericAddressParser, ARRAY_SIZE (AcpiGenericAddressParser) },
> +  { "PreserveMask", 8,                                               "0x%llx", NULL },
> +  { "WriteMask",    8,                                               "0x%llx", NULL },
> +};
> +
> +/** A parser for the CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO struct.
> +*/
> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceChannelTimingInfoParser[] = {
> +  { "NominalLatency",           4, "0x%x", NULL },
> +  { "MaxPeriodicAccessRate",    4, "0x%x", NULL },
> +  { "MinRequestTurnaroundTime", 2, "0x%x", NULL },
> +};
> +
> +/** A parser for EArmObjPccSubspaceType0Info.
> +*/
> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType0InfoParser[] = {
> +  { "SubspaceId",    1,                                                "0x%x",   NULL },
> +  { "Type",          1,                                                "0x%x",   NULL },
> +  { "BaseAddress",   8,                                                "0x%llx", NULL },
> +  { "AddressLength", 8,                                                "0x%llx", NULL },
> +  { "DoorbellReg",   sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> +  { "DoorbellReg",   sizeof (CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO),
[SAMI] "DoorbellReg" should be changed to "ChannelTiming" above.
> +    NULL, NULL, CmArmPccSubspaceChannelTimingInfoParser,
> +    ARRAY_SIZE (CmArmPccSubspaceChannelTimingInfoParser) },
> +};
> +
> +/** A parser for EArmObjPccSubspaceType1Info.
> +*/
> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
> +  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
> +    NULL, NULL, CmArmPccSubspaceType0InfoParser,
> +    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
> +  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),
> +    NULL, NULL, CmArmGenericInterruptParser,
> +    ARRAY_SIZE (CmArmGenericInterruptParser) },
> +};
> +
> +/** A parser for EArmObjPccSubspaceType2Info.
> +*/
> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
> +  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
> +    NULL, NULL, CmArmPccSubspaceType0InfoParser,
> +    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
> +  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
> +    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
> +  { "PlatIrqAckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> +};
> +
> +/** A parser for EArmObjPccSubspaceType3Info or EArmObjPccSubspaceType4Info.
> +*/
> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
> +  { "GenericPccInfo",       sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
> +    NULL, NULL, CmArmPccSubspaceType0InfoParser,
> +    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
> +  { "PlatIrq",              sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
> +    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
> +  { "PlatIrqAckReg",        sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> +  { "CmdCompleteCheckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> +  { "CmdCompleteUpdateReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> +  { "ErrorStatusReg",       sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> +};
> +
> +/** A parser for EArmObjPccSubspaceType5Info.
> +*/
> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType5InfoParser[] = {
> +  { "GenericPccInfo",      sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
> +    NULL, NULL, CmArmPccSubspaceType0InfoParser,
> +    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
> +  { "Version",             2,                                        "0x%x",NULL },
> +  { "PlatIrq",             sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,  NULL,
> +    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
> +  { "CmdCompleteCheckReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> +  { "ErrorStatusReg",      sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> +};
> +
>   /** A parser for Arm namespace objects.
>   */
>   STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
> @@ -623,6 +718,18 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
>       ARRAY_SIZE (CmArmMemoryRangeDescriptorInfoParser) },
>     { "EArmObjCpcInfo",                      CmArmCpcInfoParser,
>       ARRAY_SIZE (CmArmCpcInfoParser) },
> +  { "EArmObjPccSubspaceType0Info",         CmArmPccSubspaceType0InfoParser,
> +    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
> +  { "EArmObjPccSubspaceType1Info",         CmArmPccSubspaceType1InfoParser,
> +    ARRAY_SIZE (CmArmPccSubspaceType1InfoParser) },
> +  { "EArmObjPccSubspaceType2Info",         CmArmPccSubspaceType2InfoParser,
> +    ARRAY_SIZE (CmArmPccSubspaceType2InfoParser) },
> +  { "EArmObjPccSubspaceType3Info",         CmArmPccSubspaceType34InfoParser,
> +    ARRAY_SIZE (CmArmPccSubspaceType34InfoParser) },
> +  { "EArmObjPccSubspaceType4Info",         CmArmPccSubspaceType34InfoParser,
> +    ARRAY_SIZE (CmArmPccSubspaceType34InfoParser) },
> +  { "EArmObjPccSubspaceType5Info",         CmArmPccSubspaceType5InfoParser,
> +    ARRAY_SIZE (CmArmPccSubspaceType5InfoParser) },
>     { "EArmObjMax",                          NULL,                                  0                                },
>   };
>   

[-- Attachment #2: Type: text/html, Size: 24685 bytes --]

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

* Re: [PATCH 12/14] DynamicTablesPkg/AmlLib: Allow larger AccessSize for Pcc address space
  2022-10-10  9:20 ` [PATCH 12/14] DynamicTablesPkg/AmlLib: Allow larger AccessSize for Pcc address space PierreGondois
@ 2022-10-26 12:34   ` Sami Mujawar
  2022-10-28 10:04     ` PierreGondois
  0 siblings, 1 reply; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:34 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

There are some minor changes required marked inline as [SAMI].

If you agree, I will make the changes before merging.

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> For Pcc address space, the AccessSize field of a Register is
> used to delcare the Pcc Subspace Id. This Id can be up to 256.
>
> Cf. ACPI 6.4, s14.7 Referencing the PCC address space
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   .../Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
> index 332962bed441..3901b6e47333 100644
> --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
> +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
> @@ -1257,7 +1257,12 @@ AmlCodeGenRdRegister (
>     AML_DATA_NODE                         *RdNode;
>     EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR  RdRegister;
>   
> -  if ((AccessSize > EFI_ACPI_6_4_QWORD)  ||
> +  // Cf Cf. ACPI 6.4, s14.7 Referencing the PCC address space
[SAMI] Cf appears twice.
> +  // The AccessSize represents the Subspace Id for the PCC address space.
> +  if (((AddressSpace == EFI_ACPI_6_3_PLATFORM_COMMUNICATION_CHANNEL) &&
> +       (AccessSize > 256)) ||
> +      ((AddressSpace != EFI_ACPI_6_3_PLATFORM_COMMUNICATION_CHANNEL) &&
[SAMI] Change EFI_ACPI_6_3_PLATFORM_COMMUNICATION_CHANNEL to 
EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL.
> +       (AccessSize > EFI_ACPI_6_4_QWORD)) ||
>         ((NameOpNode == NULL) && (NewRdNode == NULL)))
>     {
>       ASSERT (0);

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

* Re: [PATCH 11/14] DynamicTablesPkg: Add PCCT Generator
  2022-10-10  9:20 ` [PATCH 11/14] DynamicTablesPkg: Add PCCT Generator PierreGondois
@ 2022-10-26 12:35   ` Sami Mujawar
  2022-10-28 10:02     ` PierreGondois
  0 siblings, 1 reply; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:35 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

There is a change required for this patch marked inline as [SAMI].

If you agree, I will make the changes before merging.

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> The Platform Communication Channel Table (PCCT) generator collates
> the relevant information required for generating a PCCT table from
> configuration manager using the configuration manager protocol.
> The DynamicTablesManager then install the PCCT table.
>
>  From ACPI 6.4, s14 PLATFORM COMMUNICATIONS CHANNEL (PCC):
>    The platform communication channel (PCC) is a generic mechanism
>    for OSPM to communicate with an entity in the platform.
>
> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
> ---
>   DynamicTablesPkg/DynamicTables.dsc.inc        |    4 +-
>   DynamicTablesPkg/Include/AcpiTableGenerator.h |    3 +-
>   .../Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf     |   30 +
>   .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c   | 1186 +++++++++++++++++
>   .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h   |   43 +
>   .../ConfigurationManagerObjectParser.c        |   46 +-
>   6 files changed, 1287 insertions(+), 25 deletions(-)
>   create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
>   create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
>   create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
>
> diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc b/DynamicTablesPkg/DynamicTables.dsc.inc
> index 3d4fa0c4c4b6..3e38fa0d0d99 100644
> --- a/DynamicTablesPkg/DynamicTables.dsc.inc
> +++ b/DynamicTablesPkg/DynamicTables.dsc.inc
> @@ -1,7 +1,7 @@
>   ## @file
>   #  Dsc include file for Dynamic Tables Framework.
>   #
> -#  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
> +#  Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.<BR>
>   #
>   #  SPDX-License-Identifier: BSD-2-Clause-Patent
>   #
> @@ -33,6 +33,7 @@ [Components.common]
>     DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
>     DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
>     DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/AcpiSratLibArm.inf
> +  DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
>   
>     # AML Fixup
>     DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
> @@ -57,6 +58,7 @@ [Components.common]
>         NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
>         NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
>         NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/AcpiSratLibArm.inf
> +      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
>   
>         # AML Fixup
>         NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
> diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h b/DynamicTablesPkg/Include/AcpiTableGenerator.h
> index f962dbff57df..d0eda011c301 100644
> --- a/DynamicTablesPkg/Include/AcpiTableGenerator.h
> +++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
> @@ -1,6 +1,6 @@
>   /** @file
>   
> -  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
> +  Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.<BR>
>   
>     SPDX-License-Identifier: BSD-2-Clause-Patent
>   
> @@ -98,6 +98,7 @@ typedef enum StdAcpiTableId {
>     EStdAcpiTableIdSsdtCmn600,                    ///< SSDT Cmn-600 Generator
>     EStdAcpiTableIdSsdtCpuTopology,               ///< SSDT Cpu Topology
>     EStdAcpiTableIdSsdtPciExpress,                ///< SSDT Pci Express Generator
> +  EStdAcpiTableIdPcct,                          ///< PCCT Generator
>     EStdAcpiTableIdMax
>   } ESTD_ACPI_TABLE_ID;
>   
> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
> new file mode 100644
> index 000000000000..da54585c2dd9
> --- /dev/null
> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
> @@ -0,0 +1,30 @@
> +## @file
> +#  Pcct Table Generator
> +#
> +#  Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +##
> +
> +[Defines]
> +  INF_VERSION    = 0x0001001B
> +  BASE_NAME      = AcpiPcctLibArm
> +  FILE_GUID      = 38FE945C-D6ED-4CD6-8D20-FCEF3260D15A
> +  VERSION_STRING = 1.0
> +  MODULE_TYPE    = DXE_DRIVER
> +  LIBRARY_CLASS  = NULL|DXE_DRIVER
> +  CONSTRUCTOR    = AcpiPcctLibConstructor
> +  DESTRUCTOR     = AcpiPcctLibDestructor
> +
> +[Sources]
> +  PcctGenerator.c
> +  PcctGenerator.h
> +
> +[Packages]
> +  DynamicTablesPkg/DynamicTablesPkg.dec
> +  EmbeddedPkg/EmbeddedPkg.dec
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +
> +[LibraryClasses]
> +  BaseLib
> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
> new file mode 100644
> index 000000000000..36caf4aaeab7
> --- /dev/null
> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
> @@ -0,0 +1,1186 @@
> +/** @file
> +  PCCT Table Generator
> +
> +  Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +  @par Reference(s):
> +  - ACPI 6.4 Specification - January 2021
> +    s14 PLATFORM COMMUNICATIONS CHANNEL (PCC)
> +
> +**/
> +
> +#include <Library/AcpiLib.h>
> +#include <Library/BaseMemoryLib.h>
> +#include <Library/DebugLib.h>
> +#include <Library/MemoryAllocationLib.h>
> +#include <Protocol/AcpiTable.h>
> +
> +// Module specific include files.
> +#include <AcpiTableGenerator.h>
> +#include <ConfigurationManagerObject.h>
> +#include <ConfigurationManagerHelper.h>
> +#include <Library/TableHelperLib.h>
> +#include <Protocol/ConfigurationManagerProtocol.h>
> +#include "PcctGenerator.h"
> +
> +/** ARM standard PCCT Generator
> +
> +Requirements:
> +  The following Configuration Manager Object(s) are required by
> +  this Generator:
> +  - EArmObjPccSubspaceType0Info
> +  - EArmObjPccSubspaceType1Info
> +  - EArmObjPccSubspaceType2Info
> +  - EArmObjPccSubspaceType3Info
> +  - EArmObjPccSubspaceType4Info
> +  - EArmObjPccSubspaceType5Info
> +*/
> +
> +/** This macro expands to a function that retrieves the PCC
> +    Subspace of Type 0 Information from the Configuration Manager.
> +*/
> +GET_OBJECT_LIST (
> +  EObjNameSpaceArm,
> +  EArmObjPccSubspaceType0Info,
> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO
> +  );
> +
> +/** This macro expands to a function that retrieves the PCC
> +    Subspace of Type 1 Information from the Configuration Manager.
> +*/
> +GET_OBJECT_LIST (
> +  EObjNameSpaceArm,
> +  EArmObjPccSubspaceType1Info,
> +  CM_ARM_PCC_SUBSPACE_TYPE1_INFO
> +  );
> +
> +/** This macro expands to a function that retrieves the PCC
> +    Subspace of Type 2 Information from the Configuration Manager.
> +*/
> +GET_OBJECT_LIST (
> +  EObjNameSpaceArm,
> +  EArmObjPccSubspaceType2Info,
> +  CM_ARM_PCC_SUBSPACE_TYPE2_INFO
> +  );
> +
> +/** This macro expands to a function that retrieves the PCC
> +    Subspace of Type 3 Information from the Configuration Manager.
> +*/
> +GET_OBJECT_LIST (
> +  EObjNameSpaceArm,
> +  EArmObjPccSubspaceType3Info,
> +  CM_ARM_PCC_SUBSPACE_TYPE3_INFO
> +  );
> +
> +/** This macro expands to a function that retrieves the PCC
> +    Subspace of Type 4 Information from the Configuration Manager.
> +*/
> +GET_OBJECT_LIST (
> +  EObjNameSpaceArm,
> +  EArmObjPccSubspaceType4Info,
> +  CM_ARM_PCC_SUBSPACE_TYPE4_INFO
> +  );
> +
> +/** This macro expands to a function that retrieves the PCC
> +    Subspace of Type 5 Information from the Configuration Manager.
> +*/
> +GET_OBJECT_LIST (
> +  EObjNameSpaceArm,
> +  EArmObjPccSubspaceType5Info,
> +  CM_ARM_PCC_SUBSPACE_TYPE5_INFO
> +  );
> +
> +/** The Platform is capable of generating an interrupt
> +    to indicate completion of a command.
> +
> +  Cf: s14.1.1 Platform Communications Channel Global Flags
> +  Platform Interrupt flag
> +  and s14.1.6 Extended PCC subspaces (types 3 and 4)
> +    If a responder subspace is included in the PCCT,
> +    then the global Platform Interrupt flag must be set to 1
> +
> +  Set this variable and populate the PCCT flag accordingly if either:
> +   - One of the PCCT Subspace uses interrupts.
> +   - A PCC Subspace of type 4 is used.
> +*/
> +STATIC BOOLEAN  mHasPlatformInterrupt;
> +
> +/** Initialize the MappingTable.
> +
> +  @param [in] MappingTable  The mapping table structure.
> +  @param [in] Count         Number of entries to allocate in the
> +                            MappingTable.
> +
> +  @retval EFI_SUCCESS            Success.
> +  @retval EFI_INVALID_PARAMETER  Invalid parameter.
> +  @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +MappingTableInitialize (
> +  IN  MAPPING_TABLE  *MappingTable,
> +  IN  UINT32         Count
> +  )
> +{
> +  VOID  **Table;
> +
> +  if ((MappingTable == NULL)  ||
> +      (Count == 0))
> +  {
> +    ASSERT (0);
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  Table = AllocateZeroPool (sizeof (*Table) * Count);
> +  if (Table == NULL) {
> +    ASSERT (0);
> +    return EFI_OUT_OF_RESOURCES;
> +  }
> +
> +  MappingTable->Table    = Table;
> +  MappingTable->MaxIndex = Count;
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/** Free the MappingTable.
> +
> +  @param [in, out]  MappingTable  The mapping table structure.
> +**/
> +STATIC
> +VOID
> +EFIAPI
> +MappingTableFree (
> +  IN  OUT MAPPING_TABLE  *MappingTable
> +  )
> +{
> +  ASSERT (MappingTable != NULL);
> +  ASSERT (MappingTable->Table != NULL);
> +
> +  if (MappingTable->Table != NULL) {
> +    FreePool (MappingTable->Table);
> +  }
> +}
> +
> +/** Add a new entry for CmArmPccSubspace at Index.
> +
> +  @param [in] MappingTable      The mapping table structure.
> +  @param [in] CmArmPccSubspace  Pointer to a CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO.
> +  @param [in] Index             Index at which CmArmPccSubspace must be added.
> +                                This is the Subspace Id.
> +
> +  @retval EFI_SUCCESS            Success.
> +  @retval EFI_BUFFER_TOO_SMALL   Buffer too small.
> +  @retval EFI_INVALID_PARAMETER  Invalid parameter.
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +MappingTableAdd (
> +  IN  MAPPING_TABLE  *MappingTable,
> +  IN  VOID           *CmArmPccSubspace,
> +  IN  UINT32         Index
> +  )
> +{
> +  if ((MappingTable == NULL)        ||
> +      (MappingTable->Table == NULL) ||
> +      (CmArmPccSubspace == NULL))
> +  {
> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  if ((Index >= MappingTable->MaxIndex) ||
> +      (MappingTable->Table[Index] != 0))
> +  {
> +    ASSERT_EFI_ERROR (EFI_BUFFER_TOO_SMALL);
> +    return EFI_BUFFER_TOO_SMALL;
> +  }
> +
> +  // Just map the Pcc Subspace in the Table.
> +  MappingTable->Table[Index] = CmArmPccSubspace;
> +  return EFI_SUCCESS;
> +}
> +
> +/** Parse the CmPccArray objects and add them to the MappingTable.
> +
> +  @param [in] MappingTable     The mapping table structure.
> +  @param [in] CmPccArray       Pointer to an array of CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO.
> +  @param [in] CmPccCount       Count of objects in CmPccArray.
> +
> +  @retval EFI_SUCCESS            Success.
> +  @retval EFI_BUFFER_TOO_SMALL   Buffer too small.
> +  @retval EFI_INVALID_PARAMETER  Invalid parameter.
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +MapPccSubspaceId (
> +  IN  MAPPING_TABLE  *MappingTable,
> +  IN  VOID           *CmPccArray,
> +  IN  UINT32         CmPccCount
> +  )
> +{
> +  EFI_STATUS                 Status;
> +  UINT8                      *PccBuffer;
> +  UINT32                     Index;
> +  UINT32                     CmObjSize;
> +  PCC_SUBSPACE_GENERIC_INFO  *GenericPcc;
> +
> +  if (CmPccCount == 0) {
> +    return EFI_SUCCESS;
> +  }
> +
> +  if ((CmPccArray == NULL) || (MappingTable == NULL)) {
> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  GenericPcc = (PCC_SUBSPACE_GENERIC_INFO *)CmPccArray;
> +
> +  switch (GenericPcc->Type) {
> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC:
> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE0_INFO);
> +      break;
> +
> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS:
> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE1_INFO);
> +      break;
> +
> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS:
> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE2_INFO);
> +      break;
> +
> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC:
> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE3_INFO);
> +      break;
> +
> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC:
> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE4_INFO);
> +      break;
> +
> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE5_INFO);
> +      break;
> +
> +    default:
> +      ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
> +      return EFI_INVALID_PARAMETER;
> +  }
> +
> +  PccBuffer = (UINT8 *)CmPccArray;
> +
> +  // Map the Pcc channel to their Subspace Id.
> +  for (Index = 0; Index < CmPccCount; Index++) {
> +    GenericPcc = (PCC_SUBSPACE_GENERIC_INFO *)PccBuffer;
> +
> +    Status = MappingTableAdd (
> +               MappingTable,
> +               PccBuffer,
> +               GenericPcc->SubspaceId
> +               );
> +    if (EFI_ERROR (Status)) {
> +      ASSERT_EFI_ERROR (Status);
> +      return Status;
> +    }
> +
> +    PccBuffer += CmObjSize;
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/** Add one PCCT Subspace structure of Type 0 (Generic).
> +
> +  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
> +  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
> +
> +  @retval EFI_SUCCESS           Table generated successfully.
> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +AddSubspaceStructType0 (
> +  IN  CM_ARM_PCC_SUBSPACE_TYPE0_INFO      *PccCmObj,
> +  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC  *PccAcpi
> +  )
> +{
> +  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
> +
> +  if ((PccCmObj == NULL) ||
> +      (PccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC)  ||
> +      (PccAcpi == NULL))
> +  {
> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  Doorbell      = &PccCmObj->DoorbellReg;
> +  ChannelTiming = &PccCmObj->ChannelTiming;
> +
> +  PccAcpi->Type                    = PccCmObj->Type;
> +  PccAcpi->Length                  = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC);
> +  *(UINT32 *)&PccAcpi->Reserved[0] = EFI_ACPI_RESERVED_DWORD;
> +  *(UINT16 *)&PccAcpi->Reserved[4] = EFI_ACPI_RESERVED_WORD;
> +  PccAcpi->BaseAddress             = PccCmObj->BaseAddress;
> +  PccAcpi->AddressLength           = PccCmObj->AddressLength;
> +
> +  CopyMem (
> +    &PccAcpi->DoorbellRegister,
> +    &Doorbell->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
> +  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
> +
> +  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
> +  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
> +  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/** Add one PCCT subspace structure of Type 1 (HW-Reduced).
> +
> +  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
> +  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
> +
> +  @retval EFI_SUCCESS           Table generated successfully.
> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +AddSubspaceStructType1 (
> +  IN  CM_ARM_PCC_SUBSPACE_TYPE1_INFO                          *PccCmObj,
> +  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS  *PccAcpi
> +  )
> +{
> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
> +  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
> +
> +  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
> +
> +  if ((PccCmObj == NULL) ||
> +      (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS)  ||
> +      (PccAcpi == NULL))
> +  {
> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  Doorbell      = &GenericPccCmObj->DoorbellReg;
> +  ChannelTiming = &GenericPccCmObj->ChannelTiming;
> +
> +  PccAcpi->Type                   = GenericPccCmObj->Type;
> +  PccAcpi->Length                 = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS);
> +  PccAcpi->PlatformInterrupt      = PccCmObj->PlatIrq.Interrupt;
> +  PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
> +  PccAcpi->Reserved               = EFI_ACPI_RESERVED_BYTE;
> +  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
> +  PccAcpi->AddressLength          = GenericPccCmObj->AddressLength;
> +
> +  CopyMem (
> +    &PccAcpi->DoorbellRegister,
> +    &Doorbell->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
> +  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
> +
> +  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
> +  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
> +  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
> +
> +  if ((PccCmObj->PlatIrq.Interrupt != 0)) {
> +    mHasPlatformInterrupt = TRUE;
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/** Add one PCCT subspace structure of Type 2 (HW-Reduced).
> +
> +  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
> +  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
> +
> +  @retval EFI_SUCCESS           Table generated successfully.
> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +AddSubspaceStructType2 (
> +  IN  CM_ARM_PCC_SUBSPACE_TYPE2_INFO                          *PccCmObj,
> +  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS  *PccAcpi
> +  )
> +{
> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
> +  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
> +  PCC_MAILBOX_REGISTER_INFO         *PlatIrqAck;
> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
> +
> +  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
> +
> +  if ((PccCmObj == NULL) ||
> +      (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS)  ||
> +      (PccAcpi == NULL))
> +  {
> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  Doorbell      = &GenericPccCmObj->DoorbellReg;
> +  PlatIrqAck    = &PccCmObj->PlatIrqAckReg;
> +  ChannelTiming = &GenericPccCmObj->ChannelTiming;
> +
> +  PccAcpi->Type                   = GenericPccCmObj->Type;
> +  PccAcpi->Length                 = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS);
> +  PccAcpi->PlatformInterrupt      = PccCmObj->PlatIrq.Interrupt;
> +  PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
> +  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
> +  PccAcpi->Reserved               = EFI_ACPI_RESERVED_BYTE;
> +  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
> +  PccAcpi->AddressLength          = GenericPccCmObj->AddressLength;
> +
> +  CopyMem (
> +    &PccAcpi->DoorbellRegister,
> +    &Doorbell->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
> +  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
> +
> +  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
> +  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
> +  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
> +
> +  CopyMem (
> +    &PccAcpi->PlatformInterruptAckRegister,
> +    &PlatIrqAck->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->PlatformInterruptAckPreserve = PlatIrqAck->PreserveMask;
> +  PccAcpi->PlatformInterruptAckWrite    = PlatIrqAck->WriteMask;
> +
> +  if ((PccCmObj->PlatIrq.Interrupt != 0)) {
> +    mHasPlatformInterrupt = TRUE;
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/** Add one PCCT subspace structure of Type 3 or 4 (Extended).
> +
> +  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
> +  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
> +
> +  @retval EFI_SUCCESS           Table generated successfully.
> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +AddSubspaceStructType34 (
> +  IN  CM_ARM_PCC_SUBSPACE_TYPE3_INFO             *PccCmObj,
> +  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC  *PccAcpi
> +  )
> +{
> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
> +  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
> +  PCC_MAILBOX_REGISTER_INFO         *PlatIrqAck;
> +  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteCheck;
> +  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteUpdate;
> +  PCC_MAILBOX_REGISTER_INFO         *ErrorStatus;
> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
> +
> +  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
> +
> +  if ((PccCmObj == NULL) ||
> +      ((GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC) &&
> +       (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC)) ||
> +      (PccAcpi == NULL))
> +  {
> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  Doorbell          = &GenericPccCmObj->DoorbellReg;
> +  PlatIrqAck        = &PccCmObj->PlatIrqAckReg;
> +  CmdCompleteCheck  = &PccCmObj->CmdCompleteCheckReg;
> +  CmdCompleteUpdate = &PccCmObj->CmdCompleteUpdateReg;
> +  ErrorStatus       = &PccCmObj->ErrorStatusReg;
> +  ChannelTiming     = &GenericPccCmObj->ChannelTiming;
> +
> +  PccAcpi->Type                   = GenericPccCmObj->Type;
> +  PccAcpi->Length                 = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC);
> +  PccAcpi->PlatformInterrupt      = PccCmObj->PlatIrq.Interrupt;
> +  PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
> +  PccAcpi->Reserved               = EFI_ACPI_RESERVED_BYTE;
> +  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
> +  PccAcpi->AddressLength          = GenericPccCmObj->AddressLength;
> +
> +  CopyMem (
> +    &PccAcpi->DoorbellRegister,
> +    &Doorbell->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
> +  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
> +
> +  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
> +  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
> +  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
> +
> +  CopyMem (
> +    &PccAcpi->PlatformInterruptAckRegister,
> +    &PlatIrqAck->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->PlatformInterruptAckPreserve = PlatIrqAck->PreserveMask;
> +  PccAcpi->PlatformInterruptAckSet      = PlatIrqAck->WriteMask;
> +
> +  PccAcpi->Reserved1[0] = EFI_ACPI_RESERVED_BYTE;
> +  PccAcpi->Reserved1[1] = EFI_ACPI_RESERVED_BYTE;
> +  PccAcpi->Reserved1[1] = EFI_ACPI_RESERVED_BYTE;
> +  PccAcpi->Reserved1[3] = EFI_ACPI_RESERVED_BYTE;
> +  PccAcpi->Reserved1[4] = EFI_ACPI_RESERVED_BYTE;
> +  PccAcpi->Reserved1[5] = EFI_ACPI_RESERVED_BYTE;
> +  PccAcpi->Reserved1[6] = EFI_ACPI_RESERVED_BYTE;
> +  PccAcpi->Reserved1[7] = EFI_ACPI_RESERVED_BYTE;
> +
> +  CopyMem (
> +    &PccAcpi->CommandCompleteCheckRegister,
> +    &CmdCompleteCheck->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->CommandCompleteCheckMask = CmdCompleteCheck->PreserveMask;
> +  // No Write mask.
> +
> +  CopyMem (
> +    &PccAcpi->CommandCompleteUpdateRegister,
> +    &CmdCompleteUpdate->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->CommandCompleteUpdatePreserve = CmdCompleteUpdate->PreserveMask;
> +  PccAcpi->CommandCompleteUpdateSet      = CmdCompleteUpdate->WriteMask;
> +
> +  CopyMem (
> +    &PccAcpi->ErrorStatusRegister,
> +    &ErrorStatus->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->ErrorStatusMask = ErrorStatus->PreserveMask;
> +  // No Write mask.
> +
> +  if (GenericPccCmObj->Type == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
> +    mHasPlatformInterrupt = TRUE;
> +  } else if ((PccCmObj->PlatIrq.Interrupt != 0)) {
> +    mHasPlatformInterrupt = TRUE;
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/** Add one PCCT subspace structure of Type 5 (HW-Registers).
> +
> +  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
> +  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
> +
> +  @retval EFI_SUCCESS           Table generated successfully.
> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +AddSubspaceStructType5 (
> +  IN  CM_ARM_PCC_SUBSPACE_TYPE5_INFO                            *PccCmObj,
> +  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS  *PccAcpi
> +  )
> +{
> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
> +  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
> +  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteCheck;
> +  PCC_MAILBOX_REGISTER_INFO         *ErrorStatus;
> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
> +
> +  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
> +
> +  if ((PccCmObj == NULL) ||
> +      (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS)  ||
> +      (PccAcpi == NULL))
> +  {
> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  Doorbell         = &GenericPccCmObj->DoorbellReg;
> +  CmdCompleteCheck = &PccCmObj->CmdCompleteCheckReg;
> +  ErrorStatus      = &PccCmObj->ErrorStatusReg;
> +  ChannelTiming    = &GenericPccCmObj->ChannelTiming;
> +
> +  PccAcpi->Type                    = GenericPccCmObj->Type;
> +  PccAcpi->Length                  = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS);
> +  PccAcpi->Version                 = PccCmObj->Version;
> +  PccAcpi->BaseAddress             = GenericPccCmObj->BaseAddress;
> +  PccAcpi->SharedMemoryRangeLength = GenericPccCmObj->AddressLength;
> +
> +  CopyMem (
> +    &PccAcpi->DoorbellRegister,
> +    &Doorbell->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
> +  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
> +
> +  CopyMem (
> +    &PccAcpi->CommandCompleteCheckRegister,
> +    &CmdCompleteCheck->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->CommandCompleteCheckMask = CmdCompleteCheck->PreserveMask;
> +  // No Write mask.
> +
> +  CopyMem (
> +    &PccAcpi->ErrorStatusRegister,
> +    &ErrorStatus->Register,
> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
> +    );
> +  PccAcpi->ErrorStatusMask = ErrorStatus->PreserveMask;
> +  // No Write mask.
> +
> +  PccAcpi->NominalLatency = ChannelTiming->NominalLatency;
> +  // No MaximumPeriodicAccessRate.
> +  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/** Populate the PCCT table using the MappingTable.
> +
> +  @param [in] MappingTable  The mapping table structure.
> +  @param [in] Pcc           Pointer to an array of Pcc Subpace structures.
> +  @param [in] Size          Size of the Pcc array.
> +
> +  @retval EFI_SUCCESS           Table generated successfully.
> +  @retval EFI_BUFFER_TOO_SMALL  Buffer too small.
> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +PopulatePcctTable (
> +  IN  MAPPING_TABLE  *MappingTable,
> +  IN  VOID           *Pcc,
> +  IN  UINT32         Size
> +  )
> +{
> +  EFI_STATUS  Status;
> +  UINT8       *PccBuffer;
> +  UINT32      CmObjSize;
> +  UINT32      Index;
> +  UINT32      MaxIndex;
> +  VOID        **Table;
> +  VOID        *CurrentPccSubspace;
> +
> +  ASSERT (MappingTable != NULL);
> +  ASSERT (MappingTable->Table != NULL);
> +
> +  PccBuffer = Pcc;
> +  MaxIndex  = MappingTable->MaxIndex;
> +  Table     = MappingTable->Table;
> +
> +  for (Index = 0; Index < MaxIndex; Index++) {
> +    CurrentPccSubspace = Table[Index];
> +    if (CurrentPccSubspace == NULL) {
> +      ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
> +      return EFI_INVALID_PARAMETER;
> +    }
> +
> +    switch (((PCC_SUBSPACE_GENERIC_INFO *)CurrentPccSubspace)->Type) {
> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC:
> +        Status = AddSubspaceStructType0 (
> +                   (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)CurrentPccSubspace,
> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC *)PccBuffer
> +                   );
> +
> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC);
> +        break;
> +
> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS:
> +        Status = AddSubspaceStructType1 (
> +                   (CM_ARM_PCC_SUBSPACE_TYPE1_INFO *)CurrentPccSubspace,
> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS *)PccBuffer
> +                   );
> +
> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS);
> +        break;
> +
> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS:
> +        Status = AddSubspaceStructType2 (
> +                   (CM_ARM_PCC_SUBSPACE_TYPE2_INFO *)CurrentPccSubspace,
> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS *)PccBuffer
> +                   );
> +
> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS);
> +        break;
> +
> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC:
> +        Status = AddSubspaceStructType34 (
> +                   (CM_ARM_PCC_SUBSPACE_TYPE3_INFO *)CurrentPccSubspace,
> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC *)PccBuffer
> +                   );
> +
> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC);
> +        break;
> +
> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC:
> +        Status = AddSubspaceStructType34 (
> +                   (CM_ARM_PCC_SUBSPACE_TYPE4_INFO *)CurrentPccSubspace,
> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_4_EXTENDED_PCC *)PccBuffer
> +                   );
> +
> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_4_EXTENDED_PCC);
> +        break;
> +
> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
> +        Status = AddSubspaceStructType5 (
> +                   (CM_ARM_PCC_SUBSPACE_TYPE5_INFO *)CurrentPccSubspace,
> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS *)PccBuffer
> +                   );
> +
> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS);
> +        break;
> +
> +      default:
> +        ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
> +        return EFI_INVALID_PARAMETER;
> +    } // switch
> +
> +    if (EFI_ERROR (Status)) {
> +      ASSERT_EFI_ERROR (Status);
> +      return Status;
> +    }
> +
> +    if (Size < CmObjSize) {
> +      ASSERT_EFI_ERROR (EFI_BUFFER_TOO_SMALL);
> +      return EFI_BUFFER_TOO_SMALL;
> +    }
> +
> +    PccBuffer += CmObjSize;
> +    Size      -= CmObjSize;
> +  } // for
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/** Construct the PCCT ACPI table.
> +
> +  Called by the Dynamic Table Manager, this function invokes the
> +  Configuration Manager protocol interface to get the required hardware
> +  information for generating the ACPI table.
> +
> +  If this function allocates any resources then they must be freed
> +  in the FreeXXXXTableResources function.
> +
> +  @param [in]  This           Pointer to the table generator.
> +  @param [in]  AcpiTableInfo  Pointer to the ACPI Table Info.
> +  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
> +                              Protocol Interface.
> +  @param [out] Table          Pointer to the constructed ACPI Table.
> +
> +  @retval EFI_SUCCESS           Table generated successfully.
> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
> +  @retval EFI_NOT_FOUND         The required object was not found.
> +  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
> +                                Manager is less than the Object size for the
> +                                requested object.
> +  @retval EFI_BUFFER_TOO_SMALL   Buffer too small.
> +  @retval EFI_OUT_OF_RESOURCES  Memory allocation failed.
> +**/
> +STATIC
> +EFI_STATUS
> +EFIAPI
> +BuildPcctTable (
> +  IN  CONST ACPI_TABLE_GENERATOR                  *CONST  This,
> +  IN  CONST CM_STD_OBJ_ACPI_TABLE_INFO            *CONST  AcpiTableInfo,
> +  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
> +  OUT       EFI_ACPI_DESCRIPTION_HEADER          **CONST  Table
> +  )
> +{
> +  EFI_STATUS                                                Status;
> +  ACPI_PCCT_GENERATOR                                       *Generator;
> +  UINT32                                                    TableSize;
> +  EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER  *Pcct;
> +  UINT8                                                     *Buffer;
> +
> +  MAPPING_TABLE  *MappingTable;
> +  UINT32         MappingTableCount;
> +
> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO  *PccType0;
> +  UINT32                          PccType0Count;
> +  CM_ARM_PCC_SUBSPACE_TYPE1_INFO  *PccType1;
> +  UINT32                          PccType1Count;
> +  CM_ARM_PCC_SUBSPACE_TYPE2_INFO  *PccType2;
> +  UINT32                          PccType2Count;
> +  CM_ARM_PCC_SUBSPACE_TYPE3_INFO  *PccType3;
> +  UINT32                          PccType3Count;
> +  CM_ARM_PCC_SUBSPACE_TYPE4_INFO  *PccType4;
> +  UINT32                          PccType4Count;
> +  CM_ARM_PCC_SUBSPACE_TYPE5_INFO  *PccType5;
> +  UINT32                          PccType5Count;
> +
> +  ASSERT (This != NULL);
> +  ASSERT (AcpiTableInfo != NULL);
> +  ASSERT (CfgMgrProtocol != NULL);
> +  ASSERT (Table != NULL);
> +  ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
> +  ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
> +
> +  if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
> +      (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
> +  {
> +    DEBUG ((
> +      DEBUG_ERROR,
> +      "ERROR: PCCT: Requested table revision = %d, is not supported."
> +      "Supported table revision: Minimum = %d, Maximum = %d\n",
> +      AcpiTableInfo->AcpiTableRevision,
> +      This->MinAcpiTableRevision,
> +      This->AcpiTableRevision
> +      ));
> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  Generator    = (ACPI_PCCT_GENERATOR *)This;
> +  MappingTable = &Generator->MappingTable;
> +  *Table       = NULL;
> +
> +  // First get all the Pcc Subpace CmObj of type X.
> +
> +  Status = GetEArmObjPccSubspaceType0Info (
> +             CfgMgrProtocol,
> +             CM_NULL_TOKEN,
> +             &PccType0,
> +             &PccType0Count
> +             );
> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Status = GetEArmObjPccSubspaceType1Info (
> +             CfgMgrProtocol,
> +             CM_NULL_TOKEN,
> +             &PccType1,
> +             &PccType1Count
> +             );
> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Status = GetEArmObjPccSubspaceType2Info (
> +             CfgMgrProtocol,
> +             CM_NULL_TOKEN,
> +             &PccType2,
> +             &PccType2Count
> +             );
> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Status = GetEArmObjPccSubspaceType3Info (
> +             CfgMgrProtocol,
> +             CM_NULL_TOKEN,
> +             &PccType3,
> +             &PccType3Count
> +             );
> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Status = GetEArmObjPccSubspaceType4Info (
> +             CfgMgrProtocol,
> +             CM_NULL_TOKEN,
> +             &PccType4,
> +             &PccType4Count
> +             );
> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Status = GetEArmObjPccSubspaceType5Info (
> +             CfgMgrProtocol,
> +             CM_NULL_TOKEN,
> +             &PccType5,
> +             &PccType5Count
> +             );
> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  // Count the number of Pcc Subspaces.
> +  MappingTableCount  = PccType0Count;
> +  MappingTableCount += PccType1Count;
> +  MappingTableCount += PccType2Count;
> +  MappingTableCount += PccType3Count;
> +  MappingTableCount += PccType4Count;
> +  MappingTableCount += PccType5Count;
> +
> +  Status = MappingTableInitialize (MappingTable, MappingTableCount);
> +  if (EFI_ERROR (Status)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  // Map the Subspace Ids for all types.
> +
> +  Status = MapPccSubspaceId (MappingTable, PccType0, PccType0Count);
> +  if (EFI_ERROR (Status)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Status = MapPccSubspaceId (MappingTable, PccType1, PccType1Count);
> +  if (EFI_ERROR (Status)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Status = MapPccSubspaceId (MappingTable, PccType2, PccType2Count);
> +  if (EFI_ERROR (Status)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Status = MapPccSubspaceId (MappingTable, PccType3, PccType3Count);
> +  if (EFI_ERROR (Status)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Status = MapPccSubspaceId (MappingTable, PccType4, PccType4Count);
> +  if (EFI_ERROR (Status)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Status = MapPccSubspaceId (MappingTable, PccType5, PccType5Count);
> +  if (EFI_ERROR (Status)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  // Compute the size of the PCCT table.
> +  TableSize  = sizeof (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER);
> +  TableSize += PccType0Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC);
> +  TableSize += PccType1Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS);
> +  TableSize += PccType2Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS);
> +  TableSize += PccType3Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC);
> +  TableSize += PccType4Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_4_EXTENDED_PCC);
> +  TableSize += PccType5Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS);
> +
> +  // Allocate a Buffer for the PCCT table.
> +  *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize);
> +  if (*Table == NULL) {
> +    Status = EFI_OUT_OF_RESOURCES;
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Pcct = (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER *)*Table;
> +
> +  Status = AddAcpiHeader (
> +             CfgMgrProtocol,
> +             This,
> +             &Pcct->Header,
> +             AcpiTableInfo,
> +             TableSize
> +             );
> +  if (EFI_ERROR (Status)) {
> +    DEBUG ((
> +      DEBUG_ERROR,
> +      "ERROR: PCCT: Failed to add ACPI header. Status = %r\n",
> +      Status
> +      ));
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  Buffer     = (UINT8 *)Pcct;
> +  Buffer    += sizeof (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER);
> +  TableSize -= sizeof (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER);
> +
> +  // Populate the PCCT table by following the Subspace Id mapping.
> +  Status = PopulatePcctTable (MappingTable, Buffer, TableSize);
> +  if (EFI_ERROR (Status)) {
> +    ASSERT_EFI_ERROR (Status);
> +    goto error_handler;
> +  }
> +
> +  // Setup the Reserved fields once mHasPlatformInterrupt hase been populated.
> +  Pcct->Flags    = mHasPlatformInterrupt;
> +  Pcct->Reserved = EFI_ACPI_RESERVED_QWORD;
> +
> +  MappingTableFree (MappingTable);
> +
> +  return Status;
> +
> +error_handler:
> +  DEBUG ((
> +    DEBUG_ERROR,
> +    "ERROR: PCCT: Failed to install table. Status = %r\n",
> +    Status
> +    ));
> +
> +  if (*Table != NULL) {
> +    FreePool (*Table);
> +    *Table = NULL;
> +  }
> +
> +  MappingTableFree (MappingTable);
> +
> +  return Status;
> +}
> +
> +/** Free any resources allocated for constructing the PCCT.
> +
> +  @param [in]      This           Pointer to the table generator.
> +  @param [in]      AcpiTableInfo  Pointer to the ACPI Table Info.
> +  @param [in]      CfgMgrProtocol Pointer to the Configuration Manager
> +                                  Protocol Interface.
> +  @param [in, out] Table          Pointer to the ACPI Table.
> +
> +  @retval EFI_SUCCESS           The resources were freed successfully.
> +  @retval EFI_INVALID_PARAMETER The table pointer is NULL or invalid.
> +**/
> +STATIC
> +EFI_STATUS
> +FreePcctTableResources (
> +  IN      CONST ACPI_TABLE_GENERATOR                  *CONST  This,
> +  IN      CONST CM_STD_OBJ_ACPI_TABLE_INFO            *CONST  AcpiTableInfo,
> +  IN      CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
> +  IN OUT        EFI_ACPI_DESCRIPTION_HEADER          **CONST  Table
> +  )
> +{
> +  ASSERT (This != NULL);
> +  ASSERT (AcpiTableInfo != NULL);
> +  ASSERT (CfgMgrProtocol != NULL);
> +  ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
> +  ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
> +
> +  if ((Table == NULL) || (*Table == NULL)) {
> +    DEBUG ((DEBUG_ERROR, "ERROR: PCCT: Invalid Table Pointer\n"));
> +    ASSERT ((Table != NULL) && (*Table != NULL));
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  FreePool (*Table);
> +  *Table = NULL;
> +  return EFI_SUCCESS;
> +}
> +
> +/** This macro defines the PCCT Table Generator revision.
> +*/
> +#define PCCT_GENERATOR_REVISION  CREATE_REVISION (1, 0)
> +
> +/** The interface for the PCCT Table Generator.
> +*/
> +STATIC
> +ACPI_PCCT_GENERATOR  PcctGenerator = {
> +  // ACPI table generator header
> +  {
> +    // Generator ID
> +    CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdPcct),
> +    // Generator Description
> +    L"ACPI.STD.PCCT.GENERATOR",
> +    // ACPI Table Signature
> +    EFI_ACPI_6_4_PLATFORM_COMMUNICATIONS_CHANNEL_TABLE_SIGNATURE,
> +    // ACPI Table Revision supported by this Generator
> +    EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION,
> +    // Minimum ACPI Table Revision supported by this Generator
> +    EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION,
> +    // Creator ID
> +    TABLE_GENERATOR_CREATOR_ID_ARM,
> +    // Creator Revision
> +    PCCT_GENERATOR_REVISION,
> +    // Build Table function
> +    BuildPcctTable,
> +    // Free Resource function
> +    FreePcctTableResources,
> +    // Extended build function not needed
> +    NULL,
> +    // Extended build function not implemented by the generator.
> +    // Hence extended free resource function is not required.
> +    NULL
> +  },
> +
> +  // Private fields are defined from here.
> +
> +  // Mapping Table
> +  {
> +    // Table
> +    NULL,
> +    // MaxIndex
> +    0,
> +  },
> +};
> +
> +/** Register the Generator with the ACPI Table Factory.
> +
> +  @param [in]  ImageHandle  The handle to the image.
> +  @param [in]  SystemTable  Pointer to the System Table.
> +
> +  @retval EFI_SUCCESS           The Generator is registered.
> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
> +  @retval EFI_ALREADY_STARTED   The Generator for the Table ID
> +                                is already registered.
> +**/
> +EFI_STATUS
> +EFIAPI
> +AcpiPcctLibConstructor (
> +  IN  EFI_HANDLE        ImageHandle,
> +  IN  EFI_SYSTEM_TABLE  *SystemTable
> +  )
> +{
> +  EFI_STATUS  Status;
> +
> +  Status = RegisterAcpiTableGenerator (&PcctGenerator.Header);
> +  DEBUG ((DEBUG_INFO, "PCCT: Register Generator. Status = %r\n", Status));
> +  ASSERT_EFI_ERROR (Status);
> +  return Status;
> +}
> +
> +/** Deregister the Generator from the ACPI Table Factory.
> +
> +  @param [in]  ImageHandle  The handle to the image.
> +  @param [in]  SystemTable  Pointer to the System Table.
> +
> +  @retval EFI_SUCCESS           The Generator is deregistered.
> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
> +  @retval EFI_NOT_FOUND         The Generator is not registered.
> +**/
> +EFI_STATUS
> +EFIAPI
> +AcpiPcctLibDestructor (
> +  IN  EFI_HANDLE        ImageHandle,
> +  IN  EFI_SYSTEM_TABLE  *SystemTable
> +  )
> +{
> +  EFI_STATUS  Status;
> +
> +  Status = DeregisterAcpiTableGenerator (&PcctGenerator.Header);
> +  DEBUG ((DEBUG_INFO, "PCCT: Deregister Generator. Status = %r\n", Status));
> +  ASSERT_EFI_ERROR (Status);
> +  return Status;
> +}
> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
> new file mode 100644
> index 000000000000..0631a1f5b74b
> --- /dev/null
> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
> @@ -0,0 +1,43 @@
> +/** @file
> +  PCCT Table Generator
> +
> +  Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +  @par Reference(s):
> +  - ACPI 6.4 Specification - January 2021
> +    s14 PLATFORM COMMUNICATIONS CHANNEL (PCC)
> +
> +**/
> +
> +#ifndef PCCT_GENERATOR_H_
> +#define PCCT_GENERATOR_H_
> +
> +#pragma pack(1)
> +
> +/** Structure used to map a Pcc Subspace to an index.
> +*/
> +typedef struct MappingTable {
> +  /// Mapping table for Subspace Ids.
> +  /// Subspace ID/Index <-> CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO pointer
> +  VOID      **Table;
> +
> +  /// Number of entries in the Table.
> +  UINT32    MaxIndex;
> +} MAPPING_TABLE;
> +
> +/** A structure holding the Pcct generator and additional private data.
> +*/
> +typedef struct AcpiPcctGenerator {
> +  /// ACPI Table generator header
> +  ACPI_TABLE_GENERATOR    Header;
> +
> +  // Private fields are defined from here.
> +
> +  /// Table to map: Subspace ID/Index <-> CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO pointer
> +  MAPPING_TABLE           MappingTable;
> +} ACPI_PCCT_GENERATOR;
> +
> +#pragma pack()
> +
> +#endif // PCCT_GENERATOR_H_
> diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> index 21d1f3f08b16..4d7aa7963fae 100644
> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c

[SAMI] The changes in ConfigurationManagerObjectParser.c should be in 
the previous patch 10/14. Otherise it would break git bisect.

If you agree, I will move the changes in 
ConfigurationManagerObjectParser.c in patch 10/14 before merging.

[/SAMI]

> @@ -539,7 +539,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmCpcInfoParser[] = {
>     { "NominalFrequencyInteger",               4,                                               "0x%lx", NULL },
>   };
>   
> -/** A parser for the CM_ARM_MAILBOX_REGISTER_INFO struct.
> +/** A parser for the PCC_MAILBOX_REGISTER_INFO struct.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmMailboxRegisterInfoParser[] = {
>     { "Register",     sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE), NULL,     NULL,
> @@ -548,7 +548,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmMailboxRegisterInfoParser[] = {
>     { "WriteMask",    8,                                               "0x%llx", NULL },
>   };
>   
> -/** A parser for the CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO struct.
> +/** A parser for the PCC_SUBSPACE_CHANNEL_TIMING_INFO struct.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceChannelTimingInfoParser[] = {
>     { "NominalLatency",           4, "0x%x", NULL },
> @@ -559,14 +559,14 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceChannelTimingInfoParser[] = {
>   /** A parser for EArmObjPccSubspaceType0Info.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType0InfoParser[] = {
> -  { "SubspaceId",    1,                                                "0x%x",   NULL },
> -  { "Type",          1,                                                "0x%x",   NULL },
> -  { "BaseAddress",   8,                                                "0x%llx", NULL },
> -  { "AddressLength", 8,                                                "0x%llx", NULL },
> -  { "DoorbellReg",   sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +  { "SubspaceId",    1,                                         "0x%x",   NULL },
> +  { "Type",          1,                                         "0x%x",   NULL },
> +  { "BaseAddress",   8,                                         "0x%llx", NULL },
> +  { "AddressLength", 8,                                         "0x%llx", NULL },
> +  { "DoorbellReg",   sizeof (PCC_MAILBOX_REGISTER_INFO),
>       NULL, NULL, CmArmMailboxRegisterInfoParser,
>       ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> -  { "DoorbellReg",   sizeof (CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO),
> +  { "DoorbellReg",   sizeof (PCC_SUBSPACE_CHANNEL_TIMING_INFO),
>       NULL, NULL, CmArmPccSubspaceChannelTimingInfoParser,
>       ARRAY_SIZE (CmArmPccSubspaceChannelTimingInfoParser) },
>   };
> @@ -574,7 +574,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType0InfoParser[] = {
>   /** A parser for EArmObjPccSubspaceType1Info.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
> -  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
> +  { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
>       NULL, NULL, CmArmPccSubspaceType0InfoParser,
>       ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
>     { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),
> @@ -585,12 +585,12 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
>   /** A parser for EArmObjPccSubspaceType2Info.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
> -  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
> +  { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
>       NULL, NULL, CmArmPccSubspaceType0InfoParser,
>       ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
> -  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
> +  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,NULL,
>       CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
> -  { "PlatIrqAckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +  { "PlatIrqAckReg",  sizeof (PCC_MAILBOX_REGISTER_INFO),
>       NULL, NULL, CmArmMailboxRegisterInfoParser,
>       ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>   };
> @@ -598,21 +598,21 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
>   /** A parser for EArmObjPccSubspaceType3Info or EArmObjPccSubspaceType4Info.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
> -  { "GenericPccInfo",       sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
> +  { "GenericPccInfo",       sizeof (PCC_SUBSPACE_GENERIC_INFO),
>       NULL, NULL, CmArmPccSubspaceType0InfoParser,
>       ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
> -  { "PlatIrq",              sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
> +  { "PlatIrq",              sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,NULL,
>       CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
> -  { "PlatIrqAckReg",        sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +  { "PlatIrqAckReg",        sizeof (PCC_MAILBOX_REGISTER_INFO),
>       NULL, NULL, CmArmMailboxRegisterInfoParser,
>       ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> -  { "CmdCompleteCheckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +  { "CmdCompleteCheckReg",  sizeof (PCC_MAILBOX_REGISTER_INFO),
>       NULL, NULL, CmArmMailboxRegisterInfoParser,
>       ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> -  { "CmdCompleteUpdateReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +  { "CmdCompleteUpdateReg", sizeof (PCC_MAILBOX_REGISTER_INFO),
>       NULL, NULL, CmArmMailboxRegisterInfoParser,
>       ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> -  { "ErrorStatusReg",       sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +  { "ErrorStatusReg",       sizeof (PCC_MAILBOX_REGISTER_INFO),
>       NULL, NULL, CmArmMailboxRegisterInfoParser,
>       ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>   };
> @@ -620,16 +620,16 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
>   /** A parser for EArmObjPccSubspaceType5Info.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType5InfoParser[] = {
> -  { "GenericPccInfo",      sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
> +  { "GenericPccInfo",      sizeof (PCC_SUBSPACE_GENERIC_INFO),
>       NULL, NULL, CmArmPccSubspaceType0InfoParser,
>       ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
> -  { "Version",             2,                                        "0x%x",NULL },
> -  { "PlatIrq",             sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,  NULL,
> +  { "Version",             2,                                 "0x%x",NULL },
> +  { "PlatIrq",             sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,  NULL,
>       CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
> -  { "CmdCompleteCheckReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +  { "CmdCompleteCheckReg", sizeof (PCC_MAILBOX_REGISTER_INFO),
>       NULL, NULL, CmArmMailboxRegisterInfoParser,
>       ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
> -  { "ErrorStatusReg",      sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
> +  { "ErrorStatusReg",      sizeof (PCC_MAILBOX_REGISTER_INFO),
>       NULL, NULL, CmArmMailboxRegisterInfoParser,
>       ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>   };

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

* Re: [PATCH 01/14] DynamicTablesPkg: Use correct print formatter
  2022-10-10  9:20 ` [PATCH 01/14] DynamicTablesPkg: Use correct print formatter PierreGondois
@ 2022-10-26 12:36   ` Sami Mujawar
  0 siblings, 0 replies; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:36 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

Thank you for this patch.

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

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> In C, the 'long long' types are 64-bits. The 'll' printf length
> specifier should be used to pring these values. Just '%x' allows to
> print values that are on 16-bits or more. Use that instead.
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   .../ConfigurationManagerObjectParser.c             | 14 +++++++-------
>   1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> index 08b4f60dfbae..13e6c0e321c4 100644
> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> @@ -1,7 +1,7 @@
>   /** @file
>     Configuration Manager Object parser.
>   
> -  Copyright (c) 2021, ARM Limited. All rights reserved.<BR>
> +  Copyright (c) 2021 - 2022, ARM Limited. All rights reserved.<BR>
>     SPDX-License-Identifier: BSD-2-Clause-Patent
>   
>   **/
> @@ -384,12 +384,12 @@ STATIC CONST CM_OBJ_PARSER  AcpiGenericAddressParser[] = {
>   /** A parser for EArmObjLpiInfo.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmLpiInfoParser[] = {
> -  { "MinResidency",             4,                                               "0x%llx", NULL },
> -  { "WorstCaseWakeLatency",     4,                                               "0x%llx", NULL },
> -  { "Flags",                    4,                                               "0x%llx", NULL },
> -  { "ArchFlags",                4,                                               "0x%llx", NULL },
> -  { "ResCntFreq",               4,                                               "0x%llx", NULL },
> -  { "EnableParentState",        4,                                               "0x%llx", NULL },
> +  { "MinResidency",             4,                                               "0x%x",   NULL },
> +  { "WorstCaseWakeLatency",     4,                                               "0x%x",   NULL },
> +  { "Flags",                    4,                                               "0x%x",   NULL },
> +  { "ArchFlags",                4,                                               "0x%x",   NULL },
> +  { "ResCntFreq",               4,                                               "0x%x",   NULL },
> +  { "EnableParentState",        4,                                               "0x%x",   NULL },
>     { "IsInteger",                1,                                               "%d",     NULL },
>     { "IntegerEntryMethod",       8,                                               "0x%llx", NULL },
>     { "RegisterEntryMethod",      sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),

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

* Re: [PATCH 02/14] DynamicTablesPkg: Add PrintString to CmObjParser
  2022-10-10  9:20 ` [PATCH 02/14] DynamicTablesPkg: Add PrintString to CmObjParser PierreGondois
@ 2022-10-26 12:36   ` Sami Mujawar
  0 siblings, 0 replies; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:36 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

Thank you for this patch.

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

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> Add a PrintString to print strings in the CmObjParser.
> String must be NULL terminated and no buffer overrun check
> is done by this function.
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   .../ConfigurationManagerObjectParser.c        | 26 +++++++++++++++++++
>   1 file changed, 26 insertions(+)
>
> diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> index 13e6c0e321c4..b46f19693bb5 100644
> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> @@ -19,6 +19,14 @@ PrintOemId (
>     UINT8        *Ptr
>     );
>   
> +STATIC
> +VOID
> +EFIAPI
> +PrintString (
> +  CONST CHAR8  *Format,
> +  UINT8        *Ptr
> +  );
> +
>   /** A parser for EArmObjBootArchInfo.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmBootArchInfoParser[] = {
> @@ -646,6 +654,24 @@ PrintOemId (
>       ));
>   }
>   
> +/** Print string.
> +
> +  The string must be NULL terminated.
> +
> +  @param [in]  Format  Format to print the Ptr.
> +  @param [in]  Ptr     Pointer to the string.
> +**/
> +STATIC
> +VOID
> +EFIAPI
> +PrintString (
> +  CONST CHAR8  *Format,
> +  UINT8        *Ptr
> +  )
> +{
> +  DEBUG ((DEBUG_ERROR, "%a", Ptr));
> +}
> +
>   /** Print fields of the objects.
>   
>     @param [in]  Data           Pointer to the object to print.

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

* Re: [PATCH 04/14] DynamicTablesPkg: Update CmObjParser for MinorRevision
  2022-10-10  9:20 ` [PATCH 04/14] DynamicTablesPkg: Update CmObjParser for MinorRevision PierreGondois
@ 2022-10-26 12:36   ` Sami Mujawar
  0 siblings, 0 replies; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:36 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

Thank you for this patch.

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

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> commit 0d23c447d6f5 ("DynamicTablesPkg: Add support to specify FADT
> minor revision")
> adds new 'MinorRevision' field to CM_STD_OBJ_ACPI_TABLE_INFO.
> Reflect the change in this patch to the CmObjectParser.
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   .../Common/TableHelperLib/ConfigurationManagerObjectParser.c   | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> index 80ebb0708661..f82541240ae0 100644
> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> @@ -639,7 +639,8 @@ STATIC CONST CM_OBJ_PARSER  StdObjAcpiTableInfoParser[] = {
>     { "TableGeneratorId",   sizeof (ACPI_TABLE_GENERATOR_ID),       "0x%x",   NULL },
>     { "AcpiTableData",      sizeof (EFI_ACPI_DESCRIPTION_HEADER *), "0x%p",   NULL },
>     { "OemTableId",         8,                                      "0x%LLX", NULL },
> -  { "OemRevision",        4,                                      "0x%x",   NULL }
> +  { "OemRevision",        4,                                      "0x%x",   NULL },
> +  { "MinorRevision",      1,                                      "0x%x",   NULL },
>   };
>   
>   /** A parser for EStdObjSmbiosTableList.

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

* Re: [PATCH 05/14] DynamicTablesPkg: Fix GTBlock and GTBlockTimerFrame CmObjParsers
  2022-10-10  9:20 ` [PATCH 05/14] DynamicTablesPkg: Fix GTBlock and GTBlockTimerFrame CmObjParsers PierreGondois
@ 2022-10-26 12:37   ` Sami Mujawar
  0 siblings, 0 replies; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:37 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

Thank you for this patch.

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

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> The CmObjParsers of the following objects was inverted, probably
> due to a wrong ordering placement in the file defining the structures:
> -EArmObjGTBlockTimerFrameInfo
> -EArmObjPlatformGTBlockInfo
>
> Assign the correct parser for each object, and re-order the
> structures in the file defining them.
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   .../Include/ArmNameSpaceObjects.h             | 32 +++++++++----------
>   .../ConfigurationManagerObjectParser.c        | 22 ++++++-------
>   2 files changed, 27 insertions(+), 27 deletions(-)
>
> diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> index c66b441d532d..cd39e609d6c4 100644
> --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> @@ -353,6 +353,22 @@ typedef struct CmArmGenericTimerInfo {
>     UINT32    VirtualPL2TimerFlags;
>   } CM_ARM_GENERIC_TIMER_INFO;
>   
> +/** A structure that describes the
> +    Platform Generic Block Timer information for the Platform.
> +
> +    ID: EArmObjPlatformGTBlockInfo
> +*/
> +typedef struct CmArmGTBlockInfo {
> +  /// The physical base address for the GT Block Timer structure
> +  UINT64             GTBlockPhysicalAddress;
> +
> +  /// The number of timer frames implemented in the GT Block
> +  UINT32             GTBlockTimerFrameCount;
> +
> +  /// Reference token for the GT Block timer frame list
> +  CM_OBJECT_TOKEN    GTBlockTimerFrameToken;
> +} CM_ARM_GTBLOCK_INFO;
> +
>   /** A structure that describes the
>       Platform Generic Block Timer Frame information for the Platform.
>   
> @@ -390,22 +406,6 @@ typedef struct CmArmGTBlockTimerFrameInfo {
>     UINT32    CommonFlags;
>   } CM_ARM_GTBLOCK_TIMER_FRAME_INFO;
>   
> -/** A structure that describes the
> -    Platform Generic Block Timer information for the Platform.
> -
> -    ID: EArmObjPlatformGTBlockInfo
> -*/
> -typedef struct CmArmGTBlockInfo {
> -  /// The physical base address for the GT Block Timer structure
> -  UINT64             GTBlockPhysicalAddress;
> -
> -  /// The number of timer frames implemented in the GT Block
> -  UINT32             GTBlockTimerFrameCount;
> -
> -  /// Reference token for the GT Block timer frame list
> -  CM_OBJECT_TOKEN    GTBlockTimerFrameToken;
> -} CM_ARM_GTBLOCK_INFO;
> -
>   /** A structure that describes the
>       Arm Generic Watchdog information for the Platform.
>   
> diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> index f82541240ae0..040aaa4cbb17 100644
> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> @@ -127,6 +127,14 @@ STATIC CONST CM_OBJ_PARSER  CmArmGenericTimerInfoParser[] = {
>   
>   /** A parser for EArmObjPlatformGTBlockInfo.
>   */
> +STATIC CONST CM_OBJ_PARSER  CmArmGTBlockInfoParser[] = {
> +  { "GTBlockPhysicalAddress", 8,                        "0x%llx", NULL },
> +  { "GTBlockTimerFrameCount", 4,                        "0x%x",   NULL },
> +  { "GTBlockTimerFrameToken", sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL }
> +};
> +
> +/** A parser for EArmObjGTBlockTimerFrameInfo.
> +*/
>   STATIC CONST CM_OBJ_PARSER  CmArmGTBlockTimerFrameInfoParser[] = {
>     { "FrameNumber",               1, "0x%x",   NULL },
>     { "PhysicalAddressCntBase",    8, "0x%llx", NULL },
> @@ -138,14 +146,6 @@ STATIC CONST CM_OBJ_PARSER  CmArmGTBlockTimerFrameInfoParser[] = {
>     { "CommonFlags",               4, "0x%x",   NULL }
>   };
>   
> -/** A parser for EArmObjGTBlockTimerFrameInfo.
> -*/
> -STATIC CONST CM_OBJ_PARSER  CmArmGTBlockInfoParser[] = {
> -  { "GTBlockPhysicalAddress", 8,                        "0x%llx", NULL },
> -  { "GTBlockTimerFrameCount", 4,                        "0x%x",   NULL },
> -  { "GTBlockTimerFrameToken", sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL }
> -};
> -
>   /** A parser for EArmObjPlatformGenericWatchdogInfo.
>   */
>   STATIC CONST CM_OBJ_PARSER  CmArmGenericWatchdogInfoParser[] = {
> @@ -560,10 +560,10 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
>       ARRAY_SIZE (CmArmSerialPortInfoParser) },
>     { "EArmObjGenericTimerInfo",             CmArmGenericTimerInfoParser,
>       ARRAY_SIZE (CmArmGenericTimerInfoParser) },
> -  { "EArmObjPlatformGTBlockInfo",          CmArmGTBlockTimerFrameInfoParser,
> -    ARRAY_SIZE (CmArmGTBlockTimerFrameInfoParser) },
> -  { "EArmObjGTBlockTimerFrameInfo",        CmArmGTBlockInfoParser,
> +  { "EArmObjPlatformGTBlockInfo",          CmArmGTBlockInfoParser,
>       ARRAY_SIZE (CmArmGTBlockInfoParser) },
> +  { "EArmObjGTBlockTimerFrameInfo",        CmArmGTBlockTimerFrameInfoParser,
> +    ARRAY_SIZE (CmArmGTBlockTimerFrameInfoParser) },
>     { "EArmObjPlatformGenericWatchdogInfo",  CmArmGenericWatchdogInfoParser,
>       ARRAY_SIZE (CmArmGenericWatchdogInfoParser) },
>     { "EArmObjPciConfigSpaceInfo",           CmArmPciConfigSpaceInfoParser,

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

* Re: [PATCH 07/14] DynamicTablesPkg: Remove deprecated APIs
  2022-10-10  9:20 ` [PATCH 07/14] DynamicTablesPkg: Remove deprecated APIs PierreGondois
@ 2022-10-26 12:37   ` Sami Mujawar
  0 siblings, 0 replies; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:37 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

Thank you for this patch.

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

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> commit 691c5f776274 ("DynamicTablesPkg: Deprecate Crs specific methods
> in AmlLib")
> deprecates some APIs. Finally remove them.
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   .../Include/Library/AmlLib/AmlLib.h           | 138 ------------------
>   .../Library/Common/AmlLib/Api/AmlApi.c        |  85 -----------
>   .../AmlLib/CodeGen/AmlResourceDataCodeGen.c   |  76 ----------
>   3 files changed, 299 deletions(-)
>
> diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> index 0d8446d78256..9210c5091548 100644
> --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> @@ -1390,142 +1390,4 @@ AmlCreateCpcNode (
>     OUT AML_OBJECT_NODE_HANDLE  *NewCpcNode   OPTIONAL
>     );
>   
> -// DEPRECATED APIS
> -#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
> -
> -/** DEPRECATED API
> -
> -  Get the first Resource Data element contained in a "_CRS" object.
> -
> -  In the following ASL code, the function will return the Resource Data
> -  node corresponding to the "QWordMemory ()" ASL macro.
> -  Name (_CRS, ResourceTemplate() {
> -      QWordMemory (...) {...},
> -      Interrupt (...) {...}
> -    }
> -  )
> -
> -  Note:
> -   - The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
> -   - "_CRS" declared using ASL "Method (Declare Control Method)" is not
> -     supported.
> -
> -  @ingroup UserApis
> -
> -  @param  [in] NameOpCrsNode  NameOp object node defining a "_CRS" object.
> -                              Must have an OpCode=AML_NAME_OP, SubOpCode=0.
> -                              NameOp object nodes are defined in ASL
> -                              using the "Name ()" function.
> -  @param  [out] OutRdNode     Pointer to the first Resource Data element of
> -                              the "_CRS" object. A Resource Data element
> -                              is stored in a data node.
> -
> -  @retval EFI_SUCCESS             The function completed successfully.
> -  @retval EFI_INVALID_PARAMETER   Invalid parameter.
> -**/
> -EFI_STATUS
> -EFIAPI
> -AmlNameOpCrsGetFirstRdNode (
> -  IN  AML_OBJECT_NODE_HANDLE  NameOpCrsNode,
> -  OUT AML_DATA_NODE_HANDLE    *OutRdNode
> -  );
> -
> -/** DEPRECATED API
> -
> -  Get the Resource Data element following the CurrRdNode Resource Data.
> -
> -  In the following ASL code, if CurrRdNode corresponds to the first
> -  "QWordMemory ()" ASL macro, the function will return the Resource Data
> -  node corresponding to the "Interrupt ()" ASL macro.
> -  Name (_CRS, ResourceTemplate() {
> -      QwordMemory (...) {...},
> -      Interrupt (...) {...}
> -    }
> -  )
> -
> -  The CurrRdNode Resource Data node must be defined in an object named "_CRS"
> -  and defined by a "Name ()" ASL function.
> -
> -  @ingroup UserApis
> -
> -  @param  [in]  CurrRdNode   Pointer to the current Resource Data element of
> -                             the "_CRS" variable.
> -  @param  [out] OutRdNode    Pointer to the Resource Data element following
> -                             the CurrRdNode.
> -                             Contain a NULL pointer if CurrRdNode is the
> -                             last Resource Data element in the list.
> -                             The "End Tag" is not considered as a resource
> -                             data element and is not returned.
> -
> -  @retval EFI_SUCCESS             The function completed successfully.
> -  @retval EFI_INVALID_PARAMETER   Invalid parameter.
> -**/
> -EFI_STATUS
> -EFIAPI
> -AmlNameOpCrsGetNextRdNode (
> -  IN  AML_DATA_NODE_HANDLE  CurrRdNode,
> -  OUT AML_DATA_NODE_HANDLE  *OutRdNode
> -  );
> -
> -/** DEPRECATED API
> -
> -  Add an Interrupt Resource Data node.
> -
> -  This function creates a Resource Data element corresponding to the
> -  "Interrupt ()" ASL function, stores it in an AML Data Node.
> -
> -  It then adds it after the input CurrRdNode in the list of resource data
> -  element.
> -
> -  The Resource Data effectively created is an Extended Interrupt Resource
> -  Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
> -  for more information about Extended Interrupt Resource Data.
> -
> -  The Extended Interrupt contains one single interrupt.
> -
> -  This function allocates memory to create a data node. It is the caller's
> -  responsibility to either:
> -   - attach this node to an AML tree;
> -   - delete this node.
> -
> -  Note: The _CRS node must be defined using the ASL Name () function.
> -        e.g. Name (_CRS, ResourceTemplate () {
> -               ...
> -             }
> -
> -  @ingroup CodeGenApis
> -
> -  @param  [in]  NameOpCrsNode    NameOp object node defining a "_CRS" object.
> -                                 Must have an OpCode=AML_NAME_OP, SubOpCode=0.
> -                                 NameOp object nodes are defined in ASL
> -                                 using the "Name ()" function.
> -  @param  [in]  ResourceConsumer The device consumes the specified interrupt
> -                                 or produces it for use by a child device.
> -  @param  [in]  EdgeTriggered    The interrupt is edge triggered or
> -                                 level triggered.
> -  @param  [in]  ActiveLow        The interrupt is active-high or active-low.
> -  @param  [in]  Shared           The interrupt can be shared with other
> -                                 devices or not (Exclusive).
> -  @param  [in]  IrqList          Interrupt list. Must be non-NULL.
> -  @param  [in]  IrqCount         Interrupt count. Must be non-zero.
> -
> -
> -  @retval EFI_SUCCESS             The function completed successfully.
> -  @retval EFI_INVALID_PARAMETER   Invalid parameter.
> -  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.
> -**/
> -EFI_STATUS
> -EFIAPI
> -AmlCodeGenCrsAddRdInterrupt (
> -  IN  AML_OBJECT_NODE_HANDLE  NameOpCrsNode,
> -  IN  BOOLEAN                 ResourceConsumer,
> -  IN  BOOLEAN                 EdgeTriggered,
> -  IN  BOOLEAN                 ActiveLow,
> -  IN  BOOLEAN                 Shared,
> -  IN  UINT32                  *IrqList,
> -  IN  UINT8                   IrqCount
> -  );
> -
> -#endif // DISABLE_NEW_DEPRECATED_INTERFACES
> -
>   #endif // AML_LIB_H_
> diff --git a/DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApi.c b/DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApi.c
> index 519afdc1eafa..9f162abe2d09 100644
> --- a/DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApi.c
> +++ b/DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApi.c
> @@ -429,88 +429,3 @@ AmlAttachNode (
>   {
>     return AmlVarListAddTail (ParentNode, NewNode);
>   }
> -
> -// DEPRECATED APIS
> -#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
> -
> -/** DEPRECATED API
> -
> -  Get the first Resource Data element contained in a "_CRS" object.
> -
> -  In the following ASL code, the function will return the Resource Data
> -  node corresponding to the "QWordMemory ()" ASL macro.
> -  Name (_CRS, ResourceTemplate() {
> -      QWordMemory (...) {...},
> -      Interrupt (...) {...}
> -    }
> -  )
> -
> -  Note:
> -   - The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
> -   - "_CRS" declared using ASL "Method (Declare Control Method)" is not
> -     supported.
> -
> -  @ingroup UserApis
> -
> -  @param  [in] NameOpCrsNode  NameOp object node defining a "_CRS" object.
> -                              Must have an OpCode=AML_NAME_OP, SubOpCode=0.
> -                              NameOp object nodes are defined in ASL
> -                              using the "Name ()" function.
> -  @param  [out] OutRdNode     Pointer to the first Resource Data element of
> -                              the "_CRS" object. A Resource Data element
> -                              is stored in a data node.
> -
> -  @retval EFI_SUCCESS             The function completed successfully.
> -  @retval EFI_INVALID_PARAMETER   Invalid parameter.
> -**/
> -EFI_STATUS
> -EFIAPI
> -AmlNameOpCrsGetFirstRdNode (
> -  IN  AML_OBJECT_NODE_HANDLE  NameOpCrsNode,
> -  OUT AML_DATA_NODE_HANDLE    *OutRdNode
> -  )
> -{
> -  return AmlNameOpGetFirstRdNode (NameOpCrsNode, OutRdNode);
> -}
> -
> -/** DEPRECATED API
> -
> -  Get the Resource Data element following the CurrRdNode Resource Data.
> -
> -  In the following ASL code, if CurrRdNode corresponds to the first
> -  "QWordMemory ()" ASL macro, the function will return the Resource Data
> -  node corresponding to the "Interrupt ()" ASL macro.
> -  Name (_CRS, ResourceTemplate() {
> -      QwordMemory (...) {...},
> -      Interrupt (...) {...}
> -    }
> -  )
> -
> -  The CurrRdNode Resource Data node must be defined in an object named "_CRS"
> -  and defined by a "Name ()" ASL function.
> -
> -  @ingroup UserApis
> -
> -  @param  [in]  CurrRdNode   Pointer to the current Resource Data element of
> -                             the "_CRS" variable.
> -  @param  [out] OutRdNode    Pointer to the Resource Data element following
> -                             the CurrRdNode.
> -                             Contain a NULL pointer if CurrRdNode is the
> -                             last Resource Data element in the list.
> -                             The "End Tag" is not considered as a resource
> -                             data element and is not returned.
> -
> -  @retval EFI_SUCCESS             The function completed successfully.
> -  @retval EFI_INVALID_PARAMETER   Invalid parameter.
> -**/
> -EFI_STATUS
> -EFIAPI
> -AmlNameOpCrsGetNextRdNode (
> -  IN  AML_DATA_NODE_HANDLE  CurrRdNode,
> -  OUT AML_DATA_NODE_HANDLE  *OutRdNode
> -  )
> -{
> -  return AmlNameOpGetNextRdNode (CurrRdNode, OutRdNode);
> -}
> -
> -#endif // DISABLE_NEW_DEPRECATED_INTERFACES
> diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
> index 32c3ab534d0b..332962bed441 100644
> --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
> +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
> @@ -1406,79 +1406,3 @@ error_handler:
>   
>     return Status;
>   }
> -
> -// DEPRECATED APIS
> -#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
> -
> -/** DEPRECATED API
> -
> -  Add an Interrupt Resource Data node.
> -
> -  This function creates a Resource Data element corresponding to the
> -  "Interrupt ()" ASL function, stores it in an AML Data Node.
> -
> -  It then adds it after the input CurrRdNode in the list of resource data
> -  element.
> -
> -  The Resource Data effectively created is an Extended Interrupt Resource
> -  Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
> -  for more information about Extended Interrupt Resource Data.
> -
> -  The Extended Interrupt contains one single interrupt.
> -
> -  This function allocates memory to create a data node. It is the caller's
> -  responsibility to either:
> -   - attach this node to an AML tree;
> -   - delete this node.
> -
> -  Note: The _CRS node must be defined using the ASL Name () function.
> -        e.g. Name (_CRS, ResourceTemplate () {
> -               ...
> -             }
> -
> -  @ingroup UserApis
> -
> -  @param  [in]  NameOpCrsNode    NameOp object node defining a "_CRS" object.
> -                                 Must have an OpCode=AML_NAME_OP, SubOpCode=0.
> -                                 NameOp object nodes are defined in ASL
> -                                 using the "Name ()" function.
> -  @param  [in]  ResourceConsumer The device consumes the specified interrupt
> -                                 or produces it for use by a child device.
> -  @param  [in]  EdgeTriggered    The interrupt is edge triggered or
> -                                 level triggered.
> -  @param  [in]  ActiveLow        The interrupt is active-high or active-low.
> -  @param  [in]  Shared           The interrupt can be shared with other
> -                                 devices or not (Exclusive).
> -  @param  [in]  IrqList          Interrupt list. Must be non-NULL.
> -  @param  [in]  IrqCount         Interrupt count. Must be non-zero.
> -
> -
> -  @retval EFI_SUCCESS             The function completed successfully.
> -  @retval EFI_INVALID_PARAMETER   Invalid parameter.
> -  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.
> -**/
> -EFI_STATUS
> -EFIAPI
> -AmlCodeGenCrsAddRdInterrupt (
> -  IN  AML_OBJECT_NODE_HANDLE  NameOpCrsNode,
> -  IN  BOOLEAN                 ResourceConsumer,
> -  IN  BOOLEAN                 EdgeTriggered,
> -  IN  BOOLEAN                 ActiveLow,
> -  IN  BOOLEAN                 Shared,
> -  IN  UINT32                  *IrqList,
> -  IN  UINT8                   IrqCount
> -  )
> -{
> -  return AmlCodeGenRdInterrupt (
> -           ResourceConsumer,
> -           EdgeTriggered,
> -           ActiveLow,
> -           Shared,
> -           IrqList,
> -           IrqCount,
> -           NameOpCrsNode,
> -           NULL
> -           );
> -}
> -
> -#endif // DISABLE_NEW_DEPRECATED_INTERFACES

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

* Re: [PATCH 08/14] DynamicTablesPkg: FdtHwInfoParserLib: Remove wrong comment
  2022-10-10  9:20 ` [PATCH 08/14] DynamicTablesPkg: FdtHwInfoParserLib: Remove wrong comment PierreGondois
@ 2022-10-26 12:37   ` Sami Mujawar
  0 siblings, 0 replies; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:37 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

Thank you for this patch.

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

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> commit 13136cc3111f ("DynamicTablesPkg: FdtHwInfoParserLib:
> Parse Pmu info")
> adds support for pmu parsing. Thus, remove the wrong comment.
>
> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
> ---
>   .../Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c             | 3 ---
>   .../Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h             | 3 ---
>   2 files changed, 6 deletions(-)
>
> diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c
> index fb01aa0d19e2..2c72bd0c582e 100644
> --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c
> +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.c
> @@ -785,9 +785,6 @@ GicCPmuNodeParser (
>       UINT32  AffinityFlags;                    // {default = 0}
>     } CM_ARM_GICC_INFO;
>   
> -  The pmu information can be found in the pmu node. There is no support
> -  for now.
> -
>     A parser parses a Device Tree to populate a specific CmObj type. None,
>     one or many CmObj can be created by the parser.
>     The created CmObj are then handed to the parser's caller through the
> diff --git a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h
> index fd980484a28d..539f39cecb22 100644
> --- a/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h
> +++ b/DynamicTablesPkg/Library/FdtHwInfoParserLib/Gic/ArmGicCParser.h
> @@ -41,9 +41,6 @@
>       UINT32  AffinityFlags;                    // {default = 0}
>     } CM_ARM_GICC_INFO;
>   
> -  The pmu information can be found in the pmu node. There is no support
> -  for now.
> -
>     A parser parses a Device Tree to populate a specific CmObj type. None,
>     one or many CmObj can be created by the parser.
>     The created CmObj are then handed to the parser's caller through the

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

* Re: [PATCH 09/14] DynamicTablesPkg: Fix Ssdt PCI generation comments
  2022-10-10  9:20 ` [PATCH 09/14] DynamicTablesPkg: Fix Ssdt PCI generation comments PierreGondois
@ 2022-10-26 12:37   ` Sami Mujawar
  0 siblings, 0 replies; 37+ messages in thread
From: Sami Mujawar @ 2022-10-26 12:37 UTC (permalink / raw)
  To: Pierre.Gondois, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Pierre,

Thank you for this patch.

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

Regards,

Sami Mujawar

On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
>
> The second model of the _PRT object is used. Indeed:
> - the interrupts described are not re-configurable
> - OSes are aware of the polarity of PCI legacy interrupts,
>    so there is no need to accurately describe the polarity.
>
> Also, fix a comment for the CM_ARM_PCI_INTERRUPT_MAP_INFO obj.
>
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
> ---
>   DynamicTablesPkg/Include/ArmNameSpaceObjects.h            | 2 +-
>   .../Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c       | 8 ++------
>   2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> index cd39e609d6c4..d711f3ec5938 100644
> --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
> @@ -1014,7 +1014,7 @@ typedef struct CmArmPciInterruptMapInfo {
>     /// Value on 8 bits (max 255).
>     UINT8    PciBus;
>   
> -  /// Pci Bus.
> +  /// Pci Device.
>     /// Value on 5 bits (max 31).
>     UINT8    PciDevice;
>   
> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
> index 85098752c614..c54ae6f551f6 100644
> --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c
> @@ -288,12 +288,6 @@ GeneratePciDeviceInfo (
>   
>     Cf. ACPI 6.4 specification, s6.2.13 "_PRT (PCI Routing Table)"
>   
> -  The first model (defining a _CRS object) is used. This is necessary because
> -  PCI legacy interrupts are active low and GICv2 SPI interrupts are active
> -  high.
> -  Even though PCI interrupts cannot be re-routed, only the first model allows
> -  to specify the activation state (low/high).
> -
>     @param [in]       Generator       The SSDT Pci generator.
>     @param [in]       CfgMgrProtocol  Pointer to the Configuration Manager
>                                       Protocol interface.
> @@ -397,6 +391,8 @@ GeneratePrt (
>          High word-Device #, Low word-Function #. (for example, device 3,
>          function 2 is 0x00030002). To refer to all the functions on a device #,
>          use a function number of FFFF).
> +
> +      Use the second model for _PRT object and describe a hardwired interrupt.
>       */
>       Status = AmlAddPrtEntry (
>                  (IrqMapInfo->PciDevice << 16) | 0xFFFF,

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

* Re: [PATCH 11/14] DynamicTablesPkg: Add PCCT Generator
  2022-10-26 12:35   ` Sami Mujawar
@ 2022-10-28 10:02     ` PierreGondois
  0 siblings, 0 replies; 37+ messages in thread
From: PierreGondois @ 2022-10-28 10:02 UTC (permalink / raw)
  To: Sami Mujawar, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Sami,

On 10/26/22 14:35, Sami Mujawar wrote:
> Hi Pierre,
> 
> There is a change required for this patch marked inline as [SAMI].
> 
> If you agree, I will make the changes before merging.

Yes indeed, this is a rebase error,
thanks for spotting it,

Regards,
Pierre

> 
> Regards,
> 
> Sami Mujawar
> 
> On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
>> From: Pierre Gondois <pierre.gondois@arm.com>
>>
>> The Platform Communication Channel Table (PCCT) generator collates
>> the relevant information required for generating a PCCT table from
>> configuration manager using the configuration manager protocol.
>> The DynamicTablesManager then install the PCCT table.
>>
>>   From ACPI 6.4, s14 PLATFORM COMMUNICATIONS CHANNEL (PCC):
>>     The platform communication channel (PCC) is a generic mechanism
>>     for OSPM to communicate with an entity in the platform.
>>
>> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
>> ---
>>    DynamicTablesPkg/DynamicTables.dsc.inc        |    4 +-
>>    DynamicTablesPkg/Include/AcpiTableGenerator.h |    3 +-
>>    .../Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf     |   30 +
>>    .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c   | 1186 +++++++++++++++++
>>    .../Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h   |   43 +
>>    .../ConfigurationManagerObjectParser.c        |   46 +-
>>    6 files changed, 1287 insertions(+), 25 deletions(-)
>>    create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
>>    create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
>>    create mode 100644 DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
>>
>> diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc b/DynamicTablesPkg/DynamicTables.dsc.inc
>> index 3d4fa0c4c4b6..3e38fa0d0d99 100644
>> --- a/DynamicTablesPkg/DynamicTables.dsc.inc
>> +++ b/DynamicTablesPkg/DynamicTables.dsc.inc
>> @@ -1,7 +1,7 @@
>>    ## @file
>>    #  Dsc include file for Dynamic Tables Framework.
>>    #
>> -#  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
>> +#  Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.<BR>
>>    #
>>    #  SPDX-License-Identifier: BSD-2-Clause-Patent
>>    #
>> @@ -33,6 +33,7 @@ [Components.common]
>>      DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
>>      DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
>>      DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/AcpiSratLibArm.inf
>> +  DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
>>    
>>      # AML Fixup
>>      DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
>> @@ -57,6 +58,7 @@ [Components.common]
>>          NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
>>          NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
>>          NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/AcpiSratLibArm.inf
>> +      NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
>>    
>>          # AML Fixup
>>          NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
>> diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h b/DynamicTablesPkg/Include/AcpiTableGenerator.h
>> index f962dbff57df..d0eda011c301 100644
>> --- a/DynamicTablesPkg/Include/AcpiTableGenerator.h
>> +++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
>> @@ -1,6 +1,6 @@
>>    /** @file
>>    
>> -  Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
>> +  Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.<BR>
>>    
>>      SPDX-License-Identifier: BSD-2-Clause-Patent
>>    
>> @@ -98,6 +98,7 @@ typedef enum StdAcpiTableId {
>>      EStdAcpiTableIdSsdtCmn600,                    ///< SSDT Cmn-600 Generator
>>      EStdAcpiTableIdSsdtCpuTopology,               ///< SSDT Cpu Topology
>>      EStdAcpiTableIdSsdtPciExpress,                ///< SSDT Pci Express Generator
>> +  EStdAcpiTableIdPcct,                          ///< PCCT Generator
>>      EStdAcpiTableIdMax
>>    } ESTD_ACPI_TABLE_ID;
>>    
>> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
>> new file mode 100644
>> index 000000000000..da54585c2dd9
>> --- /dev/null
>> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/AcpiPcctLibArm.inf
>> @@ -0,0 +1,30 @@
>> +## @file
>> +#  Pcct Table Generator
>> +#
>> +#  Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
>> +#
>> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
>> +##
>> +
>> +[Defines]
>> +  INF_VERSION    = 0x0001001B
>> +  BASE_NAME      = AcpiPcctLibArm
>> +  FILE_GUID      = 38FE945C-D6ED-4CD6-8D20-FCEF3260D15A
>> +  VERSION_STRING = 1.0
>> +  MODULE_TYPE    = DXE_DRIVER
>> +  LIBRARY_CLASS  = NULL|DXE_DRIVER
>> +  CONSTRUCTOR    = AcpiPcctLibConstructor
>> +  DESTRUCTOR     = AcpiPcctLibDestructor
>> +
>> +[Sources]
>> +  PcctGenerator.c
>> +  PcctGenerator.h
>> +
>> +[Packages]
>> +  DynamicTablesPkg/DynamicTablesPkg.dec
>> +  EmbeddedPkg/EmbeddedPkg.dec
>> +  MdePkg/MdePkg.dec
>> +  MdeModulePkg/MdeModulePkg.dec
>> +
>> +[LibraryClasses]
>> +  BaseLib
>> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
>> new file mode 100644
>> index 000000000000..36caf4aaeab7
>> --- /dev/null
>> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.c
>> @@ -0,0 +1,1186 @@
>> +/** @file
>> +  PCCT Table Generator
>> +
>> +  Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
>> +  SPDX-License-Identifier: BSD-2-Clause-Patent
>> +
>> +  @par Reference(s):
>> +  - ACPI 6.4 Specification - January 2021
>> +    s14 PLATFORM COMMUNICATIONS CHANNEL (PCC)
>> +
>> +**/
>> +
>> +#include <Library/AcpiLib.h>
>> +#include <Library/BaseMemoryLib.h>
>> +#include <Library/DebugLib.h>
>> +#include <Library/MemoryAllocationLib.h>
>> +#include <Protocol/AcpiTable.h>
>> +
>> +// Module specific include files.
>> +#include <AcpiTableGenerator.h>
>> +#include <ConfigurationManagerObject.h>
>> +#include <ConfigurationManagerHelper.h>
>> +#include <Library/TableHelperLib.h>
>> +#include <Protocol/ConfigurationManagerProtocol.h>
>> +#include "PcctGenerator.h"
>> +
>> +/** ARM standard PCCT Generator
>> +
>> +Requirements:
>> +  The following Configuration Manager Object(s) are required by
>> +  this Generator:
>> +  - EArmObjPccSubspaceType0Info
>> +  - EArmObjPccSubspaceType1Info
>> +  - EArmObjPccSubspaceType2Info
>> +  - EArmObjPccSubspaceType3Info
>> +  - EArmObjPccSubspaceType4Info
>> +  - EArmObjPccSubspaceType5Info
>> +*/
>> +
>> +/** This macro expands to a function that retrieves the PCC
>> +    Subspace of Type 0 Information from the Configuration Manager.
>> +*/
>> +GET_OBJECT_LIST (
>> +  EObjNameSpaceArm,
>> +  EArmObjPccSubspaceType0Info,
>> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO
>> +  );
>> +
>> +/** This macro expands to a function that retrieves the PCC
>> +    Subspace of Type 1 Information from the Configuration Manager.
>> +*/
>> +GET_OBJECT_LIST (
>> +  EObjNameSpaceArm,
>> +  EArmObjPccSubspaceType1Info,
>> +  CM_ARM_PCC_SUBSPACE_TYPE1_INFO
>> +  );
>> +
>> +/** This macro expands to a function that retrieves the PCC
>> +    Subspace of Type 2 Information from the Configuration Manager.
>> +*/
>> +GET_OBJECT_LIST (
>> +  EObjNameSpaceArm,
>> +  EArmObjPccSubspaceType2Info,
>> +  CM_ARM_PCC_SUBSPACE_TYPE2_INFO
>> +  );
>> +
>> +/** This macro expands to a function that retrieves the PCC
>> +    Subspace of Type 3 Information from the Configuration Manager.
>> +*/
>> +GET_OBJECT_LIST (
>> +  EObjNameSpaceArm,
>> +  EArmObjPccSubspaceType3Info,
>> +  CM_ARM_PCC_SUBSPACE_TYPE3_INFO
>> +  );
>> +
>> +/** This macro expands to a function that retrieves the PCC
>> +    Subspace of Type 4 Information from the Configuration Manager.
>> +*/
>> +GET_OBJECT_LIST (
>> +  EObjNameSpaceArm,
>> +  EArmObjPccSubspaceType4Info,
>> +  CM_ARM_PCC_SUBSPACE_TYPE4_INFO
>> +  );
>> +
>> +/** This macro expands to a function that retrieves the PCC
>> +    Subspace of Type 5 Information from the Configuration Manager.
>> +*/
>> +GET_OBJECT_LIST (
>> +  EObjNameSpaceArm,
>> +  EArmObjPccSubspaceType5Info,
>> +  CM_ARM_PCC_SUBSPACE_TYPE5_INFO
>> +  );
>> +
>> +/** The Platform is capable of generating an interrupt
>> +    to indicate completion of a command.
>> +
>> +  Cf: s14.1.1 Platform Communications Channel Global Flags
>> +  Platform Interrupt flag
>> +  and s14.1.6 Extended PCC subspaces (types 3 and 4)
>> +    If a responder subspace is included in the PCCT,
>> +    then the global Platform Interrupt flag must be set to 1
>> +
>> +  Set this variable and populate the PCCT flag accordingly if either:
>> +   - One of the PCCT Subspace uses interrupts.
>> +   - A PCC Subspace of type 4 is used.
>> +*/
>> +STATIC BOOLEAN  mHasPlatformInterrupt;
>> +
>> +/** Initialize the MappingTable.
>> +
>> +  @param [in] MappingTable  The mapping table structure.
>> +  @param [in] Count         Number of entries to allocate in the
>> +                            MappingTable.
>> +
>> +  @retval EFI_SUCCESS            Success.
>> +  @retval EFI_INVALID_PARAMETER  Invalid parameter.
>> +  @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +EFIAPI
>> +MappingTableInitialize (
>> +  IN  MAPPING_TABLE  *MappingTable,
>> +  IN  UINT32         Count
>> +  )
>> +{
>> +  VOID  **Table;
>> +
>> +  if ((MappingTable == NULL)  ||
>> +      (Count == 0))
>> +  {
>> +    ASSERT (0);
>> +    return EFI_INVALID_PARAMETER;
>> +  }
>> +
>> +  Table = AllocateZeroPool (sizeof (*Table) * Count);
>> +  if (Table == NULL) {
>> +    ASSERT (0);
>> +    return EFI_OUT_OF_RESOURCES;
>> +  }
>> +
>> +  MappingTable->Table    = Table;
>> +  MappingTable->MaxIndex = Count;
>> +
>> +  return EFI_SUCCESS;
>> +}
>> +
>> +/** Free the MappingTable.
>> +
>> +  @param [in, out]  MappingTable  The mapping table structure.
>> +**/
>> +STATIC
>> +VOID
>> +EFIAPI
>> +MappingTableFree (
>> +  IN  OUT MAPPING_TABLE  *MappingTable
>> +  )
>> +{
>> +  ASSERT (MappingTable != NULL);
>> +  ASSERT (MappingTable->Table != NULL);
>> +
>> +  if (MappingTable->Table != NULL) {
>> +    FreePool (MappingTable->Table);
>> +  }
>> +}
>> +
>> +/** Add a new entry for CmArmPccSubspace at Index.
>> +
>> +  @param [in] MappingTable      The mapping table structure.
>> +  @param [in] CmArmPccSubspace  Pointer to a CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO.
>> +  @param [in] Index             Index at which CmArmPccSubspace must be added.
>> +                                This is the Subspace Id.
>> +
>> +  @retval EFI_SUCCESS            Success.
>> +  @retval EFI_BUFFER_TOO_SMALL   Buffer too small.
>> +  @retval EFI_INVALID_PARAMETER  Invalid parameter.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +EFIAPI
>> +MappingTableAdd (
>> +  IN  MAPPING_TABLE  *MappingTable,
>> +  IN  VOID           *CmArmPccSubspace,
>> +  IN  UINT32         Index
>> +  )
>> +{
>> +  if ((MappingTable == NULL)        ||
>> +      (MappingTable->Table == NULL) ||
>> +      (CmArmPccSubspace == NULL))
>> +  {
>> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
>> +    return EFI_INVALID_PARAMETER;
>> +  }
>> +
>> +  if ((Index >= MappingTable->MaxIndex) ||
>> +      (MappingTable->Table[Index] != 0))
>> +  {
>> +    ASSERT_EFI_ERROR (EFI_BUFFER_TOO_SMALL);
>> +    return EFI_BUFFER_TOO_SMALL;
>> +  }
>> +
>> +  // Just map the Pcc Subspace in the Table.
>> +  MappingTable->Table[Index] = CmArmPccSubspace;
>> +  return EFI_SUCCESS;
>> +}
>> +
>> +/** Parse the CmPccArray objects and add them to the MappingTable.
>> +
>> +  @param [in] MappingTable     The mapping table structure.
>> +  @param [in] CmPccArray       Pointer to an array of CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO.
>> +  @param [in] CmPccCount       Count of objects in CmPccArray.
>> +
>> +  @retval EFI_SUCCESS            Success.
>> +  @retval EFI_BUFFER_TOO_SMALL   Buffer too small.
>> +  @retval EFI_INVALID_PARAMETER  Invalid parameter.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +EFIAPI
>> +MapPccSubspaceId (
>> +  IN  MAPPING_TABLE  *MappingTable,
>> +  IN  VOID           *CmPccArray,
>> +  IN  UINT32         CmPccCount
>> +  )
>> +{
>> +  EFI_STATUS                 Status;
>> +  UINT8                      *PccBuffer;
>> +  UINT32                     Index;
>> +  UINT32                     CmObjSize;
>> +  PCC_SUBSPACE_GENERIC_INFO  *GenericPcc;
>> +
>> +  if (CmPccCount == 0) {
>> +    return EFI_SUCCESS;
>> +  }
>> +
>> +  if ((CmPccArray == NULL) || (MappingTable == NULL)) {
>> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
>> +    return EFI_INVALID_PARAMETER;
>> +  }
>> +
>> +  GenericPcc = (PCC_SUBSPACE_GENERIC_INFO *)CmPccArray;
>> +
>> +  switch (GenericPcc->Type) {
>> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC:
>> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE0_INFO);
>> +      break;
>> +
>> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS:
>> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE1_INFO);
>> +      break;
>> +
>> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS:
>> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE2_INFO);
>> +      break;
>> +
>> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC:
>> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE3_INFO);
>> +      break;
>> +
>> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC:
>> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE4_INFO);
>> +      break;
>> +
>> +    case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
>> +      CmObjSize = sizeof (CM_ARM_PCC_SUBSPACE_TYPE5_INFO);
>> +      break;
>> +
>> +    default:
>> +      ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
>> +      return EFI_INVALID_PARAMETER;
>> +  }
>> +
>> +  PccBuffer = (UINT8 *)CmPccArray;
>> +
>> +  // Map the Pcc channel to their Subspace Id.
>> +  for (Index = 0; Index < CmPccCount; Index++) {
>> +    GenericPcc = (PCC_SUBSPACE_GENERIC_INFO *)PccBuffer;
>> +
>> +    Status = MappingTableAdd (
>> +               MappingTable,
>> +               PccBuffer,
>> +               GenericPcc->SubspaceId
>> +               );
>> +    if (EFI_ERROR (Status)) {
>> +      ASSERT_EFI_ERROR (Status);
>> +      return Status;
>> +    }
>> +
>> +    PccBuffer += CmObjSize;
>> +  }
>> +
>> +  return EFI_SUCCESS;
>> +}
>> +
>> +/** Add one PCCT Subspace structure of Type 0 (Generic).
>> +
>> +  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
>> +  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
>> +
>> +  @retval EFI_SUCCESS           Table generated successfully.
>> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +EFIAPI
>> +AddSubspaceStructType0 (
>> +  IN  CM_ARM_PCC_SUBSPACE_TYPE0_INFO      *PccCmObj,
>> +  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC  *PccAcpi
>> +  )
>> +{
>> +  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
>> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
>> +
>> +  if ((PccCmObj == NULL) ||
>> +      (PccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC)  ||
>> +      (PccAcpi == NULL))
>> +  {
>> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
>> +    return EFI_INVALID_PARAMETER;
>> +  }
>> +
>> +  Doorbell      = &PccCmObj->DoorbellReg;
>> +  ChannelTiming = &PccCmObj->ChannelTiming;
>> +
>> +  PccAcpi->Type                    = PccCmObj->Type;
>> +  PccAcpi->Length                  = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC);
>> +  *(UINT32 *)&PccAcpi->Reserved[0] = EFI_ACPI_RESERVED_DWORD;
>> +  *(UINT16 *)&PccAcpi->Reserved[4] = EFI_ACPI_RESERVED_WORD;
>> +  PccAcpi->BaseAddress             = PccCmObj->BaseAddress;
>> +  PccAcpi->AddressLength           = PccCmObj->AddressLength;
>> +
>> +  CopyMem (
>> +    &PccAcpi->DoorbellRegister,
>> +    &Doorbell->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
>> +  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
>> +
>> +  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
>> +  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
>> +  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
>> +
>> +  return EFI_SUCCESS;
>> +}
>> +
>> +/** Add one PCCT subspace structure of Type 1 (HW-Reduced).
>> +
>> +  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
>> +  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
>> +
>> +  @retval EFI_SUCCESS           Table generated successfully.
>> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +EFIAPI
>> +AddSubspaceStructType1 (
>> +  IN  CM_ARM_PCC_SUBSPACE_TYPE1_INFO                          *PccCmObj,
>> +  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS  *PccAcpi
>> +  )
>> +{
>> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
>> +  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
>> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
>> +
>> +  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
>> +
>> +  if ((PccCmObj == NULL) ||
>> +      (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS)  ||
>> +      (PccAcpi == NULL))
>> +  {
>> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
>> +    return EFI_INVALID_PARAMETER;
>> +  }
>> +
>> +  Doorbell      = &GenericPccCmObj->DoorbellReg;
>> +  ChannelTiming = &GenericPccCmObj->ChannelTiming;
>> +
>> +  PccAcpi->Type                   = GenericPccCmObj->Type;
>> +  PccAcpi->Length                 = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS);
>> +  PccAcpi->PlatformInterrupt      = PccCmObj->PlatIrq.Interrupt;
>> +  PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
>> +  PccAcpi->Reserved               = EFI_ACPI_RESERVED_BYTE;
>> +  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
>> +  PccAcpi->AddressLength          = GenericPccCmObj->AddressLength;
>> +
>> +  CopyMem (
>> +    &PccAcpi->DoorbellRegister,
>> +    &Doorbell->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
>> +  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
>> +
>> +  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
>> +  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
>> +  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
>> +
>> +  if ((PccCmObj->PlatIrq.Interrupt != 0)) {
>> +    mHasPlatformInterrupt = TRUE;
>> +  }
>> +
>> +  return EFI_SUCCESS;
>> +}
>> +
>> +/** Add one PCCT subspace structure of Type 2 (HW-Reduced).
>> +
>> +  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
>> +  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
>> +
>> +  @retval EFI_SUCCESS           Table generated successfully.
>> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +EFIAPI
>> +AddSubspaceStructType2 (
>> +  IN  CM_ARM_PCC_SUBSPACE_TYPE2_INFO                          *PccCmObj,
>> +  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS  *PccAcpi
>> +  )
>> +{
>> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
>> +  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
>> +  PCC_MAILBOX_REGISTER_INFO         *PlatIrqAck;
>> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
>> +
>> +  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
>> +
>> +  if ((PccCmObj == NULL) ||
>> +      (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS)  ||
>> +      (PccAcpi == NULL))
>> +  {
>> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
>> +    return EFI_INVALID_PARAMETER;
>> +  }
>> +
>> +  Doorbell      = &GenericPccCmObj->DoorbellReg;
>> +  PlatIrqAck    = &PccCmObj->PlatIrqAckReg;
>> +  ChannelTiming = &GenericPccCmObj->ChannelTiming;
>> +
>> +  PccAcpi->Type                   = GenericPccCmObj->Type;
>> +  PccAcpi->Length                 = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS);
>> +  PccAcpi->PlatformInterrupt      = PccCmObj->PlatIrq.Interrupt;
>> +  PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
>> +  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
>> +  PccAcpi->Reserved               = EFI_ACPI_RESERVED_BYTE;
>> +  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
>> +  PccAcpi->AddressLength          = GenericPccCmObj->AddressLength;
>> +
>> +  CopyMem (
>> +    &PccAcpi->DoorbellRegister,
>> +    &Doorbell->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
>> +  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
>> +
>> +  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
>> +  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
>> +  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
>> +
>> +  CopyMem (
>> +    &PccAcpi->PlatformInterruptAckRegister,
>> +    &PlatIrqAck->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->PlatformInterruptAckPreserve = PlatIrqAck->PreserveMask;
>> +  PccAcpi->PlatformInterruptAckWrite    = PlatIrqAck->WriteMask;
>> +
>> +  if ((PccCmObj->PlatIrq.Interrupt != 0)) {
>> +    mHasPlatformInterrupt = TRUE;
>> +  }
>> +
>> +  return EFI_SUCCESS;
>> +}
>> +
>> +/** Add one PCCT subspace structure of Type 3 or 4 (Extended).
>> +
>> +  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
>> +  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
>> +
>> +  @retval EFI_SUCCESS           Table generated successfully.
>> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +EFIAPI
>> +AddSubspaceStructType34 (
>> +  IN  CM_ARM_PCC_SUBSPACE_TYPE3_INFO             *PccCmObj,
>> +  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC  *PccAcpi
>> +  )
>> +{
>> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
>> +  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
>> +  PCC_MAILBOX_REGISTER_INFO         *PlatIrqAck;
>> +  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteCheck;
>> +  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteUpdate;
>> +  PCC_MAILBOX_REGISTER_INFO         *ErrorStatus;
>> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
>> +
>> +  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
>> +
>> +  if ((PccCmObj == NULL) ||
>> +      ((GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC) &&
>> +       (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC)) ||
>> +      (PccAcpi == NULL))
>> +  {
>> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
>> +    return EFI_INVALID_PARAMETER;
>> +  }
>> +
>> +  Doorbell          = &GenericPccCmObj->DoorbellReg;
>> +  PlatIrqAck        = &PccCmObj->PlatIrqAckReg;
>> +  CmdCompleteCheck  = &PccCmObj->CmdCompleteCheckReg;
>> +  CmdCompleteUpdate = &PccCmObj->CmdCompleteUpdateReg;
>> +  ErrorStatus       = &PccCmObj->ErrorStatusReg;
>> +  ChannelTiming     = &GenericPccCmObj->ChannelTiming;
>> +
>> +  PccAcpi->Type                   = GenericPccCmObj->Type;
>> +  PccAcpi->Length                 = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC);
>> +  PccAcpi->PlatformInterrupt      = PccCmObj->PlatIrq.Interrupt;
>> +  PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
>> +  PccAcpi->Reserved               = EFI_ACPI_RESERVED_BYTE;
>> +  PccAcpi->BaseAddress            = GenericPccCmObj->BaseAddress;
>> +  PccAcpi->AddressLength          = GenericPccCmObj->AddressLength;
>> +
>> +  CopyMem (
>> +    &PccAcpi->DoorbellRegister,
>> +    &Doorbell->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
>> +  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
>> +
>> +  PccAcpi->NominalLatency               = ChannelTiming->NominalLatency;
>> +  PccAcpi->MaximumPeriodicAccessRate    = ChannelTiming->MaxPeriodicAccessRate;
>> +  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
>> +
>> +  CopyMem (
>> +    &PccAcpi->PlatformInterruptAckRegister,
>> +    &PlatIrqAck->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->PlatformInterruptAckPreserve = PlatIrqAck->PreserveMask;
>> +  PccAcpi->PlatformInterruptAckSet      = PlatIrqAck->WriteMask;
>> +
>> +  PccAcpi->Reserved1[0] = EFI_ACPI_RESERVED_BYTE;
>> +  PccAcpi->Reserved1[1] = EFI_ACPI_RESERVED_BYTE;
>> +  PccAcpi->Reserved1[1] = EFI_ACPI_RESERVED_BYTE;
>> +  PccAcpi->Reserved1[3] = EFI_ACPI_RESERVED_BYTE;
>> +  PccAcpi->Reserved1[4] = EFI_ACPI_RESERVED_BYTE;
>> +  PccAcpi->Reserved1[5] = EFI_ACPI_RESERVED_BYTE;
>> +  PccAcpi->Reserved1[6] = EFI_ACPI_RESERVED_BYTE;
>> +  PccAcpi->Reserved1[7] = EFI_ACPI_RESERVED_BYTE;
>> +
>> +  CopyMem (
>> +    &PccAcpi->CommandCompleteCheckRegister,
>> +    &CmdCompleteCheck->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->CommandCompleteCheckMask = CmdCompleteCheck->PreserveMask;
>> +  // No Write mask.
>> +
>> +  CopyMem (
>> +    &PccAcpi->CommandCompleteUpdateRegister,
>> +    &CmdCompleteUpdate->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->CommandCompleteUpdatePreserve = CmdCompleteUpdate->PreserveMask;
>> +  PccAcpi->CommandCompleteUpdateSet      = CmdCompleteUpdate->WriteMask;
>> +
>> +  CopyMem (
>> +    &PccAcpi->ErrorStatusRegister,
>> +    &ErrorStatus->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->ErrorStatusMask = ErrorStatus->PreserveMask;
>> +  // No Write mask.
>> +
>> +  if (GenericPccCmObj->Type == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
>> +    mHasPlatformInterrupt = TRUE;
>> +  } else if ((PccCmObj->PlatIrq.Interrupt != 0)) {
>> +    mHasPlatformInterrupt = TRUE;
>> +  }
>> +
>> +  return EFI_SUCCESS;
>> +}
>> +
>> +/** Add one PCCT subspace structure of Type 5 (HW-Registers).
>> +
>> +  @param [in]  PccCmObj   Pointer to a CmObj PCCT Subspace info structure.
>> +  @param [in]  PccAcpi    Pointer to the ACPI PCCT Subspace structure to populate.
>> +
>> +  @retval EFI_SUCCESS           Table generated successfully.
>> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +EFIAPI
>> +AddSubspaceStructType5 (
>> +  IN  CM_ARM_PCC_SUBSPACE_TYPE5_INFO                            *PccCmObj,
>> +  IN  EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS  *PccAcpi
>> +  )
>> +{
>> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO    *GenericPccCmObj;
>> +  PCC_MAILBOX_REGISTER_INFO         *Doorbell;
>> +  PCC_MAILBOX_REGISTER_INFO         *CmdCompleteCheck;
>> +  PCC_MAILBOX_REGISTER_INFO         *ErrorStatus;
>> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO  *ChannelTiming;
>> +
>> +  GenericPccCmObj = (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)PccCmObj;
>> +
>> +  if ((PccCmObj == NULL) ||
>> +      (GenericPccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS)  ||
>> +      (PccAcpi == NULL))
>> +  {
>> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
>> +    return EFI_INVALID_PARAMETER;
>> +  }
>> +
>> +  Doorbell         = &GenericPccCmObj->DoorbellReg;
>> +  CmdCompleteCheck = &PccCmObj->CmdCompleteCheckReg;
>> +  ErrorStatus      = &PccCmObj->ErrorStatusReg;
>> +  ChannelTiming    = &GenericPccCmObj->ChannelTiming;
>> +
>> +  PccAcpi->Type                    = GenericPccCmObj->Type;
>> +  PccAcpi->Length                  = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS);
>> +  PccAcpi->Version                 = PccCmObj->Version;
>> +  PccAcpi->BaseAddress             = GenericPccCmObj->BaseAddress;
>> +  PccAcpi->SharedMemoryRangeLength = GenericPccCmObj->AddressLength;
>> +
>> +  CopyMem (
>> +    &PccAcpi->DoorbellRegister,
>> +    &Doorbell->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->DoorbellPreserve = Doorbell->PreserveMask;
>> +  PccAcpi->DoorbellWrite    = Doorbell->WriteMask;
>> +
>> +  CopyMem (
>> +    &PccAcpi->CommandCompleteCheckRegister,
>> +    &CmdCompleteCheck->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->CommandCompleteCheckMask = CmdCompleteCheck->PreserveMask;
>> +  // No Write mask.
>> +
>> +  CopyMem (
>> +    &PccAcpi->ErrorStatusRegister,
>> +    &ErrorStatus->Register,
>> +    sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE)
>> +    );
>> +  PccAcpi->ErrorStatusMask = ErrorStatus->PreserveMask;
>> +  // No Write mask.
>> +
>> +  PccAcpi->NominalLatency = ChannelTiming->NominalLatency;
>> +  // No MaximumPeriodicAccessRate.
>> +  PccAcpi->MinimumRequestTurnaroundTime = ChannelTiming->MinRequestTurnaroundTime;
>> +
>> +  return EFI_SUCCESS;
>> +}
>> +
>> +/** Populate the PCCT table using the MappingTable.
>> +
>> +  @param [in] MappingTable  The mapping table structure.
>> +  @param [in] Pcc           Pointer to an array of Pcc Subpace structures.
>> +  @param [in] Size          Size of the Pcc array.
>> +
>> +  @retval EFI_SUCCESS           Table generated successfully.
>> +  @retval EFI_BUFFER_TOO_SMALL  Buffer too small.
>> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +EFIAPI
>> +PopulatePcctTable (
>> +  IN  MAPPING_TABLE  *MappingTable,
>> +  IN  VOID           *Pcc,
>> +  IN  UINT32         Size
>> +  )
>> +{
>> +  EFI_STATUS  Status;
>> +  UINT8       *PccBuffer;
>> +  UINT32      CmObjSize;
>> +  UINT32      Index;
>> +  UINT32      MaxIndex;
>> +  VOID        **Table;
>> +  VOID        *CurrentPccSubspace;
>> +
>> +  ASSERT (MappingTable != NULL);
>> +  ASSERT (MappingTable->Table != NULL);
>> +
>> +  PccBuffer = Pcc;
>> +  MaxIndex  = MappingTable->MaxIndex;
>> +  Table     = MappingTable->Table;
>> +
>> +  for (Index = 0; Index < MaxIndex; Index++) {
>> +    CurrentPccSubspace = Table[Index];
>> +    if (CurrentPccSubspace == NULL) {
>> +      ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
>> +      return EFI_INVALID_PARAMETER;
>> +    }
>> +
>> +    switch (((PCC_SUBSPACE_GENERIC_INFO *)CurrentPccSubspace)->Type) {
>> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC:
>> +        Status = AddSubspaceStructType0 (
>> +                   (CM_ARM_PCC_SUBSPACE_TYPE0_INFO *)CurrentPccSubspace,
>> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC *)PccBuffer
>> +                   );
>> +
>> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC);
>> +        break;
>> +
>> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS:
>> +        Status = AddSubspaceStructType1 (
>> +                   (CM_ARM_PCC_SUBSPACE_TYPE1_INFO *)CurrentPccSubspace,
>> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS *)PccBuffer
>> +                   );
>> +
>> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS);
>> +        break;
>> +
>> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS:
>> +        Status = AddSubspaceStructType2 (
>> +                   (CM_ARM_PCC_SUBSPACE_TYPE2_INFO *)CurrentPccSubspace,
>> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS *)PccBuffer
>> +                   );
>> +
>> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS);
>> +        break;
>> +
>> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC:
>> +        Status = AddSubspaceStructType34 (
>> +                   (CM_ARM_PCC_SUBSPACE_TYPE3_INFO *)CurrentPccSubspace,
>> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC *)PccBuffer
>> +                   );
>> +
>> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC);
>> +        break;
>> +
>> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC:
>> +        Status = AddSubspaceStructType34 (
>> +                   (CM_ARM_PCC_SUBSPACE_TYPE4_INFO *)CurrentPccSubspace,
>> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_4_EXTENDED_PCC *)PccBuffer
>> +                   );
>> +
>> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_4_EXTENDED_PCC);
>> +        break;
>> +
>> +      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
>> +        Status = AddSubspaceStructType5 (
>> +                   (CM_ARM_PCC_SUBSPACE_TYPE5_INFO *)CurrentPccSubspace,
>> +                   (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS *)PccBuffer
>> +                   );
>> +
>> +        CmObjSize = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS);
>> +        break;
>> +
>> +      default:
>> +        ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
>> +        return EFI_INVALID_PARAMETER;
>> +    } // switch
>> +
>> +    if (EFI_ERROR (Status)) {
>> +      ASSERT_EFI_ERROR (Status);
>> +      return Status;
>> +    }
>> +
>> +    if (Size < CmObjSize) {
>> +      ASSERT_EFI_ERROR (EFI_BUFFER_TOO_SMALL);
>> +      return EFI_BUFFER_TOO_SMALL;
>> +    }
>> +
>> +    PccBuffer += CmObjSize;
>> +    Size      -= CmObjSize;
>> +  } // for
>> +
>> +  return EFI_SUCCESS;
>> +}
>> +
>> +/** Construct the PCCT ACPI table.
>> +
>> +  Called by the Dynamic Table Manager, this function invokes the
>> +  Configuration Manager protocol interface to get the required hardware
>> +  information for generating the ACPI table.
>> +
>> +  If this function allocates any resources then they must be freed
>> +  in the FreeXXXXTableResources function.
>> +
>> +  @param [in]  This           Pointer to the table generator.
>> +  @param [in]  AcpiTableInfo  Pointer to the ACPI Table Info.
>> +  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
>> +                              Protocol Interface.
>> +  @param [out] Table          Pointer to the constructed ACPI Table.
>> +
>> +  @retval EFI_SUCCESS           Table generated successfully.
>> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
>> +  @retval EFI_NOT_FOUND         The required object was not found.
>> +  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
>> +                                Manager is less than the Object size for the
>> +                                requested object.
>> +  @retval EFI_BUFFER_TOO_SMALL   Buffer too small.
>> +  @retval EFI_OUT_OF_RESOURCES  Memory allocation failed.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +EFIAPI
>> +BuildPcctTable (
>> +  IN  CONST ACPI_TABLE_GENERATOR                  *CONST  This,
>> +  IN  CONST CM_STD_OBJ_ACPI_TABLE_INFO            *CONST  AcpiTableInfo,
>> +  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
>> +  OUT       EFI_ACPI_DESCRIPTION_HEADER          **CONST  Table
>> +  )
>> +{
>> +  EFI_STATUS                                                Status;
>> +  ACPI_PCCT_GENERATOR                                       *Generator;
>> +  UINT32                                                    TableSize;
>> +  EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER  *Pcct;
>> +  UINT8                                                     *Buffer;
>> +
>> +  MAPPING_TABLE  *MappingTable;
>> +  UINT32         MappingTableCount;
>> +
>> +  CM_ARM_PCC_SUBSPACE_TYPE0_INFO  *PccType0;
>> +  UINT32                          PccType0Count;
>> +  CM_ARM_PCC_SUBSPACE_TYPE1_INFO  *PccType1;
>> +  UINT32                          PccType1Count;
>> +  CM_ARM_PCC_SUBSPACE_TYPE2_INFO  *PccType2;
>> +  UINT32                          PccType2Count;
>> +  CM_ARM_PCC_SUBSPACE_TYPE3_INFO  *PccType3;
>> +  UINT32                          PccType3Count;
>> +  CM_ARM_PCC_SUBSPACE_TYPE4_INFO  *PccType4;
>> +  UINT32                          PccType4Count;
>> +  CM_ARM_PCC_SUBSPACE_TYPE5_INFO  *PccType5;
>> +  UINT32                          PccType5Count;
>> +
>> +  ASSERT (This != NULL);
>> +  ASSERT (AcpiTableInfo != NULL);
>> +  ASSERT (CfgMgrProtocol != NULL);
>> +  ASSERT (Table != NULL);
>> +  ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
>> +  ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
>> +
>> +  if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
>> +      (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
>> +  {
>> +    DEBUG ((
>> +      DEBUG_ERROR,
>> +      "ERROR: PCCT: Requested table revision = %d, is not supported."
>> +      "Supported table revision: Minimum = %d, Maximum = %d\n",
>> +      AcpiTableInfo->AcpiTableRevision,
>> +      This->MinAcpiTableRevision,
>> +      This->AcpiTableRevision
>> +      ));
>> +    ASSERT_EFI_ERROR (EFI_INVALID_PARAMETER);
>> +    return EFI_INVALID_PARAMETER;
>> +  }
>> +
>> +  Generator    = (ACPI_PCCT_GENERATOR *)This;
>> +  MappingTable = &Generator->MappingTable;
>> +  *Table       = NULL;
>> +
>> +  // First get all the Pcc Subpace CmObj of type X.
>> +
>> +  Status = GetEArmObjPccSubspaceType0Info (
>> +             CfgMgrProtocol,
>> +             CM_NULL_TOKEN,
>> +             &PccType0,
>> +             &PccType0Count
>> +             );
>> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Status = GetEArmObjPccSubspaceType1Info (
>> +             CfgMgrProtocol,
>> +             CM_NULL_TOKEN,
>> +             &PccType1,
>> +             &PccType1Count
>> +             );
>> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Status = GetEArmObjPccSubspaceType2Info (
>> +             CfgMgrProtocol,
>> +             CM_NULL_TOKEN,
>> +             &PccType2,
>> +             &PccType2Count
>> +             );
>> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Status = GetEArmObjPccSubspaceType3Info (
>> +             CfgMgrProtocol,
>> +             CM_NULL_TOKEN,
>> +             &PccType3,
>> +             &PccType3Count
>> +             );
>> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Status = GetEArmObjPccSubspaceType4Info (
>> +             CfgMgrProtocol,
>> +             CM_NULL_TOKEN,
>> +             &PccType4,
>> +             &PccType4Count
>> +             );
>> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Status = GetEArmObjPccSubspaceType5Info (
>> +             CfgMgrProtocol,
>> +             CM_NULL_TOKEN,
>> +             &PccType5,
>> +             &PccType5Count
>> +             );
>> +  if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  // Count the number of Pcc Subspaces.
>> +  MappingTableCount  = PccType0Count;
>> +  MappingTableCount += PccType1Count;
>> +  MappingTableCount += PccType2Count;
>> +  MappingTableCount += PccType3Count;
>> +  MappingTableCount += PccType4Count;
>> +  MappingTableCount += PccType5Count;
>> +
>> +  Status = MappingTableInitialize (MappingTable, MappingTableCount);
>> +  if (EFI_ERROR (Status)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  // Map the Subspace Ids for all types.
>> +
>> +  Status = MapPccSubspaceId (MappingTable, PccType0, PccType0Count);
>> +  if (EFI_ERROR (Status)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Status = MapPccSubspaceId (MappingTable, PccType1, PccType1Count);
>> +  if (EFI_ERROR (Status)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Status = MapPccSubspaceId (MappingTable, PccType2, PccType2Count);
>> +  if (EFI_ERROR (Status)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Status = MapPccSubspaceId (MappingTable, PccType3, PccType3Count);
>> +  if (EFI_ERROR (Status)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Status = MapPccSubspaceId (MappingTable, PccType4, PccType4Count);
>> +  if (EFI_ERROR (Status)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Status = MapPccSubspaceId (MappingTable, PccType5, PccType5Count);
>> +  if (EFI_ERROR (Status)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  // Compute the size of the PCCT table.
>> +  TableSize  = sizeof (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER);
>> +  TableSize += PccType0Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC);
>> +  TableSize += PccType1Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS);
>> +  TableSize += PccType2Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS);
>> +  TableSize += PccType3Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC);
>> +  TableSize += PccType4Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_4_EXTENDED_PCC);
>> +  TableSize += PccType5Count * sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS);
>> +
>> +  // Allocate a Buffer for the PCCT table.
>> +  *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize);
>> +  if (*Table == NULL) {
>> +    Status = EFI_OUT_OF_RESOURCES;
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Pcct = (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER *)*Table;
>> +
>> +  Status = AddAcpiHeader (
>> +             CfgMgrProtocol,
>> +             This,
>> +             &Pcct->Header,
>> +             AcpiTableInfo,
>> +             TableSize
>> +             );
>> +  if (EFI_ERROR (Status)) {
>> +    DEBUG ((
>> +      DEBUG_ERROR,
>> +      "ERROR: PCCT: Failed to add ACPI header. Status = %r\n",
>> +      Status
>> +      ));
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  Buffer     = (UINT8 *)Pcct;
>> +  Buffer    += sizeof (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER);
>> +  TableSize -= sizeof (EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER);
>> +
>> +  // Populate the PCCT table by following the Subspace Id mapping.
>> +  Status = PopulatePcctTable (MappingTable, Buffer, TableSize);
>> +  if (EFI_ERROR (Status)) {
>> +    ASSERT_EFI_ERROR (Status);
>> +    goto error_handler;
>> +  }
>> +
>> +  // Setup the Reserved fields once mHasPlatformInterrupt hase been populated.
>> +  Pcct->Flags    = mHasPlatformInterrupt;
>> +  Pcct->Reserved = EFI_ACPI_RESERVED_QWORD;
>> +
>> +  MappingTableFree (MappingTable);
>> +
>> +  return Status;
>> +
>> +error_handler:
>> +  DEBUG ((
>> +    DEBUG_ERROR,
>> +    "ERROR: PCCT: Failed to install table. Status = %r\n",
>> +    Status
>> +    ));
>> +
>> +  if (*Table != NULL) {
>> +    FreePool (*Table);
>> +    *Table = NULL;
>> +  }
>> +
>> +  MappingTableFree (MappingTable);
>> +
>> +  return Status;
>> +}
>> +
>> +/** Free any resources allocated for constructing the PCCT.
>> +
>> +  @param [in]      This           Pointer to the table generator.
>> +  @param [in]      AcpiTableInfo  Pointer to the ACPI Table Info.
>> +  @param [in]      CfgMgrProtocol Pointer to the Configuration Manager
>> +                                  Protocol Interface.
>> +  @param [in, out] Table          Pointer to the ACPI Table.
>> +
>> +  @retval EFI_SUCCESS           The resources were freed successfully.
>> +  @retval EFI_INVALID_PARAMETER The table pointer is NULL or invalid.
>> +**/
>> +STATIC
>> +EFI_STATUS
>> +FreePcctTableResources (
>> +  IN      CONST ACPI_TABLE_GENERATOR                  *CONST  This,
>> +  IN      CONST CM_STD_OBJ_ACPI_TABLE_INFO            *CONST  AcpiTableInfo,
>> +  IN      CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  *CONST  CfgMgrProtocol,
>> +  IN OUT        EFI_ACPI_DESCRIPTION_HEADER          **CONST  Table
>> +  )
>> +{
>> +  ASSERT (This != NULL);
>> +  ASSERT (AcpiTableInfo != NULL);
>> +  ASSERT (CfgMgrProtocol != NULL);
>> +  ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
>> +  ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
>> +
>> +  if ((Table == NULL) || (*Table == NULL)) {
>> +    DEBUG ((DEBUG_ERROR, "ERROR: PCCT: Invalid Table Pointer\n"));
>> +    ASSERT ((Table != NULL) && (*Table != NULL));
>> +    return EFI_INVALID_PARAMETER;
>> +  }
>> +
>> +  FreePool (*Table);
>> +  *Table = NULL;
>> +  return EFI_SUCCESS;
>> +}
>> +
>> +/** This macro defines the PCCT Table Generator revision.
>> +*/
>> +#define PCCT_GENERATOR_REVISION  CREATE_REVISION (1, 0)
>> +
>> +/** The interface for the PCCT Table Generator.
>> +*/
>> +STATIC
>> +ACPI_PCCT_GENERATOR  PcctGenerator = {
>> +  // ACPI table generator header
>> +  {
>> +    // Generator ID
>> +    CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdPcct),
>> +    // Generator Description
>> +    L"ACPI.STD.PCCT.GENERATOR",
>> +    // ACPI Table Signature
>> +    EFI_ACPI_6_4_PLATFORM_COMMUNICATIONS_CHANNEL_TABLE_SIGNATURE,
>> +    // ACPI Table Revision supported by this Generator
>> +    EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION,
>> +    // Minimum ACPI Table Revision supported by this Generator
>> +    EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION,
>> +    // Creator ID
>> +    TABLE_GENERATOR_CREATOR_ID_ARM,
>> +    // Creator Revision
>> +    PCCT_GENERATOR_REVISION,
>> +    // Build Table function
>> +    BuildPcctTable,
>> +    // Free Resource function
>> +    FreePcctTableResources,
>> +    // Extended build function not needed
>> +    NULL,
>> +    // Extended build function not implemented by the generator.
>> +    // Hence extended free resource function is not required.
>> +    NULL
>> +  },
>> +
>> +  // Private fields are defined from here.
>> +
>> +  // Mapping Table
>> +  {
>> +    // Table
>> +    NULL,
>> +    // MaxIndex
>> +    0,
>> +  },
>> +};
>> +
>> +/** Register the Generator with the ACPI Table Factory.
>> +
>> +  @param [in]  ImageHandle  The handle to the image.
>> +  @param [in]  SystemTable  Pointer to the System Table.
>> +
>> +  @retval EFI_SUCCESS           The Generator is registered.
>> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
>> +  @retval EFI_ALREADY_STARTED   The Generator for the Table ID
>> +                                is already registered.
>> +**/
>> +EFI_STATUS
>> +EFIAPI
>> +AcpiPcctLibConstructor (
>> +  IN  EFI_HANDLE        ImageHandle,
>> +  IN  EFI_SYSTEM_TABLE  *SystemTable
>> +  )
>> +{
>> +  EFI_STATUS  Status;
>> +
>> +  Status = RegisterAcpiTableGenerator (&PcctGenerator.Header);
>> +  DEBUG ((DEBUG_INFO, "PCCT: Register Generator. Status = %r\n", Status));
>> +  ASSERT_EFI_ERROR (Status);
>> +  return Status;
>> +}
>> +
>> +/** Deregister the Generator from the ACPI Table Factory.
>> +
>> +  @param [in]  ImageHandle  The handle to the image.
>> +  @param [in]  SystemTable  Pointer to the System Table.
>> +
>> +  @retval EFI_SUCCESS           The Generator is deregistered.
>> +  @retval EFI_INVALID_PARAMETER A parameter is invalid.
>> +  @retval EFI_NOT_FOUND         The Generator is not registered.
>> +**/
>> +EFI_STATUS
>> +EFIAPI
>> +AcpiPcctLibDestructor (
>> +  IN  EFI_HANDLE        ImageHandle,
>> +  IN  EFI_SYSTEM_TABLE  *SystemTable
>> +  )
>> +{
>> +  EFI_STATUS  Status;
>> +
>> +  Status = DeregisterAcpiTableGenerator (&PcctGenerator.Header);
>> +  DEBUG ((DEBUG_INFO, "PCCT: Deregister Generator. Status = %r\n", Status));
>> +  ASSERT_EFI_ERROR (Status);
>> +  return Status;
>> +}
>> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
>> new file mode 100644
>> index 000000000000..0631a1f5b74b
>> --- /dev/null
>> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPcctLibArm/PcctGenerator.h
>> @@ -0,0 +1,43 @@
>> +/** @file
>> +  PCCT Table Generator
>> +
>> +  Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
>> +  SPDX-License-Identifier: BSD-2-Clause-Patent
>> +
>> +  @par Reference(s):
>> +  - ACPI 6.4 Specification - January 2021
>> +    s14 PLATFORM COMMUNICATIONS CHANNEL (PCC)
>> +
>> +**/
>> +
>> +#ifndef PCCT_GENERATOR_H_
>> +#define PCCT_GENERATOR_H_
>> +
>> +#pragma pack(1)
>> +
>> +/** Structure used to map a Pcc Subspace to an index.
>> +*/
>> +typedef struct MappingTable {
>> +  /// Mapping table for Subspace Ids.
>> +  /// Subspace ID/Index <-> CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO pointer
>> +  VOID      **Table;
>> +
>> +  /// Number of entries in the Table.
>> +  UINT32    MaxIndex;
>> +} MAPPING_TABLE;
>> +
>> +/** A structure holding the Pcct generator and additional private data.
>> +*/
>> +typedef struct AcpiPcctGenerator {
>> +  /// ACPI Table generator header
>> +  ACPI_TABLE_GENERATOR    Header;
>> +
>> +  // Private fields are defined from here.
>> +
>> +  /// Table to map: Subspace ID/Index <-> CM_ARM_PCC_SUBSPACE_TYPE[X]_INFO pointer
>> +  MAPPING_TABLE           MappingTable;
>> +} ACPI_PCCT_GENERATOR;
>> +
>> +#pragma pack()
>> +
>> +#endif // PCCT_GENERATOR_H_
>> diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
>> index 21d1f3f08b16..4d7aa7963fae 100644
>> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
>> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
> 
> [SAMI] The changes in ConfigurationManagerObjectParser.c should be in
> the previous patch 10/14. Otherise it would break git bisect.
> 
> If you agree, I will move the changes in
> ConfigurationManagerObjectParser.c in patch 10/14 before merging.
> 
> [/SAMI]
> 
>> @@ -539,7 +539,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmCpcInfoParser[] = {
>>      { "NominalFrequencyInteger",               4,                                               "0x%lx", NULL },
>>    };
>>    
>> -/** A parser for the CM_ARM_MAILBOX_REGISTER_INFO struct.
>> +/** A parser for the PCC_MAILBOX_REGISTER_INFO struct.
>>    */
>>    STATIC CONST CM_OBJ_PARSER  CmArmMailboxRegisterInfoParser[] = {
>>      { "Register",     sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE), NULL,     NULL,
>> @@ -548,7 +548,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmMailboxRegisterInfoParser[] = {
>>      { "WriteMask",    8,                                               "0x%llx", NULL },
>>    };
>>    
>> -/** A parser for the CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO struct.
>> +/** A parser for the PCC_SUBSPACE_CHANNEL_TIMING_INFO struct.
>>    */
>>    STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceChannelTimingInfoParser[] = {
>>      { "NominalLatency",           4, "0x%x", NULL },
>> @@ -559,14 +559,14 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceChannelTimingInfoParser[] = {
>>    /** A parser for EArmObjPccSubspaceType0Info.
>>    */
>>    STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType0InfoParser[] = {
>> -  { "SubspaceId",    1,                                                "0x%x",   NULL },
>> -  { "Type",          1,                                                "0x%x",   NULL },
>> -  { "BaseAddress",   8,                                                "0x%llx", NULL },
>> -  { "AddressLength", 8,                                                "0x%llx", NULL },
>> -  { "DoorbellReg",   sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +  { "SubspaceId",    1,                                         "0x%x",   NULL },
>> +  { "Type",          1,                                         "0x%x",   NULL },
>> +  { "BaseAddress",   8,                                         "0x%llx", NULL },
>> +  { "AddressLength", 8,                                         "0x%llx", NULL },
>> +  { "DoorbellReg",   sizeof (PCC_MAILBOX_REGISTER_INFO),
>>        NULL, NULL, CmArmMailboxRegisterInfoParser,
>>        ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> -  { "DoorbellReg",   sizeof (CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO),
>> +  { "DoorbellReg",   sizeof (PCC_SUBSPACE_CHANNEL_TIMING_INFO),
>>        NULL, NULL, CmArmPccSubspaceChannelTimingInfoParser,
>>        ARRAY_SIZE (CmArmPccSubspaceChannelTimingInfoParser) },
>>    };
>> @@ -574,7 +574,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType0InfoParser[] = {
>>    /** A parser for EArmObjPccSubspaceType1Info.
>>    */
>>    STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
>> -  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
>> +  { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
>>        NULL, NULL, CmArmPccSubspaceType0InfoParser,
>>        ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
>>      { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),
>> @@ -585,12 +585,12 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
>>    /** A parser for EArmObjPccSubspaceType2Info.
>>    */
>>    STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
>> -  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
>> +  { "GenericPccInfo", sizeof (PCC_SUBSPACE_GENERIC_INFO),
>>        NULL, NULL, CmArmPccSubspaceType0InfoParser,
>>        ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
>> -  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
>> +  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,NULL,
>>        CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
>> -  { "PlatIrqAckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +  { "PlatIrqAckReg",  sizeof (PCC_MAILBOX_REGISTER_INFO),
>>        NULL, NULL, CmArmMailboxRegisterInfoParser,
>>        ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>>    };
>> @@ -598,21 +598,21 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
>>    /** A parser for EArmObjPccSubspaceType3Info or EArmObjPccSubspaceType4Info.
>>    */
>>    STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
>> -  { "GenericPccInfo",       sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
>> +  { "GenericPccInfo",       sizeof (PCC_SUBSPACE_GENERIC_INFO),
>>        NULL, NULL, CmArmPccSubspaceType0InfoParser,
>>        ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
>> -  { "PlatIrq",              sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
>> +  { "PlatIrq",              sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,NULL,
>>        CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
>> -  { "PlatIrqAckReg",        sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +  { "PlatIrqAckReg",        sizeof (PCC_MAILBOX_REGISTER_INFO),
>>        NULL, NULL, CmArmMailboxRegisterInfoParser,
>>        ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> -  { "CmdCompleteCheckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +  { "CmdCompleteCheckReg",  sizeof (PCC_MAILBOX_REGISTER_INFO),
>>        NULL, NULL, CmArmMailboxRegisterInfoParser,
>>        ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> -  { "CmdCompleteUpdateReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +  { "CmdCompleteUpdateReg", sizeof (PCC_MAILBOX_REGISTER_INFO),
>>        NULL, NULL, CmArmMailboxRegisterInfoParser,
>>        ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> -  { "ErrorStatusReg",       sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +  { "ErrorStatusReg",       sizeof (PCC_MAILBOX_REGISTER_INFO),
>>        NULL, NULL, CmArmMailboxRegisterInfoParser,
>>        ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>>    };
>> @@ -620,16 +620,16 @@ STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
>>    /** A parser for EArmObjPccSubspaceType5Info.
>>    */
>>    STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType5InfoParser[] = {
>> -  { "GenericPccInfo",      sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
>> +  { "GenericPccInfo",      sizeof (PCC_SUBSPACE_GENERIC_INFO),
>>        NULL, NULL, CmArmPccSubspaceType0InfoParser,
>>        ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
>> -  { "Version",             2,                                        "0x%x",NULL },
>> -  { "PlatIrq",             sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,  NULL,
>> +  { "Version",             2,                                 "0x%x",NULL },
>> +  { "PlatIrq",             sizeof (CM_ARM_GENERIC_INTERRUPT), NULL,  NULL,
>>        CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
>> -  { "CmdCompleteCheckReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +  { "CmdCompleteCheckReg", sizeof (PCC_MAILBOX_REGISTER_INFO),
>>        NULL, NULL, CmArmMailboxRegisterInfoParser,
>>        ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> -  { "ErrorStatusReg",      sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +  { "ErrorStatusReg",      sizeof (PCC_MAILBOX_REGISTER_INFO),
>>        NULL, NULL, CmArmMailboxRegisterInfoParser,
>>        ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>>    };

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

* Re: [PATCH 12/14] DynamicTablesPkg/AmlLib: Allow larger AccessSize for Pcc address space
  2022-10-26 12:34   ` Sami Mujawar
@ 2022-10-28 10:04     ` PierreGondois
  0 siblings, 0 replies; 37+ messages in thread
From: PierreGondois @ 2022-10-28 10:04 UTC (permalink / raw)
  To: Sami Mujawar, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Sami,

On 10/26/22 14:34, Sami Mujawar wrote:
> Hi Pierre,
> 
> There are some minor changes required marked inline as [SAMI].
> 
> If you agree, I will make the changes before merging.

Yes indeed, thanks for spotting it and for making the modification,

Regards,
Pierre


> 
> Regards,
> 
> Sami Mujawar
> 
> On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
>> From: Pierre Gondois <pierre.gondois@arm.com>
>>
>> For Pcc address space, the AccessSize field of a Register is
>> used to delcare the Pcc Subspace Id. This Id can be up to 256.
>>
>> Cf. ACPI 6.4, s14.7 Referencing the PCC address space
>>
>> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
>> ---
>>    .../Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c | 7 ++++++-
>>    1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
>> index 332962bed441..3901b6e47333 100644
>> --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
>> +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
>> @@ -1257,7 +1257,12 @@ AmlCodeGenRdRegister (
>>      AML_DATA_NODE                         *RdNode;
>>      EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR  RdRegister;
>>    
>> -  if ((AccessSize > EFI_ACPI_6_4_QWORD)  ||
>> +  // Cf Cf. ACPI 6.4, s14.7 Referencing the PCC address space
> [SAMI] Cf appears twice.
>> +  // The AccessSize represents the Subspace Id for the PCC address space.
>> +  if (((AddressSpace == EFI_ACPI_6_3_PLATFORM_COMMUNICATION_CHANNEL) &&
>> +       (AccessSize > 256)) ||
>> +      ((AddressSpace != EFI_ACPI_6_3_PLATFORM_COMMUNICATION_CHANNEL) &&
> [SAMI] Change EFI_ACPI_6_3_PLATFORM_COMMUNICATION_CHANNEL to
> EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL.
>> +       (AccessSize > EFI_ACPI_6_4_QWORD)) ||
>>          ((NameOpNode == NULL) && (NewRdNode == NULL)))
>>      {
>>        ASSERT (0);

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

* Re: [PATCH 10/14] DynamicTablesPkg: Add PCCT related objects
  2022-10-26 12:34   ` Sami Mujawar
@ 2022-10-28 10:04     ` PierreGondois
  0 siblings, 0 replies; 37+ messages in thread
From: PierreGondois @ 2022-10-28 10:04 UTC (permalink / raw)
  To: Sami Mujawar, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Sami,

On 10/26/22 14:34, Sami Mujawar wrote:
> Hi Pierre,
> 
> There are some minor updates that are required for this patch marked inline as [SAMI].
> 
> If you agree, I will make these changes before merging.

Yes indeed, thanks for spotting it and for making the modification,

Regards,
Pierre


> 
> Regards,
> 
> Sami Mujawar
> 
> On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
>> From: Pierre Gondois<pierre.gondois@arm.com>
>>
>> Introduce the following CmObj in the ArmNameSpaceObjects:
>>   - CM_ARM_MAILBOX_REGISTER_INFO
>>   - CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO
>>   - CM_ARM_PCC_SUBSPACE_GENERIC_INFO
>>   - CM_ARM_PCC_SUBPSACE_TYPE0_INFO
>>   - CM_ARM_PCC_SUBPSACE_TYPE1_INFO
>>   - CM_ARM_PCC_SUBPSACE_TYPE2_INFO
>>   - CM_ARM_PCC_SUBPSACE_TYPE3_INFO
>>   - CM_ARM_PCC_SUBPSACE_TYPE4_INFO
>>   - CM_ARM_PCC_SUBPSACE_TYPE5_INFO
>>
>> These objects allow to describe mailbox registers, pcc timings
>> and PCCT subspaces. They prepare the enablement of a PCCT generator.
>>
>> Also add the CmObjParsers associated to each object.
>>
>> Signed-off-by: Pierre Gondois<Pierre.Gondois@arm.com>
>> ---
>>   .../Include/ArmNameSpaceObjects.h             | 277 +++++++++++++++---
>>   .../ConfigurationManagerObjectParser.c        | 107 +++++++
>>   2 files changed, 341 insertions(+), 43 deletions(-)
>>
>> diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
>> index d711f3ec5938..5d5a8ce92a09 100644
>> --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
>> +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
>> @@ -22,49 +22,55 @@
>>       in the ARM Namespace
>>   */
>>   typedef enum ArmObjectID {
>> -  EArmObjReserved,                     ///<  0 - Reserved
>> -  EArmObjBootArchInfo,                 ///<  1 - Boot Architecture Info
>> -  EArmObjCpuInfo,                      ///<  2 - CPU Info
>> -  EArmObjPowerManagementProfileInfo,   ///<  3 - Power Management Profile Info
>> -  EArmObjGicCInfo,                     ///<  4 - GIC CPU Interface Info
>> -  EArmObjGicDInfo,                     ///<  5 - GIC Distributor Info
>> -  EArmObjGicMsiFrameInfo,              ///<  6 - GIC MSI Frame Info
>> -  EArmObjGicRedistributorInfo,         ///<  7 - GIC Redistributor Info
>> -  EArmObjGicItsInfo,                   ///<  8 - GIC ITS Info
>> -  EArmObjSerialConsolePortInfo,        ///<  9 - Serial Console Port Info
>> -  EArmObjSerialDebugPortInfo,          ///< 10 - Serial Debug Port Info
>> -  EArmObjGenericTimerInfo,             ///< 11 - Generic Timer Info
>> -  EArmObjPlatformGTBlockInfo,          ///< 12 - Platform GT Block Info
>> -  EArmObjGTBlockTimerFrameInfo,        ///< 13 - Generic Timer Block Frame Info
>> -  EArmObjPlatformGenericWatchdogInfo,  ///< 14 - Platform Generic Watchdog
>> -  EArmObjPciConfigSpaceInfo,           ///< 15 - PCI Configuration Space Info
>> -  EArmObjHypervisorVendorIdentity,     ///< 16 - Hypervisor Vendor Id
>> -  EArmObjFixedFeatureFlags,            ///< 17 - Fixed feature flags for FADT
>> -  EArmObjItsGroup,                     ///< 18 - ITS Group
>> -  EArmObjNamedComponent,               ///< 19 - Named Component
>> -  EArmObjRootComplex,                  ///< 20 - Root Complex
>> -  EArmObjSmmuV1SmmuV2,                 ///< 21 - SMMUv1 or SMMUv2
>> -  EArmObjSmmuV3,                       ///< 22 - SMMUv3
>> -  EArmObjPmcg,                         ///< 23 - PMCG
>> -  EArmObjGicItsIdentifierArray,        ///< 24 - GIC ITS Identifier Array
>> -  EArmObjIdMappingArray,               ///< 25 - ID Mapping Array
>> -  EArmObjSmmuInterruptArray,           ///< 26 - SMMU Interrupt Array
>> -  EArmObjProcHierarchyInfo,            ///< 27 - Processor Hierarchy Info
>> -  EArmObjCacheInfo,                    ///< 28 - Cache Info
>> -  EArmObjReserved29,                   ///< 29 - Reserved
>> -  EArmObjCmRef,                        ///< 30 - CM Object Reference
>> -  EArmObjMemoryAffinityInfo,           ///< 31 - Memory Affinity Info
>> -  EArmObjDeviceHandleAcpi,             ///< 32 - Device Handle Acpi
>> -  EArmObjDeviceHandlePci,              ///< 33 - Device Handle Pci
>> -  EArmObjGenericInitiatorAffinityInfo, ///< 34 - Generic Initiator Affinity
>> -  EArmObjSerialPortInfo,               ///< 35 - Generic Serial Port Info
>> -  EArmObjCmn600Info,                   ///< 36 - CMN-600 Info
>> -  EArmObjLpiInfo,                      ///< 37 - Lpi Info
>> -  EArmObjPciAddressMapInfo,            ///< 38 - Pci Address Map Info
>> -  EArmObjPciInterruptMapInfo,          ///< 39 - Pci Interrupt Map Info
>> -  EArmObjRmr,                          ///< 40 - Reserved Memory Range Node
>> -  EArmObjMemoryRangeDescriptor,        ///< 41 - Memory Range Descriptor
>> -  EArmObjCpcInfo,                      ///< 42 - Continuous Performance Control Info
>> +  EArmObjReserved,                                             ///<  0 - Reserved
>> +  EArmObjBootArchInfo,                                         ///<  1 - Boot Architecture Info
>> +  EArmObjCpuInfo,                                              ///<  2 - CPU Info
>> +  EArmObjPowerManagementProfileInfo,                           ///<  3 - Power Management Profile Info
>> +  EArmObjGicCInfo,                                             ///<  4 - GIC CPU Interface Info
>> +  EArmObjGicDInfo,                                             ///<  5 - GIC Distributor Info
>> +  EArmObjGicMsiFrameInfo,                                      ///<  6 - GIC MSI Frame Info
>> +  EArmObjGicRedistributorInfo,                                 ///<  7 - GIC Redistributor Info
>> +  EArmObjGicItsInfo,                                           ///<  8 - GIC ITS Info
>> +  EArmObjSerialConsolePortInfo,                                ///<  9 - Serial Console Port Info
>> +  EArmObjSerialDebugPortInfo,                                  ///< 10 - Serial Debug Port Info
>> +  EArmObjGenericTimerInfo,                                     ///< 11 - Generic Timer Info
>> +  EArmObjPlatformGTBlockInfo,                                  ///< 12 - Platform GT Block Info
>> +  EArmObjGTBlockTimerFrameInfo,                                ///< 13 - Generic Timer Block Frame Info
>> +  EArmObjPlatformGenericWatchdogInfo,                          ///< 14 - Platform Generic Watchdog
>> +  EArmObjPciConfigSpaceInfo,                                   ///< 15 - PCI Configuration Space Info
>> +  EArmObjHypervisorVendorIdentity,                             ///< 16 - Hypervisor Vendor Id
>> +  EArmObjFixedFeatureFlags,                                    ///< 17 - Fixed feature flags for FADT
>> +  EArmObjItsGroup,                                             ///< 18 - ITS Group
>> +  EArmObjNamedComponent,                                       ///< 19 - Named Component
>> +  EArmObjRootComplex,                                          ///< 20 - Root Complex
>> +  EArmObjSmmuV1SmmuV2,                                         ///< 21 - SMMUv1 or SMMUv2
>> +  EArmObjSmmuV3,                                               ///< 22 - SMMUv3
>> +  EArmObjPmcg,                                                 ///< 23 - PMCG
>> +  EArmObjGicItsIdentifierArray,                                ///< 24 - GIC ITS Identifier Array
>> +  EArmObjIdMappingArray,                                       ///< 25 - ID Mapping Array
>> +  EArmObjSmmuInterruptArray,                                   ///< 26 - SMMU Interrupt Array
>> +  EArmObjProcHierarchyInfo,                                    ///< 27 - Processor Hierarchy Info
>> +  EArmObjCacheInfo,                                            ///< 28 - Cache Info
>> +  EArmObjReserved29,                                           ///< 29 - Reserved
>> +  EArmObjCmRef,                                                ///< 30 - CM Object Reference
>> +  EArmObjMemoryAffinityInfo,                                   ///< 31 - Memory Affinity Info
>> +  EArmObjDeviceHandleAcpi,                                     ///< 32 - Device Handle Acpi
>> +  EArmObjDeviceHandlePci,                                      ///< 33 - Device Handle Pci
>> +  EArmObjGenericInitiatorAffinityInfo,                         ///< 34 - Generic Initiator Affinity
>> +  EArmObjSerialPortInfo,                                       ///< 35 - Generic Serial Port Info
>> +  EArmObjCmn600Info,                                           ///< 36 - CMN-600 Info
>> +  EArmObjLpiInfo,                                              ///< 37 - Lpi Info
>> +  EArmObjPciAddressMapInfo,                                    ///< 38 - Pci Address Map Info
>> +  EArmObjPciInterruptMapInfo,                                  ///< 39 - Pci Interrupt Map Info
>> +  EArmObjRmr,                                                  ///< 40 - Reserved Memory Range Node
>> +  EArmObjMemoryRangeDescriptor,                                ///< 41 - Memory Range Descriptor
>> +  EArmObjCpcInfo,                                              ///< 42 - Continuous Performance Control Info
>> +  EArmObjPccSubspaceType0Info,                                 ///< 43 - Pcc Subspace Type 0 Info
>> +  EArmObjPccSubspaceType1Info,                                 ///< 44 - Pcc Subspace Type 2 Info
>> +  EArmObjPccSubspaceType2Info,                                 ///< 45 - Pcc Subspace Type 2 Info
>> +  EArmObjPccSubspaceType3Info,                                 ///< 46 - Pcc Subspace Type 3 Info
>> +  EArmObjPccSubspaceType4Info,                                 ///< 47 - Pcc Subspace Type 4 Info
>> +  EArmObjPccSubspaceType5Info,                                 ///< 48 - Pcc Subspace Type 5 Info
>>     EArmObjMax
>>   } EARM_OBJECT_ID;
>>   
>> @@ -1095,6 +1101,191 @@ typedef struct CmArmRmrDescriptor {
>>   */
>>   typedef AML_CPC_INFO CM_ARM_CPC_INFO;
>>   
>> +/** A structure that describes a
>> +    PCC Mailbox Register.
>> +*/
>> +typedef struct PccMailboxRegisterInfo {
>> +  /// GAS describing the Register.
>> +  EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE    Register;
>> +
>> +  /** Mask of bits to preserve when writing.
>> +
>> +    This mask is also used for registers the Register is only read
> 
> [SAMI] I think the above line should be
> 
> This mask is also used for registers. The Register is only read
> 
> [/SAMI]
> 
>> +    and there is no write mask required. E.g.:
>> +    - Error Status mask (Cf. PCC Subspace types 3/4/5).
>> +    - Command Complete Check mask (Cf. PCC Subspace types 3/4/5).
>> +  */
>> +  UINT64    PreserveMask;
>> +
>> +  /// Mask of bits to set when writing.
>> +  UINT64    WriteMask;
>> +} PCC_MAILBOX_REGISTER_INFO;
>> +
>> +/** A structure that describes the
>> +    PCC Subspace CHannel Timings.
>> +*/
>> +typedef struct PccSubspaceChannelTimingInfo {
>> +  /// Expected latency to process a command, in microseconds.
>> +  UINT32    NominalLatency;
>> +
>> +  /** Maximum number of periodic requests that the subspace channel can
>> +      support, reported in commands per minute. 0 indicates no limitation.
>> +
>> +    This field is ignored for the PCC Subspace type 5 (HW Registers based).
>> +  */
>> +  UINT32    MaxPeriodicAccessRate;
>> +
>> +  /** Minimum amount of time that OSPM must wait after the completion
>> +      of a command before issuing the next command, in microseconds.
>> +  */
>> +  UINT16    MinRequestTurnaroundTime;
>> +} PCC_SUBSPACE_CHANNEL_TIMING_INFO;
>> +
>> +/** A structure that describes a
>> +    Generic PCC Subspace (Type 0).
>> +*/
>> +typedef struct CmArmPccSubspaceGenericInfo {
>> +  /** Subspace Id.
>> +
>> +  Cf. ACPI 6.4, s14.7 Referencing the PCC address space
>> +  Cf. s14.1.2 Platform Communications Channel Subspace Structures
>> +      The subspace ID of a PCC subspace is its index in the array of
>> +      subspace structures, starting with subspace 0.
>> +
>> +  At most 256 subspaces are supported.
>> +  */
>> +  UINT8                               SubspaceId;
>> +
>> +  /// Table type (or subspace).
>> +  UINT8                               Type;
>> +
>> +  /// Base address of the shared memory range.
>> +  /// This field is ignored for the PCC Subspace type 5 (HW Registers based).
>> +  UINT64                              BaseAddress;
>> +
>> +  /// Address length.
>> +  UINT64                              AddressLength;
>> +
>> +  /// Doorbell Register.
>> +  PCC_MAILBOX_REGISTER_INFO           DoorbellReg;
>> +
>> +  /// Mailbox Timings.
>> +  PCC_SUBSPACE_CHANNEL_TIMING_INFO    ChannelTiming;
>> +} PCC_SUBSPACE_GENERIC_INFO;
>> +
>> +/** A structure that describes a
>> +    PCC Subspace of type 0 (Generic).
>> +
>> +    ID: EArmObjPccSubspaceType0Info
>> +*/
>> +typedef PCC_SUBSPACE_GENERIC_INFO CM_ARM_PCC_SUBSPACE_TYPE0_INFO;
>> +
>> +/** A structure that describes a
>> +    PCC Subspace of type 1 (HW-Reduced).
>> +
>> +    ID: EArmObjPccSubspaceType1Info
>> +*/
>> +typedef struct CmArmPccSubspaceType1Info {
>> +  /** Generic Pcc information.
>> +
>> +    The Subspace of Type0 contains information that can be re-used
>> +    in other Subspace types.
>> +  */
>> +  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
>> +
>> +  /// Platform Interrupt.
>> +  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
>> +} CM_ARM_PCC_SUBSPACE_TYPE1_INFO;
>> +
>> +/** A structure that describes a
>> +    PCC Subspace of type 2 (HW-Reduced).
>> +
>> +    ID: EArmObjPccSubspaceType2Info
>> +*/
>> +typedef struct CmArmPccSubspaceType2Info {
>> +  /** Generic Pcc information.
>> +
>> +    The Subspace of Type0 contains information that can be re-used
>> +    in other Subspace types.
>> +  */
>> +  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
>> +
>> +  /// Platform Interrupt.
>> +  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
>> +
>> +  /// Platform Interrupt Register.
>> +  PCC_MAILBOX_REGISTER_INFO    PlatIrqAckReg;
>> +} CM_ARM_PCC_SUBSPACE_TYPE2_INFO;
>> +
>> +/** A structure that describes a
>> +    PCC Subspace of type 3 (Extended)
>> +
>> +    ID: EArmObjPccSubspaceType3Info
>> +*/
>> +typedef struct CmArmPccSubspaceType3Info {
>> +  /** Generic Pcc information.
>> +
>> +    The Subspace of Type0 contains information that can be re-used
>> +    in other Subspace types.
>> +  */
>> +  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
>> +
>> +  /// Platform Interrupt.
>> +  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
>> +
>> +  /// Platform Interrupt Register.
>> +  PCC_MAILBOX_REGISTER_INFO    PlatIrqAckReg;
>> +
>> +  /// Command Complete Check Register.
>> +  /// The WriteMask field is not used.
>> +  PCC_MAILBOX_REGISTER_INFO    CmdCompleteCheckReg;
>> +
>> +  /// Command Complete Update Register.
>> +  PCC_MAILBOX_REGISTER_INFO    CmdCompleteUpdateReg;
>> +
>> +  /// Error Status Register.
>> +  /// The WriteMask field is not used.
>> +  PCC_MAILBOX_REGISTER_INFO    ErrorStatusReg;
>> +} CM_ARM_PCC_SUBSPACE_TYPE3_INFO;
>> +
>> +/** A structure that describes a
>> +    PCC Subspace of type 4 (Extended)
>> +
>> +    ID: EArmObjPccSubspaceType4Info
>> +*/
>> +typedef CM_ARM_PCC_SUBSPACE_TYPE3_INFO CM_ARM_PCC_SUBSPACE_TYPE4_INFO;
>> +
>> +/** A structure that describes a
>> +    PCC Subspace of type 5 (HW-Registers).
>> +
>> +    ID: EArmObjPccSubspaceType5Info
>> +*/
>> +typedef struct CmArmPccSubspaceType5Info {
>> +  /** Generic Pcc information.
>> +
>> +    The Subspace of Type0 contains information that can be re-used
>> +    in other Subspace types.
>> +
>> +    MaximumPeriodicAccessRate doesn't need to be populated for
>> +    this structure.
>> +  */
>> +  PCC_SUBSPACE_GENERIC_INFO    GenericPccInfo;
>> +
>> +  /// Version.
>> +  UINT16                       Version;
>> +
>> +  /// Platform Interrupt.
>> +  CM_ARM_GENERIC_INTERRUPT     PlatIrq;
>> +
>> +  /// Command Complete Check Register.
>> +  /// The WriteMask field is not used.
>> +  PCC_MAILBOX_REGISTER_INFO    CmdCompleteCheckReg;
>> +
>> +  /// Error Status Register.
>> +  /// The WriteMask field is not used.
>> +  PCC_MAILBOX_REGISTER_INFO    ErrorStatusReg;
>> +} CM_ARM_PCC_SUBSPACE_TYPE5_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 2126beba8b9f..21d1f3f08b16 100644
>> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
>> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
>> @@ -539,6 +539,101 @@ STATIC CONST CM_OBJ_PARSER  CmArmCpcInfoParser[] = {
>>     { "NominalFrequencyInteger",               4,                                               "0x%lx", NULL },
>>   };
>>   
>> +/** A parser for the CM_ARM_MAILBOX_REGISTER_INFO struct.
>> +*/
>> +STATIC CONST CM_OBJ_PARSER  CmArmMailboxRegisterInfoParser[] = {
>> +  { "Register",     sizeof (EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE), NULL,     NULL,
>> +    AcpiGenericAddressParser, ARRAY_SIZE (AcpiGenericAddressParser) },
>> +  { "PreserveMask", 8,                                               "0x%llx", NULL },
>> +  { "WriteMask",    8,                                               "0x%llx", NULL },
>> +};
>> +
>> +/** A parser for the CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO struct.
>> +*/
>> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceChannelTimingInfoParser[] = {
>> +  { "NominalLatency",           4, "0x%x", NULL },
>> +  { "MaxPeriodicAccessRate",    4, "0x%x", NULL },
>> +  { "MinRequestTurnaroundTime", 2, "0x%x", NULL },
>> +};
>> +
>> +/** A parser for EArmObjPccSubspaceType0Info.
>> +*/
>> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType0InfoParser[] = {
>> +  { "SubspaceId",    1,                                                "0x%x",   NULL },
>> +  { "Type",          1,                                                "0x%x",   NULL },
>> +  { "BaseAddress",   8,                                                "0x%llx", NULL },
>> +  { "AddressLength", 8,                                                "0x%llx", NULL },
>> +  { "DoorbellReg",   sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
>> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> +  { "DoorbellReg",   sizeof (CM_ARM_PCC_SUBSPACE_CHANNEL_TIMING_INFO),
> [SAMI] "DoorbellReg" should be changed to "ChannelTiming" above.
>> +    NULL, NULL, CmArmPccSubspaceChannelTimingInfoParser,
>> +    ARRAY_SIZE (CmArmPccSubspaceChannelTimingInfoParser) },
>> +};
>> +
>> +/** A parser for EArmObjPccSubspaceType1Info.
>> +*/
>> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType1InfoParser[] = {
>> +  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
>> +    NULL, NULL, CmArmPccSubspaceType0InfoParser,
>> +    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
>> +  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),
>> +    NULL, NULL, CmArmGenericInterruptParser,
>> +    ARRAY_SIZE (CmArmGenericInterruptParser) },
>> +};
>> +
>> +/** A parser for EArmObjPccSubspaceType2Info.
>> +*/
>> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType2InfoParser[] = {
>> +  { "GenericPccInfo", sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
>> +    NULL, NULL, CmArmPccSubspaceType0InfoParser,
>> +    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
>> +  { "PlatIrq",        sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
>> +    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
>> +  { "PlatIrqAckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
>> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> +};
>> +
>> +/** A parser for EArmObjPccSubspaceType3Info or EArmObjPccSubspaceType4Info.
>> +*/
>> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType34InfoParser[] = {
>> +  { "GenericPccInfo",       sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
>> +    NULL, NULL, CmArmPccSubspaceType0InfoParser,
>> +    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
>> +  { "PlatIrq",              sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,NULL,
>> +    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
>> +  { "PlatIrqAckReg",        sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
>> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> +  { "CmdCompleteCheckReg",  sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
>> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> +  { "CmdCompleteUpdateReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
>> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> +  { "ErrorStatusReg",       sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
>> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> +};
>> +
>> +/** A parser for EArmObjPccSubspaceType5Info.
>> +*/
>> +STATIC CONST CM_OBJ_PARSER  CmArmPccSubspaceType5InfoParser[] = {
>> +  { "GenericPccInfo",      sizeof (CM_ARM_PCC_SUBSPACE_GENERIC_INFO),
>> +    NULL, NULL, CmArmPccSubspaceType0InfoParser,
>> +    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
>> +  { "Version",             2,                                        "0x%x",NULL },
>> +  { "PlatIrq",             sizeof (CM_ARM_GENERIC_INTERRUPT),        NULL,  NULL,
>> +    CmArmGenericInterruptParser, ARRAY_SIZE (CmArmGenericInterruptParser) },
>> +  { "CmdCompleteCheckReg", sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
>> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> +  { "ErrorStatusReg",      sizeof (CM_ARM_MAILBOX_REGISTER_INFO),
>> +    NULL, NULL, CmArmMailboxRegisterInfoParser,
>> +    ARRAY_SIZE (CmArmMailboxRegisterInfoParser) },
>> +};
>> +
>>   /** A parser for Arm namespace objects.
>>   */
>>   STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
>> @@ -623,6 +718,18 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
>>       ARRAY_SIZE (CmArmMemoryRangeDescriptorInfoParser) },
>>     { "EArmObjCpcInfo",                      CmArmCpcInfoParser,
>>       ARRAY_SIZE (CmArmCpcInfoParser) },
>> +  { "EArmObjPccSubspaceType0Info",         CmArmPccSubspaceType0InfoParser,
>> +    ARRAY_SIZE (CmArmPccSubspaceType0InfoParser) },
>> +  { "EArmObjPccSubspaceType1Info",         CmArmPccSubspaceType1InfoParser,
>> +    ARRAY_SIZE (CmArmPccSubspaceType1InfoParser) },
>> +  { "EArmObjPccSubspaceType2Info",         CmArmPccSubspaceType2InfoParser,
>> +    ARRAY_SIZE (CmArmPccSubspaceType2InfoParser) },
>> +  { "EArmObjPccSubspaceType3Info",         CmArmPccSubspaceType34InfoParser,
>> +    ARRAY_SIZE (CmArmPccSubspaceType34InfoParser) },
>> +  { "EArmObjPccSubspaceType4Info",         CmArmPccSubspaceType34InfoParser,
>> +    ARRAY_SIZE (CmArmPccSubspaceType34InfoParser) },
>> +  { "EArmObjPccSubspaceType5Info",         CmArmPccSubspaceType5InfoParser,
>> +    ARRAY_SIZE (CmArmPccSubspaceType5InfoParser) },
>>     { "EArmObjMax",                          NULL,                                  0                                },
>>   };
>>   

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

* Re: [PATCH 06/14] DynamicTablesPkg: Fix wrong/missing fields in CmObjParser
  2022-10-26 12:34   ` Sami Mujawar
@ 2022-10-28 10:05     ` PierreGondois
  0 siblings, 0 replies; 37+ messages in thread
From: PierreGondois @ 2022-10-28 10:05 UTC (permalink / raw)
  To: Sami Mujawar, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Sami,

On 10/26/22 14:34, Sami Mujawar wrote:
> Hi Pierre,
> 
> I have one comment marked inline as [SAMI].
> 
> I believe other than that change this patch should be good.

Yes indeed, thanks for spotting it and for making the modification,

Regards,
Pierre


> 
> Regards,
> 
> Sami Mujawar
> 
> On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
>> From: Pierre Gondois <pierre.gondois@arm.com>
>>
>> Add missing fields to the following CmObjParser objects:
>> - EArmObjGicDInfo
>> - EArmObjCacheInfo
>> and fix wrong formatting of:
>> - EArmObjLpiInfo
>>
>> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
>> ---
>>    .../ConfigurationManagerObjectParser.c        | 24 ++++++++++---------
>>    1 file changed, 13 insertions(+), 11 deletions(-)
>>
>> diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
>> index 040aaa4cbb17..2126beba8b9f 100644
>> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
>> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
>> @@ -303,7 +303,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmProcHierarchyInfoParser[] = {
>>      { "ParentToken",                sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>>      { "GicCToken",                  sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>>      { "NoOfPrivateResources",       4,                        "0x%x", NULL },
>> -  { "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }
>> +  { "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>> +  { "LpiToken",                   sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>>    };
>>    
>>    /** A parser for EArmObjCacheInfo.
>> @@ -315,7 +316,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmCacheInfoParser[] = {
>>      { "NumberOfSets",          4,                        "0x%x", NULL },
>>      { "Associativity",         4,                        "0x%x", NULL },
>>      { "Attributes",            1,                        "0x%x", NULL },
>> -  { "LineSize",              2,                        "0x%x", NULL }
>> +  { "LineSize",              2,                        "0x%x", NULL },
>> +  { "CacheId",               4,                        "0x%x", NULL },
>>    };
>>    
>>    /** A parser for EArmObjProcNodeIdInfo.
>> @@ -400,14 +402,14 @@ STATIC CONST CM_OBJ_PARSER  AcpiGenericAddressParser[] = {
>>    /** A parser for EArmObjLpiInfo.
>>    */
>>    STATIC CONST CM_OBJ_PARSER  CmArmLpiInfoParser[] = {
>> -  { "MinResidency",             4,                                               "0x%x",   NULL },
>> -  { "WorstCaseWakeLatency",     4,                                               "0x%x",   NULL },
>> -  { "Flags",                    4,                                               "0x%x",   NULL },
>> -  { "ArchFlags",                4,                                               "0x%x",   NULL },
>> -  { "ResCntFreq",               4,                                               "0x%x",   NULL },
>> -  { "EnableParentState",        4,                                               "0x%x",   NULL },
>> -  { "IsInteger",                1,                                               "%d",     NULL },
>> -  { "IntegerEntryMethod",       8,                                               "0x%llx", NULL },
>> +  { "MinResidency",             4,                                               "0x%x",   NULL        },
>> +  { "WorstCaseWakeLatency",     4,                                               "0x%x",   NULL        },
>> +  { "Flags",                    4,                                               "0x%x",   NULL        },
>> +  { "ArchFlags",                4,                                               "0x%x",   NULL        },
>> +  { "ResCntFreq",               4,                                               "0x%x",   NULL        },
>> +  { "EnableParentState",        4,                                               "0x%x",   NULL        },
>> +  { "IsInteger",                1,                                               "%d",     NULL        },
>> +  { "IntegerEntryMethod",       8,                                               "0x%llx", NULL        },
>>      { "RegisterEntryMethod",      sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
>>        NULL, NULL, AcpiGenericAddressParser,
>>        ARRAY_SIZE (AcpiGenericAddressParser) },
>> @@ -417,7 +419,7 @@ STATIC CONST CM_OBJ_PARSER  CmArmLpiInfoParser[] = {
>>      { "UsageCounterRegister",     sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE),
>>        NULL, NULL, AcpiGenericAddressParser,
>>        ARRAY_SIZE (AcpiGenericAddressParser) },
>> -  { "StateName",                16,                                              "0x%a",   NULL },
>> +  { "StateName",                16,                                              "NULL",   PrintString },
> [SAMI] I think the format specifier should be NULL and not enclosed in
> quotes. If you agree I will fix this before merging.
>>    };
>>    
>>    /** A parser for EArmObjPciAddressMapInfo.

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

* Re: [PATCH 03/14] DynamicTablesPkg: Update CmObjParser for IORT Rev E.d
  2022-10-26 12:34   ` Sami Mujawar
@ 2022-10-28 10:05     ` PierreGondois
  0 siblings, 0 replies; 37+ messages in thread
From: PierreGondois @ 2022-10-28 10:05 UTC (permalink / raw)
  To: Sami Mujawar, devel; +Cc: Alexei Fedorov, nd@arm.com

Hi Sami,

On 10/26/22 14:34, Sami Mujawar wrote:
> Hi Pierre,
> 
> I have one comment marked inline as [SAMI].
> 
> Other than that change this patch should be good.

Yes indeed, thanks for spotting it and for making the modification,

Regards,
Pierre

> 
> Regards,
> 
> Sami Mujawar
> 
> On 10/10/2022 10:20 am, Pierre.Gondois@arm.com wrote:
>> From: Pierre Gondois <pierre.gondois@arm.com>
>>
>> commit de200b7e2c3c ("DynamicTablesPkg: Update ArmNameSpaceObjects for
>> IORT Rev E.d")
>> adds new CmObj structures and fields to the ArmNameSpaceObjects.
>> Update the CmObjectParser accordingly.
>>
>> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
>> ---
>>    .../ConfigurationManagerObjectParser.c        | 59 ++++++++++++++-----
>>    1 file changed, 45 insertions(+), 14 deletions(-)
>>
>> diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
>> index b46f19693bb5..80ebb0708661 100644
>> --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
>> +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
>> @@ -183,21 +183,23 @@ STATIC CONST CM_OBJ_PARSER  CmArmFixedFeatureFlagsParser[] = {
>>    STATIC CONST CM_OBJ_PARSER  CmArmItsGroupNodeParser[] = {
>>      { "Token",      sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>>      { "ItsIdCount", 4,                        "0x%x", NULL },
>> -  { "ItsIdToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }
>> +  { "ItsIdToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>> +  { "Identifier", 4,                        "0x%x", NULL },
>>    };
>>    
>>    /** A parser for EArmObjNamedComponent.
>>    */
>>    STATIC CONST CM_OBJ_PARSER  CmArmNamedComponentNodeParser[] = {
>> -  { "Token",             sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>> -  { "IdMappingCount",    4,                        "0x%x", NULL },
>> -  { "IdMappingToken",    sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>> -  { "Flags",             4,                        "0x%x", NULL },
>> -  { "CacheCoherent",     4,                        "0x%x", NULL },
>> -  { "AllocationHints",   1,                        "0x%x", NULL },
>> -  { "MemoryAccessFlags", 1,                        "0x%x", NULL },
>> -  { "AddressSizeLimit",  1,                        "0x%x", NULL },
>> -  { "ObjectName",        sizeof (CHAR8 *),         "%a",   NULL }
>> +  { "Token",             sizeof (CM_OBJECT_TOKEN), "0x%p", NULL        },
>> +  { "IdMappingCount",    4,                        "0x%x", NULL        },
>> +  { "IdMappingToken",    sizeof (CM_OBJECT_TOKEN), "0x%p", NULL        },
>> +  { "Flags",             4,                        "0x%x", NULL        },
>> +  { "CacheCoherent",     4,                        "0x%x", NULL        },
>> +  { "AllocationHints",   1,                        "0x%x", NULL        },
>> +  { "MemoryAccessFlags", 1,                        "0x%x", NULL        },
>> +  { "AddressSizeLimit",  1,                        "0x%x", NULL        },
>> +  { "ObjectName",        1,                        NULL,   PrintString },
> 
> [SAMI] I think the Length field for ObjectName should be "sizeof (CHAR8
> *)" otherwise PrintCmObjDesc() would not advance to the next field
> correctly/
> 
> If you agree, I will make this change locally before pushing the patch.
> 
> [/SAMI]
> 
>> +  { "Identifier",        4,                        "0x%x", NULL        },
>>    };
>>    
>>    /** A parser for EArmObjRootComplex.
>> @@ -211,7 +213,10 @@ STATIC CONST CM_OBJ_PARSER  CmArmRootComplexNodeParser[] = {
>>      { "MemoryAccessFlags", 1,                        "0x%x", NULL },
>>      { "AtsAttribute",      4,                        "0x%x", NULL },
>>      { "PciSegmentNumber",  4,                        "0x%x", NULL },
>> -  { "MemoryAddressSize", 1,                        "0x%x", NULL }
>> +  { "MemoryAddressSize", 1,                        "0x%x", NULL },
>> +  { "PasidCapabilities", 2,                        "0x%x", NULL },
>> +  { "Flags",             4,                        "0x%x", NULL },
>> +  { "Identifier",        4,                        "0x%x", NULL },
>>    };
>>    
>>    /** A parser for EArmObjSmmuV1SmmuV2.
>> @@ -231,7 +236,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmSmmuV1SmmuV2NodeParser[] = {
>>      { "SMMU_NSgIrpt",          4,                        "0x%x",   NULL },
>>      { "SMMU_NSgIrptFlags",     4,                        "0x%x",   NULL },
>>      { "SMMU_NSgCfgIrpt",       4,                        "0x%x",   NULL },
>> -  { "SMMU_NSgCfgIrptFlags",  4,                        "0x%x",   NULL }
>> +  { "SMMU_NSgCfgIrptFlags",  4,                        "0x%x",   NULL },
>> +  { "Identifier",            4,                        "0x%x",   NULL },
>>    };
>>    
>>    /** A parser for EArmObjSmmuV3.
>> @@ -249,7 +255,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmSmmuV3NodeParser[] = {
>>      { "GerrInterrupt",        4,                        "0x%x",   NULL },
>>      { "SyncInterrupt",        4,                        "0x%x",   NULL },
>>      { "ProximityDomain",      4,                        "0x%x",   NULL },
>> -  { "DeviceIdMappingIndex", 4,                        "0x%x",   NULL }
>> +  { "DeviceIdMappingIndex", 4,                        "0x%x",   NULL },
>> +  { "Identifier",           4,                        "0x%x",   NULL },
>>    };
>>    
>>    /** A parser for EArmObjPmcg.
>> @@ -261,7 +268,8 @@ STATIC CONST CM_OBJ_PARSER  CmArmPmcgNodeParser[] = {
>>      { "BaseAddress",       8,                        "0x%llx", NULL },
>>      { "OverflowInterrupt", 4,                        "0x%x",   NULL },
>>      { "Page1BaseAddress",  8,                        "0x%llx", NULL },
>> -  { "ReferenceToken",    sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL }
>> +  { "ReferenceToken",    sizeof (CM_OBJECT_TOKEN), "0x%p",   NULL },
>> +  { "Identifier",        4,                        "0x%x",   NULL },
>>    };
>>    
>>    /** A parser for EArmObjGicItsIdentifierArray.
>> @@ -432,6 +440,25 @@ STATIC CONST CM_OBJ_PARSER  CmPciInterruptMapInfoParser[] = {
>>        ARRAY_SIZE (CmArmGenericInterruptParser) },
>>    };
>>    
>> +/** A parser for EArmObjRmr.
>> +*/
>> +STATIC CONST CM_OBJ_PARSER  CmArmRmrInfoParser[] = {
>> +  { "Token",             sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>> +  { "IdMappingCount",    4,                        "0x%x", NULL },
>> +  { "IdMappingToken",    sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>> +  { "Identifier",        4,                        "0x%x", NULL },
>> +  { "Flags",             4,                        "0x%x", NULL },
>> +  { "MemRangeDescCount", 4,                        "0x%x", NULL },
>> +  { "MemRangeDescToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL },
>> +};
>> +
>> +/** A parser for EArmObjMemoryRangeDescriptor.
>> +*/
>> +STATIC CONST CM_OBJ_PARSER  CmArmMemoryRangeDescriptorInfoParser[] = {
>> +  { "BaseAddress", 8, "0x%llx", NULL },
>> +  { "Length",      8, "0x%llx", NULL },
>> +};
>> +
>>    /** A parser for EArmObjCpcInfo.
>>    */
>>    STATIC CONST CM_OBJ_PARSER  CmArmCpcInfoParser[] = {
>> @@ -588,6 +615,10 @@ STATIC CONST CM_OBJ_PARSER_ARRAY  ArmNamespaceObjectParser[] = {
>>        ARRAY_SIZE (CmArmPciAddressMapInfoParser) },
>>      { "EArmObjPciInterruptMapInfo",          CmPciInterruptMapInfoParser,
>>        ARRAY_SIZE (CmPciInterruptMapInfoParser) },
>> +  { "EArmObjRmr",                          CmArmRmrInfoParser,
>> +    ARRAY_SIZE (CmArmRmrInfoParser) },
>> +  { "EArmObjMemoryRangeDescriptor",        CmArmMemoryRangeDescriptorInfoParser,
>> +    ARRAY_SIZE (CmArmMemoryRangeDescriptorInfoParser) },
>>      { "EArmObjCpcInfo",                      CmArmCpcInfoParser,
>>        ARRAY_SIZE (CmArmCpcInfoParser) },
>>      { "EArmObjMax",                          NULL,                                  0                                },

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

* Re: [edk2-devel] [PATCH 00/14] Add PCCT generator and various fixes
  2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
                   ` (14 preceding siblings ...)
       [not found] ` <171CAABD595C9750.32766@groups.io>
@ 2022-10-31 13:34 ` Sami Mujawar
  15 siblings, 0 replies; 37+ messages in thread
From: Sami Mujawar @ 2022-10-31 13:34 UTC (permalink / raw)
  To: PierreGondois, devel

[-- Attachment #1: Type: text/plain, Size: 77 bytes --]

Merged as 52199bf5326a..e9a3613ce066

Thanks.

Regards,

Sami Mujawar

[-- Attachment #2: Type: text/html, Size: 101 bytes --]

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

end of thread, other threads:[~2022-10-31 13:34 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-10  9:20 [PATCH 00/14] Add PCCT generator and various fixes PierreGondois
2022-10-10  9:20 ` [PATCH 01/14] DynamicTablesPkg: Use correct print formatter PierreGondois
2022-10-26 12:36   ` Sami Mujawar
2022-10-10  9:20 ` [PATCH 02/14] DynamicTablesPkg: Add PrintString to CmObjParser PierreGondois
2022-10-26 12:36   ` Sami Mujawar
2022-10-10  9:20 ` [PATCH 03/14] DynamicTablesPkg: Update CmObjParser for IORT Rev E.d PierreGondois
2022-10-26 12:34   ` Sami Mujawar
2022-10-28 10:05     ` PierreGondois
2022-10-10  9:20 ` [PATCH 04/14] DynamicTablesPkg: Update CmObjParser for MinorRevision PierreGondois
2022-10-26 12:36   ` Sami Mujawar
2022-10-10  9:20 ` [PATCH 05/14] DynamicTablesPkg: Fix GTBlock and GTBlockTimerFrame CmObjParsers PierreGondois
2022-10-26 12:37   ` Sami Mujawar
2022-10-10  9:20 ` [PATCH 06/14] DynamicTablesPkg: Fix wrong/missing fields in CmObjParser PierreGondois
2022-10-26 12:34   ` Sami Mujawar
2022-10-28 10:05     ` PierreGondois
2022-10-10  9:20 ` [PATCH 07/14] DynamicTablesPkg: Remove deprecated APIs PierreGondois
2022-10-26 12:37   ` Sami Mujawar
2022-10-10  9:20 ` [PATCH 08/14] DynamicTablesPkg: FdtHwInfoParserLib: Remove wrong comment PierreGondois
2022-10-26 12:37   ` Sami Mujawar
2022-10-10  9:20 ` [PATCH 09/14] DynamicTablesPkg: Fix Ssdt PCI generation comments PierreGondois
2022-10-26 12:37   ` Sami Mujawar
2022-10-10  9:20 ` [PATCH 10/14] DynamicTablesPkg: Add PCCT related objects PierreGondois
2022-10-26 12:34   ` Sami Mujawar
2022-10-28 10:04     ` PierreGondois
2022-10-10  9:20 ` [PATCH 11/14] DynamicTablesPkg: Add PCCT Generator PierreGondois
2022-10-26 12:35   ` Sami Mujawar
2022-10-28 10:02     ` PierreGondois
2022-10-10  9:20 ` [PATCH 12/14] DynamicTablesPkg/AmlLib: Allow larger AccessSize for Pcc address space PierreGondois
2022-10-26 12:34   ` Sami Mujawar
2022-10-28 10:04     ` PierreGondois
2022-10-10  9:20 ` [PATCH 13/14] DynamicTablesPkg: Readme.md: Update available tables for generation PierreGondois
2022-10-26 12:07   ` Sami Mujawar
2022-10-10  9:20 ` [PATCH 14/14] ShellPkg/AcpiView: Update PCCT fields for ACPI 6.5 PierreGondois
2022-10-26 12:06   ` Sami Mujawar
     [not found] ` <171CAABD595C9750.32766@groups.io>
2022-10-10  9:48   ` [edk2-devel] " PierreGondois
2022-10-11  1:41     ` Ni, Ray
2022-10-31 13:34 ` [edk2-devel] [PATCH 00/14] Add PCCT generator and various fixes Sami Mujawar

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