]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/IoRemappingTable.h
MdePkg/IndustryStandard: add definitions for ACPI 6.0 IORT
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / IoRemappingTable.h
1 /** @file
2 ACPI IO Remapping Table (IORT) as specified in ARM spec DEN0049B
3
4 http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf
5
6 Copyright (c) 2017, Linaro Limited. All rights reserved.<BR>
7
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 **/
16
17 #ifndef __IO_REMAPPING_TABLE_H__
18 #define __IO_REMAPPING_TABLE_H__
19
20 #include <IndustryStandard/Acpi.h>
21
22 #define EFI_ACPI_IO_REMAPPING_TABLE_REVISION 0x0
23
24 #define EFI_ACPI_IORT_TYPE_ITS_GROUP 0x0
25 #define EFI_ACPI_IORT_TYPE_NAMED_COMP 0x1
26 #define EFI_ACPI_IORT_TYPE_ROOT_COMPLEX 0x2
27 #define EFI_ACPI_IORT_TYPE_SMMUv1v2 0x3
28 #define EFI_ACPI_IORT_TYPE_SMMUv3 0x4
29
30 #define EFI_ACPI_IORT_MEM_ACCESS_PROP_CCA BIT0
31
32 #define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_TR BIT0
33 #define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_WA BIT1
34 #define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_RA BIT2
35 #define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_AHO BIT3
36
37 #define EFI_ACPI_IORT_MEM_ACCESS_FLAGS_CPM BIT0
38 #define EFI_ACPI_IORT_MEM_ACCESS_FLAGS_DACS BIT1
39
40 #define EFI_ACPI_IORT_SMMUv1v2_MODEL_v1 0x0
41 #define EFI_ACPI_IORT_SMMUv1v2_MODEL_v2 0x1
42 #define EFI_ACPI_IORT_SMMUv1v2_MODEL_MMU400 0x2
43 #define EFI_ACPI_IORT_SMMUv1v2_MODEL_MMU500 0x3
44
45 #define EFI_ACPI_IORT_SMMUv1v2_FLAG_DVM BIT0
46 #define EFI_ACPI_IORT_SMMUv1v2_FLAG_COH_WALK BIT1
47
48 #define EFI_ACPI_IORT_SMMUv1v2_INT_FLAG_LEVEL 0x0
49 #define EFI_ACPI_IORT_SMMUv1v2_INT_FLAG_EDGE 0x1
50
51 #define EFI_ACPI_IORT_SMMUv3_FLAG_COHAC_OVERRIDE BIT0
52 #define EFI_ACPI_IORT_SMMUv3_FLAG_HTTU_OVERRIDE BIT1
53
54 #define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_UNSUPPORTED 0x0
55 #define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_SUPPORTED 0x1
56
57 #define EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE BIT0
58
59 #pragma pack(1)
60
61 ///
62 /// Table header
63 ///
64 typedef struct {
65 EFI_ACPI_DESCRIPTION_HEADER Header;
66 UINT32 NumNodes;
67 UINT32 NodeOffset;
68 UINT32 Reserved;
69 } EFI_ACPI_6_0_IO_REMAPPING_TABLE;
70
71 ///
72 /// Definition for ID mapping table shared by all node types
73 ///
74 typedef struct {
75 UINT32 InputBase;
76 UINT32 NumIds;
77 UINT32 OutputBase;
78 UINT32 OutputReference;
79 UINT32 Flags;
80 } EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE;
81
82 ///
83 /// Node header definition shared by all node types
84 ///
85 typedef struct {
86 UINT8 Type;
87 UINT16 Length;
88 UINT8 Revision;
89 UINT32 Reserved;
90 UINT32 NumIdMappings;
91 UINT32 IdReference;
92 } EFI_ACPI_6_0_IO_REMAPPING_NODE;
93
94 ///
95 /// Node type 0: ITS node
96 ///
97 typedef struct {
98 EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
99
100 UINT32 NumItsIdentifiers;
101 //UINT32 ItsIdentifiers[NumItsIdentifiers];
102 } EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE;
103
104 ///
105 /// Node type 1: root complex node
106 ///
107 typedef struct {
108 EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
109
110 UINT32 CacheCoherent;
111 UINT8 AllocationHints;
112 UINT16 Reserved;
113 UINT8 MemoryAccessFlags;
114
115 UINT32 AtsAttribute;
116 UINT32 PciSegmentNumber;
117 } EFI_ACPI_6_0_IO_REMAPPING_RC_NODE;
118
119 ///
120 /// Node type 2: named component node
121 ///
122 typedef struct {
123 EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
124
125 UINT32 Flags;
126 UINT32 CacheCoherent;
127 UINT8 AllocationHints;
128 UINT16 Reserved;
129 UINT8 MemoryAccessFlags;
130 UINT8 AddressSizeLimit;
131 //UINT8 ObjectName[];
132 } EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE;
133
134 ///
135 /// Node type 3: SMMUv1 or SMMUv2 node
136 ///
137 typedef struct {
138 UINT32 Interrupt;
139 UINT32 InterruptFlags;
140 } EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT;
141
142 typedef struct {
143 EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
144
145 UINT64 Base;
146 UINT64 Span;
147 UINT32 Model;
148 UINT32 Flags;
149 UINT32 GlobalInterruptArrayRef;
150 UINT32 NumContextInterrupts;
151 UINT32 ContextInterruptArrayRef;
152 UINT32 NumPmuInterrupts;
153 UINT32 PmuInterruptArrayRef;
154
155 UINT32 SMMU_NSgIrpt;
156 UINT32 SMMU_NSgIrptFlags;
157 UINT32 SMMU_NSgCfgIrpt;
158 UINT32 SMMU_NSgCfgIrptFlags;
159
160 //EFI_ACPI_6_0_IO_REMAPPING_SMMU_CTX_INT ContextInterrupt[NumContextInterrupts];
161 //EFI_ACPI_6_0_IO_REMAPPING_SMMU_CTX_INT PmuInterrupt[NumPmuInterrupts];
162 } EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE;
163
164 ///
165 /// Node type 4: SMMUv4 node
166 ///
167 typedef struct {
168 EFI_ACPI_6_0_IO_REMAPPING_NODE Node;
169
170 UINT64 Base;
171 UINT32 Flags;
172 UINT32 Reserved;
173 UINT64 VatosAddress;
174 UINT32 Model;
175 UINT32 Event;
176 UINT32 Pri;
177 UINT32 Gerr;
178 UINT32 Sync;
179 } EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE;
180
181 #pragma pack()
182
183 #endif