[edk2-devel] [PATCH v1 2/2] ShellPkg: Add Type 5 PCC Subspace Structure parser

Chris Jones christopher.jones at arm.com
Fri Aug 13 17:02:45 UTC 2021


Bugzilla: 3563 (https://bugzilla.tianocore.org/show_bug.cgi?id=3563)

Update the Acpiview PCCT parser with the HW Registers based
Communications Subspace Structure (Type 5) as defined in Section 14.1.7
of the ACPI 6.4 specification.

Signed-off-by: Chris Jones <christopher.jones at arm.com>
---
 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c | 58 +++++++++++++++++++-
 1 file changed, 55 insertions(+), 3 deletions(-)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
index 7d3a2dd10dc928265bad3711e929d96c1ed40b1d..6beee70b23a3b32992efa0edac48fe236591b9f5 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
@@ -77,7 +77,7 @@ ValidateRangeLength8 (
 }
 
 /**
-  This function validates address space for type 0 structure.
+  This function validates address space for Memory/IO GAS.
 
   @param [in] Ptr     Pointer to the start of the field data.
   @param [in] Context Pointer to context specific information e.g. this
@@ -86,7 +86,7 @@ ValidateRangeLength8 (
 STATIC
 VOID
 EFIAPI
-ValidatePccType0Gas (
+ValidatePccMemoryIoGas (
   IN UINT8* Ptr,
   IN VOID*  Context
   )
@@ -274,7 +274,7 @@ STATIC CONST ACPI_PARSER PccSubspaceType0Parser[] = {
   {L"Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL},
   {L"Memory Range Length", 8, 16, L"0x%lx", NULL, NULL, ValidateRangeLength8,
     NULL},
-  {L"Doorbell Register", 12, 24, NULL, DumpGas, NULL, ValidatePccType0Gas,
+  {L"Doorbell Register", 12, 24, NULL, DumpGas, NULL, ValidatePccMemoryIoGas,
     NULL},
   {L"Doorbell Preserve", 8, 36, L"0x%lx", NULL, NULL, NULL, NULL},
   {L"Doorbell Write", 8, 44, L"0x%lx", NULL, NULL, NULL, NULL},
@@ -367,6 +367,29 @@ STATIC CONST ACPI_PARSER PccSubspaceType3Parser[] = {
   {L"Error Status Mask", 8, 156, L"0x%lx", NULL, NULL, NULL, NULL},
 };
 
+/**
+  An ACPI_PARSER array describing the HW Registers based Communications
+  Subspace Structure - Type 5
+*/
+STATIC CONST ACPI_PARSER PccSubspaceType5Parser[] = {
+  PCC_SUBSPACE_HEADER (),
+  {L"Version", 2, 2, L"0x%x", NULL, NULL, NULL, NULL},
+  {L"Base Address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL},
+  {L"Shared Memory Range Length", 8, 12, L"0x%lx", NULL, NULL, NULL, NULL},
+  {L"Doorbell Register", 12, 20, NULL, DumpGas, NULL,
+    ValidatePccMemoryIoGas, NULL},
+  {L"Doorbell Preserve", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL},
+  {L"Doorbell Write", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL},
+  {L"Command Complete Check Register", 12, 48, NULL, DumpGas, NULL,
+    ValidatePccMemoryIoGas, NULL},
+  {L"Command Complete Check Mask", 8, 60, L"0x%lx", NULL, NULL, NULL, NULL},
+  {L"Error Status Register", 12, 68, NULL, DumpGas, NULL,
+    ValidatePccMemoryIoGas, NULL},
+  {L"Error Status Mask", 8, 80, L"0x%lx", NULL, NULL, NULL, NULL},
+  {L"Nominal Latency", 4, 88, L"0x%x", NULL, NULL, NULL, NULL},
+  {L"Minimum Request Turnaround Time", 4, 92, L"0x%x", NULL, NULL, NULL, NULL}
+};
+
 /**
   This function parses the PCC Subspace type 0.
 
@@ -482,6 +505,29 @@ DumpPccSubspaceType4 (
     );
 }
 
+/**
+  This function parses the PCC Subspace type 5.
+
+  @param [in] Ptr     Pointer to the start of the Subspace Structure.
+  @param [in] Length  Length of the Subspace Structure.
+**/
+STATIC
+VOID
+DumpPccSubspaceType5 (
+  IN UINT8* Ptr,
+  IN UINT8  Length
+  )
+{
+  ParseAcpi (
+    TRUE,
+    2,
+    "Subspace Type 5",
+    Ptr,
+    Length,
+    PARSER_PARAMS (PccSubspaceType5Parser)
+    );
+}
+
 /**
   This function parses the ACPI PCCT table including its sub-structures
   of type 0 through 4.
@@ -593,6 +639,12 @@ ParseAcpiPcct (
           *PccSubspaceLength
           );
         break;
+      case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
+        DumpPccSubspaceType5 (
+          PccSubspacePtr,
+          *PccSubspaceLength
+          );
+        break;
       default:
         IncrementErrorCount ();
         Print (
-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#79286): https://edk2.groups.io/g/devel/message/79286
Mute This Topic: https://groups.io/mt/84868166/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list