Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 28 additions & 8 deletions DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1554,9 +1554,14 @@ AddSmmuV3Nodes (
{
SmmuV3Node->Node.Revision = 2;
SmmuV3Node->Node.Identifier = EFI_ACPI_RESERVED_DWORD;
} else {
} else if (AcpiTableInfo->AcpiTableRevision <
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_06)
{
SmmuV3Node->Node.Revision = 4;
SmmuV3Node->Node.Identifier = NodeList->Identifier;
} else {
SmmuV3Node->Node.Revision = 5;
SmmuV3Node->Node.Identifier = NodeList->Identifier;
}

// SMMUv3 specific data
Expand All @@ -1577,12 +1582,27 @@ AddSmmuV3Nodes (
SmmuV3Node->ProximityDomain = 0;
}

if ((SmmuV3Node->Event != 0) && (SmmuV3Node->Pri != 0) &&
(SmmuV3Node->Gerr != 0) && (SmmuV3Node->Sync != 0))
{
// If all the SMMU control interrupts are GSIV based,
// the DeviceID mapping index field is ignored.
SmmuV3Node->DeviceIdMappingIndex = 0;
/* DeviceID mapping valid flag was introduced in IORT rev E.e
* for SMMUV3 nodes rev. > 5.
* For older revisions, if all the SMMU control interrupts are GSIV
* based, DeviceID mapping index field is ignored.
* If the DeviceID mapping index valid flag is set to 0,
* DeviceID mapping index field must be ignored.
* Where the SMMU uses message signaled interrupts for
* its control interrupts, DeviceId Mapping Index contains an
* index into the array of ID mapping.
*/

if ((SmmuV3Node->Node.Revision < 5) || (!(SmmuV3Node->Flags & EFI_ACPI_IORT_SMMUv3_FLAG_DEVICEID_VALID))) {
if ((SmmuV3Node->Event != 0) && (SmmuV3Node->Pri != 0) &&
(SmmuV3Node->Gerr != 0) && (SmmuV3Node->Sync != 0))
{
// If all the SMMU control interrupts are GSIV based,
// the DeviceID mapping index field is ignored.
SmmuV3Node->DeviceIdMappingIndex = 0;
} else {
SmmuV3Node->DeviceIdMappingIndex = NodeList->DeviceIdMappingIndex;
}
} else {
SmmuV3Node->DeviceIdMappingIndex = NodeList->DeviceIdMappingIndex;
}
Expand Down Expand Up @@ -2819,7 +2839,7 @@ ACPI_IORT_GENERATOR IortGenerator = {
// ACPI Table Signature
EFI_ACPI_6_4_IO_REMAPPING_TABLE_SIGNATURE,
// ACPI Table Revision supported by this Generator
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05,
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_06,
// Minimum supported ACPI Table Revision
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00,
// Creator ID
Expand Down
4 changes: 4 additions & 0 deletions MdePkg/Include/IndustryStandard/IoRemappingTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
@par Reference(s):
- IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022
(https://developer.arm.com/documentation/den0049/)
- IO Remapping Table, Platform Design Document, Revision E.e, Sept 2022
(https://developer.arm.com/documentation/den0049/)

@par Glossary:
- Ref : Reference
Expand All @@ -24,6 +26,7 @@
#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00 0x0
#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION_04 0x4 // Deprecated
#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05 0x5
#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION_06 0x6

#define EFI_ACPI_IORT_TYPE_ITS_GROUP 0x0
#define EFI_ACPI_IORT_TYPE_NAMED_COMP 0x1
Expand Down Expand Up @@ -59,6 +62,7 @@
#define EFI_ACPI_IORT_SMMUv3_FLAG_COHAC_OVERRIDE BIT0
#define EFI_ACPI_IORT_SMMUv3_FLAG_HTTU_OVERRIDE BIT1
#define EFI_ACPI_IORT_SMMUv3_FLAG_PROXIMITY_DOMAIN BIT3
#define EFI_ACPI_IORT_SMMUv3_FLAG_DEVICEID_VALID BIT4

#define EFI_ACPI_IORT_SMMUv3_MODEL_GENERIC 0x0
#define EFI_ACPI_IORT_SMMUv3_MODEL_HISILICON_HI161X 0x1
Expand Down