@@ -15,6 +15,110 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
1515
1616#pragma pack(1)
1717
18+ //
19+ // Process Address Space ID (PASID) Extended Capability Structure.
20+ //
21+ #define PCI_EXPRESS_EXTENDED_CAPABILITY_PASID_ID 0x001B
22+ #define PCI_EXPRESS_EXTENDED_CAPABILITY_PASID_VER1 0x1
23+
24+ typedef union {
25+ struct {
26+ UINT16 Reserved0 : 1 ; // [0]
27+ UINT16 ExecutePermissionSupport : 1 ; // [1]
28+ UINT16 PrivilegedModeSupport : 1 ; // [2]
29+ UINT16 TranslatedReqWithPasidSupport : 1 ; // [3]
30+ UINT16 Reserved1 : 3 ; // [7:4]
31+ UINT16 MaxPasidWidth : 5 ; // [12:8]
32+ UINT16 Reserved2 : 3 ; // [15:13]
33+ } Bits ;
34+ UINT16 Uint16 ;
35+ } PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID_CAPABILITY ;
36+
37+ typedef union {
38+ struct {
39+ UINT16 PasidEnable : 1 ; // [0]
40+ UINT16 ExecutePermissionEnable : 1 ; // [1]
41+ UINT16 PrivilegedModeEnable : 1 ; // [2]
42+ UINT16 TranslatedReqWithPasidEnable : 1 ; // [3]
43+ UINT16 Reserved : 12 ;
44+ } Bits ;
45+ UINT16 Uint16 ;
46+ } PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID_CONTROL ;
47+
48+ typedef struct {
49+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header ;
50+ PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID_CAPABILITY Capability ;
51+ PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID_CONTROL Control ;
52+ } PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID ;
53+
54+ //
55+ // Downstream Port Containment (DPC) Extended Capability.
56+ //
57+ #define PCI_EXPRESS_EXTENDED_CAPABILITY_DPC_ID 0x001D
58+
59+ typedef union {
60+ struct {
61+ UINT16 DpcInterruptMsgNo : 5 ; // [4:0]
62+ UINT16 RpExtensionsForDpc : 1 ; // [5]
63+ UINT16 PoisonedTlpEgressBlockingSupp : 1 ; // [6]
64+ UINT16 DpcSoftwareTriggerSupp : 1 ; // [7]
65+ UINT16 RpPioLogSize : 4 ; // [11:8] Bits [3:0] of log size
66+ UINT16 DlActiveErrCorSignalingSupp : 1 ; // [12]
67+ UINT16 RpPioLogSizeExt : 1 ; // [13] Bit [4] of log size
68+ UINT16 Reserved : 2 ; // [15:14]
69+ } Bits ;
70+ UINT32 Uint16 ;
71+ } PCI_EXPRESS_REG_DPC_CAPABILITY ;
72+
73+ typedef union {
74+ struct {
75+ UINT16 DpcTriggerEn : 2 ; // [1:0]
76+ UINT16 DpcCompletionCtl : 1 ; // [2]
77+ UINT16 DpcInterruptEn : 1 ; // [3]
78+ UINT16 DpcErrCorEn : 1 ; // [4]
79+ UINT16 PoisonedTlpEgressBlockingEn : 1 ; // [5]
80+ UINT16 DpcSoftwareTrigger : 1 ; // [6]
81+ UINT16 DlActiveErrCorEn : 1 ; // [7]
82+ UINT16 DpcSigSfwEn : 1 ; // [8]
83+ UINT16 Reserved : 7 ; // [15:9]
84+ } Bits ;
85+ UINT16 Uint16 ;
86+ } PCI_EXPRESS_REG_DPC_CONTROL ;
87+
88+ typedef union {
89+ struct {
90+ UINT16 DpcTriggerStatus : 1 ; // [0]
91+ UINT16 DpcTriggerReason : 2 ; // [2:1]
92+ UINT16 DpcInterruptStatus : 1 ; // [3]
93+ UINT16 DpcRpBusy : 1 ; // [4]
94+ UINT16 DpcTriggerReasonExtension : 2 ; // [6:5]
95+ UINT16 Reserved0 : 1 ; // [7]
96+ UINT16 RpPioFirstErrorPointer : 5 ; // [12:8]
97+ UINT16 DpcSigSfwStatus : 1 ; // [13]
98+ UINT16 Reserved1 : 2 ; // [15:14]
99+ } Bits ;
100+ UINT16 Uint16 ;
101+ } PCI_EXPRESS_REG_DPC_STATUS ;
102+
103+ typedef struct {
104+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header ;
105+ PCI_EXPRESS_REG_DPC_CAPABILITY Capability ; // Offset 04h size 2
106+ PCI_EXPRESS_REG_DPC_CONTROL Control ; // Offset 06h size 2
107+ PCI_EXPRESS_REG_DPC_STATUS Status ; // Offset 08h size 2
108+ UINT16 ErrSourceId ; // Offset 0Ah size 2
109+ UINT32 RpPioStatus ; // Offset 0Ch size 4
110+ UINT32 RpPioMask ; // Offset 10h size 4
111+ UINT32 RpPioSeverity ; // Offset 14h size 4
112+ UINT32 RpPioSysErr ; // Offset 18h size 4
113+ UINT32 RpPioException ; // Offset 1Ch size 4
114+ UINT32 RpPioHdrLog [4 ]; // Offset 20h size 16 header log DW 1-4
115+ UINT32 RpPioImpSpecLog ; // Offset 30h size 4
116+ UINT32 RpPioHdrLogExt [10 ]; // Offset 34h size 40 header log DW 5-14
117+ } PCI_EXPRESS_EXTENDED_CAPABILITIES_DPC ;
118+
119+ //
120+ // L1 PM Substates Extended Capability.
121+ //
18122#define PCI_EXPRESS_EXTENDED_CAPABILITY_L1_PM_SUBSTATES_ID 0x001E
19123#define PCI_EXPRESS_EXTENDED_CAPABILITY_L1_PM_SUBSTATES_VER1 0x1
20124
@@ -67,41 +171,41 @@ typedef struct {
67171 PCI_EXPRESS_REG_L1_PM_SUBSTATES_CONTROL2 Control2 ;
68172} PCI_EXPRESS_EXTENDED_CAPABILITIES_L1_PM_SUBSTATES ;
69173
70- /// Process Address Space ID Extended Capability Structure
71- ///
72- /// Based on section 7.29 of PCI Express Base Specification 3.1
73- ///@{
74- #define PCI_EXPRESS_EXTENDED_CAPABILITY_PASID_ID 0x001B
75- #define PCI_EXPRESS_EXTENDED_CAPABILITY_PASID_VER1 0x1
174+ //
175+ // Precision Time Measurement (PTM) Extended Capability.
176+ //
177+ #define PCI_EXPRESS_EXTENDED_CAPABILITY_PTM_ID 0x001F
76178
77179typedef union {
78180 struct {
79- UINT16 PasidSupport : 1 ;
80- UINT16 ExecutePermissionSupport : 1 ;
81- UINT16 PrivilegedModeSupport : 1 ;
82- UINT16 Reserved1 : 5 ;
83- UINT16 MaxPasidWidth : 5 ;
84- UINT16 Reserved2 : 3 ;
181+ UINT32 PtmRequesterCapable : 1 ; // [0]
182+ UINT32 PtrmResponderCapable : 1 ; // [1]
183+ UINT32 PtmRootCapable : 1 ; // [2]
184+ UINT32 EPtmCapable : 1 ; // [3]
185+ UINT32 PtmPropatagionDelayAdaptCapable : 1 ; // [4]
186+ UINT32 Reserved0 : 3 ; // [7:5]
187+ UINT32 LocalClockGranularity : 8 ; // [15:8]
188+ UINT32 Reserved1 : 16 ; // [31:16]
85189 } Bits ;
86- UINT16 Uint16 ;
87- } PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID_CAPABILITY ;
190+ UINT32 Uint32 ;
191+ } PCI_EXPRESS_REG_PTM_CAPABILITY ;
88192
89193typedef union {
90194 struct {
91- UINT16 PasidEnable : 1 ;
92- UINT16 ExecutePermissionEnable : 1 ;
93- UINT16 PrivilegedModeEnable : 1 ;
94- UINT16 Reserved : 13 ;
195+ UINT32 PtmEnable : 1 ; // [0]
196+ UINT32 RootSelect : 1 ; // [1]
197+ UINT32 Reserved0 : 6 ; // [7:2]
198+ UINT32 EffectiveGranularity : 8 ; // [15:8]
199+ UINT32 Reserved1 : 16 ; // [31:16]
95200 } Bits ;
96- UINT16 Uint16 ;
97- } PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID_CONTROL ;
201+ UINT32 Uint32 ;
202+ } PCI_EXPRESS_REG_PTM_CONTROL ;
98203
99204typedef struct {
100- PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header ;
101- PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID_CAPABILITY Capability ;
102- PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID_CONTROL Control ;
103- } PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID ;
104- ///@}
205+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header ;
206+ PCI_EXPRESS_REG_PTM_CAPABILITY Capability ; // Offset 04h size 4
207+ PCI_EXPRESS_REG_PTM_CONTROL Control ; // Offset 08h size 4
208+ } PCI_EXPRESS_EXTENDED_CAPABILITIES_PTM ;
105209
106210#pragma pack()
107211
0 commit comments