IORT: Add in support for the SMMUv3 subtable
PATCH 1/1 IORT: Add in support for the SMMUv3 subtable
The most recent version of the IORT specification adds in a definition for a subtable to describe SMMUv3 devices; there is already a subtable for SMMUv1/v2 devices.
Add in the definition of the subtable, add in the code to compile it, and add in a template for it.
--- source/common/dmtbdump.c | 6 ++++++ source/common/dmtbinfo.c | 19 +++++++++++++++++++ source/compiler/dttable1.c | 17 +++++++++++++++-- source/compiler/dttemplate.h | 15 +++++++++++---- source/include/acdisasm.h | 1 + source/include/actbl2.h | 25 +++++++++++++++++++++++-- 6 files changed, 75 insertions(+), 8 deletions(-)
source/common/dmtbdump.c +6 -0
@@ -1845,6 +1845,12 @@ AcpiDmDumpIort ( IortSmmu =ACPI_ADD_PTR (ACPI_IORT_SMMU , IortNode, NodeOffset);break ; +case ACPI_IORT_NODE_SMMU_V3 : + + InfoTable = AcpiDmTableInfoIort4; + Length = IortNode->Length - NodeOffset; +break ; +default : AcpiOsPrintf ("\n**** Unknown IORT node type 0x%X\n",
source/common/dmtbinfo.c +0 -0
@@ -242,6 +242,7 @@#define ACPI_IORT1_OFFSET (f) (UINT16) ACPI_OFFSET
(ACPI_IORT_NAMED_COMPONENT,f)
#define ACPI_IORT2_OFFSET(f) (UINT16) ACPI_OFFSET
(ACPI_IORT_ROOT_COMPLEX,f)
#define ACPI_IORT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU,f) +#define ACPI_IORT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_V3,f) #define ACPI_IORTA_OFFSET(f) (UINT16) ACPI_OFFSET
(ACPI_IORT_MEMORY_ACCESS,f)
#define ACPI_IORTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NODE,f)
#define ACPI_IORTM_OFFSET(f) (UINT16) ACPI_OFFSET
(ACPI_IORT_ID_MAPPING,f)
@@ -328,6 +329,7 @@
#define ACPI_GTDT0a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET
(ACPI_GTDT_TIMER_ENTRY,f,o)
#define ACPI_GTDT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o) #define ACPI_IORT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU,f,o) +#define ACPI_IORT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_V3,f,o) #define ACPI_IORTA_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET
(ACPI_IORT_MEMORY_ACCESS,f,o)
#define ACPI_IORTM_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_ID_MAPPING,f,o)
#define ACPI_LPITH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_LPIT_HEADER,f,o)
@@ -1633,6 +1635,23 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[] =
ACPI_DMT_TERMINATOR
};
+/* 0x04: SMMUv3 */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] =
+{
+ {ACPI_DMT_UINT64, ACPI_IORT4_OFFSET (BaseAddress), "Base
Address", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Flags), "Flags
(decoded below)", 0},
+ {ACPI_DMT_FLAG0, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "COHACC
Override", 0},
+ {ACPI_DMT_FLAG1, ACPI_IORT4_FLAG_OFFSET (Flags, 0), "HTTU
Override", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_IORT4_OFFSET (VatosAddress), "VATOS
Address", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (Model), "Model", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (EventGsiv), "Event
GSIV", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (PriGsiv), "PRI GSIV", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (GerrGsiv), "GERRGSIV", 0},
+ {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (SyncGsiv), "Sync
GSIV", 0},
+ ACPI_DMT_TERMINATOR
+};
/*******************************************************************************
*
source/compiler/dttable1.c +15 -2
@@ -1315,8 +1315,8 @@ DtCompileIort (DtInsertSubtable (ParentTable, Subtable);/* -* Using ACPI_SUB_PTR, We needn't define a seperate structure. Care -* should be taken to avoid accessing ACPI_TABLE_HADER fields. +* Using ACPI_SUB_PTR, We needn't define a separate structure. Care +* should be taken to avoid accessing ACPI_TABLE_HEADER fields. */ Iort =ACPI_SUB_PTR (ACPI_TABLE_IORT , Subtable->Buffer,sizeof (ACPI_TABLE_HEADER ));
@@ -1547,6 +1547,19 @@ DtCompileIort ( IortSmmu->PmuInterruptCount = PmuIrptNumber;break ; +case ACPI_IORT_NODE_SMMU_V3 : + + Status =DtCompileTable (PFieldList, AcpiDmTableInfoIort4, + &Subtable, TRUE); +if (ACPI_FAILURE (Status)) + { +return (Status); + } + +DtInsertSubtable (ParentTable, Subtable); + NodeLength += Subtable->Length; +break ; +default :DtFatal (ASL_MSG_UNKNOWN_SUBTABLE , SubtableStart,"IORT" );
source/compiler/dttemplate.h +11 -4
@@ -615,11 +615,11 @@ const unsigned char TemplateHpet[] =const unsigned char TemplateIort[] = { -0x49 ,0x4F ,0x52 ,0x54 ,0x0C ,0x01 ,0x00 ,0x00 ,/* 00000000 "IORT...." */ -0x00 ,0xBC ,0x49 ,0x4E ,0x54 ,0x45 ,0x4C ,0x20 ,/* 00000008 "..INTEL " */ +0x49 ,0x4F ,0x52 ,0x54 ,0x48 ,0x01 ,0x00 ,0x00 ,/* 00000000 "IORTH..." */ +0x00 ,0x02 ,0x49 ,0x4E ,0x54 ,0x45 ,0x4C ,0x20 ,/* 00000008 "..INTEL " */ 0x54 ,0x45 ,0x4D ,0x50 ,0x4C ,0x41 ,0x54 ,0x45 ,/* 00000010 "TEMPLATE" */ 0x00 ,0x00 ,0x00 ,0x00 ,0x49 ,0x4E ,0x54 ,0x4C ,/* 00000018 "....INTL" */ -0x10 ,0x04 ,0x15 ,0x20 ,0x04 ,0x00 ,0x00 ,0x00 ,/* 00000020 "... ...." */ +0x12 ,0x02 ,0x16 ,0x20 ,0x05 ,0x00 ,0x00 ,0x00 ,/* 00000020 "... ...." */ 0x34 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,/* 00000028 "4......." */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x2C ,0x00 ,0x00 ,/* 00000030 ".....,.." */ 0x00 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x00 ,0x00 ,/* 00000038 "........" */
@@ -648,7 +648,14 @@ const unsigned char TemplateIort[] =0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,/* 000000F0 "........" */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,/* 000000F8 "........" */ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,/* 00000100 "........" */ -0x00 ,0x00 ,0x00 ,0x00 /* 00000108 "...." */ +0x00 ,0x00 ,0x00 ,0x00 ,0x04 ,0x3C ,0x00 ,0x00 ,/* 00000108 ".....<.." */ +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,/* 00000110 "........" */ +0x3C ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,/* 00000118 "<......." */ +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,/* 00000120 "........" */ +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,/* 00000128 "........" */ +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,/* 00000130 "........" */ +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,/* 00000138 "........" */ +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 /* 00000140 "........" */ }; const unsigned char TemplateIvrs[] =
source/include/acdisasm.h +1 -0
@@ -391,6 +391,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3[];extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3a[];extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3b[];extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[];extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortAcc[];extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr[];extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[];
source/include/actbl2.h +23 -2
@@ -834,7 +834,7 @@ typedef struct acpi_ibft_target* IORT - IO Remapping Table * * Conforms to "IO Remapping Table System Software on ARM Platforms", -* Document number: ARM DEN 0049A, 2015 +* Document number: ARM DEN 0049B, October 2015 * ******************************************************************************/
@@ -870,7 +870,8 @@ enum AcpiIortNodeTypeACPI_IORT_NODE_ITS_GROUP =0x00 ,ACPI_IORT_NODE_NAMED_COMPONENT =0x01 ,ACPI_IORT_NODE_PCI_ROOT_COMPLEX =0x02 , - ACPI_IORT_NODE_SMMU = 0x03 +ACPI_IORT_NODE_SMMU =0x03 , + ACPI_IORT_NODE_SMMU_V3 = 0x04 };
@@ -979,6 +980,26 @@ typedef struct acpi_iort_smmu#define ACPI_IORT_SMMU_COHERENT_WALK (1<<1) +typedef struct acpi_iort_smmu_v3 +{ +UINT64 BaseAddress;/* SMMUv3 base address */ +UINT32 Flags; +UINT32 Reserved; +UINT64 VatosAddress; +UINT32 Model;/* O: generic SMMUv3 */ +UINT32 EventGsiv; +UINT32 PriGsiv; +UINT32 GerrGsiv; +UINT32 SyncGsiv; + +}ACPI_IORT_SMMU_V3 ; + +/* Masks for Flags field above */ + +#define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1) +#define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (1<<1) + +/******************************************************************************* * * IVRS - I/O Virtualization Reporting Structure
Signature · 12 lines
2.5.0 -- ciao, al ----------------------------------- Al Stone Software Engineer Red Hat, Inc. [email protected] -----------------------------------
Quoted 8 lines · Al Stone
The most recent version of the IORT specification adds in a definition for a subtable to describe SMMUv3 devices; there is already a subtable for SMMUv1/v2 devices.
Add in the definition of the subtable, add in the code to compile it, and add in a template for it.
Signed-off-by Al Stone <[email protected]>
[snip...]
My apologies. Please ignore this patch. I inadvertently sent it to the wrong mailing list.
Some day, I hope to know how to use email well... :/
Signature · 8 lines
ciao, al ----------------------------------- Al Stone Software Engineer Red Hat, Inc. [email protected] -----------------------------------