summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library
diff options
context:
space:
mode:
authorChris Jones <christopher.jones@arm.com>2021-08-13 18:02:45 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-10-06 11:20:48 +0000
commitb4da6c29f1d36031e04212f53277ce0dcba309f1 (patch)
tree2f3889d241a11253b5dfe02792c6fe1e95c297e3 /ShellPkg/Library
parent80e67bcb235068eed6cbed4f5d4b421042d66df6 (diff)
downloadedk2-b4da6c29f1d36031e04212f53277ce0dcba309f1.tar.gz
edk2-b4da6c29f1d36031e04212f53277ce0dcba309f1.tar.bz2
edk2-b4da6c29f1d36031e04212f53277ce0dcba309f1.zip
ShellPkg: Add Type 5 PCC Subspace Structure parser
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@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c58
1 files changed, 55 insertions, 3 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c
index 7d3a2dd10d..6beee70b23 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},
@@ -368,6 +368,29 @@ STATIC CONST ACPI_PARSER PccSubspaceType3Parser[] = {
};
/**
+ 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.
@param [in] Ptr Pointer to the start of Subspace Structure.
@@ -483,6 +506,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.
When trace is enabled this function parses the PCCT table and
@@ -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 (