Extensible Host Controler Interface Usb Xhci
Extensible Host Controler Interface Usb Xhci
for
Universal Serial Bus
(xHCI)
Revision 1.0
5/21/10
1
eXtensible Host Controller Interface Revision 1.0
Intel may make changes to specifications and product descriptions at any time, without notice.
Designers must not rely on the absence or characteristics of any features or instructions marked
“reserved” or “undefined.” Intel reserves these for future definition and shall have no
responsibility whatsoever for conflicts or incompatibilities arising from future changes to them.
2
eXtensible Host Controller Interface Revision 1.0
Revision History
0.96 5/8/2009
1.0 5/21/10 Refer to Errata files.
3
eXtensible Host Controller Interface Revision 1.0
Contributors
4
eXtensible Host Controller Interface Revision 1.0
5
eXtensible Host Controller Interface Revision 1.0
Dedication
The xHCI Specification is dedicated to the memory of Brad Hosler, a good friend and the impact of whose
accomplishments have made the Universal Serial Bus one of the most successful technology innovations
of the Personal Computer era.
- The xHCI Architecture Team
6
eXtensible Host Controller Interface Revision 1.0
Table of Contents
Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Table of Figures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Table of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1 PREFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.1 OBJECTIVE OF SPECIFICATION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.2 SCOPE OF DOCUMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.3 DOCUMENT ORGANIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.4 REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.5 INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1.6 TERMS AND ABBREVIATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.7 DOCUMENTATION CONVENTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.7.1 Capitalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.7.2 Italic Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.7.3 Numbers and Number Bases. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.7.4 Implementation Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.7.5 Word Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.7.6 Pseudo Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.7.7 Other Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2 INTRODUCTION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.1 MOTIVATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.1.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.2 KEY FEATURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.3 XHCI PRODUCT COMPLIANCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3 ARCHITECTURAL OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.1 INTERFACE ARCHITECTURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.2 XHCI DATA STRUCTURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.2.1 Device Context Base Address Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.2.2 Device Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.2.3 Slot Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.2.4 Endpoint Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.2.4.1 Stream Context Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.2.4.1.1 Stream Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.2.5 Input Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.2.5.1 Input Control Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.2.6 Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.2.6.1 Transfer Ring Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.2.7 Transfer Request Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.2.7.1 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.2.7.2 Other Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.2.8 Scatter/Gather Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.2.9 Control Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.2.10 Bulk and Interrupt Transfers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.2.11 Isoch Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.3 COMMAND INTERFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.3.1 No Op. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.3.2 Enable Slot. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.3.3 Disable Slot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.3.4 Address Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.3.5 Configure Endpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
7
eXtensible Host Controller Interface Revision 1.0
8
eXtensible Host Controller Interface Revision 1.0
9
eXtensible Host Controller Interface Revision 1.0
10
eXtensible Host Controller Interface Revision 1.0
11
eXtensible Host Controller Interface Revision 1.0
12
eXtensible Host Controller Interface Revision 1.0
13
eXtensible Host Controller Interface Revision 1.0
5.5.2.3.2 Event Ring Segment Table Base Address Register (ERSTBA) . . . . . . . . . . . . . . . 308
5.5.2.3.3 Event Ring Dequeue Pointer Register (ERDP). . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
5.6 DOORBELL REGISTERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
6 DATA STRUCTURES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
6.1 DEVICE CONTEXT BASE ADDRESS ARRAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
6.2 CONTEXTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
6.2.1 Device Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
6.2.2 Slot Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
6.2.2.1 Address Device Command Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
6.2.2.2 Configure Endpoint Command Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
6.2.2.3 Evaluate Context Command Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
6.2.3 Endpoint Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
6.2.3.1 Address Device Command Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
6.2.3.2 Configure Endpoint Command Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
6.2.3.3 Evaluate Context Command Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
6.2.3.4 Max Burst Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
6.2.3.5 Max Packet Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
6.2.3.6 Interval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
6.2.4 Stream Context Array. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
6.2.4.1 Stream Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
6.2.5 Input Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
6.2.5.1 Input Control Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
6.2.6 Port Bandwidth Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
6.3 TRB RING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
6.4 TRANSFER REQUEST BLOCK (TRB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
6.4.1 Transfer TRBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
6.4.1.1 Normal TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
6.4.1.2 Control TRBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
6.4.1.2.1 Setup Stage TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
6.4.1.2.2 Data Stage TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
6.4.1.2.3 Status Stage TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
6.4.1.3 Isoch TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
6.4.1.4 No Op TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
6.4.2 Event TRBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
6.4.2.1 Transfer Event TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
6.4.2.2 Command Completion Event TRB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
6.4.2.3 Port Status Change Event TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
6.4.2.4 Bandwidth Request Event TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
6.4.2.5 Doorbell Event TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
6.4.2.6 Host Controller Event TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
6.4.2.7 Device Notification Event TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
6.4.2.8 MFINDEX Wrap Event TRB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
6.4.3 Command TRBs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
6.4.3.1 No Op Command TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
6.4.3.2 Enable Slot Command TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
6.4.3.3 Disable Slot Command TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
6.4.3.4 Address Device Command TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
6.4.3.5 Configure Endpoint Command TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
6.4.3.6 Evaluate Context Command TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
6.4.3.7 Reset Endpoint Command TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
6.4.3.8 Stop Endpoint Command TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
6.4.3.9 Set TR Dequeue Pointer Command TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
6.4.3.10 Reset Device Command TRB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
6.4.3.11 Force Event Command TRB (Optional Normative) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
14
eXtensible Host Controller Interface Revision 1.0
15
eXtensible Host Controller Interface Revision 1.0
8 VIRTUALIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
8.1 OPERATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
8.1.1 Resource Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
8.1.1.1 MMIO Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
8.1.1.2 Device Slots. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
8.1.1.3 Interrupters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
8.1.2 Device Enumeration and Handoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
8.1.2.1 Root Hub Attach Emulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
8.1.2.2 External Hub Attach Emulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
8.2 SR-IOV EXTENDED CAPABILITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
8.2.1 SR-IOV Extended Capability Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
8.2.2 xHCI-IOV Extended Capability Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
8.3 DOORBELL REGISTERS AND VIRTUALIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
8.3.1 Direct-Assigned Device Slot. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
8.3.2 Emulated Device Slot. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
8.4 INTERRUPTER MAPPING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
8.5 REGISTER SPACE EMULATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
APPENDIX A -XHCI PCI POWER MANAGEMENT INTERFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
16
eXtensible Host Controller Interface Revision 1.0
17
eXtensible Host Controller Interface Revision 1.0
18
eXtensible Host Controller Interface Revision 1.0
Table of Figures
1 Preface ................................................................................................................................................ 27
2 Introduction ........................................................................................................................................ 43
3 Architectural Overview ...................................................................................................................... 47
Figure 1: Universal Serial Bus, Revision 3.0 System Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Figure 2: USB 3.0 EXtensible Host Controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Figure 3: General Architecture of the eXtensible Host Controller Interface. . . . . . . . . . . . . . . . . . . . . . . . 50
Figure 4: Transfer Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Figure 5: Simple Transfer Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Figure 6: Scatter/Gather Transfer Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Figure 7: Control Transfer Descriptor Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Figure 8: Isochronous Transfer Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4 Operational Model.............................................................................................................................. 69
Figure 9: Device Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Figure 10: Slot State Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Figure 11: Example Configure Endpoint Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Figure 12: Endpoint Context Addressing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Figure 13: Endpoint State Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Figure 14: Index Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Figure 15: Segmented Ring Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Figure 16: Enqueue Pointer Advancement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Figure 17: Initial State of Transfer Ring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Figure 18: Final State of Transfer Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Figure 19: Segmented Event Ring Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Figure 20: Event Ring State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Figure 21: TRB Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Figure 22: SETUP Data, the Parameter Component of Setup Stage TRB . . . . . . . . . . . . . . . . . . . . . . . 157
Figure 23: Link TRB Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Figure 24: TRB Packet Boundary Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Figure 25: TD Fragment Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Figure 26: Non-aligned TD Fragment Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Figure 27: xHC Stream Protocol State Machine (xSPSM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Figure 28: Stream Context Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Figure 29: Microframe Index (MFINDEX) Register Mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Figure 30: Interrupt Throttle Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Figure 31: Heavy load, interrupts moderated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Figure 32: Light load, interrupts not moderated. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Figure 33: USB2 Root Hub Port State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Figure 34: USB2 Root Hub Port Enabled Substate Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Figure 35: USB3 Root Hub Port State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Figure 36: USB3 Root Hub Port Polling Substate Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Figure 37: USB3 Root Hub Port DbC Substate Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Figure 38: USB3 Root Hub Port Enabled Substate Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Figure 39: USB3 Root Hub Port U1’ Substate Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Figure 40: USB3 Root Hub Port U2’ Substate Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Figure 41: USB3 Root Hub Port U3’ Substate Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Figure 42: Example Port Change Bit Port Status Change Event Generation . . . . . . . . . . . . . . . . . . . . . 234
Figure 43: Port Routing Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Figure 44: BIOS Ownership State Machine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Figure 45: OS Ownership State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Figure 46: Integrated Hub Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
5 Register Interface.............................................................................................................................259
Figure 47: PCI Type 00h Configuration Space Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Figure 48: PCI Power Management Capability Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
19
eXtensible Host Controller Interface Revision 1.0
20
eXtensible Host Controller Interface Revision 1.0
21
eXtensible Host Controller Interface Revision 1.0
22
eXtensible Host Controller Interface Revision 1.0
Table of Tables
1 Preface ................................................................................................................................................ 27
2 Introduction ........................................................................................................................................ 43
3 Architectural Overview ...................................................................................................................... 47
Table 1 Command TRB Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4 Operational Model.............................................................................................................................. 69
Table 2: Device Slot State Code Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Table 3: Stop Endpoint Command TRB Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Table 4: Event Ring State Machine Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Table 5: Summary of USB Transaction Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Table 6: CErr Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Table 7: USB SETUP Data to Data Stage TRB and Status Stage TRB mapping. . . . . . . . . . . . . . . . . . 158
Table 8: USB2 Pipe Actions based on Endpoint Response and Residual Transfer State . . . . . . . . . . . 196
Table 9: USB3 Pipe Actions based on Endpoint Response and Residual Transfer State . . . . . . . . . . . 198
Table 10: Behavior During System Wake-up Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Table 11: xHC Traffic Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Table 12: LPM State Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
5 Register Interface.............................................................................................................................259
Table 13: eXtensible Host Controller Interface Register Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Table 14: Register Alignment Requirement Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Table 15: Register Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Table 16: Class Code Register (CLASSC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Table 17: Serial Bus Release Number Register (SBRN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Table 18: Frame Length Adjustment Register (FLADJ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Table 19: eXtensible Host Controller Capability Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Table 20: Host Controller Structural Parameters 1 (HCSPARAMS1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Table 21: Host Controller Structural Parameters 2 (HCSPARAMS2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Table 22: Host Controller Structural Parameters 3 (HCSPARAMS3) . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Table 23: Host Controller Capability Parameters (HCCPARAMS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Table 24: Doorbell Offset Register (DBOFF). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Table 25: Runtime Register Space Offset Register (RTSOFF). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Table 26: Host Controller Operational Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Table 27: Host Controller USB Port Register Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Table 28: USB Command Register Bit Definitions (USBCMD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Table 29: USB Status Register Bit Definitions (USBSTS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Table 30: Page Size Register Bit Definitions (PAGESIZE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Table 31: Device Notification Register Bit Definitions (DNCTRL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Table 32: Command Ring Control Register Bit Definitions (CRCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Table 33: Device Context Base Address Array Pointer Register Bit Definitions (DCBAAP) . . . . . . . . . . 288
Table 34: Configure Register Bit Definitions (CONFIG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Table 35: Port Status and Control Register Bit Definitions (PORTSC) . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Table 36: USB2 to USB3 Port Link State Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Table 37: USB3 Port Power Management Status and Control Register Bit Definitions (PORTPMSC) . 297
Table 38: USB2 Port Power Management Status and Control Register Bit Definitions (PORTPMSC) . 299
Table 39: USB3 Port Power Management Status and Control Register Bit Definitions (PORTPMSC) . 301
Table 40: Host Controller Runtime Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Table 41: Microframe Index Register Bit Definitions (MFINDEX) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Table 42: Interrupter Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
Table 43: Interrupter Management Register Bit Definitions (IMAN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Table 44: Interrupter Moderation Register (IMOD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Table 45: Event Ring Segment Table Size Register Bit Definitions (ERSTSZ). . . . . . . . . . . . . . . . . . . . 307
Table 46: Event Ring Segment Table Base Address Register Bit Definitions (ERSTBA) . . . . . . . . . . . . 308
Table 47: Event Ring Dequeue Pointer Register Bit Definitions (ERDP) . . . . . . . . . . . . . . . . . . . . . . . . 309
Table 48: Doorbell Register Bit Field Definitions (DB). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
23
eXtensible Host Controller Interface Revision 1.0
24
eXtensible Host Controller Interface Revision 1.0
25
eXtensible Host Controller Interface Revision 1.0
Table 157: Offset 28h - Debug Capability Field Definitions (DCPORTSC) . . . . . . . . . . . . . . . . . . . . . . . 410
Table 158: Offset 30h - Debug Capability Field Definitions (DCCP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Table 159: Offset 38h - Debug Capability Field Definitions (DbCIC). . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Table 160: Offset 3Ch - Debug Capability Info Context Field Definitions (DbCIC) . . . . . . . . . . . . . . . . . 413
Table 161: Offset 00h - Debug Capability Info Context Field Definitions (DbCIC) . . . . . . . . . . . . . . . . . 415
Table 162: Offset 08h - Debug Capability Info Context Field Definitions (DbCIC) . . . . . . . . . . . . . . . . . 415
Table 163: Offset 10h - Debug Capability Info Context Field Definitions (DbCIC) . . . . . . . . . . . . . . . . . 415
Table 164: Offset 18h - Debug Capability Info Context Field Definitions (DbCIC) . . . . . . . . . . . . . . . . . 415
Table 165: Offset 20h - Debug Capability Info Context Field Definitions (DbCIC) . . . . . . . . . . . . . . . . . 416
Table 166: DbC Device Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Table 167: DbC Configuration Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Table 168: DbC Interface Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Table 169: DbC Endpoint Descriptor 1 OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Table 170: DbC SuperSpeed Endpoint Companion Descriptor 1 OUT. . . . . . . . . . . . . . . . . . . . . . . . . . 421
Table 171: DbC Endpoint Descriptor 2 IN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Table 172: DbC SuperSpeed Endpoint Companion Descriptor 2 IN . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Table 173: BOS Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Table 174: BOS SS Device Capability Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
Table 175: xHCI_IOV Capability Header Field Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Table 176: VM Interrupter Range Register Field Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Table 177: VF Device Slot Assignment Register Field Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
Table 178: Offset 00h - xHCI Local Memory Capability Field Definitions . . . . . . . . . . . . . . . . . . . . . . . . 431
Table 179: Offset 04h - xHCI Local Capability Field Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
Table 180: Offset 08h - xHCI Local Capability Field Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
8 Virtualization.....................................................................................................................................433
Appendix A - xHCI PCI Power Management Interface ........................................................................445
Table 181: xHCI Support for Power Management States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Table 182: xHCI Power State Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
Appendix B - High Bandwidth Isochronous Rules..............................................................................448
Table 183: HS High-Bandwidth Behavior for OUT Transactions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
Table 184: HS High-Bandwidth Behavior for IN Transactions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
Appendix C - Stream Usage Models .....................................................................................................452
Appendix D - Port to Connector Mapping ............................................................................................454
Appendix E - State Machine Notation...................................................................................................461
Appendix F - SS Bus Access Constraints............................................................................................462
Table 185: SuperSpeed Bulk OUT Transaction Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
Table 186: SuperSpeed Interrupt Transaction Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
Table 187: SuperSpeed Isoch Transaction Limits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Appendix G - 0.96 Exceptions ...............................................................................................................466
Table 188: Forced Stopped Event (FSE) Option Flag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
Table 189: Secondary Bandwidth Domain Reporting (SBD) Option Flag . . . . . . . . . . . . . . . . . . . . . . . . 466
Table 190: L1 Capability (L1C) Option Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
26
1 Preface
1.1 Objective of Specification
The eXtensible Host Controller Interface (xHCI) specification describes the register-level host controller
interface for Universal Serial Bus (USB2) Revision 2.0 and above. The specification includes a description
of the hardware/software interface between system software and the host controller hardware.
This specification is intended for hardware component designers, system builders and device driver
(software) developers. The reader is expected to be familiar with the current Universal Serial Bus
Specification revisions. In spite of due diligence, there may exist conflicts between this specification and
the USB Specification. The USB Specifications take precedence on all issues of conflict.
27
eXtensible Host Controller Interface Revision 1.0
1.4 References
The following documents are referenced throughout this specification. The Spec Reference defines a
shorthand mnemonic used in this specification for the respective document listed below.
Spec
Title Revision Location
Reference
Note: Rather than enumerating the full specification name every time one of the above specs are
referenced in this document, the abbreviation listed in the Spec Reference column shall be used.
28
eXtensible Host Controller Interface Revision 1.0
1.5 Index
This document does not include an index. An effective substitute when viewing with a Adobe® Reader® is
to use the Search dialog to locate all references to a specific xHCI feature or field.
To facilitate indexing, all references to register and data fields may be automatically located using their
mnemonic if they have one, or their name if they don’t.
For example, to find all references to the Port Power (PP) field of the PORTSC register, in Reader® open
the Search dialog box, by selecting “File” then “Search” from the menu. Since this field has a mnemonic,
enter the string “PP” in the ‘What word of phrase would you like to search for?’ text box. Check the ‘Whole
words only’ and ‘Case-sensitive’ check boxes, and press the ‘Search’ button to list all references to the
Port Power flag in this specification.
To find all references to the Frame ID field, which does not have a mnemonic, simply enter “Frame ID” into
the ‘What word of phrase would you like to search for?’ text box.
29
eXtensible Host Controller Interface Revision 1.0
30
eXtensible Host Controller Interface Revision 1.0
31
eXtensible Host Controller Interface Revision 1.0
Device Software Software that is responsible for managing a USB device. This software
may or may not also be responsible for configuring the device for use.
Direct-Assignment Direct-Assignment is a term used with virtualization to describe a
hardware device interface that is Directly Assigned to a Virtual Machine.
Direct-Assigned devices do not suffer from the overhead incurred by
device whose hardware register-level interface is emulated in software by
a virtual environment.
Doorbell Array The Doorbell Array is an array of 256 Doorbell Registers, which supports
up to 255 USB devices or hubs. Doorbell Register 0 is allocated to the
Host Controller, the remaining registers are allocated to individual Device
Slots.
Doorbell Register A Doorbell Register provides system software with a mechanism for
notifying the xHC if it has Slot, or Endpoint related work to perform. A DB
Target field in the Doorbell Register is written with a Reason Code to
“ring” the doorbell.
Downstream The direction of data flow from the host or away from the host. A
downstream port is the port on a hub electrically farthest from the host
that generates downstream data traffic from the hub. Downstream ports
receive upstream data traffic.
DPH Error A DPH Error may be due to one or more of the following conditions: an
incorrect Device Address, the Endpoint Number and Direction does not
refer to an endpoint that is part of the current configuration, or the DPH
does not have an expected sequence number.
DPP Error A DPP Error may be due to one or more of the following conditions: CRC
incorrect, DPP aborted, DPP missing, or the data length in the DPH does
not match the actual data payload length.
Dword A data element that is four bytes (32 bits) in size.
EHCI Enhanced Host Controller Interface. Intel defined USB host controller
specification for High-speed devices.
Embedded hub A USB 2.0 or 3.0 hub that is located on the system board, and between
the xHC device and the system board USB connector or non-removable
USB device.
Endpoint A uniquely addressable portion of a USB device that is the source or sink
of information in a communication flow between the host and device.
Endpoint Address The xHCI defines an Endpoint Address as 5-bit value that is a
combination of an Endpoint Number (bits 4-1) and an Endpoint Direction
(bit 0). For Control Endpoints, the Direction (bit 0) is set to ‘1’ to form its
Endpoint Address. Note that xHCI encoding of an Endpoint Address is
not the same as the Endpoint Descriptor bEndpointAddress field defined
by the USB specification.
Endpoint Context An Endpoint Context data structure defines a Transfer Ring which is used
to manage transfers associated with the respective endpoint. An
Endpoint Context exists for each endpoint of a device.
Endpoint Direction The direction of data transfer on the USB. The direction can be either IN
or OUT. IN refers to transfers to the host; OUT refers to transfers from the
host. When computing the Endpoint Address an IN endpoint is
represented by a ‘1’ and an OUT endpoint is represented by a ‘0’.
32
eXtensible Host Controller Interface Revision 1.0
Endpoint ID Identical to the Device Context Index (DCI). Refer to section 4.5.1.
Endpoint Number A four-bit value between 0h and Fh, inclusive, associated with an
endpoint on a USB device.
Enqueue Pointer The Enqueue Pointer is a pointer into a TRB Ring. It references the next
TRB location available to producer for scheduling work items to the Ring.
The Enqueue Pointer is NOT defined as a physical xHC register. A
facsimile of this pointer is maintained internally by the xHC and system
software to manage a respective ring.
ERDY Handshake acknowledgment packet indicating an Endpoint is Ready to
move data.
Event Data TD A TD that consists of just one Event Data TRB.
Event Data TRB A Normal Transfer TRB with its Event Data (ED) flag equal to ‘1’. Refer to
section 4.11.5.2.
Frame A 1 millisecond time base established on full-/low-speed USB buses.
Fine-grain scatter/gather The xHCI TRBs support byte granularity for the TRB Data Buffer Pointer
and TRB Transfer Length fields, which enables “fine-grain” scatter/gather
operations.
Full-speed USB operation at 12 Mb/s. Also see low-speed, high-speed and
SuperSpeed.
Handshake Packet A USB packet that acknowledges or rejects a specific condition. For
examples, see ACK and NAK.
High-bandwidth endpoint A high-speed USB device endpoint that transfers more than 1024 bytes
and less than 3073 bytes per microframe.
High-speed USB operation at 480 Mb/s. Also see low-speed, full-speed and
SuperSpeed.
High-Touch High touch registers are referenced regularly during the normal operation
of the xHC by system software, e.g. Ringing doorbells to queue work,
managing interrupts, etc.
Host The host computer system where the USB Host Controller is installed.
This includes the host hardware platform (CPU, bus, etc.) and the
operating system in use.
Host Controller The host’s USB interface.
Host Controller Driver This software entity is the interface between the xHC and the USB Driver
(xHCD) (USBD). It translates system software requests for USB operations to
TRBs scheduled on pipes to USB devices.
Host Controller Driver This software entity is a component of the xHCD that manages the
Enumeration Component enumeration of USB devices at power up, when they are attached, and
(xHCDe) when they are detached.
Hub A USB device that provides additional connections to the USB.
Hub Tier One plus the number of USB links in a communication path between the
host and a peripheral device.
Input Device Context The Device Context component (Slot and Endpoint Contexts) of an Input
Context. An Input Context data structure pointed to by a Command TRB.
33
eXtensible Host Controller Interface Revision 1.0
Input Endpoint Context An Endpoint Context contained in an Input Context. An Input Context
data structure pointed to by a Command TRB.
Input Slot Context A Slot Context contained in an Input Context. An Input Context data
structure pointed to by a Command TRB.
Integrated hub A Tier 2 USB 2.0 hub that is integrated into an xHC device.
Interval The time delay between scheduling periodic transfers. Intervals are
defined in frames (1ms.) for LS/FS devices, microframes (125µs.) for HS
and SS devices.
Isoch TD An Isoch Transfer Descriptor consists of an Isoch TRB chained to 0 or
more Normal TRBs, and describes a work item for an isochronous
endpoint. Isoch TDs are only found on the Transfer Rings associated with
Isoch Endpoints.
Isoch TRB An Isochronous Transfer Request Block that is always the first TRB of an
Isoch TD. They are only found on the Transfer Rings associated with
Isoch Endpoints. Refer to section 4.11.2.3.
ISR The Interrupt Service Routine is the software invoked by an interrupt.
L0 USB2 “On” power state.
L1 USB2 Link Power Managed (LPM) state.
L2 USB2 Suspend state.
L3 USB2 “Off” power state.
Latency Tolerance Latency Tolerance Messaging (LTM) adds the capability for attached
Messaging devices to provide information that can improve the host platform's ability
(LTM) to select when and how long to sleep. This is accomplished by an
attached device sending an LTM, informing the host of its acceptable
service latency between accesses, i.e. the device's latency tolerance.
LFPS Low Frequency Periodic Signal. Refer to USB3 spec.
Link A USB physical interconnect between two connected ports.
link connection A “USB3 link connection” refers to the SuperSpeed Rx and Tx signal
pairs.
A “USB2 link connection” refers to the D+/D- signal pair.
Link Management Packet A type of SuperSpeed header packet used to communicate information
(LMP) between a pair of links.
Link TD A TD that consists of just one Link TRB.
Link TRB A Transfer Request Block that is always the last TRB of a TRB Ring
Segment. Link TRBs are used to form large, non-contiguous Transfer
Rings that cross Page boundaries. Refer to section 4.11.5.1.
Low-speed USB operation at 1.5 Mb/s. Also see full-speed, high-speed and
SuperSpeed.
Low-Touch Low touch registers are referenced infrequently by system software, e.g.
only at initialization time, only when a USB device is enumerated, etc.
Message Pipe A bi-directional pipe that transfers data using a request/data/status
paradigm. The data has an imposed structure that allows requests to be
reliably identified and communicated, e.g. a Control endpoint.
34
eXtensible Host Controller Interface Revision 1.0
Microframe A 125 microsecond time base established on USB buses by the xHC.
Full-speed USB buses utilize an 8 microframe time base.
LTM See Latency Tolerance Messaging.
MMIO Memory Mapped I/O
MSI Message Signaled Interrupts. PCI feature that provides vectored
interrupts to a single interrupt controller.
MSI-X Extended Message Signaled Interrupts. PCI feature that provides
vectored interrupts to multiple interrupt controllers.
NAK Handshake packet indicating a negative acknowledgment.
Normal TRB A Normal Transfer Request Block that is used on transfer Rings to define
a single contiguous buffer for a data transfer. Normal TRBs may be
“chained” to support scatter/gather or buffer concatenation operations.
Refer to section 4.11.2.1.
NRDY Handshake acknowledgment packet indicating an endpoint is Not Ready
to move data.
OHCI Open Host Controller Interface. Industry defined USB host controller
specification for Low-speed and Full-Speed devices.
Optional Normative If an Optional Normative feature is implemented, it shall comply with the
requirements specified for that optional normative feature. The optional
normative approach assures interoperability between multiple vendors,
by definition, when implementing the same xHCI extensions.
Operational Registers The Operational Registers specify host controller configuration and
runtime modifiable state. And are used by system software to control and
monitor the operational state of the host controller.
OSI An Operating System Instance is the software operating environment that
runs in a Virtual Machine. Virtualization allows multiple Operating System
Instances to concurrently run within a platform.
Output Device Context A Device Context data structure pointed to by a Device Context Base
Address Array entry.
Output Endpoint Context An Endpoint Context contained in the Device Context data structure
pointed to by a Device Context Base Address Array entry.
Output Slot Context A Slot Context contained in the Device Context data structure pointed to
by a Device Context Base Address Array entry.
Page A Page refers to the smallest possible size of a block of contiguous
physical memory used by a processor architecture that supports paged
memory.
PCI Peripheral Component Interconnect. Refer to the PCI specification.
PCI Config Space PCI Configuration Space. A segregated address space that provides a
means of identifying and enumerating the host controller by system
software.
PCIe PCI Express. Refer to the PCIe specification.
Periodic Pipe A “Guaranteed Bandwidth” Pipe defined by an Isoch or Interrupt endpoint.
35
eXtensible Host Controller Interface Revision 1.0
36
eXtensible Host Controller Interface Revision 1.0
Slot Context The Slot Context data structure defines information that applies to the
slot, the device as whole, or to all Endpoint Contexts.
Slot ID Refers to the index of a Device Slot. The Slot Identifier defines a value
that is used to index into the Doorbell Array and Device Context Base
Address Array. It is a logical Device Address that is used for all system
software references to a physical USB device attached to the xHC.
SO See Service Opportunity.
SOF See Start-of-Frame.
SOPC See Service Opportunity Packet Count.
Start-of-Frame The first transaction in each USB2 (micro)frame. A SOF allows endpoints
(SOF) to identify the start of the (micro)frame and synchronize internal endpoint
clocks to the host.
Stream Pipe A pipe that transfers data as a stream of samples with no defined USB
structure, e.g. an Interrupt, Isoch, or Bulk endpoint.
SR-IOV PCIe Single Root – I/O Virtualization. Refer to SR-IOV specification.
SuperSpeed USB operation at 5 Gb/s. Also see low-speed, high-speed and full-speed.
System Software A general reference to the software that is responsible for managing the
xHCI.
TD See Transfer Descriptor.
TD Transfer Size The TD Transfer Size is defined by the sum of the Length fields in all
TRBs that comprise the TD.
Token Packet A type of packet that identifies what transaction is to be performed on the
bus.
Total Available Bandwidth The Total Available Bandwidth identifies a Bus Instance’s ability to move
real data. As rule of thumb, the Total Available Bandwidth will be at least
20% lower than the cited bit rate of a Bus Instance, or more depending on
the mix of packet sizes. Also note that multiple Root Hub ports may share
the bandwidth of a single Bus Instance.
Transaction The delivery of service to a USB endpoint; consists of a token packet,
optional data packet, and optional handshake packet. Specific packets
are allowed/required based on the transaction type.
Transaction Packet Transaction Packets (TPs) are SuperSpeed packets that traverse a path
(TP) between the host and device. TPs are used to control data flow between
devices and the host as well as to manage the end to end connection.
Transaction Translator A functional component of a USB hub. The Transaction Translator
responds to special high-speed transactions and translates them to full/
low-speed transactions with full/low-speed devices attached on
downstream facing ports.
Transfer One or more bus transactions to move information between a software
client and its function.
Transfer Descriptor A Transfer Descriptor defines a single Transfer to a USB device. A TD
(TD) consists of one or more Transfer Request Blocks. The TRBs of a Multiple-
TRB Transfer Descriptor are tied together using the Chain flag in the TRB
Control component.
37
eXtensible Host Controller Interface Revision 1.0
Transfer Request Block A TRB is a small, flexible data structure in memory that defines the
(TRB) characteristics of a single DMA operation executed by the xHC.
Transfer Ring A Transfer Ring is a TRB Ring associated with an Endpoint Context.
Each Transfer Ring describes the scheduled work items for a single USB
Endpoint.
Transfer Type Determines the characteristics of the data flow between a software client
and its function. Four standard transfer types are defined: control,
interrupt, bulk, and isochronous.
TRB See Transfer Request Block.
TRB Ring A TRB Ring is defined by three parameters: a pointer to the TRB Ring
data structure base address, and Enqueue and Dequeue Pointers that
define the “active” TRBs in the ring.
TT See Transaction Translator.
U0 Maximum power USB3 link state. The USB3 link is in its full power state
and USB 3 device in the “On” power state.
U1, U2 Intermediate USB3 link power state. The link is in an intermediate USB3
Link Power Managed (LPM) state and the USB 3 device in “On” power
state.
U3 Lowest USB3 link power state. USB3 device in Suspend state.
UHCI Universal Host Controller Interface. Intel defined USB host controller
specification for Low-speed and Full-Speed devices.
Universal Serial Bus Driver The host resident software entity responsible for providing common
(USBD) services to clients that are manipulating one or more functions on one or
more Host Controllers.
Universal Serial Bus Resources provided by the USB, such as bandwidth and power. Also see
Resources Device Resources and Host Resources.
Upstream The direction of data flow towards the host. An upstream port is the port
on a device electrically closest to the host that generates upstream data
traffic from the hub. Upstream ports receive downstream data traffic.
USBD See Universal Serial Bus Driver.
Virtual Intermediary A Virtual Intermediaries (VIs) describes a mechanism that runs in the
(VI) VMM, Service VM, or other software entity for sharing devices between
virtual platforms. It is assumed that the mechanism shall be invoked and
executed on every IO transaction, i.e. generates VM_Enter and VM_Exit
events.
Virtualized Environment A platform software environment that includes a VMM which manages
VMs.
VM Virtual Machine. A Virtual Machine manages a single Operating System
Instance (OSI).
VMM Virtual Machine Manager. A Virtual Machine Manager manages Virtual
Machine instances in a virtualized environment.
wMaxPacketSize Maximum Packet Size value defined by a USB Endpoint Descriptor.
Word A data element that is two bytes (16 bits) in size.
38
eXtensible Host Controller Interface Revision 1.0
XactErr A USB Transaction Error. May be due to a babble condition, CRC error, a
timeout, etc.
xHCI Extended Capabilities The xHCI Extended Capabilities specify optional features of a xHC
implementation, as well as providing the ability to add new capabilities to
implementations after the publication of this specification.
xHC instance A xHC instance is either the physical or virtual version of the xHC
presented as a PCIe SR-IOV Physical Function (PF0) or Virtual Function
(VF1-n). A xHC implementation that does not support virtualization only
presents a single xHC instance to the platform.
Zero-based Value If a maximum is defined for a range of working values (e.g. 32), a Zero-
based Value is a value where the legal range of values is 0 to maximum-
1 (e.g. 0 to 31).
39
eXtensible Host Controller Interface Revision 1.0
1.7.1 Capitalization
Some terms are capitalized to distinguish their definition in the context of this document from their common
English meaning. Words not capitalized have their common English meaning. When terms such as
“memory write” or “memory read” appear completely in lower case, they include all transactions of that
type.
Register names and the names of fields and bits in registers and headers are presented with the first letter
capitalized and the remainder in lower case.
40
eXtensible Host Controller Interface Revision 1.0
41
eXtensible Host Controller Interface Revision 1.0
42
2 Introduction
2.1 Motivation
The development of the eXtensible Host Controller Interface was driven by 3 key factors; Speed, Power
Efficiency, and Virtualization.
Speed The storage capacities of portable devices have been increasing with Moore’s Law.
Vendors of these devices need high performance interfaces so that these high capac-
ity devices can be loaded in reasonable amounts of time. The SuperSpeed support of
the xHCI addresses this need.
Power Efficiency When USB was originally developed, it was targeted at desktop platforms and perfor-
mance was the primary objective, which meant that host power consumption was not
an important consideration. Since then, mobile platforms have become the platform of
choice, and their batteries have made host power consumption and idle time effi-
ciency key considerations. The xHCI elimination of the host memory based transac-
tion schedules and its support for the advanced USB3 power management features
are key to providing more power efficient platforms without sacrificing performance.
Virtualization Virtualization is beginning to play a key role in system architectures and the legacy
USB host controller architectures exhibit some serious shortcomings when applied to
virtualized environments. Legacy USB host controller interfaces define a data pump;
where critical state related to overall bus management (Bandwidth allocation, Address
assignment, etc.) reside in the software driver. Trying to apply the standard hardware
IO virtualization technique, of replicating IO interface registers, to the legacy USB host
controller interface is problematic because critical state that must be managed across
Virtual Machines (VMs) is not available to hardware. The xHCI architecture moves the
control of this critical state into hardware, enabling USB resource management across
VMs. The xHCI virtualization features also provide for: 1) Direct-Assignment of individ-
ual USB devices (irrespective of their location in the bus topology) to any VM, 2) mini-
mizing run-time inter-VM communications, and 3) support for native USB device
sharing.
The eXtensible Host Controller Interface addresses these factors. In addition, the xHCI architecture
provides a new industry standard means for interfacing to USB devices that delivers the extensibility
necessary to meet future needs.
2.1.1 Goals
The goal of xHCI architecture is to define a USB host controller to ultimately replace UHCI/OHCI/EHCI, to
provide highly power efficient operation, higher performance, and extensibility to new USB specifications,
such as USB3 and beyond. Key xHCI architectural goals are:
• Efficient operation – idle power and performance better than current USB host controller architectures.
• A device level programming model that is fully consistent with the existing USB software model
• Decouple the host controller interface presented to software from the underlying USB protocols
• Minimize host memory accesses, fully eliminating them when USB devices are idle
• Eliminate the “Companion Controller” model
• Enable hardware “fail-over” modes in system resource constrained situations so devices are still
accessible, but perhaps at less optimal power/performance point
• Provide the ability for different markets to differentiate hardware capabilities, e.g. target host controller
43
eXtensible Host Controller Interface Revision 1.0
44
eXtensible Host Controller Interface Revision 1.0
45
eXtensible Host Controller Interface Revision 1.0
46
3 Architectural Overview
A USB Host System is composed of a number of hardware and software layers. Figure 1 illustrates a
conceptual block diagram of the building block layers in a host system that work in concert to support USB
3.0.
USBDI Software
Universal Serial Bus Driver (USBD)
...
Scope of
xHCI
eXtensible Host
Controller (xHC)
P0 P1 ... Pn Hardware
Dev Dev
47
eXtensible Host Controller Interface Revision 1.0
48
eXtensible Host Controller Interface Revision 1.0
LS/FS HS SS
Bus Bus Bus
Instance Instance Instance
Port Routing
The xHC always manages the respective speed USB devices connected to its Root Hub ports. Depending
on the implementation, the resources of a USB bus instance (bandwidth, device addressability, etc.) may
be presented on each root hub port, shared across multiple root hub ports, or a combination of allocations.
This specification defines the registers and interfaces for the eXtensible Host Controller Interface.
49
eXtensible Host Controller Interface Revision 1.0
Array
PCI Extended
Capabilities Operational
Registers
The xHCI provides support for two categories of USB transfer types: asynchronous and periodic.
Isochronous and Interrupt transfers are Periodic transfer types. Asynchronous transfer types include
Control and Bulk. Figure 3 illustrates that the xHCI provides a homogeneous mechanism (Transfer Rings)
for each category of transfer type.
The USB Base Address Register (BAR) in the PCI Config Space points to the base address of the xHC
register interface. The xHC register interface consists of 4 major components: Capability Registers,
Operational Registers, Runtime Registers, and the Doorbell Array. The Operational and Capability
Registers are concatenated in MMIO space. The Runtime Registers are actually just an extension of the
Operational Registers. Their partitioning allows the xHC to better support virtualization, by allowing the
Runtime Registers to reside on a separate page boundary. A xHCI Capabilities Pointer mechanism (similar
to that defined by PCI) is presented in the Capability Registers to point to new or optional capabilities of an
xHC implementation.
50
eXtensible Host Controller Interface Revision 1.0
The Capability Registers specify read-only limits, restrictions and capabilities of the host controller
implementation. These values are used as parameters to the host controller driver.
The Runtime and Operational Registers specify host controller configuration and runtime modifiable
state, and are used by system software to control and monitor the operational state of the host controller.
These registers are partitioned as a function of those that are heavily accessed during runtime and those
that are accessed only at initialization time or only lightly during runtime to better support virtualization of
the xHCI.
The xHCI Extended Capabilities specify optional features of an xHC implementation, as well as providing
the ability to add new capabilities to implementations after the publication of this specification.
The Doorbell Array is an array of up to 256 Doorbell Registers, which supports up to 255 USB devices or
hubs. Each Doorbell Register provides system software with a mechanism for notifying the xHC if it has
Slot or Endpoint related work to perform. A DB Target field in the Doorbell Register is written with a value
that identifies the reason for “ringing” the doorbell. Doorbell Register 0 is allocated to the Host Controller
for Command Ring management.
The term Device Slot is used as a generic reference to a set of xHCI data structures associated with an
individual USB device. Each device is represented by an entry in the Device Context Base Address Array,
a register in the Doorbell Array register, and a device’s Device Context. The term Slot ID refers to the
index used to identify a specific Device Slot. For example the value of Slot ID will be used as an index to
identify a specific entry in the Device Context Base Address Array.
The Device Context Base Address Array supports up to 255 USB devices or hubs, where each element
in the array is a pointer to a Device Context data structure.
The Command Ring is used by software to pass device and host controller related commands to the xHC.
The Command Ring shall be treated as read-only by the xHC. Refer to section 4.9.3 for a discussion of
Command Ring Management.
The Event Ring is used by the xHC to pass command completion and asynchronous events to software.
The Event Ring shall be treated as read-only by system software. Refer to section 4.9.4 for a discussion of
Event Ring Management.
A Transfer Ring is used by software to schedule work items for a single USB Endpoint. A Transfer Ring is
organized as a circular queue of Transfer Descriptor (TD) data structures, where each Transfer
Descriptor defines one or more Data Buffers that will be moved to or from the USB. Transfer Rings are
treated as read-only by the xHC. Refer to section 4.9.2 for a discussion of Transfer Ring Management.
All three types of rings support the ability for system software to grow or shrink them while they are active.
Special TDs written to the Transfer and Command rings allow software to change their size, however since
the Event Ring is read-only to software, the Event Ring Segment Table is provided so that software may
modify its size.
51
eXtensible Host Controller Interface Revision 1.0
52
eXtensible Host Controller Interface Revision 1.0
The Stream Context data structure provides a pointer to the Stream’s Transfer Ring and provides some
opaque (scratchpad) space for the xHC.
53
eXtensible Host Controller Interface Revision 1.0
contexts are affected by the command. After a command is complete, software may reuse or free the Input
Context data structure.
Throughout this document Slot Context or Endpoint Contexts contained in an Input Context are also
referred to as “Input” Slot or Endpoint Contexts.
Refer to section 6.2.5 for more information on the Input Context.
3.2.6 Rings
A Ring is a circular queue of data structures. Three types of Rings are used by the xHC to communicate
and execute USB operations:
• Command Ring
• One for the xHC
• Event Ring
• One for each Interrupter (refer to section 4.17)
• Transfer Ring
• One for each Endpoint or Stream
The Command Ring is used by system software to issue commands to the xHC.
The Event Ring is used by the xHC to return status and results of commands and transfers to system
software.
Transfer Rings are used to move data between system memory buffers and device endpoints.
Below is a description of the operation of a Transfer Ring. All ring types employ the same basic
mechanisms to transfer information between the xHC and host memory.
54
eXtensible Host Controller Interface Revision 1.0
xHCI
Transfer Ring
Endpoint 0
Information TRB
In the simplest case, software defines a Transfer Ring by allocating and initializing a memory buffer for it,
then setting the Enqueue and Dequeue Pointers to the address of this memory buffer and writing it into the
TR Dequeue Pointer field of the associated Endpoint or Stream Context. Each memory buffer that
comprises a Transfer Ring is called a Segment. Multiple Segments may be linked together to form large
rings, and Segments may be added or removed from a ring during runtime. A Transfer Ring is empty when
the Enqueue Pointer equals the Dequeue Pointer.
Note: The Transfer Ring Enqueue and Dequeue Pointers are not accessible through physical xHC
registers. They are logical entities, maintained internally by both system software and the xHC.
Refer to section 4.9.2 for more information on Enqueue and Dequeue Pointers.
After a Transfer Ring is initialized Transfer Descriptors (comprised of one or more TRBs) may be placed on
it.
A “ring” is formed by the placement of a special Link TRB at the end of a Transfer Ring which jumps the
TRB execution back to its beginning.
1. When the Dequeue and Enqueue Pointers are equal the Transfer Ring is empty. The Dequeue Pointer identifies the address of
the next TRB to be executed by the xHC. The Enqueue Pointer identifies the address of the next TRB location available to soft-
ware for queuing a TD. TRBs between the Dequeue and Enqueue Pointers are owned by the xHC.
55
eXtensible Host Controller Interface Revision 1.0
56
eXtensible Host Controller Interface Revision 1.0
Figure 5 illustrates a Transfer TRB Ring with multiple pending TDs. The Enqueue Pointer identifies the
next TRB location available to system software for scheduling work (TDs) to the Ring. The Dequeue
Pointer identifies the next TRB in the Transfer Ring to be executed by the xHC. Upon completion of a
Transfer TRB, the Length and Status of the transfer may optionally be reported in a Transfer Event TRB.
Refer to section 6.4.2.1 for more information on the Transfer Event TRB.
Note: A Transfer Ring may include an Event Data TRB. Rather than pointing to a Data buffer this TRB
contains a 64-bit value which software may use to tag a TD and generate a special Transfer Event
to pass that tag back to software when the TD is complete. Refer to section 4.11.5.2 for more
information.
57
eXtensible Host Controller Interface Revision 1.0
Transfer
Transfer Ring Descriptor
(3 TRBs) Initial Page
TRB
Offset
1 Transfer TRB Pointer
Descriptor TRB
Rsvd Length Data
TRB
Ctrl (Normal, Chain)
Dequeue Pointer TRB
Enqueue Pointer TRB Pointer Data
TRB
Rsvd Length
TRB Data Length
Ctrl (Normal, Chain)
Execution
Pointer
Rsvd Length
The total TD transfer
Ctrl (Normal) length equals the sum
of its TRB Lengths
In the figure above note that the Chain bit (CH) is set in all but the last TRB of the Multi-TRB TD. The xHC
parses the TRBs in the Multi-TRB TD from the Dequeue Pointer towards the Enqueue Pointer (top to
bottom in this figure) to form a concatenated data buffer from separate buffers that reside in memory. If the
Transfer Ring was associated with an OUT Endpoint then the concatenated data buffer would be sent to
the USB Device as single transfer.
Note that no constraints are placed on the TRB Length fields in a Scatter/Gather list. Classically all the
buffers pointed to by a scatter gather list were required to be “page size” in length except for the first and
last (as illustrated by the example above). The xHCI does not require this constraint. Any buffer pointed to
by a Normal, Data Stage, or Isoch TRB in a TD may be any size between 0 and 64K bytes in size. For
instance, if when an OS translates a virtual memory buffer into a list of physical pages, some of the entries
in the list reference multiple contiguous pages, the flexible Length fields of TRBs allow a 1:1 mapping of list
entries to TRBs, i.e. a multi-page list entry does not need to be defined as multiple page sized TRBs.
58
eXtensible Host Controller Interface Revision 1.0
contiguous, Normal TRBs may be chained to the Data Stage TRB. All the TRBs in the Data Stage TD
transfer data in the same direction (i.e., all INs or all OUTs), as defined by the Data Stage TRB.
A Status Stage TD is required to complete a control transfer by retrieving the completion status of the USB
SETUP transaction from the USB device. The Status Stage TD is always the last TD in a control transfer
sequence. A Status Stage TD always consists of a single Status Stage TRB and may include an Event
Data TRB. Refer to section 8.5.3.1 of the USB2 specification and section 8.12.2.1 of the USB3
specification for more information on status reporting.
Transfer Descriptors
Data Buffer Pointer
(Setup Data)
Execution
Rsvd Length = 8
Ctrl (Setup, Immediate) Setup Transfer with
no Data Stage
Data Buffer Pointer
Transfer Ring (Not Used)
TRB
Rsvd Length = 0
TRB
Ctrl (Status Stage, IN)
TRB
Data Buffer Pointer
TRB
(Setup Data)
Dequeue Pointer TRB
Rsvd Length = 8 Setup Transfer with
Enqueue Pointer TRB an IN Data Stage
Ctrl (Setup Stage, Immediate)
TRB
TRB Data Buffer Pointer
Initial Page
Rsvd Length Offset
Ctrl (Data Stage, IN)
IN Data Length
Data Buffer Pointer
(Not Used)
Rsvd Length = 0
Ctrl (Status Stage, OUT)
Figure 7 is an example of the contents of a Control Endpoint Transfer Ring. This example illustrates two
control transfers: 1) a Setup stage transfer with no Data stage (top TD) is followed by 2) a Setup stage
transfer with an IN Data stage. Note that the Status Stage TRBs define ‘0’ length transfers, and that the
direction of the Data Stage and Status Stage TRBs depends on the Control transfer direction identified in
the Setup Stage TRB, and whether a Data Stage is required. Refer to section 4.11.2.2 for more information
on Setup Stage transfers.
59
eXtensible Host Controller Interface Revision 1.0
• If the data required by an Isoch TD is not physically contiguous (e.g. crosses a page boundary), then
one or more additional Normal TRBs shall be chained to the Isoch TRB by the host.
• The size of an Isoch Transfer in bytes shall be limited to either Max Packet Size * Max Burst Size *
Mult (defined in the Endpoint Context), or the sum of the Length fields defined by the Isoch TRB and all
Normal TRBs chained to it.
• For Isoch Out transfers, the xHC shall generate a Ring Underrun Transfer Event if the Transfer Ring is
empty when an active interval boundary is reached.
• For Isoch IN transfers, the xHC shall generate a Ring Overrun Transfer Event if the Transfer Ring is
empty when an active interval boundary is reached.
IMPLEMENTATION NOTE
Fractional Isoch Transfers
To relax the real-time demands on the system, an Isoch Transfer scheduled by an application may define
the data for many frames2. Also in order to hit a precise data rate the size of the Isoch transfers may have
to vary from frame to frame. For instance, system software may define 10ms. of 44.1 KHz 16-bit stereo
data to be transferred to a set of USB headphones. To minimize latency and the buffering requirements of
the USB headphones, the driver will schedule the minimum amount of data to be sent every millisecond.
That is, 176 bytes (44 4-byte/sample (16-bits/channel)) are moved every millisecond for 9ms. and 180
bytes are moved in the 10th ms. (to cover the “.1”). Assuming that the 10ms. of audio data is stored
contiguously on a single page in memory, then a set of 10 TDs shall be posted to the Transfer Ring each
containing a single Isoch TRB, with the Length of the last TRB being 4 bytes larger than the rest.
If the audio data buffer is not physically contiguous (e.g. crosses a Page boundary), then an additional
Normal TRB will be chained to the Isoch TD that crossed the Page boundary.
2. The period between isochronous transfers is often referred to as a “Frame”, however strictly speaking the period is defined by the
Endpoint Descriptor bInterval field. The value of bInterval is in Frames (1ms.) or Microframes (125μs.) depending on whether the
device is LS/FS or HS/SS. In this document, references to “frame” or “interval” in isochronous discussions should be interpreted
as “the period between isochronous transfers”.
60
eXtensible Host Controller Interface Revision 1.0
4 Isoch Transfer
Descriptors
(5 TRBs)
Pointer
Frame A
Pointer Frame D
Frame C (Hi)
Rsvd Length
Ctrl (Normal)
Pointer
Execution Frame D
Rsvd Length
Ctrl (Isoch)
61
eXtensible Host Controller Interface Revision 1.0
Name Description
No Op Tests TRB Ring mechanism
Enable Slot Returns a Device Slot ID and transitions the Device Slot from the Disabled
to the Default state.
Disable Slot Transitions the selected Device Slot from any state to the Disabled state.
Any pending transfers are terminated and the slot is made available again.
Address Device Enables the Default Control Endpoint, optionally issues a SET_ADDRESS
request to the USB device, and transitions the Device Slot to the Addressed
state.
Configure Endpoint Enables and/or Disables selected endpoints for the device.
Evaluate Context Informs xHC that software has modified selected Context parameters.
Reset Endpoint Resets selected Endpoint. This command is used to recover from a halted
endpoint.
Stop Endpoint Stops or aborts operation on selected Endpoint.
Set TR Dequeue Pointer Updates the Transfer Ring Dequeue Pointer of an enabled endpoint.
Reset Device Resets selected Device Slot. This command is used to synchronize the
state of a Device Slot when resetting a USB device.
Force Event Used with virtualization by a VMM to force a TRB on to an Event Ring
owned by a VM.
Negotiate Bandwidth Initiates Bandwidth Request Events.
Set Latency Tolerance Used by software to set the Best Effort Latency Tolerance (BELT) value for
the xHC.
Get Port Bandwidth Provides a means for software to identify the periodic bandwidth available
on xHC Root Hub Ports.
Force Header Allows software to generate SS LMPs or TPs to a Root Hub Port.
Refer to Table 131 for the TRB Type IDs associated with Commands.
62
eXtensible Host Controller Interface Revision 1.0
3.3.1 No Op
The No Op Command may be issued by software to exercise the TRB Ring mechanism of the xHC without
affecting any xHC or USB Device state, or to report the current value of the Command Ring Dequeue
Pointer.
Refer to section 4.6.2 for more information on the No Op Command.
63
eXtensible Host Controller Interface Revision 1.0
64
eXtensible Host Controller Interface Revision 1.0
Control Endpoint Context to ‘8’. Then use the endpoint to issue a GET_DESCRIPTOR(Device) request to
the device, retrieving the first 8 bytes of the Device Descriptor. Byte 7 of the Device Descriptor defines the
actual Max Packet Size for the Default Control Endpoint. This command would then be used to update the
Max Packet Size field of the Default Control Endpoint to its true value. Other fields that may need to be
updated late in the enumeration process are the Slot Context Hub and Max Exit Latency.
The command passes a pointer to an Input Context data structure to the xHC. The xHC evaluates specific
fields of the Input Context and updates the Device Context. The specific fields affected by the command
are identified in the respective context descriptions in section 6.2.
Upon successful completion of an Evaluate Context Command, the xHC shall begin executing with the
updated context parameters.
Refer to section 4.6.7 for more information on the Evaluate Context Command.
65
eXtensible Host Controller Interface Revision 1.0
66
eXtensible Host Controller Interface Revision 1.0
3. Section 10.1 of the USB3 spec describes a USB 3.0 hub as a “logical combination of 2 hubs: a USB 2.0 hub and a
SuperSpeed hub”. Each logical hub has its own set of addressable ports for supporting the respective protocol.
Each downstream (A) connector of a hub connects to one port or each logical hub. This allows Low-, Full-, or High-
Speed as well as SuperSpeed devices to be attached to any connector. The xHCI follows this model by providing
separate USB2.0 and USB3.0 Root Hub ports. Refer to section 4.19.7 for details.
67
eXtensible Host Controller Interface Revision 1.0
68
4 Operational Model
This section describes the general operational model for the eXtensible Host Controller Interface (xHCI)
hardware and eXtensible Host Controller Driver (xHCD) (generally referred to as system software). Each
significant operational feature of the eXtensible Host Controller (xHC) is discussed in a separate section.
Each section presents the operational model requirements for the xHC hardware. Where appropriate,
recommended system software operational models for features are also presented.
• After Chip Hardware Reset5 wait until the Controller Not Ready (CNR) flag in the USBSTS is ‘0’ before
writing any xHC Operational or Runtime registers.
Note: This text does not imply a specific order for the following operations, however these operations
shall be completed before setting the USBCMD register Run/Stop (R/S) bit to ‘1’.
• Program the Max Device Slots Enabled (MaxSlotsEn) field in the CONFIG register (5.4.7) to enable
the device slots that system software is going to use.
• Program the Device Context Base Address Array Pointer (DCBAAP) register (5.4.6) with a 64-bit
address pointing to where the Device Context Base Address Array is located.
• Define the Command Ring Dequeue Pointer by programming the Command Ring Control Register
(5.4.5) with a 64-bit address pointing to the starting address of the first TRB of the Command Ring.
4. Refer to the PCI spec for the initialization and use of MSI or PIN interrupt mechanisms
5. A Chip Hardware Reset may be either a PCI reset input or an optional power-on reset input to the xHC.
6. Interrupts are optional. The xHC may be managed by polling Event Rings.
69
eXtensible Host Controller Interface Revision 1.0
• Allocate and initialize the MSI-X Message Table (5.2.6.3), setting the Message Address and
Message Data, and enable the vectors. At a minimum, table vector entry 0 shall be initialized and
enabled. Refer to the PCI specification for more details.
• Allocate and initialize the MSI-X Pending Bit Array (PBA, 5.2.6.4).
• Point the Table Offset and PBA Offsets in the MSI-X Capability Structure to the MSI-X Message
Control Table and Pending Bit Array, respectively.
• Initialize the Message Control register (5.2.6.3) of the MSI-X Capability Structure.
• Initialize each active interrupter by:
• Defining the Event Ring: (refer to section 4.9.4 for a discussion of Event Ring Management.)
• Allocate and initialize the Event Ring Segment(s).
• Allocate the Event Ring Segment Table (ERST) (section 6.5). Initialize ERST table entries
to point to and to define the size (in TRBs) of the respective Event Ring Segment.
• Program the Interrupter Event Ring Segment Table Size (ERSTSZ) register (5.5.2.3.1)
with the number of segments described by the Event Ring Segment Table.
• Program the Interrupter Event Ring Dequeue Pointer (ERDP) register (5.5.2.3.3) with the
starting address of the first segment described by the Event Ring Segment Table.
• Program the Interrupter Event Ring Segment Table Base Address (ERSTBA) register
(5.5.2.3.2) with a 64-bit address pointer to where the Event Ring Segment Table is
located.
Note that writing the ERSTBA enables the Event Ring. Refer to section 4.9.4 for more
information on the Event Ring registers and their initialization.
• Defining the interrupts:
• Enable the MSI-X interrupt mechanism by setting the MSI-X Enable flag in the MSI-X
Capability Structure Message Control register (5.2.6.3).
• Initializing the Interval field of the Interrupt Moderation register (5.5.2.2) with the target
interrupt moderation rate.
• Enable system bus interrupt generation by writing a ‘1’ to the Interrupter Enable (INTE)
flag of the USBCMD register (5.4.1).
• Enable the Interrupter by writing a ‘1’ to the Interrupt Enable (IE) field of the Interrupter
Management register (5.5.2.1).
• Write the USBCMD (5.4.1) to turn the host controller ON via setting the Run/Stop (R/S) bit to ‘1’. This
operation allows the xHC to begin accepting doorbell references.
At this point, the host controller is up and running and the Root Hub ports (5.4.8) will begin reporting device
connects, etc., and system software may begin enumerating devices. System software may follow the
procedures described in section 4.3, to enumerate attached devices.
USB2 (LS/FS/HS) devices require the port reset process to advance the port to the Enabled state. Once
USB2 ports are Enabled, the port is active with SOFs occurring on the port, but the Pipe Schedules have
not yet been enabled.
SS ports automatically advance to the Enabled state if a successful device attach is detected.
70
eXtensible Host Controller Interface Revision 1.0
If successful, the port shall transition to the Enabled state, i.e. the Port Enabled/Disabled
(PED) flag shall be set to ‘1’, and the Port Reset (PR) flag and Port Link State (PLS) field shall
be ‘0’. The attached USB device shall be in the Default state.
If unsuccessful, the port shall transition to the Disconnected state, i.e. the PED and PR flags
shall be cleared to ‘0’ and Port Link State (PLS) field shall be set to RxDetect (‘5’). The
attached USB device shall remain powered.
b. A USB2 protocol port requires software to reset the port to advance the port to the Enabled
state and a USB device from the Powered state to the Default state. After an attach event, the
PED and PR flags shall be ‘0’ and the PLS field shall be ‘7’ (Polling) in the PORTSC register.
71
eXtensible Host Controller Interface Revision 1.0
System software shall enable the port by resetting the port (writing a '1' to the PORTSC PR bit)
then waiting for a Port Status Change Event due to the assertion of Port Reset Change (PRC)
flag. Refer to section 4.3.1 for an overview of the Root Hub port reset activities.
The completion of the port reset shall cause the PORTSC register PRC and PED flags to be
set (‘1’), the PR flag to be cleared (‘0’), and the PLS field to be U0 (‘0’). If the assertion of PRC
results in a ‘0’ to ‘1’ transition of PSCEG (4.19.2), the xHC shall generate a Port Status
Change Event as a result of the transition of PRC. The reset operation sets the USB2 device
into the Default state, preparing it for a SET_ADDRESS request.
4) After the port successfully reaches the Enabled state, system software shall obtain a Device Slot
for the newly attached device using an Enable Slot Command, as described in section 4.3.2.
5) After successfully obtaining a Device Slot, system software shall initialize the data structures
associated with the slot as described in section 4.3.3.
6) Once the slot related data structures are initialized, system software shall use an Address Device
Command to assign an address to the device and enable its Default Control Endpoint, as
described in section 4.3.4.
7) For LS, HS, and SS devices; 8, 64, and 512 bytes, respectively, are the only packet sizes allowed
for the Default Control Endpoint, so step a may be skipped.
For FS devices, system software should initially read the first 8 bytes of the USB Device Descriptor
to retrieve the value of the bMaxPacketSize0 field and determine the actual Max Packet Size for
the Default Control Endpoint, by issuing a USB GET_DESCRIPTOR request to the device, update
the Default Control Endpoint Context with the actual Max Packet Size and inform the xHC of the
context change. Step a describes this operation.
a. The USB GET_DESCRIPTOR request requires a Data Stage, so the Setup Stage TD shall be
followed by a Data Stage TD, then a Status Stage TD. To do this software shall:
i) Allocate an 8 byte buffer to receive the Device Descriptor.
ii) Initialize the Setup Stage TD (a single Setup TRB) on the Endpoint 0 Transfer Ring.
• TRB Type = Setup Stage TRB
• TRB Transfer Length = 8.
• Interrupt On Completion (IOC) = 0.
• Immediate Data (IDT) = 1.
• bmRequestType = 80h. (Dir = Device-to-Host, Type = Standard, Recipient = Device)
• bRequest = 6 (GET_DESCRIPTOR).
• wValue = 0100h. Low byte = 0 (Descriptor Index), High Byte = 1 (Descriptor type).
• wIndex = 0.
• wLength = 8.
• Cycle bit = Current Producer Cycle State.
iii) Advance the Endpoint 0 Transfer Ring Enqueue Pointer
iv) Initialize the Data Stage TD (a single Data Stage TRB) on the Endpoint 0 Transfer Ring.
• TRB Type = Data Stage TRB
• Direction (DIR) = ‘1’.
• TRB Transfer Length = 8.
• Chain bit (CH) = 0.
• Interrupt On Completion (IOC) = 0.
• Immediate Data (IDT) = 0.
• Data Buffer Pointer = The address of the Device Descriptor receive buffer.
• Cycle bit = Current Producer Cycle State.
72
eXtensible Host Controller Interface Revision 1.0
73
eXtensible Host Controller Interface Revision 1.0
1) Write the PORTSC register with the Port Reset (PR) bit set to ‘1’.
2) Wait for a successful Port Status Change Event for the port, where the Port Reset Change (PRC)
bit in the PORTSC field is set to ‘1’.
Section 4.19.5 describes the port reset operations performed by the xHC.
The next step requires system software to obtain a Device Slot (section 4.3.2), then associate the newly
attached device with the Device Slot and enable its Default Control Endpoint.
Note: After a port is successfully reset, the PORTSC Port Speed field shall indicate the speed of the
attached device.
7. e.g. To access a device attached directly to a Root Hub port, the Route String shall equal ‘0’, and the Root Hub
Port Number shall indicate the specific Root Hub port to use.
74
eXtensible Host Controller Interface Revision 1.0
Ring.
• Dequeue Cycle State (DCS) = 1. Reflects Cycle bit state for valid TRBs written by software.
• Interval = 0.
• Max Primary Streams (MaxPStreams) = 0.
• Mult = 0.
• Error Count (CErr) = 3.
6) Allocate the Output Device Context data structure (6.2.1) and initialize it to ‘0’.
7) Load the appropriate (Device Slot ID) entry in the Device Context Base Address Array (5.4.6) with
a pointer to the Output Device Context data structure (6.2.1).
8) Issue an Address Device Command for the Device Slot, where the command points to the Input
Context data structure described above. Refer to sections 4.6.5 and 6.4.3.4 for more information
on the Address Device Command.
75
eXtensible Host Controller Interface Revision 1.0
successfully configure the slot. If all interface settings have been exhausted (i.e. none have been accepted
by the xHC), only the Default Control Endpoint will remain enabled.
If system software was unable to successfully complete a Configure Endpoint Command due to a
Bandwidth Error, it may optionally use the Negotiate Bandwidth Command to cause the xHC to request
bandwidth with other devices. Refer to section 4.16.1 for more information on bandwidth negotiation.
System software executes the xHCI portion of the device configuration process by successfully completing
a Configure Endpoint Command as described in section 4.11.4.5.
System software shall wait for the Command Completion Event associated with the Configure Endpoint
Command before issuing any more commands to the slot.
After the Configure Endpoint Command and SET_CONFIGURATION request complete successfully,
software may schedule TDs on any enabled endpoint Transfer Ring.
If the Configure Endpoint Command is not successful, undefined behavior will result if software issues a
SET_CONFIGURATION request to the device.
Successful completion of the Configure Endpoint Command with the Deconfigure (DC) flag = ‘0’ shall
transition the Device Slot from the Addressed to the Configured state. Refer to section 4.5.3 for more
information on how the Configure Endpoint Command affects Device Slot states.
2) Free8 Transfer Rings of all endpoints that will be affected by the Alternate Interface setting.
3) Clear all the Endpoint Context fields of each endpoint that will be disabled by the Alternate
Interface setting, to ‘0’.
4) For each endpoint enabled by the Configure Endpoint Command:
76
eXtensible Host Controller Interface Revision 1.0
b. Initialize the Transfer Ring Segment(s) by clearing all fields of all TRBs to ‘0’.9
c. Initialize the Endpoint Context data structure:
• EP Type = Derived from the Endpoint Descriptor:bmAttributes:Transfer Type and Endpoint
Descriptor:bEndpointAddress:Direction. Refer to Table 57 for the encoding.
• Max Packet Size = Endpoint Descriptor:wMaxPacketSize & 07FFh.
• Interval = Refer to section 6.2.3.6 for the computation of the Interval value.
• Max Burst Size = SuperSpeed Endpoint Companion Descriptor:bMaxBurst or (Endpoint
Descriptor: wMaxPacketSize & 1800h) >> 11.
• Mult = ‘0’ or SuperSpeed Endpoint Companion Descriptor:bmAttributes Mult field.
• CErr = 3, or 0 for an Isoch endpoint.
• If Streams are supported by the endpoint (i.e. SuperSpeed Endpoint Companion
Descriptor:bmAttributes MaxStreams field > 0):
• Select a Max Primary Streams (MaxPStreams) value > 0 and <= SuperSpeed
Endpoint Companion Descriptor:bmAttributes MaxStreams
• Update MaxPStreams.
• Allocate and clear Primary Stream Array.
• MaxPStreams = Size of Primary Stream Array.
• TR Dequeue Pointer = Start address of Primary Stream Array.
• else
• MaxPStreams = ‘0’.
• TR Dequeue Pointer = Start address of the first segment of the previously allocated
Transfer Ring.
• Dequeue Cycle State (DCS) = 1. Assuming that all TRBs in the segment referenced
by the TR Dequeue Pointer have been initialized to ‘0’, this field reflects Cycle bit state
for valid TRBs written by software.
5) Issue and successfully complete a Configure Endpoint Command as described in section 4.11.4.5.
System software shall wait for the Command Completion Event associated with the Configure Endpoint
Command before issuing any more commands to the slot.
Note: A Configure Endpoint Command is not necessary prior to a SET_INTERFACE request, if the
SET_INTERFACE request does not change any endpoint parameters.
8. If just the parameters of a currently defined endpoint are being changed by the Alternate Interface setting then
software may chose to reuse the Transfer Ring for the new interface setting and not free it. In this case, software
does not need to allocate a new Transfer Ring as described in step 4a).
9. The Cycle bit (C) of all TRBs in a TR Segment shall be initialized to the inverse of the value that the Dequeue
Cycle State (DCS) field is initialized to. This pseudo code recommends initializing the all bytes in a TR Segment to
‘0’, which also initializes the Cycle bit to ‘0’ in all TRBs of the TR Segment, and the DCS flag of the pointer that ref-
erences the TR Segment to ‘1’, however software may initialize the Cycle bit to ‘1’ in all TRBs of a newly allocated
TR Segment and the DCS flag of the pointer that references it to ‘0’. Refer to section 4.9.2 for more information on
Cycle bit (C) initialization.
77
eXtensible Host Controller Interface Revision 1.0
be provided by system software in the Multi-TT (MTT), TT Hub Slot ID and TT Port Number fields of the
device’s Slot Context.
The xHC uses the TT Hub Slot ID to obtain the hub’s address from the USB Device Address field of the
hub’s Slot Context.
The xHC also checks that the Hub flag in the hub’s Slot Context equals ‘1’, to verify that the TT Hub Slot ID
references a hub. A Parameter Error shall be generated for the offending TD if the Hub flag = ‘0’.
If the device is not Low- or Full-speed or if the device is attached to a Root Hub port, then the TT Hub Slot
ID, Multi-TT (MTT), and the TT Port Number fields shall be cleared to ‘0’.
Refer to section 8.4.2 of the USB2 spec. for more information on Split Transaction tokens, and section
11.14 for Transaction Translator information.
78
eXtensible Host Controller Interface Revision 1.0
The Device Context Base Address Array supports up to 25510 USB devices or hubs, where each
element in the array is a 64-bit pointer to the base address of a Device Context data structure.
The Slot ID is the index that software uses when accessing the Device Context Base Address Array to
retrieve a pointer to the Device Context data structure or to access the Doorbell Register associated with a
device.
A Device Context data structure describes the Offset DCI
characteristics and current state of an individual USB
000h
device attached to the host controller. The Device
Context is organized as an array of 32 context data Slot Context 0
structures, consisting of 1 Slot Context and 31 Endpoint 020h
Context data structures. Figure 9 illustrates the Device Endpoint Context 0
Context layout. Refer to section 6.2.1 for data structure 1
(Bidirectional, Control EP)
details. 040h
Each Endpoint Context data structure defines the Endpoint Context 15 OUT 30
characteristics of the endpoint; type, direction,
3E0h
bandwidth requirements, etc., and points to a Transfer
Ring or a Stream Context Array. An Endpoint Context Endpoint Context 15 IN 31
10. The total number of USB devices supported by the xHCI architecture is less than 256 (the number of Device Context slots)
because some of the Device Context slots are reserved by the xHCI for special purposes and are not available for enumerating
USB devices. e.g. If virtualization is enabled, slots allocated to one VF will appear to be “reserved” to another VF.
11. An Endpoint Context is “enabled” if it is not in the Disabled state.
79
eXtensible Host Controller Interface Revision 1.0
A 32-bit Doorbell Register exists in the Doorbell Array for each Device Slot and is indexed by the Slot ID.
The DB Target and DB Stream ID fields in the Doorbell Register indicates the purpose of “ringing” the
doorbell.
Ringing the Host Controller Doorbell (Doorbell Register 0) with the DB Target = Host Controller Command,
indicates to the xHC that software has defined a command in the Command Ring that it wants executed.
Ringing the Device Slot’s Doorbell Register, indicates to the xHC that software has added work to be
executed on the Transfer Ring (pipe) defined by the DB Target and DB Stream ID field values. Refer to
section 5.6.
80
eXtensible Host Controller Interface Revision 1.0
Disabled
Reset Device
Address
Enable Slot Device
(BSR=0) Reset Device
Configure Endpoint (DC=1)
81
eXtensible Host Controller Interface Revision 1.0
Slot
Default
USB Device Other EP USB Device DCBAA Context
Definition Control EP
State State Address Pointer Slot State
State
value
a. Whether a non-Default Control endpoint is Disabled or not is determined by the Configure Endpoint Command.
4.5.3.2 Disabled
In this slot state the Device Slot is disabled, i.e. the slot’s Doorbell register is disabled and the pointer to the
slot’s Output Device Context in the Device Context Base Address Array is invalid. The only command that
software is allowed to issue for the slot in this state is the Enable Slot Command.
If the Output Slot Context is valid (i.e. an Address Device Command has been issued for the slot), the xHC
shall set the Slot State field to Disabled upon the completion of a Disable Slot Command.
When in the Disabled state, the slot shall transition to the Enabled state due to the successful completion
of an Enable Slot Command.
Note: Software shall not write to the Doorbell register of slots that are in the Disabled state.
Note: A Device Slot shall not generate events when it is in the Disabled state.
4.5.3.3 Enabled
In this slot state the Device Slot has been allocated to software by the Enable Slot Command, however the
Doorbell register for the slot is not enabled and the pointer to the slot’s Output Device Context in the
Device Context Base Address Array is invalid. The only commands that software is allowed to issue for a
slot in this state are the Address Device and Disable Slot.
When in the Enabled state, the slot shall transition to the Default state due to the successful completion of
an Address Device Command with the Block Set Address Request (BSR) flag set to ‘1’.
When in the Enabled state, the slot shall transition to the Addressed state due to the successful completion
of an Address Device Command with the Block Set Address Request (BSR) flag cleared to ‘0’.
When in the Enabled state, the slot shall transition to the Disabled state due to a Disable Slot Command.
82
eXtensible Host Controller Interface Revision 1.0
Note: The Enabled state is a logical slot state that is maintained internally by the xHC. A unique value for
the Enabled state is not defined for the Slot Context Slot State field in Table 55, i.e. the Slot State
field value ‘0’ is overloaded for the Disabled and Enabled states, refer to Slot Context Slot State
value column in Table 2. Software initializes the Device Context data structure to ‘0’, hence Slot
State = Disabled. The Device Context is then assigned to the xHC with an Address Device
Command. The Address Device Command also transitions the slot to the Default or Addressed
state, so there never is a case where the xHC would actually set the Slot State field to Enabled.
Note: Software shall not write to the Doorbell register of slots that are in the Enabled state.
4.5.3.4 Default
In this slot state the USB device is in the Default state, the pointer to the Device Slot’s Output Device
Context in the Device Context Base Address Array is valid, the Slot Context and Endpoint Context 0 in the
Output Device Context have been initialized by the xHC, and the Doorbell register for the slot is enabled
only for DB Target = Control EP 0 Enqueue Pointer Update. The only commands that software is allowed
to issue for the slot in this state are the Address Device (BSR = 0), Reset Endpoint, Stop Endpoint,
Evaluate Context, Set TR Dequeue Pointer, and Disable Slot.
When in the Default state, the slot shall transition to the Addressed state due to the successful completion
of an Address Device Command with the Block Set Address Request (BSR) flag cleared to ‘0’.
When in the Default state, the slot shall transition to the Disabled state due to a Disable Slot Command.
Upon the completion of a Evaluate Context, Reset Endpoint, Stop Endpoint, or Set TR Dequeue Pointer
Command while in the Default state, the slot shall remain in Default state.
The xHC shall set the Output Slot Context Slot State field to Default and the USB Device Address field to
‘0’ when this state is entered.
Note: Software shall ensure that only one Device Slot is in the Default state at time, otherwise undefined
behavior may occur.
4.5.3.5 Addressed
In this slot state the USB device is in the Address state, the pointer to the Device Slot’s Output Device
Context in the Device Context Base Address Array is valid, the Slot Context and Endpoint Context 0 in the
Output Device Context have been initialized by the xHC, and the Doorbell register for the slot is enabled
only for DB Target = Control EP 0 Enqueue Pointer Update. The only commands that software is allowed
to issue for the slot in this state are the Evaluate Context, Configure Endpoint, Reset Endpoint, Stop
Endpoint, Negotiate Bandwidth, Set TR Dequeue Pointer, Reset Device, and Disable Slot.
When in the Addressed state, the slot shall transition to the Configured state due to the successful
completion of a Configure Endpoint Command and the Deconfigure (DC) flag = ‘0’.
When in the Addressed state, the slot shall remain in the Addressed state due to the successful completion
of a Configure Endpoint Command and the Deconfigure (DC) flag = ‘1’, i.e. the Configure Endpoint
Command is treated like a No Op Command.
When in the Addressed state, the slot shall transition to the Default state due to a Reset Device Command.
The xHC shall set the Output Slot Context Slot State field to Addressed when this state is entered.
Upon the completion of an Evaluate Context, Stop Endpoint, or Set TR Dequeue Pointer Command while
in the Addressed state, the slot shall remain in Addressed state.
While in the Addressed state, the Reset Device Command may be used to transition the slot to the Default
state.
When in the Addressed state, the slot shall transition to the Disabled state due to the successful
completion of a Disable Slot Command.
83
eXtensible Host Controller Interface Revision 1.0
4.5.3.6 Configured
In this slot state the USB device is in the Configured state, the pointer to the Device Slot’s Output Device
Context in the Device Context Base Address Array is valid, the Slot Context, Endpoint Context 0, and
enabled IN and OUT Endpoint Contexts between 1 and 15 in the Output Device Context have been
initialized by the xHC, and the Device Context doorbell for the slot is enabled for DB Target = Control EP 0
Enqueue Pointer Update and any enabled endpoint. The only commands that software is allowed to issue
for the slot in this state are the Configure Endpoint (DC = ‘0’ or ‘1’), Reset Endpoint, Stop Endpoint, Set TR
Dequeue Pointer, Evaluate Context, Reset Device, Negotiate Bandwidth, and Disable Slot.
The xHC shall set the Output Slot Context Slot State field to Configured when this state is entered.
Upon the completion of an Evaluate Context, Configure Endpoint, Reset Endpoint, Stop Endpoint,
Negotiate Bandwidth, or Set TR Dequeue Pointer Command while in the Configured state, the slot shall
remain in Configured state.
Upon the completion of a “deconfigure” Configure Endpoint Command (DC = ‘0’) while in the Configured
state, the slot shall transition to the Addressed state.
When in the Configured state, the Reset Device Command may be used to transition the slot to the Default
state.
When in the Configured state, the completion of a Disable Slot Command shall transition the slot to the
Disabled state.
84
eXtensible Host Controller Interface Revision 1.0
85
eXtensible Host Controller Interface Revision 1.0
86
eXtensible Host Controller Interface Revision 1.0
To ring the Host Controller Doorbell software shall write the Host Controller Doorbell register (offset 0 in the
Doorbell Register Array), asserting the Host Controller Command value in the DB Target field and ‘0’ in the
DB Stream ID field.
The xHC, upon detecting a Host Controller Command Doorbell ring, shall execute commands until the
Command Ring is stopped or empty.
Note: If multiple commands are posted to the Command Ring, they are executed in order, so a delay
may be incurred before a particular command is executed.
The xHC shall generate a Command Completion Event for every command. The Command TRB Pointer
field of the Command Completion Event shall point to the Command TRB that initiated the event. The
Completion Code field of the Command Completion Event shall indicate the completion status of the
command. The Slot ID and VF ID fields shall reflect the values of the respective fields of the Command
TRB that initiated the event.
The Primary Event Ring receives all Command Completion Events.
The Command Completion Events that result from processing the commands shall be ordered with
respect to their location in the Command Ring.
Command execution times are xHC implementation defined.
The standard and optional commands supported by the xHCI are listed in Table 1.
xHC vendors may define proprietary commands using the Vendor Defined TRB Type codes identified in
Table 131. All vendor defined commands shall utilize the Command Completion Event TRB to report
completions.
87
eXtensible Host Controller Interface Revision 1.0
Software may follow the method described in section 4.6.1.1 to restart the “stopped” Command Ring.
Note: If the xHC detects the assertion of an abort request between the execution of two commands or
after the last command, a Command Completion Event with the Completion Code set to
Command Aborted may not be found on the Event Ring after an abort operation.
IMPLEMENTATION NOTE
Aborting Commands
Typically when software asserts the Command Abort (CA) flag, the Command Ring will normally stop after
the completion of a command, i.e. Completion Code is not equal to Command Aborted in the last Event
Ring Command Completion Event TRB. Only if a command is “blocked” will it be aborted.
An example of a command that may hang is the Address Device Command, because waiting for a
SET_ADDRESS request to be acknowledged by a USB device is outside of the xHC’s ability to control.
An xHC implementation should “checkpoint” the state associated with a command before a command is
initiated. If the CA flag is set before the command is complete (e.g. its Command Completion Event TRB is
posted to the Event Ring), then the command’s previous state should be restored by the xHC using the
checkpoint information and its Completion Code shall be set to Command Aborted.
Software should time the completion of all xHCI commands, including the Command Abort operation, i.e.
the delay between the negation of CRR (‘0’) and the assertion of CA (‘1’). If software doesn’t see CRR
negated in a timely manner (e.g. longer than 5 seconds), then it should assume that the there are larger
problems with the xHC and assert HCRST.
4.6.2 No Op
The No Op command can be issued by software to exercise the TRB Ring mechanism of the xHC without
affecting any xHC or USB Device state, or to report the current value of the Command Ring Dequeue
Pointer.
Note: A No Op Command may be inserted on the Command Ring by software to modify the alignment
memory boundaries of Command TDs.
The format of the No Op Command TRB is defined in section 6.4.3.1.
The format of the Command Completion Event TRB is defined in section 6.4.2.2.
88
eXtensible Host Controller Interface Revision 1.0
To issue an Enable Slot Command, system software shall perform the following operations:
• Insert an Enable Slot Command TRB on the Command Ring and initialize the following fields:
• TRB Type = Enable Slot command (refer to Table 131).
• Clear all other fields of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
• Write the Host Controller Doorbell with DB Target = Host Controller Command.
When an Enable Slot Command is executed by the xHC it shall perform the following operations:
• Insert a Command Completion Event on the Event Ring and initialize the following fields:
• TRB Type = Command Completion Event (refer to Table 131).
• Command TRB Pointer = The address of the Enable Slot Command TRB.
• Determine if a Device Slot is available.
• If a Device Slot is available:
• Slot ID = ID of the selected Device Slot.
• Completion Code = Success (refer to Table 130).
• else // Device Slot is not available
• Slot ID = ‘0’.
• Completion Code = No Slots Available.
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Event Ring’s PCS flag.
89
eXtensible Host Controller Interface Revision 1.0
90
eXtensible Host Controller Interface Revision 1.0
• else // The slot has not been enabled by an Enable Slot Command
• Completion Code = Slot Not Enabled Error.
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Event Ring’s PCS flag.
Note: Any pending events not already posted to an Event Ring may be aborted when this command is
executed.
91
eXtensible Host Controller Interface Revision 1.0
The Add Context flags A0 and A1 of the Input Control Context data structure (in the Input Context) shall be
set to ‘1’, and all remaining Add Context and Drop Context flags shall all be cleared to ‘0’.
System software shall initialize Slot Context and Endpoint Context 0 entries of the Input Context. All other
Endpoint Contexts in the Input Context shall be ignored by the xHC during the execution of this command.
To issue an Address Device Command, system software shall perform the following operations:
• Ensure that the Device Context Base Address Array entry points to a properly sized and initialized
Device Context data structure for the device.
• Allocate and initialize an Input Context data structure for the command.
• The Add Context flags for the Slot Context and the Endpoint 0 Context shall be set to ‘1’. All fields
of the Input Context Slot Context data structure shall define valid values, except for the Slot State
and USB Device Address fields which shall be cleared to ‘0’. The Endpoint 0 Context data
structure in the Input Context shall define valid values for the TR Dequeue Pointer, EP Type, Error
Count (CErr), and Max Packet Size fields. The MaxPStreams, Max Burst Size, and EP State
values shall be cleared to '0'.
• Insert an Address Device Command on the Command Ring and initialize the following fields:
• TRB Type = Address Device command (refer to Table 131).
• Slot ID = ID of the target Device Slot.
• Input Context Pointer = The base address of the Input Context data structure.
• Clear all other fields of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
• Write the Host Controller Doorbell with DB Target = Host Controller Command.
Note: A Slot or Endpoint Context contained in the Input Context is referred to as an Input Slot or
Endpoint Context. And a Slot or Endpoint Context contained in the Device Context data structure
pointed to by the Device Context Base Address Array is referred to as an Output Slot or Endpoint
Context and the Device Context itself is referred to as the Output Device Context.
When an Address Device Command is executed by the xHC it shall perform the following operations:
• Insert a Command Completion Event on the Event Ring and initialize the following fields:
• TRB Type = Command Completion Event (refer to Table 131).
• Command TRB Pointer = The address of the Address Device Command TRB.
• Slot ID = The value of the command’s Slot ID.
• If the Device Slot identified by the command’s Slot ID field has been previously enabled by an
Enable Slot Command:
• Retrieve the pointer to the Output Device Context of the selected Device Slot.
• If the Block Set Address Request (BSR) flag = ‘1’
• If the slot is in the Enabled state:
• Copy all fields of the Input Slot Context to the Output Slot Context.
• Copy all fields of the Input Endpoint 0 Context to the Output Endpoint 0 Context.
• Set the Endpoint State (EP State) field in the Output Endpoint 0 Context to Running.
• Set the Slot State in the Output Slot Context to Default.
• Set the USB Device Address field in the Output Slot Context to ‘0’.
• Completion Code = Success (refer to Table 130).
• else // The slot is not in the Enabled state:
• Completion Code = Context State Error.
• else // BSR = ‘0’
92
eXtensible Host Controller Interface Revision 1.0
93
eXtensible Host Controller Interface Revision 1.0
Note: A USB Transaction Error Completion Code for an Address Device Command may be due to a Stall
response from a device. Software should issue a Disable Slot Command for the Device Slot then
an Enable Slot Command to recover from this error. Refer to section 4.11.2.2 Implementation note.
Note: All endpoints shall be in the Stopped state or if in the Running state, shall be “idle” (e.g. no USB
Transactions are in progress, the Transfer Ring is empty, and software has processed all
outstanding events for the Transfer Ring) when this command is executed. If this condition is not
met undefined behavior may occur.
Note: If an Address Device Command fails with USB Transaction Error and the target device is behind a
TT, software shall issue a ClearFeature(CLEAR_TT_BUFFER) request to TT in the HS hub.
Refer to section 6.2.1 for the definition of a Device Context data structure and its access constraints.
The requirements of a “valid” Slot Context data structure are defined in section 6.2.2.1.
The requirements of a “valid” Endpoint Context data structure are defined in section 6.2.3.1.
94
eXtensible Host Controller Interface Revision 1.0
Note: A USB device presents one or more Configuration options to system software. System software
selects a specific configuration with a USB SET_CONFIGURATION request. Also, each Interface
defined by a Configuration may optionally present multiple Alternate Interface settings. System
software selects a specific Alternate Interface setting with a USB SET_INTERFACE request. The
result of the USB SET_CONFIGURATION and SET_INTERFACE requests allow system software
to enable a selected set endpoints on a USB device. The specific endpoints enabled by a
Configuration or Alternate Interface setting depend on the respective descriptors reported by the
device. The xHC does not maintain information about the relationships between the Configuration
and Alternate Interface options presented by a USB device and the endpoints enabled by a
specific configuration option. System software shall use the Add Context and Drop Context flags of
the Configure Endpoint Command to explicitly identify to the xHC the endpoints of a Device Slot
that shall be enabled due to the selected USB device Configuration and Alternate Interface
settings.
Note: Slot or Endpoint Contexts are found in Device and Input Contexts. A Slot or Endpoint Context
contained in the Input Context is referred to as an Input Slot or Endpoint Context, and a Slot or
Endpoint Context contained in the Device Context data structure is referred to as an Output Slot
or Endpoint Context.
The Add Context flag A1 and Drop Context flags D0 and D1 of the Input Control Context (in the Input
Context) shall be cleared to ‘0’. Endpoint 0 Context does not apply to the Configure Endpoint Command
and shall be ignored by the xHC. A0 shall be set to ‘1’ and refer to section 6.2.2.2 for the Slot Context fields
used by the Configure Endpoint Command. The state of the remaining Add Context and Drop Context
flags depend on the specific endpoints affected by the command. System software shall initialize the
Endpoint Contexts of the Input Context referenced by Add Context flags. All Endpoint Context data
structures not referenced by an Add Context flag shall be ignored by the xHC. Note that Endpoint Context
flags referenced only by a Drop Context flag does not need to be initialized. Refer to section 6.2.3.2 for the
Endpoint Context fields used by the Configure Endpoint Command.
Note: An endpoint shall be in the Stopped state or if in the Running state shall be “idle” (e.g. no USB
Transactions are in progress, the Transfer Ring is empty, and software has processed all
outstanding events for the Transfer Ring) if its Drop Context flag is set. If this condition is not met
undefined behavior may occur.
The following rules apply to processing a Configure Endpoint Command:
• The xHC resources assigned to a Device Slot are not modified until after all Drop Context and Add
Context flags are evaluated.
• The Slot State field of a Device Slot Context is not modified until after all Drop Context and Add
Context flags are evaluated.
• The xHC maintains a global Resources Available variable, which is initialized to indicate all xHC
resources are available. A Resource is an xHC implementation defined metric, which refers to the
internal xHC data structures, buffer space, or other implementation specific resources required to
support an endpoint type.
• For each USB bus instance, a Bandwidth Available variable is maintained, which initialized to the
respective maximum available value. Bandwidth is a commodity allocated by the host controller.
Refer to section 4.14.2 (Reserved Bandwidth) for more information on how bandwidth requirements
are calculated for an endpoint.
• Two temporary variables are maintained by the xHC when evaluating the Configure Endpoint
Command: Resource Required and Bandwidth Required. Both variables are initialized to ‘0’.
• The Resource Required variable identifies the “sum” of xHC resources required to support all
endpoints affected by a Configure Endpoint Command. Note that the “units” of xHC resource
measurement is an implementation specific value.
• The Bandwidth Required variable identifies the “sum” of USB bandwidth necessary to support all
endpoints affected by a Configure Endpoint Command.
95
eXtensible Host Controller Interface Revision 1.0
• The Drop Context flags are evaluated before the Add Context flags.
• For each endpoint indicated by a Drop Context flag = ‘1’:
• If the Output Endpoint Context is not in the Disabled state:
• The endpoint related resources are subtracted from the Resource Required variable.
• If the endpoint is periodic, then the bandwidth assigned to the endpoint is subtracted from the
Bandwidth Required variable.
• else // Output Endpoint Context is in the Disabled state
• Do nothing
• For each Input Endpoint Context indicated by an Add Context flag = ‘1’:
• The resources required to support the endpoint described by the Input Endpoint Context shall be
added to the Resource Required variable.
• If the endpoint described by the Input Endpoint Context is periodic, then the bandwidth required to
support the endpoint shall be added to the Bandwidth Required variable.
• If the Drop Context flag is set for an endpoint and the Output Endpoint Context is in the Disabled state,
the Drop Context flag shall be ignored and no resource or bandwidth evaluation shall be performed for
the endpoint.
• After all Drop Context and Add Context flags are evaluated the xHC determines whether the command
was successful:
• The Resources Required variable is compared to the Resources Available variable, if the result
indicates an oversubscription of resources by the command (i.e. Resources Available - Resources
Required is less than 0), then the command shall be unsuccessful and a Resource Error
Completion Code shall be returned in the Command Completion Event. Refer to section 4.14.1.1
for more information on xHC resources.
• The Bandwidth Required variable is compared to the Bandwidth Available variable, if the result
indicates an oversubscription of bandwidth by the command (i.e. Bandwidth Available - Bandwidth
Required is less than 0), then the command shall be unsuccessful and a Bandwidth Error
Completion Code shall be returned in the Command Completion Event.
• If the Resource and Bandwidth requirements of the command can be met, then the command is
successful and a Success Completion Code shall be returned in the Command Completion Event.
• If the command is unsuccessful:
• Current xHC resource allocations shall be unchanged for the endpoint.
• Current xHC bandwidth allocations shall be unchanged for the endpoint.
• The Output Slot Context Slot State field shall be unchanged for the device.
• The Output Endpoint Contexts referenced by the command in the Device Context shall be
unchanged.
• The Command Completion Event shall indicate the appropriate error Completion Code.
xHC behavior is undefined if the Drop Context flag is ‘0’, the Add Context flag is ‘1’, and the Output
Endpoint Context is not in the Disabled state (i.e. software is trying to add an endpoint without dropping its
current resources).
• If the command is successful:
• The Resources Available variable shall be updated to reflect the new resource allocation.
• The Bandwidth Available variable shall be updated to reflect the adjusted bandwidth allocation.
• For each endpoint:
• If the Drop Context flag is ‘0’ and the Add Context flag is ‘0’, the xHC shall:
96
eXtensible Host Controller Interface Revision 1.0
• Do nothing.
• The respective Input Endpoint Context is ignored by the xHC.
• If the Drop Context flag is ‘1’ and the Add Context flag is ‘0’, the xHC shall:
• Drop the endpoint from its pipe scheduling list if it is scheduled.
• Set the Endpoint State (EP State) field of the Output Endpoint Context to Disabled.
• The Input Endpoint Context data structure is ignored by the xHC.
• If the Drop Context flag is ‘0’ and the Add Context flag is ‘1’, the xHC shall:
• Add the endpoint to its pipe scheduling list.
• All fields of the Input Endpoint Context data structure in the Configure Endpoint Context
are copied to the Output Endpoint Context fields in the Device Context.
Note that when the Input Endpoint Context is copied to the Output Endpoint Context, the
ownership of a Stream Context Array pointed to by the Input TR Dequeue Pointer is
passed from software to the xHC.
• The Endpoint State (EP State) field of the Output Endpoint Context is set to Running.
• Enable the associated Device Context Doorbell.
• If the Drop Context flag is ‘1’ and the Add Context flag is ‘1’, the xHC shall:
• Release the current Resources and Bandwidth allocated to the endpoint and assign the
new Resources and Bandwidth requested for the endpoint.
• All fields of the Input Endpoint Context data structure in the Configure Endpoint Context
are copied to the Output Endpoint Context fields in the Device Context.
Note that when the Input Endpoint Context is copied to the Output Endpoint Context, the
ownership of a Stream Context Array pointed to by the Input TR Dequeue Pointer field is
passed from software to the xHC. Software shall not deallocate any Stream Context Array
data structures while they are owned by the xHC. It is software’s decision whether to set
the Input TR Dequeue Pointer equal to the Output TR Dequeue Pointer, thus reusing the
currently allocated Stream Contexts/Transfer Rings, or allocating new data structures and
changing the Input TR Dequeue Pointer value. If new data structures are allocated,
software shall be responsible for recovering the old data structures after the command
completes.
• Set the Endpoint State (EP State) field of the Output Endpoint Context to Running.
• If the device is “deconfigured” by this command (i.e. all Output Endpoint Contexts (DCI 2-31) are in
the Disabled state), the Output Slot Context Slot State field shall be set to the Addressed state by
the xHC.
• If any Output Endpoint Context (2 through 31) is not in the Disabled state, the Output Slot Context
Slot State field shall be set to the Configured state by the xHC.
• The Command Completion Event Completion Code shall indicate Success.
When this command is used to “Set an Alternate Interface on a device”, software shall set the Drop
Context and Add Context flags as follows:
• If an endpoint is not modified by the Alternate Interface setting, then software shall set the Drop
Context and Add Context flags to ‘0’.
• If an endpoint previously disabled, is enabled by the Alternate Interface setting, then software shall set
the Drop Context flag to ‘0’ and Add Context flag to ‘1’, and initialize the Input Endpoint Context.
• If an endpoint previously enabled, is disabled by the Alternate Interface setting, then software shall set
the Drop Context flag to ‘1’ and Add Context flag to ‘0’.
97
eXtensible Host Controller Interface Revision 1.0
• If the parameter of an enabled endpoint are modified by an Alternate Interface setting, the Drop
Context and Add Context flags shall be set to ‘1’.
When configuring or deconfiguring a device, only after completing a successful Configure Endpoint
Command and a successful USB SET_CONFIGURATION request may software schedule data transfers
through a newly enabled endpoint or Stream Transfer Ring of the Device Slot.
When setting an Alternate Interface on a device, only after completing a successful Configure Endpoint
Command and a successful USB SET_INTERFACE request may software schedule data transfers
through a newly enabled endpoint or Stream Transfer Ring of the Device Slot.
When the command is complete, a Command Completion Event is posted to the Event Ring indicating the
success or failure of the command.
If the Slot State is Disabled when a Configure Endpoint Command is received, the xHC shall generate a
Slot Not Enabled Error on the Event Ring.
The xHC shall reject a Configure Endpoint Command with Bandwidth Error if it determines that the
bandwidth required by the configuration is not available.
The xHC shall reject a Configure Endpoint Command with Resource Error if it determines that it does not
have enough internal resources (buffer space, etc.) available to service all the endpoints defined in the
configuration.
If the configuration defines periodic endpoints, system software may optionally issue a Negotiate
Bandwidth Command to cause the xHC to renegotiate bandwidth with other devices. Refer to section
4.16.1 for more information on bandwidth negotiation.
Upon successful completion of a Configure Endpoint Command, the enabled endpoints will be added to
the xHCs’ pipe scheduling list, the respective Device Context Doorbells shall be enabled, and TRBs can be
posted to any enabled endpoint or Stream Transfer Ring.
Refer to section 4.11.4.5 for more information on the Configure Endpoint Command.
The requirements of a “valid” Slot Context data structure are defined in section 6.2.2.2.
The requirements of a “valid” Endpoint Context data structure are defined in section 6.2.3.2.
The requirements of a “valid” Stream Context data structure are defined in section 6.2.2.1.
If the successful completion of the Configure Endpoint Command results in endpoints being enabled, then
information in the Input Context is copied to the Device Context. As illustrated in the figure below.
98
eXtensible Host Controller Interface Revision 1.0
To issue a Configure Endpoint Command system software shall perform the following operations:
• Allocate and initialize an Input Context data structure for the command.
• Insert a Configure Endpoint Command on the Command Ring and initialize the following fields:
• TRB Type = Configure Endpoint Command (refer to Table 131).
• Slot ID = ID of the target Device Slot.
• Input Context Pointer = The base address of the Input Context data structure.Clear all other fields
of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
• Write the Host Controller Doorbell with DB Target = Host Controller Command.
Note: This example assumes the existence of two global variables: Bandwidth Available, and Resource
Available, which identify the amount of the respective parameter available for allocation. And two
temporary variables: Bandwidth Required, and Resource Required, which define the amount of
the respective parameter required to successfully complete the Configure Endpoint Command.
Bandwidth is a commodity allocated by the host controller. Refer to section 4.14.2 for the
maximum bus bandwidth may be allocated to periodic endpoints. Resource is an xHC
implementation specific parameter which may refer to internal xHC data structure or buffer space.
Note: A Slot or Endpoint Context contained in the Input Context is referred to as an Input Slot or
Endpoint Context. And a Slot or Endpoint Context contained in the Device Context data structure
pointed to by the Device Context Base Address Array is referred to as an Output Slot or Endpoint
Context.
When a Configure Endpoint Command is executed by the xHC it shall perform the following operations:
• Insert a Command Completion Event on the Event Ring and initialize the following fields:
• TRB Type = Command Completion Event (refer to Table 131).
• Command TRB Pointer = The address of the Configure Endpoint Command TRB.
• Slot ID = The value of the command’s Slot ID.
• Initialize the Bandwidth Required variable to 0.
• Initialize the Resource Required variable to 0.
• If the Device Slot identified by the Slot ID field has been previously enabled by an Enable Slot
Command:
• Retrieve the Output Device Context of the selected Device Slot.
// Release the resources and bandwidth for the endpoints to be disabled.
• If the Output Device Context Slot State is equal to Configured:
• If the Deconfigure (DC) flag = ‘1’:
• For each Endpoint Context not in the Disabled state:
• Subtract the resources allocated to the endpoint from the Resource Required
variable.
• If the endpoint is periodic:
• Subtract bandwidth allocated to the endpoint from the Bandwidth Required
variable.
• Set the Output EP State field to Disabled.
• Set the Slot State in the Output Slot Context to Addressed.
• Completion Code = Success (refer to Table 130). Note: This value may be overwritten
by a later operation.
• else // DC = ‘0’
99
eXtensible Host Controller Interface Revision 1.0
Note that this action passes ownership of the Transfer Ring or Stream
Context Array/Transfer Rings from software to the xHC. If the Output
Endpoint Context had previously pointed to a Transfer Ring or a Stream
Context Array, software is responsible for performing any garbage
collection necessary for recovering them.
• Set the Output EP State field to Running.
• Load the xHC Enqueue and Dequeue Pointers with the value of the TR
Dequeue Pointer field from the Endpoint Context.
• If all Endpoints are Disabled:
• Set the Slot State in the Output Slot Context to Addressed.
• Set the Context Entries field in the Output Slot Context to ‘1’.
• else // An Endpoint is Enabled
12. Note, if both the Add and Drop flags are set for an Endpoint Context, the xHC is not expected to write out the inter-
mediate Disabled state to the Output Device Context. The only requirement is that the Endpoint Context is correct
when the Command Completion Event is generated.
100
eXtensible Host Controller Interface Revision 1.0
When an Evaluate Context Command is processed by the xHC it shall only affect the parameters identified
by the respective context. Refer to the Evaluate Context Command Usage sub-sections in section 4.5.2
and 6.2.2.3 for more information on the specific context fields that are affected.
The format of the Evaluate Context Command TRB is defined in section 6.4.3.6.
13. It is not required that the following checks for Primary and Secondary Bandwidth availability occur in this order. An
xHCI implementation may check for Secondary Bandwidth availability first.
101
eXtensible Host Controller Interface Revision 1.0
The format of the Command Completion Event TRB is defined in section 6.4.2.2.
When the command is complete, a Command Completion Event is posted to the Event Ring indicating the
success or failure of the command.
If the Slot State is Disabled when an Evaluate Context Command is received, the xHC shall generate a
Slot Not Enabled Error Event on the Event Ring.
Upon successful completion of an Evaluate Context Command, the xHC shall begin executing with the
updated context parameters.
The Evaluate Context Command utilizes the Input Context data structure defined in section 6.2.5 to define
which Contexts are to be evaluated. The state of the Add Context flags depends on the specific endpoints
affected by the command. All Drop Context flags of the Input Control Context shall be cleared to ‘0’ (these
flags do not apply to the Evaluate Context Command). System software shall initialize Contexts of the
Input Context affected by the command. All Contexts not referenced by an Add Context flag in the Input
Context are ignored by the xHC.
To issue an Evaluate Context Command, system software shall perform the following operations:
• Allocate and initialize an Input Context data structure for the command.
• Insert an Evaluate Context Command on the Command Ring
• TRB Type = Evaluate Context Command (refer to Table 131).
• The Add Context flags shall be initialized to indicate the IDs of the Contexts affected by the
command. Refer to sections 6.2.2.3 and 6.2.3.3 for the specific Context fields that shall be
evaluated.
• Set all Drop Context flags to ‘0’.
• Slot ID = ID of the target Device Slot.
• Input Context Pointer = The base address of the Input Context data structure.
• Clear all other fields of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
• Write the Host Controller Doorbell with DB Target = Host Controller Command.
When an Evaluate Context Command is executed by the xHC it shall perform the following operations:
• Insert a Command Completion Event on the Event Ring.
• TRB Type = Command Completion Event (refer to Table 131).
• Command TRB Pointer = The address of the Evaluate Context Command TRB.
• Slot ID = The value of the command’s Slot ID.
• Completion Code = Success (refer to Table 130).
• If the Device Slot identified by the Slot ID fields has been previously enabled by an Enable Slot
Command:
• Retrieve the Output Device Context of the selected Device Slot.
• If the Output Slot State is equal to Default, Addressed or Configured:
• For each Context designated by an Add Context flag = '1':
• Evaluate the parameter settings defined by the selected Contexts.
• If the Context parameters are not valid:
• Completion Code = Parameter Error.
• If the Max Exit Latency is non-zero:
• Calculate the Isoch Scheduling Delay.
• If the Max Exit Latency + Isoch Scheduling Delay does not allow an Isoch endpoint to
102
eXtensible Host Controller Interface Revision 1.0
be scheduled:
• Completion Code = Max Exit Latency Too Large Error.
• If Completion Code = Success:
• For each Endpoint Context designated by a Add Context flag = '1':
• Update Output Device Context parameters.
• else // The Output Slot State is not equal to Default, Addressed or Configured
• Completion Code = Context State Error.
• else // The slot has not been enabled by an Enable Slot Command
• Completion Code = Slot Not Enabled Error.
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Event Ring’s PCS flag.
Note: The xHC shall consider an Endpoint Context invalid if the DCI of an Add Context flag = ‘1’ is
greater than the value of Context Entries.
Note The Output Slot/Endpoint Context parameters shall not be changed if any error is detected by this
command.
Note: When an Evaluate Context Command modifies the value of Max Exit Latency, the xHC shall
reposition the PING relative to the Isoch transactions of a running Isoch endpoint without dropping
the data of any Isoch TDs.
The requirements of a “valid” Slot Context data structure are defined in section 6.2.2.3.
The requirements of a “valid” Endpoint Context data structure are defined in section 6.2.3.3.
103
eXtensible Host Controller Interface Revision 1.0
To issue a Reset Endpoint Command system software shall perform the following operations:
• Insert a Reset Endpoint Command TRB on the Command Ring and initialize the following fields:
• TRB Type = Reset Endpoint Command (refer to Table 131).
• Transfer State Preserve (TSP) = Desired Transfer State result.
• Endpoint ID = ID of the target endpoint.
• Slot ID = ID of the target Device Slot.
• Clear all other fields of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
• Write the Host Controller Doorbell with DB Target = Host Controller Command (DB Stream ID = ‘0’).
104
eXtensible Host Controller Interface Revision 1.0
When a Reset Endpoint Command is executed by the xHC it shall perform the following operations:
• Insert a Command Completion Event on the Event Ring and initialize the following fields:
• TRB Type = Command Completion Event (refer to Table 131).
• Command TRB Pointer = The address of the Reset Endpoint Command TRB.
• Slot ID = The value of the command’s Slot ID.
• If the Device Slot identified by the Slot ID has been enabled by an Enable Slot Command:
• Retrieve the Device Context of the selected Device Slot.
• If the Slot State is set to Default, Addressed, or Configured:
• If the Endpoint State (EP State) field is set to Halted:
• Set the Endpoint State (EP State) field to Stopped.
• If the Transfer State Preserve (TSP) flag is cleared to ‘0’:
• Set the USB2 Data Toggle or the USB3 Sequence Number for the pipe to ‘0’.
• Enable the Doorbell register for the endpoint.
• Completion Code = Success (refer to Table 130).
• else // The Endpoint State (EP State) field is not set to Halted
• Completion Code = Context State Error.
• else // The Slot State is not set to Default, Addressed, or Configured
• Completion Code = Context State Error.
• else // The slot has not been enabled by an Enable Slot Command
• Completion Code = Slot Not Enabled Error
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Event Ring’s PCS flag.
Note: The xHC resources and bandwidth associated with a reset endpoint are not released by the Reset
Endpoint Command.
Note: After the successful completion of a Reset Endpoint Command with TSP = ‘0’, system software
may issue a CLEAR_FEATURE(ENDPOINT_HALT) request to the USB device to reset the halt
condition on the endpoint of the device.
Note: Software shall be responsible for timing the Reset “recovery interval” required by USB.
Note: After a Reset Endpoint Command is executed for a control endpoint, software shall execute a Set
TR Dequeue Pointer Command to ensure that the endpoint's Dequeue Pointer references a Setup
TD.
Note: Software is responsible for cleaning up any partially completed transfers after issuing a Reset
Endpoint Command, e.g. after this command completes, software shall update the associated
Transfer Ring to ensure that any endpoint specific requirements are met (e.g. as identified in the
previous note), before ringing the endpoint’s doorbell.
105
eXtensible Host Controller Interface Revision 1.0
1) Issue a Reset Endpoint Command with the TSP flag set to ‘1’. This causes the endpoint to
advance from the Halted to the Stopped state, but does not change the state of the Data Toggle or
Sequence Number, and allows the xHC to continue the retry process another CErr times.
2) Ring the doorbell for the endpoint to initiate up to another CErr retries.
To support Soft Retry, the state of a partially completed TRB transfer (e.g. if 1K of a 4K TRB has been
moved) shall be maintained by a Reset Endpoint Command if TSP = ‘1’.
Note: Soft Retry attempts shall not be performed on Isoch endpoints. Any attempt to do so may result in
undefined behavior.
Note: Soft Retry attempts shall not be performed on Interrupt endpoints if the device is behind a TT in a
HS Hub (i.e. TT Hub Slot ID > ‘0’). Any attempt to do so may result in undefined behavior.
Note: Recovery of lost data on an Interrupt endpoint may be handled by class specific mechanism.
Note: Software shall limit the number of unsuccessful Soft Retry attempts to prevent an infinite loop.
106
eXtensible Host Controller Interface Revision 1.0
Note that when an endpoint is stopped, the xHC maintains the state necessary to restart the last active
Transfer Ring where it left off, however software may not want to do this. The options are discussed below:
1) Temporarily Stop Transfer Ring Activity - If the intent of software in issuing the Stop Endpoint
Command was just to temporarily stop activity on the Transfer Ring, then software may restart the
stopped ring where it left off by simply ringing its doorbell.
2) Aborting a Transfer - If, because of a timeout or other reason, software issued the Stop Endpoint
Command to abort the current TD. Then the Set TR Dequeue Pointer Command may be used to
force the xHC to dump any internal state that it has for the ring and restart activity at the new
Transfer Ring location specified by the Set TR Dequeue Pointer Command.
3) Modifying the order of execution of TDs on a Transfer Ring - It may be necessary for software to
place a “high priority” TD on a ring, by inserting a TD ahead of any pending TDs. To safely modify
the order of execution of TDs on a ring, software shall first stop the endpoint. When an endpoint is
stopped, software may examine the Event Ring to determine the current state of TDs on the
associated Transfer Ring(s). If the xHC stopped in the middle of a TD, then that TD may not be
modified by software, however any other TDs on the ring may be. If the xHC stopped between
TDs, then it may modify any TD on the transfer ring. After the TDs are inserted, removed, or
rearranged to the satisfaction of software, it may ring the doorbell to restart operation on the ring.
Note: The xHC cannot distinguish whether software temporarily stopped Transfer Ring activity or
stopping the Transfer Ring to modifying the order of execution of its TDs. In either case, if the xHC
has read-ahead and cached TRBs for the Transfer Ring, it shall invalidate all TRBs not associated
with the current TD before continuing execution of the Transfer Ring. This ensures that any TDs
modified by software shall be correctly executed by the xHC.
Note: If software is issuing the Stop Endpoint Command due to suspending a device or a function on a
device, it shall set the Suspend (SP) flag to ‘1’ in the Stop Endpoint Command TRB (refer to SP
definition in Table 111).
The xHC shall perform the following operations when Stopping an endpoint:
• The xHC shall stop the USB activity for the pipe.
• If a USB IN or OUT transaction is in-flight, it shall be completed.
• ERDYs shall be ignored on the pipe for that endpoint.
• If LS, FS, or HS polling of the pipe shall cease.
• If an SS pipe is waiting for an ERDY, the xHC shall clear the flow control condition and cease
waiting for the ERDY.
Note: A Set TR Dequeue Pointer Command clears any transfer related state associated with an
endpoint. If an SS pipe was waiting for an ERDY when the endpoint was stopped, then if the
endpoint transfer state was not cleared by a TR Dequeue Pointer Command, the xHC shall
reissue an IN or OUT for the pipe when the ring is restarted.
• The current endpoint Service Opportunity (SO) shall be terminated.
• Stop the Transfer Ring activity for the pipe. Refer to Table 3 for Stop conditions and Actions.
• Remove the endpoint from the xHC’s Pipe Schedule.
• Generate a Command Completion Event.
After the command completes, the endpoint shall be reinstated on the xHC’s Pipe Schedule the next time
its doorbell is rung.
Note: Prior to restarting the ring, software may use the Set TR Dequeue Pointer Command to modify the
value of the TR Dequeue Pointer field of the Endpoint or Stream Context. The Set TR Dequeue
Pointer Command shall invalidate any xHC TDs that may be cached, forcing xHC to fetch Transfer
TRBs from memory when the pipe is restarted.
107
eXtensible Host Controller Interface Revision 1.0
Note: If software wants to know the exact number of bytes transferred when a TD is stopped:
If the ED flag is ‘0’ and the Completion Code equals Stopped, software may subtract the value of
the TRB Transfer Length field reported by the Transfer Event from the sum of the TRB Transfer
Length fields of all Transfer TRBs in the TD executed prior to and including the TRB referenced by
the Transfer Event.
If the ED flag is ‘0’ and the Completion Code equals Stopped - Length Invalid, software shall
ignore the TRB Transfer Length field of the Transfer Event, and simply sum of the TRB Transfer
Length fields of all Transfer TRBs in the TD executed prior to the TRB referenced by the Transfer
Event.
If the ED flag is ‘1’ then the TRB Transfer Length field reflects the number of bytes transferred prior
to stopping.
Note: If the ED flag is ‘0’ in the Stopped Transfer Event software may emulate an Event Data Transfer
Event for the stopped Transfer Ring. It does this by starting at the TRB referenced by the Stopped
Transfer Event and advancing through the TD, searching for the next Event Data TRB. If one is
found, the Parameter Component of the Event Data TRB and the “number of bytes transferred” as
described in the previous Note may be used to emulate an Event Data Transfer Event.
Note: After the command is complete, the TR Dequeue Pointer field of all Endpoint/Stream Contexts
associated with an endpoint shall contain the current value of the Dequeue Pointer for the
respective ring.
A Transfer Ring may be stopped in a variety of states, as illustrated by Table 3. If a TD was stopped during
its execution due to the Stop Endpoint Command, then a Stopped Transfer Event shall be generated.
However, if the Transfer Ring was stopped on a “natural” boundary (e.g. at a TD boundary, on a Link TD,
etc.), then no Stopped Transfer Event will be generated. Software is able to reliably manage stopped
Transfer Rings with this approach as long as the xHC implementation can guarantee that all Transfer
Events associated with the stopped Transfer Ring are written to system memory before the Command
Completion Event is written.
The xHC shall generate a Stopped Transfer Event every time a Transfer Ring is stopped with a Stop
Endpoint Command. This operation is referred to as Force Stopped Event (FSE). The forced Stopped
Transfer Event explicitly indicates to software that the selected Transfer Ring has stopped. If a Transfer
Ring is empty when a Stop Endpoint Command is issued, a Stopped Transfer Event shall be generated on
the Event Ring indicated by the Slot Context Interrupter Target field.
The Table 3 identifies the Action that shall be taken by the xHC on the TRB referenced by the Dequeue
Pointer when the transfer ring stops. When restarting a Stopped endpoint, Table 3 also identifies whether
the xHC shall advance the Dequeue Pointer prior to executing a TRB, or if it shall continue the execution at
the Stopped TRB.
Note: The cases in Table 3 that reference a “FSE” Action shall force an additional Stopped Transfer
Event.
Note: A Busy endpoint may asynchronously transition from the Running to the Halted or Error state due
to error conditions detected while processing TRBs. A possible race condition may occur if
software, thinking an endpoint is in the Running state, issues a Stop Endpoint Command however
at the same time the xHC asynchronously transitions the endpoint to the Halted or Error state. In
this case, a Context State Error may be generated for the command completion. Software may
verify that this case occurred by inspecting the EP State for Halted or Error when a Stop Endpoint
Command results in a Context State Error.
108
eXtensible Host Controller Interface Revision 1.0
109
eXtensible Host Controller Interface Revision 1.0
d. The xHC shall perform a Force Stopped Event (FSE) operation by generating a Transfer Event for the endpoint with
Condition Code = Stopped - Invalid Length, TRB Pointer = current Dequeue Pointer value, and TRB Transfer Length
= 0.
e. Force normal completion of Event Data TRB before generating Command Completion Event.
f. When the Dequeue Pointer is advanced, the xHC shall begin parsing TRBs at the address identified by the Link TRB
Ring Segment Pointer field.
g. In this case the TRB referenced by the TR Dequeue Pointer is invalid, so use the state of the Chain (CH) bit from the
last executed TRB. If no TRBs had been executed previously, assume C = ‘0’ case.
h. The event generated by the “Stopped while waiting for more TRBs to be posted for TD.” condition uses the Slot Con-
text Interrupter Target field to identify the target Event Ring.
Note: If a Transfer Ring has been Halted due to error condition when a Stop Endpoint Command is
received, no Stopped Transfer Event shall be generated.
Note: If a Stop Endpoint Command is issued to a Stream pipe, it is the responsibility of software to not
modify the Transfer Ring of an active Stream, e.g. issue a Set TR Dequeue Pointer Command to
an active Stream. If software modifies the state of an active Stream, undefined behavior may
occur. Refer to section 4.12 for active vs. non-active Stream Context information.
To issue a Stop Endpoint Command system software shall perform the following operations:
• Insert a Stop Endpoint Command on the Command Ring and initialize the following fields:
• TRB Type = Stop Endpoint Command (refer to Table 131).
• Endpoint ID = ID of the target endpoint.
• Slot ID = ID of the target Device Slot.
• Clear all other fields of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
• Write the Host Controller Doorbell with DB Target = Host Controller Command.
When a Stop Endpoint Command is executed by the xHC it shall perform the following operations:
• If the Stop Endpoint Command interrupted the execution of a TD, then insert a Transfer Event on the
Event Ring and initialize the following fields:
• TRB Type = Transfer Event.
• Slot ID = The value of the command’s Slot ID.
• Endpoint ID = The value of the command’s Endpoint ID.
• If the TRB referenced by the TR Dequeue Pointer is an Event Data TRB:
• ED = ‘1’.
• Parameter Component (TRB Pointer) = 64 bits of Event Data TRB Parameter component.
• Length = The value of the Event Data Transfer Length Accumulator (EDTLA). Refer to section
4.11.5.2 for a description of EDTLA.
• else // The the TRB referenced by the TR Dequeue Pointer is not an Event Data TRB
• ED = ‘0’.
• TRB Pointer = The address of the TRB interrupted by the command.
• Length = The number of bytes remaining to be moved for the interrupted TRB.
• Completion Code = Stopped (refer to Table 130).
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Event Ring’s PCS flag.
• Insert a Command Completion Event on the Event Ring and initialize the following fields:
• TRB Type = Command Completion Event.
• Command TRB Pointer = The address of the Stop Endpoint Command TRB.
• Slot ID = The value of the command’s Slot ID.
110
eXtensible Host Controller Interface Revision 1.0
• If the Device Slot identified by the Slot ID has been previously enabled by an Enable Slot
Command:
• Retrieve the Device Context of the selected Device Slot.
• If the Slot State is set to Default, Configured, or Addressed:
• If the Endpoint State (EP State) field equals Running:
• Stop the USB activity for the pipe as described above.
• Stop the Transfer Ring activity for the pipe as described above.
• Write Dequeue Pointer value to the Output Endpoint or Stream Context TR Dequeue
Pointer field.
• Write CCS value to the Output Endpoint or Stream Context Dequeue Cycle State
(DCS) field.
• Removed the endpoint from the xHC’s Pipe Schedule.
• Set the Endpoint State (EP State) field to Stopped.
• Completion Code = Success.
• else // The Endpoint State (EP State) field is not Running
• Completion Code = Context State Error.
• else // The Slot State is not set to Default, Configured, or Addressed
• Completion Code = Context State Error.
• else // The slot has not been enabled by an Enable Slot Command
• Completion Code = Slot Not Enabled Error
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Event Ring’s PCS flag.
Note: The xHC resources and bandwidth associated with an endpoint are not released by the Stop
Endpoint Command.
111
eXtensible Host Controller Interface Revision 1.0
• Copy the value of the New TR Dequeue Pointer field in the Set TR Dequeue Pointer TRB to the
TR Dequeue Pointer field of the target Endpoint or Stream Context.
• Generate a Command Completion Event with the Completion Code set to Success.
Note: If, when the Transfer Ring was stopped a TD was only partially executed, then any remaining
TRBs in that TD shall not be executed when the endpoints’ TR Dequeue Pointer is updated by the
Set TR Dequeue Pointer Command.
Note: A Set TR Dequeue Pointer Command may be issued to modify the TR Dequeue Pointer field of a
non-active Stream Context while a Stream endpoint is in the Running state. Refer to section 4.12
for active vs. non-active Stream Context information.
To issue a Set TR Dequeue Pointer Command system software shall perform the following operations:
• Insert a Set TR Dequeue Pointer Command on the Command Ring and initialize the following fields:
• TRB Type = Set TR Dequeue Pointer Command (refer to Table 131).
• Endpoint ID = ID of the target endpoint.
• Stream ID = ID of the target Stream Context or ‘0’ if MaxPStreams = ‘0’.
• Slot ID = ID of the target Device Slot.
• New TR Dequeue Pointer = The new TR Dequeue Pointer field value for the target endpoint.
• Dequeue Cycle State (DCS) = The state of the xHCI CCS flag for the TRB pointed to by the TR
Dequeue Pointer field.
• Clear all other fields of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
• Write the Host Controller Doorbell with DB Target = Host Controller Command.
When a Set TR Dequeue Pointer Command is executed by the xHC it shall perform the following
operations:
• Insert a Command Completion Event on the Event Ring and initialize the following fields:
• TRB Type = Command Completion Event (refer to Table 131).
• Command TRB Pointer = The address of the Set TR Dequeue Pointer Command TRB.
• Slot ID = The value of the command’s Slot ID.
• If the Device Slot identified by the Slot ID has been enabled by an Enable Slot Command:
• Retrieve the Device Context of the selected Device Slot.
• If the Slot State is set to Default, Configured, or Addressed:
• If the Endpoint State (EP State) field equals Stopped or Error, or if EP State equals
Running and a non-active Stream Context is the target of the command (refer to section
4.12 for active vs. non-active Stream Context information):
• If the Stream ID field is non-zero a Stream Context is referenced so perform a Stream
ID boundary check as described in section 4.12.2.1:
• If the Stream ID is valid:
• Copy the value of the New TR Dequeue Pointer field to the TR Dequeue
Pointer field of the target Stream Context.
• Copy the value of the Dequeue Cycle State (DCS) field to the Dequeue Cycle
State (DCS) field of the target Stream Context.
• Completion Code = Success (refer to Table 130).
• else // The Stream ID is invalid
• Completion Code = TRB Error.
• else (Stream ID = ‘0’)
• If MaxPStreams = ‘0’:
112
eXtensible Host Controller Interface Revision 1.0
• Copy the value of the New TR Dequeue Pointer field to the TR Dequeue
Pointer field of the target Endpoint Context.
• Copy the value of the Dequeue Cycle State (DCS) field to the Dequeue Cycle
State (DCS) field of the target Endpoint Context.
• Completion Code = Success.
• else // MaxPStreams > ‘0’
• Completion Code = TRB Error.
• else // The Endpoint State (EP State) field is not Stopped or Error
• Completion Code = Context State Error.
• else // The Slot State is not set to Default, Configured, or Addressed
• Completion Code = Context State Error.
• else // The slot has not been enabled by an Enable Slot Command
• Completion Code = Slot Not Enabled Error
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Event Ring’s PCS flag.
Note: Consider the case where there are multiple TDs posted for pipe for a single data transfer and a
short packet or other condition on one TD means that the data transfer is terminated, and that the
subsequent TDs associated with the data transfer are now invalid. The xHC may have read ahead
on the Transfer Ring and cached the subsequent TDs. To ensure that xHC frees any cached
information associated with a pipe in a timely manner (so that it can reuse the cache space for
other pipes), software shall issue a Set TR Dequeue Pointer Command for the pipe when the data
transfer is terminated, vs. waiting for the next data transfer to be ready before issuing the
command.
Note: If software issues a Set TR Dequeue Pointer Command that points to a TRB that had previously
been partially completed TD, the xHC shall treat that TRB as the first TRB of the TD. i.e. any prior
state associated with a partially completed TRB is lost.
113
eXtensible Host Controller Interface Revision 1.0
To issue a Reset Device Command system software shall perform the following operations:
• Insert an Reset Device Command on the Command Ring and initialize the following fields:
• TRB Type = Reset Device Command (refer to Table 131).
• Slot ID = The ID of the Device Slot to reset.
• Clear all other fields of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
• Write the Host Controller Doorbell with DB Target = Host Controller Command.
When a Reset Device Command is executed by the xHC it shall perform the following operations:
• If the Device Slot is in the Addressed or Configured state:
• Abort any USB transactions to the Device.
• Set the Slot State field of Slot Context to the Default state.
• Set the USB Device Address field of Slot Context to ‘0’.
• For each Endpoint Context of the Device Context (except the Default Control Endpoint):
• Set the Endpoint Context EP State field to Disabled.
• Insert a Command Completion Event on the Event Ring of Interrupter 0 and initialize the following
fields:
• TRB Type = Command Completion Event (refer to Table 131).
• Command TRB Pointer = The address of the Reset Device Command TRB.
• If the Device Slot was in the Addressed or Configured state:
• Completion Code = Success (refer to Table 130).
• else // The Device Slot was not in the Addressed or Configured state
• Completion Code = Context State Error.
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Event Ring’s PCS flag.
Note: Software is responsible for recovering any memory data structures (Stream Context Arrays,
Transfer Rings, etc.) owned by disabled Endpoint Contexts the slot when the Reset Device
Command is issued.
114
eXtensible Host Controller Interface Revision 1.0
To issue a Force Event Command system software shall perform the following operations:
• Allocate and initialize the VF Event TRB that will be sent to the target VF’s Event Ring. The details of
the VF Event TRB initialization will depend on the type of Event that is being forced.
• Insert a Force Event Command on the Command Ring of the PF0 and initialize the following fields:
• TRB Type = Force Event Command (refer to Table 131).
• VF ID = ID of the target VF.
• VF Interrupter Target = The ID of the target Interrupter assigned to the VF. Refer to Table 117 for
more information on this value.
• Event TRB Pointer = The address of the VF Event TRB.
• Clear all other fields of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
• Write the Host Controller Doorbell with DB Target = Host Controller Command.
When a Force Event Command is executed by the xHC it shall perform the following operations:
• Insert a Command Completion Event on the Event Ring and initialize the following fields:
• TRB Type = Command Completion Event (refer to Table 131).
• Command TRB Pointer = The address of the Force Event Command TRB.
• If the VF ID is valid:
• If the VF Interrupter Target is in range for the VF:
• If the target VF’s Event Ring is not full:
• Insert the VF’s Event TRB referenced by the Force Event Command Event TRB
Pointer into target VF’s Event Ring specified by the VF ID and the VF Interrupter
Target fields:
• Copy all fields of the VF Event TRB except the Cycle bit field to the target VF’s
Event Ring.
• Cycle bit = Target VF’s Event Ring’s PCS flag.
• Completion Code = Success (refer to Table 130).
• else // The target VF’s Event Ring is full
• Completion Code = VF Event Ring Full Error.
• else // The VF Interrupter Target is not in range for the VF
• Completion Code = TRB Error.
• else // The VF ID is not valid
• Completion Code = TRB Error.
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Event Ring’s PCS flag.
Note: When the command completes, the VMM may release the buffer containing the Event TRB
pointed to by the Force Event Command.
Note: The “forced” event shall be dropped if the target Event Ring is full. Software should reschedule a
Force Event Command if an VF Event Ring Full Error is returned.
115
eXtensible Host Controller Interface Revision 1.0
To issue a Negotiate Bandwidth Command system software shall perform the following operations:
• Insert an Negotiate Bandwidth Command on the Command Ring and initialize the following fields:
• TRB Type = Negotiate Bandwidth Command (refer to Table 131).
• Slot ID = The ID of the slot that requires the bandwidth negotiation.
• Clear all other fields of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
• Write the Host Controller Doorbell with DB Target = Host Controller Command.
When a Negotiate Bandwidth Command is executed by the xHC it shall perform the following operations:
• If the command is supported:
• If the Device Slot identified by the Slot ID has been enabled by an Enable Slot Command:
• If the Slot ID identifies a slot in the Addressed or Configured state then:
• If there are devices that define candidate periodic endpoints for receiving Bandwidth
Request Events:
• For each device, identify the target Event Ring (specified by the Interrupt Target field
of the device’s Slot Context).
• If there is space on the device’s target Event Ring:
• Insert a Bandwidth Request Event and initialize the following fields:
• TRB Type = Bandwidth Request Event (refer to Table 131).
• Slot ID = ID of the device slot.
• Completion Code = Success (refer to Table 130).
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Device’s target Event Ring’s PCS flag.
• else // No space on the device’s target Event Ring
• Skip the device.
• Completion Code = Success (refer to Table 130).
• else // The Slot ID identifies slot not in the Addressed or Configured state
• Completion Code =Context State Error.
• else // The slot has not been enabled by an Enable Slot Command
• Completion Code = Slot Not Enabled Error
116
eXtensible Host Controller Interface Revision 1.0
To issue a Set Latency Tolerance Value Command system software shall perform the following operations:
• Insert an Set Latency Tolerance Value Command on the Command Ring and initialize the following
fields:
• TRB Type = Set Latency Tolerance Value Command (refer to Table 131).
117
eXtensible Host Controller Interface Revision 1.0
118
eXtensible Host Controller Interface Revision 1.0
The Get Port Bandwidth Command passes a pointer to a Port Bandwidth Context data structure to the
xHC. The xHC updates this context with the percentage of Total Available Bandwidth on each port. If a hub
is attached to a Root Hub port then the reported bandwidth is available on any unused port of the hub or
any port of the hub that is operating at the Device Speed.
For the Root Hub the Port Bandwidth Context shall be at least NumPorts+1 bytes in size or for an external
hub the Port Bandwidth Context shall be at least bNbrPorts14+1 bytes in size, rounded up to the nearest
Dword boundary.
The xHC overwrites the Port Bandwidth Context when it executes the Get Port Bandwidth Command, so
software does not need to initialize the context data structure before passing it to the xHC.
• A Root Hub port assigned to the Debug Capability shall report ‘0’ bandwidth available.
• If the Device Speed parameter is LS, FS, or HS, then USB3 (SS) Root Hub ports shall report ‘0’
bandwidth available.
• If the Device Speed parameter is SS, then USB2 Root Hub ports shall report ‘0’ bandwidth available.
Note: Software shall consider any port that reports ‘0’ bandwidth available as being unusable. A port
that, as far as software is concerned, does not have a device attached may report ‘0’ bandwidth
available. e.g. a VMM shall report ‘0’ bandwidth for a port if the device attached to it is assigned to
another VF.
Consider a physical connector that is “USB3 compatible” and has a SS device attached it. The connector
will be wired to a USB2 and a USB3 Root Hub Port. When the USB2 Root Hub Port is queried for its HS
bandwidth availability, it will not know that a SS device is attached to physical connector and report a non-
zero HS bandwidth availability, when in reality the USB2 Root Hub port is not available because it is
associated with a physical connector that is attached to SS device. The same problem will occur with a
USB3 Root Hub port if a USB2 device or hub is attached to the physical connector. Note that the problem
does not occur if a USB3 hub is attached because both Root Hub Ports see a hub attached. Software,
knowing the Root Hub Port to physical USB connector mapping (refer to section 4.19.7) and whether the
attached device is a USB2 or USB3 hub, shall be responsible for correcting the reported Port Bandwidth
Values.
The format of the Get Port Bandwidth Command TRB is defined in section 6.4.3.14.
The Get Port Bandwidth Command utilizes the Port Bandwidth Context data structure defined in section
6.2.6.
The format of the Command Completion Event TRB is defined in section 6.4.2.2.
To issue a Get Port Bandwidth Command, system software shall perform the following operations:
• Allocate and initialize an Port Bandwidth Context data structure.
• Insert a Get Port Bandwidth Command TRB on the Command Ring
• TRB Type = Get Port Bandwidth Command (refer to Table 131).
• Dev Speed = The bus speed of the target device. Refer to the Dev Speed field in Table 121 for the
encoding.
• Hub Slot ID = ‘0’ if referencing Root Hub ports (i.e. the Primary Bandwidth Domain) or the value of
the respective hub’s Slot ID if referencing the ports of a USB2 hub (i.e. a Secondary Bandwidth
Domain). Refer to section 4.16.2 for more information on Bandwidth Domains.
• Port Bandwidth Context Pointer = The base address of the Port Bandwidth Context data structure.
• Clear all other fields of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
14. Refer to section 11.23.2.1 in the USB2 spec for the definition Hub Descriptor bNbrPorts field.
119
eXtensible Host Controller Interface Revision 1.0
• Write the Host Controller Doorbell with DB Target = Host Controller Command.
When a Get Port Bandwidth Command is executed by the xHC it shall perform the following operations:
• Insert a Command Completion Event TRB on the Event Ring.
• TRB Type = Command Completion Event (refer to Table 131).
• Command TRB Pointer = The address of the Get Port Bandwidth Command TRB.
• Slot ID = ‘0’.
• If the Dev Speed field is valid (i.e. not equal to Undefined or Reserved):
• If the Hub Slot ID field = ‘0’:
• Compute Percentage of Total Available Bandwidth for each Root Hub port based on its
Speed. Use the value of the Dev Speed field for ports that do not have devices attached.
• else
• Compute the percentage of Total Available Bandwidth for the ports of the hub specified by
the Hub Slot ID based on their Speed. Use the value of the Dev Speed field for ports that
do not have devices attached.
• Copy the results to the Port Bandwidth Context.
• Completion Code = Success (refer to Table 130).
• else // The Dev Speed field is not valid
• Completion Code = TRB Error.
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Event Ring’s PCS flag.
Note: If a non-zero Hub Slot ID references a Device Slot whose Slot Context Hub field = ‘0’ or Speed
field is not equal to High-speed, may result in undefined behavior by the xHC.
The xHC is not required to comprehend the content of the header being forced. Depending upon
the type of header forced, it is possible for various parameters in the header (such a Data Packet
sequence numbers) to be out of sync with the host controller and/or device. In addition, some TPs
may result in Device responses which will not be comprehended by the xHC. It may be necessary
to reset the xHC to recover from these conditions.
The format of the Force Header Command TRB is defined in section 6.4.3.15.
The format of the Command Completion Event TRB is defined in section 6.4.2.2.
To issue a Force Header Command, system software shall perform the following operations:
• Insert a Force Header Command TRB on the Command Ring
• TRB Type = Force Header Command (refer to Table 131).
120
eXtensible Host Controller Interface Revision 1.0
• Root Hub Port Number = The number of the Root Hub Port that defines the target of the Header
packet.
• Packet Type = The field identifies the SS packet type. Refer to section 8.3.1.2 in the USB3
specification for valid values.
• Header Info = The header Type specific data to send to the target device. Refer to section 8 in the
USB3 specification for the encoding information.
• Clear all other fields of the command TRB to ‘0’.
• Cycle bit = Command Ring’s PCS flag.
• Write the Host Controller Doorbell with DB Target = Host Controller Command.
When a Force Header Command is executed by the xHC it shall perform the following operations:
• Insert a Command Completion Event on the Event Ring.
• TRB Type = Command Completion Event (refer to Table 131).
• Command TRB Pointer = The address of the Force Header Command TRB.
• Slot ID = 0.
• If the Force Header packet was transmitted successfully:
• Completion Code = Success (refer to Table 130).
• else // The Force Header packet was not transmitted successfully
• Completion Code = USB Transaction Error.
• Clear all other fields of the event TRB to ‘0’.
• Cycle bit = Event Ring’s PCS flag.
121
eXtensible Host Controller Interface Revision 1.0
4.7 Doorbells
The xHCI presents an array of up to 256 32-bit Doorbell Registers (refer to section 5.6), which reside in
MMIO space and are indexed by Device Slot ID. The base of the Doorbell Register Array is pointed to by
the Doorbell Offset (DBOFF) register in the xHCI Capability Registers (refer to section 5.3.7).
Each Doorbell Register contains a DB Target field, which is used to indicate the reason for a software
reference to the register. System software “rings” a doorbell by writing a Doorbell Register with the
appropriate value in the DB Target field.
Doorbell Register 0 is dedicated to the Host Controller. For this register, there is only one valid value for the
DB Target field, 0 (Host Controller Command). The remaining values (1-255) are reserved.
Doorbell Registers 1-255 are referred to as the Device Context Doorbell registers. There is a 1:1 mapping
of Device Context Doorbell registers to Device Slots. System software rings a Device Context Doorbell
after it has inserted work on a Transfer Ring (endpoint/Stream) associated with the respective Device Slot.
The DB Target and DB Stream ID fields of a Device Context Doorbell register is used to identify which
Transfer Ring of a device has been modified. Refer to Table 48 for the encoding of the DB Target field.
The xHC internally records all Doorbell Register write references and uses the information to determine if
the Command Ring or a Transfer Ring has newly posted work items (TDs). There is no need to “clear” a
Doorbell Register. To inform the xHC that work has been posted to two separate Transfer Rings of a
device, system software shall post two writes to the associated Doorbell Registers, where the value of the
DB Target field identifies the respective Transfer Ring.
Doorbell registers return no information when read.
Software shall not write to a Doorbell register:
• If the associated Device Slot is in the Disabled state.
• If the associated Device Slot is not in the Disabled state and the DB Target field is set to an endpoint
that is in the Disabled state.
If a doorbell register is written by software with the DB Target value that references an endpoint that is in
the Disabled state, the xHC should generate a Transfer Event TRB with the TRB Pointer, TRB Transfer
Length, Event Data (ED) fields set to ‘0’, a Completion Code of Endpoint Not Enabled Error, and the Slot ID
and Endpoint ID fields contain the IDs of device slot/endpoint that the doorbell that was rung for. This
transfer Event TRB shall be posted to the Primary Event Ring.
An Endpoint Not Enabled Error should be generated for doorbell register writes to Device Slots that are in
the Disabled state regardless of the DB Target value provided.
The xHC may ignore doorbell references to Device Slots in the Disabled state or endpoints in the Disabled
state.
The xHC shall ignore doorbell references to endpoints in the Halted or Error state.
122
eXtensible Host Controller Interface Revision 1.0
4.8 Endpoint
A USB device supports up to 31 endpoints (EPs): e.g.15 IN, 15 OUT, and 1 Control. The Default Control
EP (0) is a bidirectional EP defined for all USB devices.
...
Figure 12) is a bidirectional endpoint and, per the
USB specification, the Direction bit is “ignored” ...
when calculating its Endpoint Address, i.e. only
the Endpoint Number is used to calculate the
location of a Control Endpoint Context data EP Context 15 OUT
30
structure. To accommodate the addressing Direction = 0
EP Number 15
anomaly of USB bidirectional endpoint addressing
the xHC shall use the IN (odd) Endpoint Context of EP Context 15 IN
31
the pair to manage bidirectional endpoints. Direction = 1
The USB specification allows a device to define
Device Context Index(DCI)
additional Control (bidirectional) endpoints,
beyond the Default Control Endpoint (EP 0) Figure 12: Endpoint Context Addressing
required by the USB Framework. Using the rules
defined above, the xHCI is capable of supporting additional Control endpoints.
For all Endpoint Numbers greater than 0, the xHC shall ignore the OUT (even) Endpoint Context of the pair
of any endpoint that declares itself as a bidirectional. Software shall use the IN (odd) Endpoint Context of a
pair for managing a Control Endpoint.
123
eXtensible Host Controller Interface Revision 1.0
124
eXtensible Host Controller Interface Revision 1.0
Set TR
Dequeue TRB Error
Address Device or Pointer3 Error
Configure Endpoint1 Set TR
Dequeue Reset
Disabled Pointer Endpoint
Running Stop
Endpoint
Configure Endpoint,
Ring Doorbell Stopped
Disable Slot, or
or Configure
Reset Device2 Ring Doorbell Endpoint2
Figure 13 illustrates the state transitions presented by an endpoint. The Disabled to Running transition for
the Default Control Endpoint shall occur due to an Address Device Command, and for all other endpoints
the transition shall be invoked by a Configure Endpoint Command. Refer to Appendix E for state machine
notation.
A Halt condition or USB Transaction error detected on a USB pipe shall cause a Running Endpoint to
transition to the Halted state. A Reset Endpoint Command shall be used to clear the Halt condition on the
endpoint and transition the endpoint to the Stopped state. A Stop Endpoint Command received while an
endpoint is in the Halted state shall have no effect and shall generate a Command Completion Event with
the Completion Code set to Context State Error.
Note: A STALL detected on any stage (Setup, Data, or Status) of a Default Control Endpoint request
shall transition the Endpoint Context to the Halted state. A Default Control Endpoint STALL
condition is cleared by a Reset Endpoint Command which transitions the endpoint from the Halted
to the Stopped state. The Default Control Endpoint shall return to the Running state when the
Doorbell is rung for the next Setup Stage TD sent to the endpoint.
Section 8.5.3.4 of the USB2 spec and section 8.12.2.3 of the USB3 spec state of Control pipes,
“Unlike the case of a functional stall, protocol stall does not indicate an error with the device.” The
xHC treats a functional stall and protocol stall identically, by Halting the endpoint and requiring
software to clear the condition by issuing a Reset Endpoint Command.
Note: If the STALL condition is detected on the Setup or Data Stage TD of a request, software shall be
responsible for removing the Data Stage or Status Stage TDs, respectively, associated with the
request from the Transfer Ring.
A TRB Error condition should cause a Running Endpoint to transition to the Error state. A Set TR Dequeue
Pointer Command shall be used to transition the endpoint to the Stopped state. A Stop Endpoint Command
received while an endpoint is in the Error state shall have no effect and shall generate a Command
Completion Event with the Completion Code set to Context State Error.
125
eXtensible Host Controller Interface Revision 1.0
Note: An endpoint in the Running state may be Busy (actively processing TRBs on its Transfer Ring) or
Idle (the endpoint is not processing TRBs and waiting for a doorbell ring), i.e. an endpoint does not
exit the Running state if it exhausts its Transfer Ring.
Note: Some xHC implementations may not handle a TRB Error gracefully, resulting in undefined
behavior and possibly the assertion of HCE. It is the responsibility of software to always present
correctly formed TRBs to the xHC.
A Stop Endpoint Command shall also transition the endpoint to the Stopped state. While in the Stopped
state, the ownership of the Transfer Ring is relinquished up by the xHC, allowing software to add, delete, or
modify any TD on the ring.
If an endpoint is in the Stopped state when the doorbell is rung, it will transition to the Running state. A
Configure Endpoint Command shall also transition a Stopped endpoint to the Running state. Note that a
Configure Endpoint Command does not affect the Default Control Endpoint, therefore shall not transition
the Default Control Endpoint from the Stopped to the Running state.
A Configure Endpoint “deconfigure” (DC = ‘1’) or Reset Device Command shall transition all endpoints,
except for the Default Control Endpoint, from the Running, Halted, Error, or Stopped states to the Disabled
state.
A Disable Slot Command shall transition all endpoints, including the Default Control Endpoint, from the
Running, Halted, Error, or Stopped states to the Disabled state, as noted by the large bubble. System
software is responsible for issuing a Disable Slot Command when a device detach event is detected.
A Set TR Dequeue Pointer Command may be issued to a non-active Stream Context of an endpoint to set
its Dequeue Pointer while the endpoint is in the Running state. Refer to sections 4.6.10 and 4.12.
An endpoint in the Stopped state shall not generate Transfer Events.
When an endpoint transitions from the Stopped to the Running state due to a doorbell ring, the EP State
field of the Output Endpoint Context shall be updated by the xHC to running before any Transfer Events
are generated.
Note: If the xHC is reset while an endpoint is not in the Disabled state, the value of the Endpoint State
(EP State) field shall be invalid.
Note: An Endpoint is considered “enabled” if it is not in the Disabled state.
Note: Software shall not write to the Doorbell register with the DB Target field value set to an endpoint
that is in the Disabled state.
Note: An endpoint shall transition to the Halted state if a tHostTransactionTimeout occurs (refer to Table
8-33 in the USB3 spec). Note that the tHostTransactionTimeout is a xHC implementation specific
delay.
Note: There are several cases where the EP State field in the Output Endpoint Context may not reflect
the current state of an endpoint. The xHC should attempt to keep EP State as current as possible,
however it may defer these updates to perform higher priority references to memory, e.g. Isoch
data transfers, etc. Software should maintain an internal variable that tracks the state of an
endpoint and not depend on EP State to represent the instantaneous state of an endpoint.
For example, when a Command that affects EP State is issued, the value of EP State may be
updated anytime between when software rings the Command Ring doorbell for a command and
when the associated Command Completion Event is placed on the Event Ring by the xHC. The
update of EP State may also be delayed relative to a Doorbell ring or error condition (e.g. TRB
Error, STALL, or USB Transaction Error) that causes an EP State change not generated by a
command.
Software should maintain an accurate value for EP State, by tracking it with an internal variable
that is driven by Events and Doorbell accesses associated with an endpoint using the following
method:
126
eXtensible Host Controller Interface Revision 1.0
• When a command is issued to an endpoint that affects its state, software should use the
Command Completion Event to update its image of EP State to the appropriate state.
• When a Transfer Event reports a TRB Error, software should update its image of EP State to
Error.
• When a Transfer Event reports a Stall Error or USB Transaction Error, software should update
its image of EP State to Halted.
• When software rings the Doorbell of an endpoint to transition it from the Stopped to Running
state, it should update its image of EP State to Running.
Refer to section 6.2.3 for more information on the Endpoint Context data structure.
127
eXtensible Host Controller Interface Revision 1.0
15. Note: The xHCI Producer/Consumer model is not related to the PCI Producer/Consumer model.
128
eXtensible Host Controller Interface Revision 1.0
A consumer or producer may modify any TRB that it owns, at any time, and in any order. The producer
shall never modify a TRB that is owed by the consumer. And the consumer shall never modify a TRB that
is owed by the producer.
TRBs shall be executed by the consumer in order, starting at the TRB referenced by the Dequeue Pointer.
All TRB data structures shall be 16 bytes in size.
TRB Rings may be larger than a Page, however they shall not cross a 64K byte boundary. Refer to section
4.11.5.1 for more information on TRB Rings and page boundaries.
Initially when the TRB Ring is created in memory, or if it is ever re-initialized, all TRBs in the ring shall be
cleared to ‘0’. This state represents an empty queue.
Note: Refer to Table 131 for a definition of the valid TRB types allowed on a specific TRB ring type.
Table 132 defines the allowable Transfer Ring TRB Types as function of endpoint type.
Note: Ownership of TRBs on a Transfer Ring is strictly determined by the location of its Enqueue and
Dequeue pointers. A short packet, error, or other condition reported for a TRB that is not the last
TRB of a TD shall not be interpreted by the producer (software) as indicating that the ownership of
the remaining TRBs in the TD have also transitioned to the producer.
129
eXtensible Host Controller Interface Revision 1.0
be Success, because there was no error associated with the “skipped” TRB. However, an xHC
implementation may redundantly assert the original error Condition Code. As a general rule, the
Completion Code of a Transfer Event represents the status of the buffer referenced by the
Transfer TRB that generated it, however there may be exceptions.
130
eXtensible Host Controller Interface Revision 1.0
Dequeue Pointer
Transfer Enqueue Pointer
TRB 3 PCS
TRB 4 PCS
Producer
Owned
TRB 5 ~PCS
TRBs Cycle bit
... ... Transition
Consumer TRB n-1 ~PCS Link TRB
Owned Toggle Cycle = 1
TRBs TRB n ~PCS
Points to the beginning
Where TRB n is the of the Transfer Ring
last TRB in the ring. Cycle bit
In Figure 14, TRBs are written by the producer setting the Cycle bit to the value of PCS. Note that in
Figure 14, “~PCS” is the inverted version of PCS.
To form a ring (or circular queue) a Link TRB may be inserted at the end of a ring to point to the first TRB in
the ring. A ring may contain multiple Link TRBs which are used to chain together Transfer Ring Segments.
In the example of Figure 14 the Toggle Cycle flag is set in the Link TRB. If the Producer encounters a
Toggle Cycle flag set in a Link TRB it shall toggle the state of its PCS flag. If the Consumer encounters a
Toggle Cycle flag set in a Link TRB it shall toggle the state of its CCS flag. The producer sets the TRB
Cycle bit to the value of the PCS flag when it writes a TRB to set the position of the Enqueue Pointer. In
Figure 14, the next TRB written by the producer after encountering the Link TRB will be TRB 0. The
assertion of the Toggle Cycle bit in the Link TRB will cause the Producer to toggle the state of the PCS flag.
The Cycle bit in TRB0 will be set to the value of PCS.
Link TRBs allow Transfer Rings to span Page boundaries and to be dynamically sized.
Note: All TRBs between the Dequeue Pointer and the Enqueue Pointer-1 are owned by the Consumer
and may not be modified by the Producer. If the Ring is empty (Dequeue Pointer = Enqueue
Pointer) then no TRBs are owned by the Consumer. Any TRBs in a ring not owned by the
Consumer are owned by the Producer.
Note: If Streams are not enabled for an endpoint, the Transfer Ring CCS flag shall be set to the value of
the Endpoint Context DCS flag by a Configure Endpoint Command if the associated Add Context
flag is ‘1’, or by a Set TR Dequeue Pointer Command.
If Streams are enabled for an endpoint, then when a Stream is selected, the CCS flag shall be set
to the value of the DCS flag in the associated Stream Context, and when the Stream state is
saved, the DCS flag in the associated Stream Context shall be set to the value of the CCS flag.
131
eXtensible Host Controller Interface Revision 1.0
Unused
Figure 15 illustrates a Segmented Ring that contains two segments. In this example both segments are
allocated as 4KB contiguous blocks of memory. Segment 0 defines 256 TRBs, where the last TRB is a Link
TRB that points to the beginning of the next segment. Segment 1, which defines 244 TRBs, does not fully
utilize the 4K buffer that was allocated for it. The two segments together define ring size of 500 total TRBs,
where 498 of them are available for TDs. Note that the Toggle Cycle flag is set only in Segment 1’s Link
TRB.
132
eXtensible Host Controller Interface Revision 1.0
Once started (by a doorbell), the xHC processes TRBs until the ring is empty. A ring is defined as “empty”
if the Dequeue Pointer is equal to the Enqueue pointer. The value of the Enqueue Pointer is defined by the
Cycle bit transition.
To prevent overruns, software shall determine when the Ring is full. The ring is defined as “full” if
advancing the Enqueue Pointer will make it equal to the Dequeue Pointer. Software shall take Link TRBs
into account when evaluating the full condition. If the Enqueue Pointer is not pointing at a Link TRB,
software can determine if the Ring is full by adding the size of a TRB (16) to the Enqueue Pointer and
checking if the result is equal to the value of the Dequeue Pointer. If the Enqueue Pointer is pointing at a
Link TRB, then software shall compare the Ring Segment Pointer value in the Link TRB with the Dequeue
Pointer.
Initialize Ring
Write TRB?
No
Note: The Producer Cycle State (PCS) and the Consumer Cycle State (CCS) flags are maintained
internally by the xHC and software to aid in identifying the value of the Enqueue pointer. These
flags are NOT defined in xHC registers or data structures.
The Pointer Advancement rules:
• The Cycle bit shall be initialized by software to ‘0’ in all TRBs of all segments when initializing a ring.
• The Producer Cycle State (PCS) and the Consumer Cycle State (CCS) bits shall be set to ‘1’ when a
ring is initialized.
Note: The initial state of a Transfer Ring’s CCS flag is determined by the Endpoint Context DCS flag.
The initial state of the Command Ring’s CCS flag is determined by the Command Ring Control
Register Ring Cycle State (RCS) flag. The initial state of the Event Ring’s CCS flag is always ‘1’.
The previous two bullets assume that the DCS and RCS flags are initialized to ‘1’ by software. If
software chooses to initialize a CCS flag (DCS or RCS) to ‘0’, the Cycle bits in the respective ring
shall be set to ‘1’.
• The Cycle bit shall be written by the producer with the current value of the PCS bit.
• The Cycle bit shall be treated as Read-Only by the consumer.
• The Consumer may execute a TRB referenced by the Dequeue Pointer whose Cycle bit equals CCS.
133
eXtensible Host Controller Interface Revision 1.0
• If the Enqueue Pointer references a Link TRB, then the Enqueue Pointer shall be set to Link TRB Ring
Segment Pointer and if the Toggle Cycle bit is set to ‘1’ in the Link TRB, the PCS bit shall be toggled by
the Producer.
• If the Dequeue Pointer references a Link TRB then the Dequeue Pointer shall be set to Link TRB Ring
Segment Pointer and if the Toggle Cycle bit is set to ‘1’ in the Link TRB, the CCS bit shall be toggled by
the Consumer.
Note: A Cycle bit transition takes place between a Link TRB and the first TRB of the segment that the
Link TRB Ring Segment Pointer references.
Note: The TR Dequeue Pointer and Link TRB are not required to point to the beginning of a memory
page.
Segment A Segment B
TRB 0 0 TRB 0 1
TRB 1 0 TRB 1 1
TRB 2 0 TRB 2 1
TRB 3 0 TRB 3 1
Enqueue Pointer TRB 4 1 TRB 4 1
PCS = 0 TRB 5 1 TRB 5 1
Dequeue Pointer
... ... ... ...
CCS = 1
TRB n-1 1 TRB n-1 1
TRB n 1 TRB n (TC) 1
Initial State
Figure 17 illustrates a two segment Transfer Ring (A and B) where TRBs 5 to n of Segment B and TRBs 0
to 3 of Segment A are owned by the consumer (xHC), and the remaining TRBs are available to the
producer (software) for creating new TDs. Note that the Toggle Cycle (TC) bit is set in the Link TRB of
segment B and not set in the Link TRB of segment A, hence the state of the Cycle bit is toggled once each
pass through the Transfer Ring.
Now, consider the case where software needs to grow the ring size of Figure 17. Software may pause its
insertion of TDs on the Transfer Ring, which temporarily stops the Enqueue Pointer from advancing, to
insert a new segment. Software may only modify Link TRBs that it owns, so the new segment C may only
be inserted between existing segments A and B as illustrated in Figure 18.
Note: If a Link TRB is not owned by software and not an “intermediate” TRB of the TD currently being
executed by the xHCI, software may stop the Transfer Ring to modify the Link TRB, then restart it.
If the Link TRB is an “intermediate” TRB of the TD currently being executed by the xHCI, then
software shall use a Set TR Dequeue Pointer Command after stopping the Transfer Ring to ensure
that the xHCI flushes any cached TRBs before restarting it. Refer to section 4.6.9 for more
information on the requirements of stopping a Transfer Ring.
134
eXtensible Host Controller Interface Revision 1.0
In this example software initializes the new segment with the following operations:
• All TRBs in the new segment C to ‘0’, including the Cycle bit.
• The TRB Type of the last TRB (n) in segment C shall be set to Link TRB.
• And the Ring Segment Pointer field of the segment C Link TRB (n) shall be initialized to point to the
first TRB (0) of segment B.
• The Toggle Cycle (TC) flag of the segment C Link TRB (n) shall be set, to indicate the Cycle bit
transition between the last TRB in segment C and first TRB in segment B.
Software then modifies segment A’s Link pointer to point to link the new Segment C into the ring.
• The Ring Segment Pointer field of the segment A Link TRB (n) shall be initialized to point to the first
TRB (0) of segment C.
• The Toggle Cycle (TC) flag of the segment A Link TRB (n) shall be set to ‘1’, to indicate the Cycle bit
transition between the consumer owned TRBs in segments A and C.
Software is required to ensure that the state of the Cycle bits in the new segment(s) and the Toggle Cycle
flags in the Link TRBs that are used to connect the new segment to existing segments, do not cause an
inconsistency in the definition of the Enqueue Pointer position.
Given the initial conditions illustrated in Figure 17, to ensure Cycle bit consistency when inserting
segments software may either: 1) clear all the Cycle bits in all TRBs in the new segment(s) to ‘0’ and
modify the Link TRB Toggle Cycle flags in the segment that points to the new segment and the new
segment, or 2) set all the Cycle bits in all TRBs in the new segment to ‘1’. Figure 18 illustrates the case 1.
135
eXtensible Host Controller Interface Revision 1.0
The operation of a Command Ring is identical to Transfer Rings with the following exceptions:
• If the Command Ring Control Register (CRCR) is written while the Command Ring is stopped (CRR =
‘0’) the xHC shall initialize the Command Ring Dequeue Pointer with the value of the Command Ring
Pointer field (refer to section 5.4.5).
• When the Host Controller Doorbell Register (0) is written by system software, the xHC will evaluate the
Command TRB pointed to by the Command Ring Dequeue Pointer. Once started (by a doorbell write),
the xHC processes Command TRBs and advances the Command Ring Dequeue Pointer until the ring
is empty.
• The location of the Command Ring Dequeue Pointer is reported on the Event Ring in Command
Completion Events.
• No multi-TRB TDs are allowed on the Command Ring.
All other aspects of Command Ring management are identical to those described for the Transfer Rings.
i.e.:
• Software is responsible for advancing the Enqueue pointer. It does this by toggling the Cycle bit each
pass through the Command Ring as it writes Command TRBs.
• A Command Ring is defined as “empty” if the Dequeue Pointer is equal to the Enqueue pointer. The
Enqueue Pointer is defined by a Cycle bit transition.
Note: Refer to the description of the CRCR RCS bit in Table 32 for information on Command Ring CCS
flag initialization.
Note: While the Command Ring is in the Running state (CRR = ‘1’), it may be Busy (actively processing
Command TRBs) or Idle (not processing Command TRBs and waiting for a doorbell ring), i.e. CCR
is not negated when the Command Ring has completed all queued commands.
136
eXtensible Host Controller Interface Revision 1.0
Event Ring segments are defined by an Event Ring Segment Table (ERST). The ERST consists of an
array of Base Address/Size pairs (ERST.BaseAddress and ERST.Size), each defining a single Event Ring
segment. The first element in the ERST (0) is pointed to by the ERST Base Address Register (ERSTBA
section 5.5.2.3.2). The number of elements in the ERST is defined by the ERST Size Register (ERSTSZ
section 5.5.2.3.1). When the xHC is initialized, it begins writing Event TRBs starting at the address
referenced by the 0th ERST entry. The xHC maintains a count of the Event TRBs that it has written to a
segment. When the count exceeds the value of the associated ERST.Size entry, the xHC shall fetch the
next ERST entry. The ERST entries are treated as a circular queue, wrapping back to the ERST(0) after
the ERST(ERSTSZ – 1) is fetched. Refer to section 6.5 for the definition of an ERST entry.
137
eXtensible Host Controller Interface Revision 1.0
PCS = 1
Check current
segment No
TRB Count = 1?
ERST Count = 0
Yes
Yes
Check For ER Full ERST Count++ TRB Count = 0?
Advance to
next segment
No
Write Event TRB @ EREP
EREP += 16
TRB Count--
Yes
No
ERDP Write?
Wait for more room
in Event Ring
No
TRB Count = 0?
Figure 20 describes the algorithm the xHC employs for advancing its internal Event Ring Enqueue Pointer
(EREP). The left side of the figure describes the EREP Advancement algorithm. The right side of the figure
describes the algorithm for checking if the Event Ring is full.
Note: The Producer Cycle State (PCS) flag for the Event Ring is toggled only when the Event Ring
wraps back to the beginning.
Note: The Event Ring State machine is Stopped if the USBCMD Run/Stop (R/S) flag is ‘0’.
Note: A blocked Event Ring may impact forward progress on endpoints whose TDs target other Event
Rings.
138
eXtensible Host Controller Interface Revision 1.0
Note: It is recommended that software process as many Events as possible before writing the ERDP.
This approach not only minimizes the number of MMIO writes, but is particularly important if the
Event Ring is full. If an Event Ring Full condition exists, writing the ERDP after processing
individual Events may cause no work to progress because the Event Ring becomes filled with
Event Ring Full Events.
Ideally, software writes the ERDP after processing all Events on an Event Ring.
Practically, software should maximize the number of Events processed before writing the ERDP,
e.g. processing a minimum of 4 Events before each ERDP write.
Note: Section 4.23.2 describes the xHC Restore process. Step 2 in the restore process requires
software to load all registers (including the ERSTBA) with previously saved values. Writing the
ERSTBA initializes the Event Ring State Machine internal variables and advances it to wait for
Run/Stop (R/S) to be asserted or an event to be posted. A Restore operation, which always follows
the register load by software, shall overwrite the Event Ring State Machine internal variables
(ERSTE, ERST Count, EREP, and TRB Count) with previously saved values, allowing the Event
Ring State Machine to “pick up where it left off” after a power event.
Event Ring Segment Table ERST Resides in host memory. Contains the addresses
and lengths of the Event Ring segments. Refer to
section 6.5.
Event Ring Dequeue Pointer ERDP Resides in Runtime register space. Advanced by
software. Refer to section 5.5.2.3.3.
Event Ring Enqueue Pointer EREP Internal xHC variable. Advanced by Figure 20
algorithm
Event Ring Segment Table ERST Count Internal xHC variable. Identifies the offset into the
Count ERST of the segment that is currently being filled
with Event TRBs by the xHC.
Event Ring Segment Table ERSTE Internal xHC variable. A pointer to an ERST entry.
Entry
Event Ring Segment Table ERSTE.BaseAddr Ring Segment Base Address field of current ERST
Base Address entry.
Event Ring Segment Size ERSTE.Size Segment Size field of current ERST entry.
Event Ring Segment Table ERSTSZ Number of entries in the in the ERST.
Size
Next Segment Pointer NSP Base address for next Segment of ERST, based
on the current EREP.
TRB Count TRB Count Internal xHC variable. Identifies the number of
remaining TRBs in the current segment.
The following steps describe the xHC Event Ring Enqueue Pointer (EREP) Advancement algorithm (left
side of Figure 20):
1) When the ERST Base Address (ERSTBA) register is initially written the Event Ring State Machine
enters the Start state.
2) The xHC initializes its internal PCS flag to ‘1’.
139
eXtensible Host Controller Interface Revision 1.0
16. A Controller Restore State (CRS) operation overwrites the Event Ring State Machine internal variables. This may
occur while waiting for Run/Stop (RS) to be set to ‘1’ when restoring state from a power event. Refer to section
4.23.2.
140
eXtensible Host Controller Interface Revision 1.0
b. If the ERST Count equals the value of the ERSTSZ register, then advance the EREP to the
first segment of the ERST by setting the ERST Count to ‘0’ and toggling the Producer Cycle
State (PCS) flag, then go to step 5 to initialize the state machine parameters for the first
segment of the ERST.
5) To initialize the state machine parameters, the xHC fetches the entry in the Event Ring Segment
Table referenced by the ERST Count (ERSTE = ERST[ERST Count]) and initializes its Enqueue
Pointer (EREP) with the value of the Ring Segment Base Address field (ERSTE.BaseAddr) and
the TRB Count with the value of the Segment Size field (ERSTE.Size). Once the EREP has been
advanced to the next segment go to step 6 and wait for the ERDP to advance.
6) The Event Ring will remain full until the next time that software writes the ERDP. When the ERDP
is written, the xHC will determine if the new ERDP value has freed space on the Event Ring by
returning to step 1).
Note: The expectation is that the xHC shall gracefully stop execution on the Command and Transfer
Rings when the Event Ring is full. An “Event Ring Stop” will propagate all the way to the USB when
all the buffered operations in the xHC are exhausted. The xHC is expected to not lose Control,
Interrupt, or Bulk data under these conditions, however if the condition persists, the xHC will begin
to miss periodic endpoint Service Opportunities (SOs), resulting in the loss of Isoch data and the
possible loss of Interrupt data. The Missed Service Error may be used to report this condition in an
Isoch Transfer Event once the Event Ring Stop condition is cleared. The Event Ring Full Error
shall be reported whether data is lost or not, to inform system software that the Event Ring is under
provisioned.
Note: Step 2b above states that “the xHC stops processing the Transfer and Command Rings” if an
Event Ring is full. This action is further qualified with the type of Event Ring that has gone full. If
the Primary Event Ring is full, then all command and transfer rings shall stop processing TRBs. If
a Secondary Event Ring becomes full, then the xHC may stop all command and transfer ring
processing, or only stop processing on those transfer rings that target the full Event Ring. If
virtualization is enabled, an xHC implementation shall ensure that a full condition on a Secondary
Event Ring does not stop the processing of TRBs on the Command Ring, the Primary Event Ring,
or other Secondary Event Rings.
141
eXtensible Host Controller Interface Revision 1.0
whether it matches the expected state for the next pass through the Event Ring. If it does not match, it
means that the EREP is pointing at the last TRB of segment 1 and the Event Ring is empty. If it does
match, then software shall advance the Dequeue Pointer to the first TRB of segment ‘0’. If the Event Ring
is empty, software shall reevaluate direction of the EREP at the segment 1 to segment 2 boundary the next
time it receives an interrupt.
The Valid (non-zero) to Invalid (‘0’) transition of the Event TRB Completion Code field shall be used by
software to determine the position of the Enqueue Pointer during the first pass of the Dequeue Pointer
through the new segment(s). The TRB Cycle bit field shall be treated as invalid during the first pass
through the new segment(s) and shall not be used by software to determine the position of the Enqueue
Pointer.
After the first pass of the Enqueue Pointer through the new segment(s), the xHC has initialized the Cycle
bit in all newly added Event TRBs.
After the first pass of the Dequeue Pointer through the new segment(s), software shall evaluate the Cycle
bit state in segment 2 to determine the Enqueue Pointer position.
Note: ERST entries (Segment Base Address and Size fields) between 0 and ERSTSZ-1 are not allowed
to be modified by software when HCHalted (HCH) = ‘0’.
142
eXtensible Host Controller Interface Revision 1.0
143
eXtensible Host Controller Interface Revision 1.0
144
eXtensible Host Controller Interface Revision 1.0
A host controller implementation may delay the generation of Events associated with Transfer TRBs. The
following conditions should force Transfer Event generation to take place immediately:
• The completion of a TRB that has its IOC flag set.
• The completion of a short packet on a TRB that has its ISP flag set.
• An error occurs on any Transfer TRB.
• An xHC implementation dependent threshold, designed to prevent the TRB Ring state from getting too
far behind, is reached.
Note: The TRB Pointer field in a Transfer Event TRBs not only references the TRB that generated the
event, but it also provides system software with the latest value of the xHC Dequeue Pointer for
the Transfer Ring. Software may choose to use Event Data TRBs exclusively to report TD
completions (e.g. never setting an IOC flag in the Transfer TRBs of TDs). However, to keep the
software copy of the Transfer Ring Dequeue Pointer current, software will occasionally have to set
the IOC flag in a Transfer TRB, except if an Event Data TRB is declared. The frequency with which
the IOC flag is set in Transfer TRBs will depend on many system and software factors, that are
outside the scope of this specification.
Note: System software should not generate unnecessary Events. Typically there is no need to set the
IOC flag in more than one Transfer TRB per TD. The only exceptions would be for 1) very large
TDs (e.g. > 16MB transfers) where Intermediate Event Data TRBs are declared, or 2) if the IOC
flag is set to refresh the software Dequeue Pointer value.
Note: An Event Lost Error shall be generated for the endpoint if the xHC is unable to generate all the
Events defined by a TD. An Event Lost Error shall halt the endpoint. By following the
recommendations in the notes above, this condition may be avoided. The conditions that generate
this error are xHC implementation specific.
Note that the parsing of subsequent Event Data TRBs is optional because they don’t provide
any real value. Their Completion Code shall equal Short Packet, because that was the status
145
eXtensible Host Controller Interface Revision 1.0
of the last Transfer TRB executed, and their length shall be equal to the previous reported
TRB Transfer Length field value, refer section 4.11.5.2 which describes the EDTLA operation.
• If a Link TRB is encountered, the xHC shall parse the Link TRB and if its IOC flag is set (‘1’), then
a Transfer Event shall be generated with its Completion Code set to Success. All Link TRBs
encountered in TD shall be parsed.
If a Short Packet condition does not occur while receiving the data for a TD, the xHC shall parse all TRBs
of the TD. i.e. any TRB with its IOC flag shall generate a Transfer Event.
Note: A USB packet may be comprised of the data from many TRBs, or many USB packets may be
required to transfer a single TRB.
Note: No relationship is assumed between USB packet boundaries and TRB data buffer boundaries.
Note: If software is using Event Data TRBs to flag the completion of a TD that may receive a short
packet, then:
• The ISP and IOC flags shall be cleared (‘0’) in all Transfer TRBs.
• The IOC shall be set (‘1’) in all Event Data TRB(s).
Event Data Transfer TRBs encountered prior to the occurrence of a short packet shall generate an
Event Data Transfer Event with its Completion Code = Success (assuming no errors) and TRB
Transfer Length field equal to the number of bytes transferred since the beginning of the TD or the
previous Event Data Transfer TRB of the TD.
If a short packet occurs, then the subsequent Event Data Transfer TRBs encountered while
advancing to the end of the TD shall generate an Event Data Transfer Event with its Completion
Code = Short Packet and TRB Transfer Length field equal to the number of bytes transferred since
the beginning of the TD or the previous Event Data Transfer TRB of the TD.
If a short packet does not occur, then the last Event Data Transfer TRB shall generate an Event
Data Transfer Event with its Completion Code = Success (assuming no errors) and TRB Transfer
Length field equal to the number of bytes transferred since the beginning of the TD or the previous
Event Data Transfer TRB of the TD. Refer to section 4.11.5.2 for more information on Event Data
TRB usage.
• If a TD on an IN endpoint is terminated with an Event Data TRB, there is no need to set the
ISP flag in every TRB of the TD because the length of the transfer (including the terminating
Short Packet) shall be reported by the TRB Transfer Length field of the Event Data TRB.
• Software shall not interpret an Short Packet Event Data Transfer Event as indicating that the
TD that it is associated with is “complete”, unless the Event Data Transfer Event is the last
TRB of the TD.
Note: If software is not using Event Data TRBs, but wants to flag the completion of a TD that may receive
a short packet, then:
• The ISP flag shall be set (‘1’) in all Transfer TRBs of the TD, and
• The IOC flag shall be set (‘1’) in the last Transfer TRB of the TD.
If a short packet occurs, then a Transfer Event shall be generated with the Completion Code =
Short Packet, its TRB Pointer field pointing to the Transfer TRB that the short packet occurred on,
and its TRB Transfer Length field shall indicate the residue bytes in the buffer.
If a short packet does not occur, then the last TRB of the TD shall generate a Transfer Event with
its Completion Code = Success (assuming there was no error), its TRB Pointer field pointing to the
last Transfer TRB, and the TRB Transfer Length field shall equal 0.
146
eXtensible Host Controller Interface Revision 1.0
• If the Short Packet occurred while processing a Transfer TRB with only an ISP flag set, then
two events shall be generated for the transfer; one for the Transfer TRB that the short packet
occurred on, and a second for the last TRB with the IOC flag set.
• Software shall not interpret an Short Packet Event as indicating that the TD that it is
associated with is “complete”, unless the TRB Pointer field of the Transfer Event references
the last TRB of the TD.
4.10.2 Errors
The detection of an error during a USB transfer shall always generate a Transfer Event, irrespective of
whether the Interrupt-on-Short Packet (ISP) or Interrupt On Completion (IOC) flags are set in the Transfer
TRB. The Completion Code of the Transfer Event shall identify the detected error condition. An error may
occur on any TRB of a TD.
All Transfer Ring error conditions force the state of the associated endpoint to Halted and require system
software intervention to recover.
Refer to section 4.11.2.2 for more information on Control Endpoint error handling.
An isoch endpoint never halts because there is no handshake to report a halt condition. Errors are reported
as a completion code associated with a TRB for an isochronous transfer, but an isoch pipe is not halted in
an error case. If an error is detected, the xHC shall continue to process the data associated with the next
ESIT of the transfer. Only limited error detection is possible because the protocol for isochronous
transactions do not provide per-transaction handshakes. Refer to section 5.6.5 of the USB2 spec. There is
no equivalent text in the USB3 spec, however SuperSpeed isoch endpoints are treated the same way.
Note: If a device responds to a SETUP packet with a STALL17 the endpoint shall generate a Stall Error
for the Setup TRB and shall be halted.
A two step process is required to recover a halted endpoint:
1) System software shall use a Reset Endpoint Command (section 4.11.4.7) to remove the Halted
condition in the xHC. After the successful completion of the Reset Endpoint Command, the Endpoint
Context is transitioned from the Halted to the Stopped state and the Transfer Ring of the endpoint is
reenabled. The next write to the Doorbell of the Endpoint will transition the Endpoint Context from the
Stopped to the Running state.
Note: The Reset Endpoint Command for the endpoint shall complete successfully and the halt condition
on the USB device shall be successfully cleared before attempting to restart the Transfer Ring by
ringing its doorbell.
17. Typically control endpoints only return STALL TPs due to a Protocol Stall condition (as described in the USB3
spec section 8.12.2.3), however section 8.1 of the USB3 spec states “For non-isochronous transfers, an endpoint
may respond to valid transactions by:... Returning a STALL Transaction Packet if there is an internal endpoint
error”. This condition describes a “Functional Stall” case, which applies to a SuperSpeed Control Endpoint if an
internal endpoint error is detected by the device, hence any TP or DP issued to a Control Endpoint may return a
STALL TP, including a Setup DP.
147
eXtensible Host Controller Interface Revision 1.0
2) Software intervention is required to recover the pipe within the USB device.
Removal of the halt condition on an interrupt or bulk pipe in a USB device is achieved via software
intervention through a separate control pipe.
Note: The software intervention required to remove the halt condition on the USB device shall be
invoked after the pipe has been transitioned to the Stopped state by a successful Reset Endpoint
Command, but before writing to the Doorbell register of the Endpoint to restart activity on the pipe.
Note: Since an Isoch endpoint does not generate a transaction handshake, they cannot generate a Stall
Error.
Removal of the halt condition on the Control endpoint of a USB device is achieved by the device accepting
the next SETUP PID.
For Control endpoints, a reset of the USB device shall be required to clear the halt or error condition if the
device does not accept the next Setup PID.
Refer to section 4.11.2.2 for additional Control Endpoint error handling.
18. A TRB Error is generated due to a malformed TRB or a SET_ADDRESS Setup Stage TRB, hence their generation
is solely due to a xHCI driver error. So as not to burden xHCI implementations with complex error handing logic
that only applies to the driver debug process, an xHC is allowed to assert HCE when TRB Error conditions are
detected.
19. Refer to Table 8-1 in the USB2 spec for a list of the PID Codes (Types).
148
eXtensible Host Controller Interface Revision 1.0
This error condition shall only be reported in a Transfer Event due to an error detected on a Transfer TRB.
This error shall not be reported in any other Event TRB types.
Note: No retries shall be performed if the xHC does not see a response to a Data Transaction (either IN
or OUT) within tHostTransactionTimeout on a SuperSpeed pipe. The endpoint shall transition to
Halted state when this condition is detected.
Note: The USB3 spec defines a range of possible tHostTransactionTimeout values. The specific value
applied by an xHC implementation may be hardcoded by an xHC vendor or programmable
through a vendor defined mechanism, e.g. a Vendor Defined xHCI Extended Capability.
A babble condition also exists if IN transaction is in progress at High-speed EOF2 point. This is called a
Frame Babble. If a Frame Babble condition is detected while a TRB is being processed the xHC shall set
the Babble Detected Error in the Completion Code field of the TRB, generate an Error Event, and halt the
endpoint. In addition, the xHC shall disable the Root Hub port to which the Frame Babble is detected. The
xHC shall never start an OUT transaction that will babble across a microframe EOF.
Note: Frame Babble is also a Port_Error condition which shall transition a port in the Enabled state to the
Disabled state, assert the PEC flag (‘1’), and generate a Port Status Change Event. Refer to
section 4.19.1.1.6.
149
eXtensible Host Controller Interface Revision 1.0
IMPLEMENTATION NOTE
PID Mismatch and Babble Checking
When a host controller detects a data PID mismatch, it shall either: disable the Packet Babble checking for
the duration of the bus transaction, or do packet babble checking based solely on Maximum Packet Size.
The USB core specification defines the requirements on a data receiver when it receives a data PID
mismatch (e.g. expects a DATA0 and gets a DATA1 or visa-versa). In summary, the xHC shall ignore the
received data and respond with an ACK handshake, in order to advance the transmitter's data sequence.
The xHCI allows System software to provide buffers for a Control, Bulk or Interrupt IN endpoint that are not
an even multiple of the maximum packet size specified by the device. Whenever a device misses an ACK
for an IN endpoint, the host and device are out of synchronization with respect to the progress of the data
transfer. The xHC may have advanced the transfer to a buffer that is less than maximum packet size. The
device will re-send its maximum packet size data packet, with the original data PID, in response to the next
IN token. In order to properly manage the bus protocol, the host controller shall disable the Packet Babble
check when it observes the data PID mismatch.
A babble condition also exists if on an IN transaction the DPP exceeds the Max Packet Size. If a babble
condition is detected the xHC shall set the Babble Detected Error in the Completion Code field of the TRB,
generate an Error Event, and halt the endpoint.
150
eXtensible Host Controller Interface Revision 1.0
If a catastrophic error occurs during a host system access involving the Host Controller module the Host
System Error (HSE) bit in the USBSTS register shall be set to ‘1’. (In a PCI system, conditions that set this
bit to ‘1’ include PCI Parity error, PCI Master Abort, and PCI Target Abort.) When this error occurs, the Host
Controller shall clear the Run/Stop (R/S) bit in the USBCMD register to prevent further execution of the
scheduled TDs.
The following conditions shall indicate an Event TRB problem:
• System software receives an xHC interrupt and a Valid Transfer Event TRB does not point to a Valid
source TRB.
• System software receives an xHC interrupt and a Valid Transfer Event TRB does not identify an
enabled Device Slot.
• System software receives an xHC interrupt and a Valid Transfer Event TRB does not identify to an
enabled endpoint.
• Out of range, incomplete, or inconsistent Event TRB field values.
It is recommended that system software check for these conditions.
Note: A Host System Error (HSE = ‘1’) may be generated due to transfer integrity errors on the system
bus. Some modern system bus interrupt mechanisms (e.g MSI, MSI-X) utilize specialized writes to
the host address space to generate interrupts. These writes require that the address and data
paths of the system bus to be functioning properly. A catastrophic error condition may prevent
these writes from completing successfully. It is recommended that an xHC implementation uses
and “Out-of-Band” mechanism for reporting Host System Errors. This may be a hardwired
interrupt, bus or system error signal provided by the system bus.
Host System Error (HSE) may optionally be used to report other internal xHC errors that might jeopardize
system level operation or data integrity. It should be assumed, however, that the assertion of HSE should
generate a critical system interrupt (e.g., NMI or Machine Check) and is, therefore, fatal. Consequently,
care should be taken in using HSE to report non-parity or system errors. Both the xHC and software shall
assume that system integrity has been compromised when HSE is asserted.
Note: Host Controller Error (HCE) should be used to report internal xHC error conditions which may be
recovered from by software resetting and reinitialization of the xHC. Refer to section 4.24.1.
IMPLEMENTATION NOTE
Out-of-Band Error Reporting
The PCI PERR# (Parity ERRor) and SERR# (System ERRor) error reporting pins are required for all PCI
implementations. xHC implementations shall assert the PERR# pin if a parity error is detected during a PCI
transaction (other than Special Cycle). The xHC shall assert the SERR# pin if an address parity error, data
parity error on the Special Cycle command, the Host System Error (HSE) bit in the USBSTS register is set
to ‘1’, or any other system error is detected by the xHC where the result will be fatal. Assertion of the
PERR# or SERR# pins shall set the HSE bit in the USBSTS register to ‘1’.
If an MSI or MSI-X write transaction is terminated with a Master-Abort or a Target-Abort, the xHC shall
report the error by asserting SERR# (if bit 8 in the PCI Configuration Space Command register is set) and
to set the appropriate bits in the PCI Configuration Space Status register (refer to Section 3.7.4.2 of the
PCI specification). An MSI or MSI-X memory write transaction is ignored by the target if it is terminated
with a Master-Abort or Target-Abort. Refer to section 5.2.1 for more information on the PCI Configuration
Space registers.
If SERR# is not enabled, software should implement an algorithm for checking the HSE flag if the xHC is
not responding.
Non-PCI xHC implementations shall provide an equivalent out-of-band notification mechanism for xHC
151
eXtensible Host Controller Interface Revision 1.0
Decrement
Error Comment
Counter
Transaction Error Yes Refer to section 4.10.2.3.
Stalled No Detection of Babble or Stall automatically halts the ring. Thus, count
is not decremented.
No Error No If a bus transaction completes and the host controller does not detect
a transaction error, then the host controller should reset the Bus Error
Counter to extend the total number of errors for this TD. For example,
Bus Error Counter should be reset with value of CErr on each
successful completion of a USB transaction. The xHC shall not reset
the Bus Error Counter if the value at the start of the transaction is
00b.
Data Buffer Error No Data buffer errors are host problems. They don't count against the
device's retries.
Babble Detected No Detection of Babble or Stall automatically halts the ring. Thus, count
is not decremented.
Note: Software shall not program CErr to a value of ‘0’ when the Slot Context Speed field indicates a
Full- or Low-speed device. This combination could result in undefined behavior.
152
eXtensible Host Controller Interface Revision 1.0
• If an Event Data TRB is encountered, the xHC shall parse it, i.e. if the its IOC flag is set, an Event Data
Transfer Event shall be generated with its Completion Code set to the same error value reported by the
Transfer Event and TRB Transfer Length field set to the number of bytes successfully transferred. The
first Event Data TRB encountered shall be parsed.
• If subsequent Event Data TRBs are encountered in the process of advancing to the next Isoch TD,
the xHC may optionally parse them.
Note that the parsing of subsequent Event Data TRBs is optional because they don’t provide any
real value. Their Completion Code shall set as described above, because that was the status of
the last Transfer TRB executed, and their length shall be 0, refer to section 4.11.5.2 which
describes the EDTLA operation.
• If a Link Data TRB is encountered, the xHC shall parse the Link TRB, i.e. if its IOC flag is set, a
Transfer Event shall be generated with its Completion Code set to Success. All Link TRBs
encountered shall be parsed.
Note: Isoch TD shall follow the TD Fragment rules which define when an IOC flag may be set within a
TD.
Note: A SuperSpeed Isoch IN endpoint may transition to the Halted state if a tHostTransactionTimeout
occurs (refer to Table 8-33 in the USB3 spec). Note that the tHostTransactionTimeout is a xHC
implementation specific delay.
4.10.3 Events
Refer to section 4.17.4 for information on Event to Interrupter mapping.
153
eXtensible Host Controller Interface Revision 1.0
Length field shall be invalid. If the TRB Pointer field is non-zero, it may not reference a TRB that
has its IOC flag set (‘1’) within the skipped TD.
Note If the conditions that cause a Missed Service Error persist, multiple consecutive Isoch transfers
may not be completed. In this case, a Missed Service Error Transfer Event may not be generated
for every ESIT missed.
Note: If a Missed Service Error occurs, the xHC should not drop Events associated with the missed
Isoch TDs as it attempts to resynchronize an Isoch pipe, e.g. if IOC = ‘1’ in a Link TRB then it
returns Success, in an Event Data TRB then it returns Missed Service Error, in a Transfer Event
then it returns Missed Service Error, etc.
Note: A Missed Service Error shall not be reported if an Isoch transfer was not completed due to another
error condition, e.g. USB Transaction Error, etc.
154
eXtensible Host Controller Interface Revision 1.0
4.11 TRBs
This section discusses the properties and uses of TRBs that are outside of the scope of the general data
structure descriptions that are provided in section 6.4.
03-00H
Parameter
07-04H
Status 0B-08H
A TRB consist of 3 basic components: Parameter, Status, and Control. The following sub-sections identify
the properties of each component.
155
eXtensible Host Controller Interface Revision 1.0
The format/contents of all Event TRB components shall be defined by the Control component TRB Type
field. TRB Type field shall always reside in bits 10-15 of the Control component.
The Enqueue Pointer of a ring is defined by the transition of the Control component Cycle (C) bit in the
Event TRB Ring. Refer to section 4.9 for a detailed explanation of Cycle bit operation.
How an Event Ring is managed is described in section 4.11.3.
156
eXtensible Host Controller Interface Revision 1.0
Figure 22: SETUP Data, the Parameter Component of Setup Stage TRB
31 16 15 8 7 0
wValue bRequest bmRequestType 00h
7 6 5 4 0
DTD Type Recipient
bmRequestType
Figure 22 illustrates the mapping of the USB SETUP Data defined in section 9.3 (Table 9-2) of the USB2 or
USB3 spec. to the Setup Stage TRB Parameter component.
The Transfer Ring associated with a Control Endpoint adheres to the following rules:
• The Control Transfer Ring may contain Setup Stage and Status Stage TDs, and optionally Data Stage
TDs.
• Each Setup Stage TD shall contain a single Setup Stage TRB.
• A Data Stage TD shall consist of a Data Stage TRB chained to zero or more Normal TRBs, or Event
Data TRBs.
• A Status Stage TD shall contain of a single Status Stage TRB, optionally chained to an Event Data
TRB.
• All Control transfers require a Setup Stage TD followed by a Status Stage TD. If a data stage is
required for the transfer, then system software is responsible for ensuring that a Data Stage TD is
inserted between the Setup Stage TD and the Status Stage TD. “No-data” Control transfers do not
require a Data Stage TD.
• A No-data Control transfer is generated by software if a Data Stage TD does not exist between the
Setup Stage and Status Stage TDs.
• A Setup Stage TRB shall contain immediate data (IDT flag = ‘1’), its Parameter fields shall contain the
8-byte USB SETUP Data, which defines the request and the request’s parameters that will be sent to
the device in the USB Setup stage transaction, and its Length field shall be set to ‘8’.
• System software is responsible for setting the values passed in the USB SETUP Data fields as
function of the desired USB Control Endpoint request. Refer to section 9.3 in the USB2 or section 9.3
in the USB3 spec. for the format of the USB Setup Data.
157
eXtensible Host Controller Interface Revision 1.0
• System software is responsible for ensuring that the Direction (DIR) flag of the Data Stage and Status
Stage TRBs are consistent with the USB SETUP Data defined bmRequestType:Data Transfer
Direction (DTD) flag and wLength field. Refer to Table 7 for mapping.
• No more than one Data Stage TD may be defined between a pair of Setup and Status Stage TDs.
Table 7: USB SETUP Data to Data Stage TRB and Status Stage TRB mapping
Note: The Direction (DIR) flag in the Status Stage TRB indicates the direction of the control transfer
acknowledgement. For USB2 devices, DIR directly determines the PID that shall be used for the
associated USB2 transaction. For USB3 devices, a Status TP is defined which is used for the
status stage of all SuperSpeed (SS) control transfers. Refer to section 8.5 of the USB3 spec for the
definition of the SS Status TP Direction flag.
Note: The Direction (DIR) flag in the Data Stage TRB defines the transfer direction for all TRBs in the
Data Stage TD. For USB2 devices, DIR directly determines the PID that shall be used for the Data
Stage transaction. For USB3 devices, if DIR = OUT a DP is generated with write data, if DIR = IN
an ACK TP is generated to request read data from the device.
• If the data associated with a Data Stage TD is not contiguous, then additional Normal TRBs shall be
chained in a Data Stage TD.
• System software is responsible for ensuring that the total data length defined by a Data Stage TD (i.e.
the sum of the Length fields of the Data Stage TRB and all Normal TRBs) is equal to wLength. Note
that communicating with some non-compliant devices may require violating this rule. The transfer
lengths managed by the xHC depend strictly on the TRB Length fields.
• The Transfer Event generated by a Status Stage TRB shall report a Success, Stall Error, or other error
Completion Code.
• Success indicates that the USB device has completed the command and is ready to accept a new
command. Refer to “Function completes” row in Table 8-7 of the USB 2 spec. Refer to “Request
completes” row in Table 8-27 of the USB 3 spec.
• Stall Error indicates that the USB device has an error that prevents it from completing the command.
Refer to “Function has an error” row in Table 8-7 of the USB 2 spec. Refer to “Request has an error”
row in Table 8-27 of the USB 3 spec. Software shall provide a timeout for all control operations and
abort them using a Stop Endpoint Command if the operation times out.
Note: If a USB device is still processing the command when the Status Stage TD is executed, the
device will return a Busy20 response. The xHC shall wait indefinitely for a Success, Stall Error or other
error response from device for the Status stage.
20. Refer to “Function is busy” row in Table 8-7 of the USB 2 spec. Refer to “Device is busy” row in Table 8-27 of the
USB 3 spec.
158
eXtensible Host Controller Interface Revision 1.0
• The xHC shall NOT check for the following Control transfer error conditions.
Note: Some (non-compliant) USB devices use the SETUP Data wLength field as a custom parameter
for non-data control transfers. xHCI implementations should not tie a non-zero wLength value to the
existence of a Data Stage TD in a control transfer to ensure compatibility with those devices.
• If a Data Stage TD follows a Setup Stage TD, where wLength = ‘0’.
• If a Status Stage TD does not follow a Setup Stage TD, where wLength = ‘0’.
• If a Data Stage TD does not follow a Setup Stage TD, where wLength > ‘0’21.
• If the total size of the Data Stage TD is not equal to wLength.
• If the Data Stage TRB Direction (DIR) flag does not correspond to the definition in Table 7.
• If the Status Stage TRB Direction (DIR) flag does not correspond to the definition in Table 7.
• The xHC is NOT required to check for the following Control transfer error conditions. If system
software is properly designed these error conditions will never occur. However if the xHC does check
for these conditions it shall generate a Transfer Event for the TRB that the error was detected on with
the Completion Code set to TRB Error.
• If a Status Stage TD does not follow a Data Stage TD.
• If the Setup Stage TRB defines a Length not = 8.
• If the Status Stage TRB defines a Length > 0.
• The xHC shall inspect the bRequest field in Setup Stage TRBs for a SET_ADDRESS request code
and the bmRequestType field for Data Transfer Direction (DTD) = Host-to-device, Type = Standard,
and Recipient = Device. If these values are detected for bRequest and bmRequestType, no Control
transfer shall be issued to the USB, and the Transfer Event associated with the Setup Stage TRB shall
return a TRB Error completion code. The SET_ADDRESS request is the ONLY Standard Device
Request trapped by the xHC. This error shall not generate a stall condition on the Default Control
Endpoint and the xHC shall advance to the next Setup Stage TD or the Enqueue Pointer (i.e.Cycle bit
transition), whichever is encountered first.
• On a SS endpoint, if a STALL TP is received for a Setup, Data, or Status Stage TD, the xHC shall
generate a Transfer Event pointing to the TRB that the error occurred on, with the Completion Code
set to Stall Error.
• On a USB2 endpoint, if an error is detected on a Setup, Data or Status Stage TD, the xHC shall
generate a Transfer Event pointing to the TRB that the error occurred on, with the Completion Code
set to USB Transaction Error.
• All Control transfers begin with a Setup Stage TD and end with a Status Stage TD. A Control transfer
may be aborted prior to executing its Data Stage or Status Stage TDs using a Stop Endpoint
Command. Software is responsible for cleaning up the Transfer Ring after issuing a Stop Endpoint
Command. And this is the only case where the xHC may expect to see a Setup Stage TD not follow a
Status Stage TD.
Note: Undefined behavior may occur if software does not schedule a Status Stage TD to terminate a
control transfer.
21. This condition violates the definition of a USB Control Transfer, however this condition should be ignored by the
xHC to ensure legacy device compatibility. The Setup Stage Transfer Type (TRT) field strictly indicates the pres-
ence and the Direction of the Data Stage TD, and determines the direction of the Status Stage TD so the wLength
field should be ignored by the xHC.
159
eXtensible Host Controller Interface Revision 1.0
IMPLEMENTATION NOTE
Control Endpoint Recommendations
The USB2 specification section 8.5.3 is silent about what to do if a STALL is returned for a Setup
Transaction handshake. The EHCI spec (e.g. section 4.12.1) treats a STALL generically, retrying the
transaction indefinitely. Receiving a STALL for any Transaction handshake (including a Setup) halts the
endpoint. The EHCI treats a NAK to a Setup Transaction as a USB Transaction Error (i.e. decrements
CErr). It is recommended that xHCI provides the same response.
The USB3 specification section 8.12.2 is silent about what to do if an NRDY or STALL is returned for a
Setup TP. xHCI implementations should treat these NRDYs like a USB Transaction Error, retrying the
transaction CErr times (refer to section 4.10.2.3), and if a STALL is received for a Setup TP the xHC should
halt the endpoint (refer to section 4.10.2.3).
160
eXtensible Host Controller Interface Revision 1.0
Note: A Transfer Event TRB is used to report the condition; however a Ring Underrun or Ring Overrun
Event is not associated with a Transfer TRB (because the ring is empty). The TRB Pointer field of
the Transfer Event TRB used to report the error is not valid and should be ignored by software.
An Isoch Transfer Ring will be reinstated on the xHC’s Pipe Schedule the next time its doorbell is rung.
If the xHC is unable meet an Isochronous deadline, a Missed Service Error Event shall be generated for
the endpoint.
Note: The xHC may not generate a Missed Service Error for each Isochronous deadline missed, e.g. if
the Event Ring is full.
The Ring Underrun, Ring Overrun, and Missed Service Error Events shall utilize a Transfer Event TRB
format.
The Isoch TRB Frame ID field may be used to specify the Service Interval Boundary than an Isoch transfer
may start on. If the Start Isoch ASAP (SIA) flag is cleared to ‘0’ in the Isoch TRB, the xHC shall schedule
the Isoch TD within one Service Interval of the next match of the Frame ID field with the Frame Index
portion (bits 13:3) of the Microframe Index (MFINDEX) register. Refer to Figure 29. The range of possible
values for the Frame ID field are 0 to 2047. If the Start Isoch ASAP (SIA) flag is set to ‘1’ in the Isoch TRB,
the Frame ID field is ignored and the Isoch TD is scheduled as soon as possible.
The Isoch TRB Transfer Burst Count (TBC) and Transfer Last Burst Packet Count (TLBPC) fields may be
used by the xHC to identify the exact number of packets that will comprise an Isoch TD without having to
read in the complete TD. The xHC may use this information to better manage its periodic schedules. Refer
to section 6.4.1.3 for more information.
The TBC field (Table 79) shall be initialized by software. The following method shall be used to compute
TBC, where TDPC is the Transfer Descriptor Packet Count described in section 4.14.1.
TBC = ROUNDUP ( TDPC / Max Burst Size ) - 1
The TLBPC field (Table 79) shall be initialized by software. The following method shall be used to compute
TLBPC, where TDPC is the Transfer Descriptor Packet Count described in section 4.14.1.
IsochBurstResiduePackets = TDPC MODULUS Max Burst Size
TLBPC = IF ( IsochBurstResiduePackets == 0 )
THEN Max Burst Size - 1
ELSE IsochBurstResiduePackets - 1
Refer to section 6.4.1.3 for the detailed definition of an Isoch TRB.
4.11.2.4 TD Size
The TD Size field of a TRB defines a number of packets that remain to be transferred for a TD after
processing all Max Packet Sized packets in the current TRB and all previous TRBs. This field may be used
by the xHC to estimate the size of a TD without requiring it to read ahead TRBs to the end of the TD. The
TD Size field shall be initialized by software in Transfer TRBs, with a value calculated for a TRB using the
following method, and the field shall be that declare it:
TD Packet Count defines the number of packets that must be transferred to complete a TD.
TD Packet count = ROUNDUP( TD Transfer Size / Max Packet Size )
x is the number of Transfer TRBs in a TD.
n is the index of a Transfer TRB in a TD, where n = 1 for the first Transfer TRB of a TD.
TRB Transfer Length Sum (n) is the sum of the TRB Transfer Length fields in TRBs 1 through n.
Packets Transferred (n) defines the number of Max Packet Sized packets that have been transferred for
the TD, up to and including the data described by TRB (n).
Packets Transferred (n) = ROUNDDOWN( TRB Transfer Length Sum (n) / Max Packet Size )
161
eXtensible Host Controller Interface Revision 1.0
TRB Residue (n) defines the number of bytes remaining in TRB (n)'s buffer after processing all Max
Packet Sized packets in the current TRB and all previous TRBs of a TD.
TRB Residue (n) = TRB Transfer Length Sum (n) - (Max Packet Size * Packets Transferred (n) )
TD Size (n), For all Transfer TRBs except the last in a TD, TD Size identifies the number of packets that
still need to be scheduled to complete this TD after sending TRB Residue (n) + the data for TRBs n+1
through x. The value of the TD Size in the last Transfer TRB of a TD (TD Size (x)) shall be cleared to '0' to
explicitly indicate that it is the last Transfer TRB of the TD. Since the TD Size field is only 5 bits, its value
shall be forced to 31 if the number of packets to be scheduled is greater than 31.
For all Transfer TRBs of a TD except the last (n = 1 through x-1):
TD Size (n) = IF ( TD Packet Count - Packets Transferred (n) > 31, then 31,
else TD Packet Count - Packets Transferred (n) )
For the last Transfer TRB of a TD:
TD Size (x) = 0.
Note: If the TRB Residue for the last Transfer TRB (TRB Residue (x)) is greater than 0, then a
terminating short packet shall be generated for the TD. Also note that the TRB Residue value is
always less than Max Packet Size.
Refer to section 6.4.1 for more information on the TD Size field.
4.11.2.5 Frame ID
The Frame ID field identifies the target frame that the Interval associated with this Isochronous Transfer
Descriptor will start on. The Frame ID is valid only if the Start Isoch ASAP (SIA) field of an Isoch TRB
equals ‘0’.
Software shall not schedule an Isoch TD with a Frame ID value that is greater than 895 ms. ahead of the
current MFINDEX register value. This limitation allows the xHC to properly manage Isoch TDs when a
Missed Service Error occurs.
Note: When a Missed Service Error occurs, the Isoch TD that was supposed to be transferred during the
missed service interval is dropped, and the xHC is expected resynchronize the Isoch pipe by
advancing to the next Isoch TD for the next Interval. If the Frame ID of an Isoch TD is used to
identify a specific starting Frame for a TD, then the scheduling limit on the Frame ID allows the
xHC to unambiguously determine if an Isoch TD should be skipped or executed.
Software should not schedule an Isoch TD with a Frame ID value that is less than IST + 1 microframe
ahead of the current MFINDEX register value. This limitation allows the xHC sufficient time to fetch and
schedule Isoch TDs. For more information on the Isochronous Scheduling Threshold (IST), refer to section
4.14.2.1.4.
Note: The Frame ID value is calculated as the modulus of 2048, i.e. the size of the Frame Index portion
of the MFINDEX register (refer to Figure 29).
Note: After specifying a Frame ID (i.e. SIA = ‘0’) for an Isoch TD, software shall set SIA = ‘1’ in all
subsequent Isoch TDs that are scheduled for consecutive Intervals after the initial Isoch TD.
Note: If the Frame ID field value of an Isoch TD references an ESIT that already has an Isoch TD
scheduled for it, then the Frame ID field shall be ignored and the xHC shall schedule the Isoch TD
as if SIA = ‘1’.
Note: For endpoints with an ESIT greater than 1 ms. software shall specify a Frame ID value that begins
on an ESIT Boundary. E.g. if the Interval of an endpoint is 4 ms. (32 microframes) the valid Frame
ID values for the endpoint are 0, 4, 8, 12, and so on.
Note: For endpoints with an ESIT less than or equal to 1 ms. the Isoch TD may be scheduled on any
ESIT Boundary within the Frame specified by the Frame ID.
162
eXtensible Host Controller Interface Revision 1.0
IMPLEMENTATION NOTE
Event TRB Updating
The xHC shall ensure that all Dwords in an Event TRB are updated before it toggles the Cycle (C) bit in
Dword 3. An xHC implementation may update all 4 Dwords of the Event TRB as an atomic (single DMA)
operation, or if it updates the Event TRB Dwords as discrete operations, then it shall update Dword 3
(toggling the Cycle bit) last.
163
eXtensible Host Controller Interface Revision 1.0
If an endpoint defines Streams, then commands that affect Endpoint Contexts may also affect the
associated Stream Contexts. In cases where both contexts may be affected, the combined contexts are
referred to as the “Endpoint/Stream” Context.
The remaining fields shall be managed by system software as a function of the command type, and are
described below.
Note: The Address Device, Configure Endpoint, and Evaluate Context Commands utilize an Input
Context data structure.
164
eXtensible Host Controller Interface Revision 1.0
execution of an Evaluate Context Command. Refer to section 4.3 for more information on the use of this
command.
Note: Refer to the Slot and Endpoint Context data structure descriptions (sections 6.2.2 and 6.2.3,
respectively) for information on the specific Context fields that are evaluated by this command. A
typical use of this command is immediately after an Address Device Command to inform that xHC
that software has updated the Max Packet Size field of the Control endpoint. Refer to section 4.3
for more information on this usage.
The format of the Evaluate Context Command TRB is defined in section 6.4.3.6.
Refer to section 4.6.7 for more information on the Evaluate Context Command.
165
eXtensible Host Controller Interface Revision 1.0
If the BW Negotiation Capability (BNC) bit in the HCCPARAMS register is ‘1’, then the xHC shall support
this command.
The format of the Negotiate Bandwidth Command TRB is defined in section 6.4.3.12.
Refer to section 4.16 for more information on Bandwidth Negotiation.
Refer to section 4.6.13 for more information on the Negotiate Bandwidth Command.
166
eXtensible Host Controller Interface Revision 1.0
• The Link TRB of the last Ring Segment in a ring shall point to the beginning of the first segment of the
ring.
• The Toggle Cycle flag shall be set in at least one Link TRB of a ring.
Note: The Ring Segment Pointer field in a Link TRB is not required to point to the beginning of a physical
memory page.
Note: A Link TRB may be found on Transfer or Command Rings.
Refer to Figure 23 for an illustration of TRB Ring Segments and Link TRBs.
Unused
167
eXtensible Host Controller Interface Revision 1.0
Note: The Primary Interrupter (‘0’) is the target of all Command Completion Events. The Interrupter
Target field shall be ignored by the xHC in Link TRBs found on the Command Ring.
IMPLEMENTATION NOTE
xHC TRB Fetching
All TRBs between the Enqueue and Dequeue Pointers of a TRB Ring are owned by the xHC. No
constraints are placed on how many TRBs an xHC implementation may fetch in a single DMA operation or
the order that the xHC may fetch them in. System software shall not modify a TRB owed by the xHC.
168
eXtensible Host Controller Interface Revision 1.0
The following rules apply to Event Data TRBs on a Transfer Ring unless otherwise stated:
• An event shall be generated by an Event Data TRB if its IOC flag is set to ‘1’.
• An event generated by an Event Data TRB (Event Data Transfer Event) shall utilize the format of the
Transfer Event TRB. The Slot ID and Endpoint ID fields shall be set appropriately for the Transfer Ring
that contained the Event Data TRB, and the Event Data (ED) flag shall be set to ‘1’.
• The event generated when the IOC flag of an Event Data TRB is set to ‘1’ shall report the Completion
Code of the previously executed Transfer TRB of a TD, or Success if inserted as an Event Data TD
(i.e. a TD that consists of just one Event Data TRB) on a ring. The “previously executed Transfer TRB”
is either the last Transfer TRB of the TD or the Transfer TRB that generated an error which forced a
premature completion of the TD. Intermediate Event Data TRBs shall report “Success”.
• The Parameter Component of the Transfer Event generated by an Event Data TRB shall contain the
value of the Event Data TRB Parameter Component.
• The Length field of a Event Data Transfer Event shall reflect the number of bytes transferred from the
beginning of a TD or since the last Event TRB encountered in a TD.
Note: The above rules also apply to Intermediate Event Data Transfer Event TRBs.
Note: The Event Data (ED) flag in the Transfer Event TRB indicates to system software whether the
Parameter Component of the respective event should be interpreted as pointer to system memory
or software defined data.
Note: The IOC flag is treated generically by the xHC. If it is set in a TRB, then the xHC shall generate an
Event for that TRB. If the IOC flag is not set in an Event Data TRB, the xHC will advance past it,
clearing the EDTLA in the process.
Note: An Event Data TRB may only be found on a Transfer Ring.
Note: An Event Data TRB shall not immediately follow another Event Data TRB.
Note: Refer to section 4.12.3 for information on how the Evaluate Next TRB (ENT) flag should be used to
manage Event Data TRBs.
Note: If a short packet or other condition is detected that terminates the transfer associated with a TD but
does not halt an endpoint, and one or more Event Data TRBs follow the Transfer TRB that
terminated the transfer, then the xHC shall generate an Event Data Transfer Event TRB for each
Event Data Transfer TRB encountered as it advances to the next TD.
Note: Software shall not define a “stand-alone” Event Data TD (i.e. a TD that only contains a single
Event Data TRB) on an Isoch Transfer Ring, however Event Data TRBs may be included in Isoch
TDs.
169
eXtensible Host Controller Interface Revision 1.0
• Software shall advance past and ignore Vendor Defined TRBs encountered on an Event Ring.
Note: All vendor defined TRBs shall define a Cycle (C) bit at the same bit position as defined in all xHCI
TRBs and manage it as defined in section 4.9 for the respective ring type.
Note: All vendor defined Event TRBs shall define a Completion Code field at the same bit position as
defined in all xHCI Event TRBs and manage it as defined in section 4.9.4.
Note: Any vendor defined Transfer TRBs that may be included in a multi-TRB TD, shall define a Chain
bit (CH) field at the same bit position as defined in a Normal TRB and manage it as defined in
section 4.9.1.
xHC vendors may use the Vendor Defined TRB Type codes to define proprietary xHCI commands. All
vendor defined commands shall utilize the Command Completion Event TRB to report completions.
Multiple vendors may define the same xHCI Extended Capability code or Vendor Defined TRB code to
perform different operations. All vendor defined xHCI Extended Capability codes and TRB Types shall be
qualified by system software with the PCI Configuration Space Header Vendor ID and Subsystem Vendor
ID.
Vendors may also define Completion Codes. The Vendor Defined completion codes are separated into two
groups: error and information. This partitioning allows software to infer the purpose of a Vendor Defined
completion code even if it does not have vendor specific knowledge. Refer to Table 130.
If software does not have vendor specific knowledge, completion codes in the range defined by Vendor
Defined Info codes shall be interpreted identically to a Success completion code.
If software does not have vendor specific knowledge, completion codes in the range defined by Vendor
Defined Error codes shall be interpreted as an Undefined Error completion code, e.g if a Vendor Defined
Error code is reported in a Command Completion Event software shall assume that the associated
command did not complete successfully.
To determine the number of bytes actually transferred, software shall add the TRB Transfer Length
fields of all TRBs up to and including the TRB that generated the Transfer Event, and subtract the
Transfer Event TRB Transfer Length field.
2) Terminate the TD with an Event Data TRB that has its IOC flag set, and not set the ISP or IOC flag
in any Transfer TRB of the TD. This action shall cause the xHC to generate an Event Data
Transfer Event if a Short Packet condition is detected while executing any TRB in the TD or if the
device completely fills the buffer.
170
eXtensible Host Controller Interface Revision 1.0
The TRB Transfer Length field of the Event Data Transfer Event identifies the number of bytes
actually transferred, from the beginning of the TD or since the last Event Data Transfer Event. The
TRB Transfer Length field of the Event Data Transfer Event may define up to a 16,777,215 byte
transfer.
More than one Event Data TRB may be defined within a TD.
If Event Data TRBs are defined within a TD, then the IOC or ISP flags shall not be set in any Transfer TRB
of a TD. i.e. the use of Event Data Transfer Events and normal Transfer Events to report a TD completion
are mutually exclusive.
Note: Software may insert an Event Data TD immediately following a TD to provide additional
information related to the previous TD. An Event Data TD is a TD that consists of just one Event
Data TRB.
Software shall specify the same Interrupter Target value in all Transfer TRBs of a TD. If an invalid
Interrupter Target value is defined in a TRB, the behavior of the xHC is undefined if the TRB generates a
Transfer Event. If virtualization is supported, an xHC implementation shall ensure that this “undefined
behavior” does not affect another function (PF0 or VFx).
The Transfer TRB TD Size field shall be valid in all Transfer TRBs that define it. Refer to section 4.11.2.4
Software shall not define a No Op Transfer TRB within a multi-TRB TD, i.e. software shall never set the
Chain bit of a No Op TRB to '1' and a No Op TRB shall always be preceded by a TRB whose Chain bit is
also set to '0'.
Software shall not define a Link TRB as the first TRB of a multi-TRB TD.
Software shall not define a Link TRB as the last TRB of a multi-TRB TD.
One or more Link TDs may precede or follow a TD. A Link TD is a TD that consists of just one Link TRB.
Software shall not define consecutive Link TRBs within a TD, i.e. software shall not set the Chain bit of
consecutive Link TRBs to '1'.
Undefined xHC behavior may occur if the requirements defined in this section are not met.
Note: Besides reporting an error or the completion of a TD, Events may also be used by software to
periodically update the current value of the Dequeue Pointer, to indicate the crossing of a Transfer
Ring Segment boundary so it can add or remove a segment, etc., so the xHC shall generate an
Event every time it encounters an IOC flag equal to ‘1’, irrespective of any error events that may be
forced for earlier TRBs in a TD that did not have their IOC flag set.
For example, software may periodically set IOC flags in TRBs of a large TD so that it may update
its Dequeue Pointer and reuse the TRBs that have been consumed by the xHC (rather than having
to expand the Transfer Ring). Unless an error is encountered, all the intermediate events shall
report Success. If any event generated by a TD reports an error, then that Completion Code
overrides any Successful Completion Codes that other TRBs associated with the TD may have
asserted, whether they come before or after the error Event.
Note: Software shall not interpret an error Event as indicating that the TD that it is associated with is
“complete” (i.e. ownership of all the TRBs of the TD have been relinquished by the xHC), unless
the TRB Pointer field of the error Transfer Event references the last TRB of the TD.
4.11.7.1 TD Fragments
The Max Burst Payload (MBP) is the number of bytes moved by a maximum sized burst, i.e. Max Burst
Size * Max Packet Size bytes.
A TD is comprised of one or more TD Fragments. If the TD Transfer Size is an even multiple of the MBP
then all TD Fragments shall define exact multiples of MBP data bytes. If not, then the only last TD
Fragment shall define less than MBP data (or the Residue) bytes.
171
eXtensible Host Controller Interface Revision 1.0
Each TD Fragment is comprised of one or more TRBs. The first TRB of a TD Fragment is written last,
ensuring that all the other TRBs of the TD Fragment are complete and reference valid buffers in host
memory.
TD Fragments require software to construct TDs as sequential groups of TRBs. If the TD Transfer Size is
greater than MBP, the TD consists of 1 or more MBP multiple sized TD Fragments.
Software is allowed to construct a single TD Fragment that is an integral multiple of MPB bytes, or that
defines a complete TD.
• The first TRB of a TD Fragment shall always be a Transfer TRB.
• A TD Fragment shall not span Transfer Ring Segments.
• Link TRB placement in a TD Fragment shall follow the rules described in this section and section
4.11.7.
• Event Data TRB placement in a TD Fragment shall follow the rules described in this section and
sections 4.11.5.2 and 4.11.7.
• A TRB Packet Boundary in a TD immediately precedes a Transfer TRB in which the first byte of the
buffer referenced by a Transfer TRB is the also the first byte of a USB packet.
• The first TRB of a TD Fragment shall be the first TRB of a TD or immediately follow a TRB Packet
Boundary.
• The last TRB of a TD Fragment immediately precedes a TRB Packet Boundary or is the last TRB of a
TD.
The IOC flag may be set in only one TRB of a TD Fragment, with the following conditions:
• The IOC flag may be set in a Transfer TRB that immediately precedes a TRB Packet Boundary or the
last Transfer TRB of a TD Fragment.
• The IOC flag may be set in a non-Transfer TRB (e.g. a Link TRB, Event Data TRB, etc.) that resides
between two Transfer TRBs that form a TRB Packet Boundary, or follow the last Transfer TRB of a TD.
172
eXtensible Host Controller Interface Revision 1.0
Packet 1 Packet 2 Packet 3 Packet 4 Packet 5 Packet 6 Packet 7 Packet 8 Packet 9 Packet 10 Pkt 11
Transfer
Descriptor
Transfer TRB 1
Transfer TRB 2
TD Fragment 1 Transfer TRB 3
Transfer TRB 4
Link TRB
Transfer TRB 5
Transfer TRB 6
TD Fragment 2
Transfer TRB 7
Event Data TRB
The example of Figure 24 illustrates a TD that consists of two TD Fragments. TD Fragment 1 ends on
boundary that is also a multiple of Max Packet Size bytes, while TD Fragment 2 ends at the end of the TD.
Both TD Fragments end on a TRB Packet Boundary (red lines). An additional TRB Packet Boundary is
defined in each TD Fragment, i.e. between TRBs 2 and 3 in TD Fragment 1 and between TRBs 5 and 6 in
TD Fragment 2. Following the rules described above, the IOC flag may be set only once in a TD Fragment,
i.e. in Transfer TRB 2, Transfer TRB 4, or the Link TRB of TD Fragment 1, and in Transfer TRB 5, Transfer
TRB 7, or the Event Data TRB of TD Fragment 2. The IOC flag cannot be set in Transfer TRBs 1, 3 or 6
because they do not immediately precede a TRB Packet Boundary.
The TD Fragment rules above also ensure that the last Transfer TRB of a TD Fragment shall describe a
data buffer that ends on a Max Packet Size boundary (Transfer TRB 4) or terminates the TD (Transfer TRB
7).
173
eXtensible Host Controller Interface Revision 1.0
Example 3 Example 4
Max Burst Size = 8KB Max Burst Size = 8KB
Virtual Virtual
Memory Memory
TD Offset = 3KB 4K TD Offset = 3KB 4K
1 TRB 1K Pages 1 TRB 1K Pages
TD Fragment 1 TD Fragment 1
MBP bytes
2 TRB 4K 8KB MBP bytes
2 TRB 4K 8KB
3 TRB 3K 3 TRB 3K
4 TRB 1K 4 TRB 1K
TD Fragment 2 8KB
5 TRB 4K 31K 5 TRB 4K 31K
MBP bytes TD Fragment 2
6 TRB 3K Virtual 6 TRB 4K 16KB Virtual
MBPx2 bytes
7 TRB 1K Buffer 7 TRB 4K Buffer
TD Fragment 3 8KB
8 TRB 4K 8 TRB 3K
MBP bytes
9 TRB 3K 9 TRB 1K
TD Fragment 4
10 TRB 1K 7KB 10 TRB 4K 7KB
TD Fragment 4 2KB
Residue bytes 2KB
11 TRB 4K 11 TRB 2K
Residue bytes
12 TRB 2K
In Figure 25 the TDs in all the examples describe the same Virtual Buffer, which is 31KB in size, begins at
a 3KB offset into the first physical Page, and spans 9 Pages.
Example 1 illustrates the TD Fragments that would be generated for an endpoint with a Max Packet Size =
1KB and a Max Burst Size of 16 packets. The first TD Fragment describes MBP (16K) bytes of buffer
space. The second TD Fragment describes the TD Fragment Residue of the TD, or 15K bytes of buffer
space. Note that two TRBs (5 and 6) are used to split 5th physical memory Page on a MBP boundary.
Example 2 illustrates a case where the single TD Fragment fully describes the TD, or 31K bytes of buffer
space. In this case the TD is fully formed when TRB 1 is written, and the xHC will generate the Max Burst
Size transactions as appropriate for the endpoint.
Examples 3 and 4 illustrates TD Fragments that may be generated for an endpoint with a Max Packet Size
= 1KB and a Max Burst Size of 8 packets. Each of the first three TD Fragments in Example 3 describe
MBP (8K) bytes of buffer space, and the last TD Fragment describes the Residue of the TD, or 7K bytes of
buffer space. In Example 4 software has decided to use TD Fragment 2 to describe 2 x MBP bytes of
buffer space.
In every case, software shall write the first TRB of a respective TD Fragment last. For instance the write
order in Example 4 would be TRBs: 2->3->1, 5->6->7->8->4, and 10->11->9. And so on. Note that it really
doesn’t matter what order the TRBs of a TD Fragment are written in, as long as its first TRB is written last.
Note that in each example of Figure 25, the data associated with a single page is split between two TRBs
to enforce a TD Fragment boundary, e.g. in example 1, the 4KB page on the boundary between TD
Fragment 1 and 2 is defined by TRB 5 (3KB) and TRB 6 (1KB), where TRB 5 defines the last 3KB of the
16KB TD Fragment 1 and TRB 6 defines the first 1KB of TD Fragment 2.
174
eXtensible Host Controller Interface Revision 1.0
Note: Only fully formed TDs may be scheduled on periodic (interrupt or isoch) endpoints, e.g. write the
first TRB of a multi-TRB TD last, irrespective of the number of TD Fragments that comprise it, and
the TD Fragment rules for the assertion of IOC in TRBs described above apply.
Virtual
Memory
TD Offset = 4K
3.75KB
1 TRB 256B Pages
2 TRB 4K
TD Fragment 1 3 TRB 4K
MBP bytes 16KB
4 TRB 4K Max Packet Size
5 TRB 3840B Boundary
6 TRB 256B
7 TRB 4K 30.5K
TD Fragment 2
8 TRB 4K Virtual
Residue bytes 14.5KB
9 TRB 4K Buffer
10 TRB 2304B
2.25KB
In Figure 26 the example defines a TD that transfers 30.5KB of data, where the packet size (Max Packet
Size) = 1KB, the Burst Size = 16 KB, and the initial offset of the data in the first 4KB page is 3.75KB
(3840B). An important aspect of this example is that due to the initial offset (3.75KB), page boundaries do
not land on packet boundaries (as they do in Figure 25).
Given the rules defined above for where an IOC flag may be set in a TD Fragment:
• In Figure 26 the IOC flag only may be set in TRBs 5 and 10. In TRB 5 because TRBs 5 and 6 split the
data in the page that they reference to force a break on a Burst Size boundary, hence the buffer
described by TRB 5 ends on a packet, boundary. The IOC flag may be set in TRB 10 because it is the
last packet of a TD, which forces a packet boundary. Note that the Link TRB does not land on a packet
boundary relative to the start of TD Fragment 1, so its IOC flag may not be set.
• In Figure 25 all TRBs define buffers that end on Packet boundaries, hence an IOC flag may be set in
any TRB of a TD Fragment, but only once per TD.
Note: The TD Fragment rules, that define which TRBs of a TD that an IOC flag may be set in, apply to
Isoch TDs, however a partially formed TD shall not be posted to an Isoch endpoint. Only fully
formed TDs may be posted to Isoch endpoints, e.g. software shall write the first TRB of a multi-
TRB TD last, irrespective of its size.
175
eXtensible Host Controller Interface Revision 1.0
4.12 Streams
Streams extend the number of Transfer Rings that may be accessible to a SS Bulk USB endpoint. A
standard endpoint defines a single Transfer Ring. Streams allow an individual endpoint to define up to
6553322 Transfer Rings using Linear Stream Arrays or 65023 Transfer Rings using Primary/Secondary
Stream Arrays.
Streams allow the data flow of a bulk pipe to be multiplexed between multiple Transfer Rings associated
with the endpoint. The USB device determines which Stream is active at any time, i.e. which Stream
Context Transfer Ring is being used to move data.
The TR Dequeue Pointer field of an Endpoint Context that supports Streams points to an array of Stream
Context data structures called the Stream Context Array or just Stream Array. A Stream (i.e. Stream
Context) is selected with a Stream ID, where the Stream ID is used to index into a Stream Array.
A Stream Context data structure also contains a TR Dequeue Pointer field, which points to the Transfer
Ring associated with the Stream.
A Stream Protocol maintained between the xHC and a SS USB device allows the device to establish the
Current Stream (CStream) of an endpoint and control the movement of data for that Stream. At any time
the device may terminate a Stream data transfer and switch to another Stream. The xHC is only required to
maintain the transfer state of the Current Stream. Because all Streams associated with an endpoint share
the same bulk pipe, if the Current Stream causes the pipe to stall, then all Streams associated with the pipe
are also stalled.
A Stream Context may be “active” or “non-active”. A non-active Stream Context shall be identified by an
empty Transfer Ring or if, through an out-of-band (Device Class) defined mechanism, software knows that
the Stream Context will not be selected by a USB device to become the Current Stream (CStream). For
example, a UASP data Stream Context becomes active (i.e. may be selected at any time by the device and
become the Current Stream) after software rings the doorbell with the DB Stream ID equal to the Stream ID
of the Stream Context. The Stream Context becomes non-active (i.e. shall not be selected by the device to
become the Current Stream) when the UASP command associated with the Stream Context completes, or
after an Abort Task command for the Stream Context is successfully completed by the UASP device.
Note: The value of CStream is not exposed for a Stream endpoint by the xHC after an endpoint
transitions to the Stopped state (e.g. after to a Stop Endpoint Command). So if the Transfer Ring of
a Stream Context is not empty, then software shall use an out-of-band mechanism to determine
whether a Stream Context is active or not,
For more information on Streams refer to the section 8.12.1.4 of the USB3 specification.
22. Stream IDs 0, 65535 (No Stream) and 65534 (Prime) are reserved.
176
eXtensible Host Controller Interface Revision 1.0
&
EP not DSICV=0
Config’d LFCV=1 |
Doorbell & LFCV=0 &
!TD(LCSteam)
TD(LCStream)
HID=0 DSICV=1 DBPV=0
LFCV=0 &
HID=1 & & DB Steam ID
= LCStream
& DBPV=0
LFCV=1 |
DB Steam ID Move
IPPV=0 IPPV=1 != LCStream Data
IPPV=0 Doorbell
Doorbell
& DBPV=1 DBPV=1
IPPV=0
Prime
Idle Accept
Pipe
IPPV=0
IPPV=1 Doorbell
DBPV=1
Start
Stream
DBPV=0
Figure 27 illustrates the xHCI Stream Protocol state machine, which overlays the USB Stream Protocol
State Machine described in the USB3 spec. This section describes the xHC’s role in the execution of the
Stream Protocol. There is a 1:1 correspondence of the states described in the xSPSM and those defined in
the USB3 SPSM. The xSPSM identifies the xHCI’s role in advancing the USB3 SPSM. Refer to
Appendix E for state machine notation.
The xSPSM associated with an unconfigured endpoint shall enter the Disabled state when a Configure
Endpoint Command is executed and Streams are enabled (MaxPStreams >0).
The first time the endpoint doorbell is rung after entering the Disabled state, the xHC shall transition the
xSPSM to the Prime Pipe state, and the device should automatically transition the xSPSM to the Idle
state.
Note: The USB packet exchanges that transition the SPSM through its states are described in USB3
specification section 8.12.1.4.
The Prime Pipe state is used by the xHC to inform the USB device that host memory buffers have been
modified or added to the endpoint by system software. The device may use this information as queue to
start or restart stream activity.
To facilitate the xSPSM management of Prime Pipe transitions, an Idle Prime Pipe Value (IPPV),
LCStream Flow Control Value (LFCV), and Doorbell Pending Value (DBPV) may be implemented by the
xHC as a shadow flags. All three flags are initially cleared (‘0’). The xSPSM utilizes IPPV. LFCV, and
DBPV.
IPPV is cleared (‘0’) when the Idle state is entered from the Start Stream or Move Data state and set (‘1’)
when the Prime Pipe state is entered. IPPV is used to limit Prime Pipe transitions to one per Idle state
entry.
LFCV records if the LCStream was flow controlled by the device. In this case, the xHC should not generate
a Host Initiated Data Move if buffers are posted for the LCStream. LFCV is updated when the Move Data
state is exited. If the Move Data state was exited due to an NRDY(Stream n) condition then LFCV is set,
177
eXtensible Host Controller Interface Revision 1.0
otherwise LFCV is cleared. Refer to the IMDSM and OMDSM (Figures 8-30 and 8-32, respectively) in the
USB3 specification for more information on the NRDY(Stream n) condition.
DBPV is cleared when entering the Start Stream or Move Data states and set if the doorbell is rung while
the xSPSM is in the Start Stream or Move Data states. DBPV records doorbell rings while the xSPSM is
not in the Idle state, so that a Prime Pipe state may be immediately forced when the Idle state is
reentered.
To further accelerate the Stream protocol an xHC implementation may optionally capture the DB Stream ID
value when the doorbell is rung. A fourth shadow flag, DB Stream ID Captured Value (DSICV) is set if the
xHC hardware captures the DB Stream ID when the doorbell is rung, otherwise it is cleared.
If the doorbell for the endpoint is rung while in the Idle state the following algorithm shall be applied:
• If Host Initiated transitions are disabled (HID = ‘1’):
• if IPPV = ‘0’, transition to the Prime Pipe state.
• if IPPV = ‘1’, remain in the Idle state.
• If HID = ‘0’:
• If the xHC captures the DB Stream ID when the doorbell is rung (DSICV=1):
• If LFCV = ‘0’ and the DB Stream ID value equals LCStream23, transition to the Move Data
state.
• If LFCV = ‘1’ or the DB Stream ID value does not equal LCStream:
• if IPPV = ‘0’, transition to the Prime Pipe state.
• if IPPV = ‘1’, remain in the Idle state.
• If the DB Stream ID is not captured when the doorbell is rung (DSICV=0), access the Transfer
Ring associated with LCStream to determine whether it is empty:
• If LFCV = ‘0’ and the Transfer Ring is not empty (TD(LCStream)), transition to the Move Data
state.
• If LFCV = ‘1’ or the Transfer Ring is empty (!TD(LCStream)), transition to the Prime Pipe
state.
Note: Due to internal resource or other limitations, an xHC implementation may disable Host Initiated
transitions for an endpoint, i.e. the xSPSM may operate as if HID is always ‘1’, irrespective of the
value of the field in the Endpoint Context.
Refer to section 4.12.1.1 for more information on Host Initiated transitions to the Data Move state.
When the xSPSM returns to the Idle state from the Prime Pipe state the xHC shall set the IPPV flag to ‘1’,
flagging the fact that a Prime Pipe transition has been executed while in Idle.
When the xSPSM transitions from the Idle to the Start Stream or the Move Data state the xHC shall clear
the DBPV flag to ‘0’, preparing it to record any Doorbell rings while it is in the Start Stream or Move Data
states.
If the endpoint’s doorbell is rung while in the Start Stream or Move Data state, the DBPV flag is set to ‘1’.
Note: If an error (USB Transaction, timeout, etc.) is detected in the SuperSpeed ISPSM (Figure 8-29 in
the USB3 specification) Prime Pipe or Prime Pipe Ack state, or the OSPSM (Figure 8-31 in the
USB3 specification) Prime Pipe, Start Stream End, or the Prime Pike Ack state, the xHC shall
generate a Transfer Event with the TRB Pointer and TRB Transfer Length fields = ‘0’, to the Event
Ring identified by the Slot Context Interrupter Target field.
When the Idle state is entered from the Start Stream or Move Data state, the IPPV flag is cleared to ‘0’,
enabling one Prime Pipe transition while in the Idle state.
23. Refer to section 8.12.1.4.1 in the USB3 specification for the definition of LCStream.
178
eXtensible Host Controller Interface Revision 1.0
If in the Idle state and the IPPV flag is ‘0’ and DBPV is ‘1’, the xSPSM shall transition to the Prime Pipe
state, informing the device of the recorded doorbell ring.
A Stream ID is a zero-based value that indexes into the endpoint’s Stream Context Array starting at offset
‘0’, as illustrated in Figure 28.
The xHC uses the value of the Stream ID field, received in a SuperSpeed Transaction Packet (TP) or Data
Packet (DP), as an index into the Stream Context Array(s) to access the Stream Context associated with
the packet. Refer to section 8.2 in the USB3 specification for a discussion of SuperSpeed Packet Types.
If Streams are defined for an endpoint, then:
• The Endpoint Context MaxPStreams field is > ‘0’.
• The Endpoint Context TR Dequeue Pointer field points to a Primary Stream Context Array.
• The Primary Stream Context Array shall contain MaxPStreams Stream Context data structures.
Streams may only be defined for Bulk endpoint types.
The MaxPStreams field in the Endpoint Context identifies the number of Streams supported by the Primary
Stream Array of the endpoint. If MaxPStreams = ‘0’, then the endpoint is a standard endpoint and its TR
Dequeue Pointer field points to a Transfer Ring. The value of the MaxPStreams field shall not exceed the
value reported in the MaxStreams field of the SuperSpeed Endpoint Companion Descriptor for the
endpoint.
The Stream ID field of USB packets on endpoints that do not define Streams shall be ignored by the xHC.
Refer to section 4.6.9 for more information on how a Stream is affected by a Stop Endpoint Command.
Refer to section 4.6.10 for more information on how a Stream is affected by a Set TR Dequeue Pointer
Command.
179
eXtensible Host Controller Interface Revision 1.0
If the MaxPStreams field of the Endpoint Context is greater than ‘0’, then Streams are supported by the
endpoint and the TR Dequeue Pointer field points to a Primary Stream Array with MaxPStreams entries.
Refer to Table 56 for the definition of the valid MaxPStream values.
Note that the MaxStreams field of the SuperSpeed Endpoint Companion Descriptor identifies the
maximum number of Streams that the associated endpoint supports, however software may configure the
Primary Stream Array of the associated endpoint with less than MaxStreams entries and grow the number
of hardware supported Streams later.
Secondary
Device Context
Stream Context Array 0
TR
Slot Ring Stream Context 0
(PSID = 0, SSID = 0, SCT = 0) TR
TR Ring
Control EP 0 Ring Stream Context 1
(PSID = 0, SSID = 1, SCT = 0)
EP1 OUT
(Max Streams = 0)
EP1 IN
Primary ...
Stream Context Array Stream Context 15 TR
(Max PStreams = 3)
(PSID = 0, SSID = 15, SCT = 0) Ring
EP2 OUT Stream Context 0
(Max Streams = 0) (PSID = 0, SSID = 0, SCT = 3) TR
Ring Secondary
EP2 IN Stream Context 1
(Max Streams = 0) (PSID = 1, SSID = 0, SCT = 1) Stream Context Array 2
Stream Context 2 TR
Stream Context 0
(PSID = 2, SSID = 0, SCT = 3)
(PSID = 2, SSID = 0, SCT = 0) Ring
TR
Ring ... Stream Context 1
(PSID = 2, SSID = 1, SCT = 0)
Stream Context 15
(PSID = 15, SSID = 0, SCT = 1) TR ... TR
Ring
Stream Context 15 Ring
(PSID = 2, SSID = 15, SCT = 0)
To access a specific Stream Context, the xHCI splits the Stream ID into two sub-fields; the Primary Stream
ID (PSID) and Secondary Stream ID (SSID). The Primary Stream ID is used as an index into the Primary
Stream Array. If the Secondary Stream ID is equal to ‘0’, then the Stream Context in the Primary Stream
Array shall contain a pointer to a Transfer Ring (e.g. Primary Stream Context 1 or 15, SCT = ‘1’). If the
Secondary Stream ID is non-zero, then the Stream Context in the Primary Stream Array shall contain a
pointer to a Secondary Stream Array (e.g. Primary Stream Context 0 or 2, SCT = ‘3’), and the Secondary
Stream ID is used as an index into the Secondary Stream Array.
The boundary between the PSID and SSID sub-fields is defined by the MaxPStreams field of the Endpoint
Context, Refer to Table 56. The PSID resides in the low order bits of a Stream ID and the SSID resides in
the high order bits.
All endpoints that declare Streams shall be initialized to point to a Primary Stream Array. Secondary
Stream Arrays may be defined at initialization or run time. Software shall coordinate the allocation of
Stream IDs with the Primary/Secondary Stream Array layout of an endpoint. Note that in the example of
Figure 28, Stream Contexts 1 and 15 in the Primary Stream Array point to a Secondary Stream Array. To
access a Stream Context in the Secondary Stream Array referenced by Primary Stream Context 0,
software shall set the Primary Stream ID to 0, and the Secondary Stream ID to the index of the Secondary
Stream Context. Note that the Stream ID value ‘0’ (i.e. PSID & SSID = ‘0’) is reserved by the USB3 spec
and should never be presented to the xHC by a device that declares a Stream endpoint. Hence in the
example of Figure 28, Stream Context 0 in Secondary Stream Context Array 0 is reserved and shall not be
accessed by the xHC.
180
eXtensible Host Controller Interface Revision 1.0
Note: If Secondary Stream Arrays are enabled, then Stream Context 0 of the Primary Stream Context
Array shall always reference a Secondary Stream Array (i.e. SCT > ‘1’). An SCT value of ‘0’ or ‘1’
may result in undefined behavior.
The value of MaxPStreams informs the xHC of the size of the Primary Stream Array. If Secondary Streams
are enabled, then the maximum size of a Primary Stream Array is 256 entries (MaxPStreams = ‘7’). The
Stream Context Type (SCT) field in each Stream Context identifies whether a context in the Primary
Stream Array points to a Transfer Ring or a Secondary Stream Array. The SCT field also identifies the
number of entries in a Secondary Stream Array. This flexible mechanism must be carefully managed by
software to ensure that the SIDs that it generates shall not cause the xHC to reference an out-of-range
Secondary Stream Context.
The maximum size Primary Stream Array supported by an xHC implementation is defined by the
MaxPSASize field in the HCCPARAMS register (refer to Table 23).
The NSS field in the HCCPARAMS register (Table 23) identifies whether an xHC implementation supports
Secondary Stream Arrays.
If Linear Stream Array mode is enabled (Linear Stream Array24 (LSA) flag = ‘1’):
• If a Stream ID is less than the Primary Stream Array size defined by MaxPStreams and greater than
‘0’, then the xHC shall check Stream Context Type (SCT) of Stream Context data structure in the
Primary Context Array as follows:
24. The Linear Stream Array (LSA) field is defined in Table 56.
181
eXtensible Host Controller Interface Revision 1.0
25. The Stream Context Type (SCT) field is defined in Table 60.
182
eXtensible Host Controller Interface Revision 1.0
When the transition to the Idle state occurs, the xHC is expected to save the state of the Stream (e.g. the
Transfer Ring Dequeue Pointer) so that it may pick up where it left off the next time the Stream is
scheduled. Note that the transition to the Idle state may occur in the middle of a TD, so the saved Stream
state shall support the ability to continue a partially completed TD.
If the transition to the Idle state was due to one of the temporary conditions described above, then the xHC
should wait for the device to reschedule the Stream. However, if the transition to the Idle state was due to
a completed transfer, then the xHC should complete the TD before saving the Stream state.
If a TD is comprised of one or more Normal TRBs and terminated with an Event Data TRB, then the
transition to the Idle state (and associated Stream state save) could occur after all the data for the TD has
been moved (e.g. after Transfer Event TRBs have been executed), but before the Event Data TRB is
executed. Under these conditions, the execution of the Event Data TRB necessary to complete the TD will
not occur until the next time the Stream is scheduled. This could lock up the Stream if software was waiting
for the TD to complete before scheduling the Stream again.
Before the transitioning a Stream pipe to the Idle state, then the xHC shall evaluate the ENT flag in the last
TRB completed, and if the ENT flag is set (‘1’), then the xHC shall evaluate the next TRB before saving the
Stream state.
Setting the ENT flag in the last Normal TRB of the TD described above, allows the xHC to execute the
terminating Event Data TRB and complete the TD before saving the Stream state, thus eliminating the lock
up condition.
Note: System software shall set the ENT flag in the last Transfer TRB before a terminating Event Data
TRB in a TD on a Stream (Bulk), normal Bulk, Interrupt, or Control Transfer Ring. This action
ensures the timely execution of an Event Data TRB if the Transfer Ring is flow controlled.
When the xHC detects the Chain and ENT bits both set to ‘1’ in a TRB, it shall evaluate the next TRB. If the
next TRB is an Event Data TRB, the xHC shall generate the associated Event Data Transfer Event before
saving the Stream state. If the next TRB is not an Event Data TRB, the xHC shall save the Stream state,
i.e. evaluate the next TRB the next time the associated Stream is scheduled.
Note: System software should only set the ENT flag in a TRB if the next TRB is an Event Data TRB and
the Event Data TRB is the last TRB in a TD. The ENT flag does not span TDs, therefore the ENT
flag is valid only if the Chain bit (CH) is ‘1’.
Note: The ENT flag shall “span” a Link TRB if there is a Link TRB between the TRB with the ENT flag set
and the next Transfer TRB. i,e, if the ENT flag is set in a TRB that it is immediately followed by a
Link TRB, the xHC shall execute the Link TRB and evaluate the TRB that the Link TRB points to,
before advancing to the next endpoint in the Pipe Schedule.
Note: If an endpoint is Halted due to an error while executing a TRB, a Transfer Event shall be generated
for that TRB and the xHC is not required to evaluate the ENT flag of the TRB that generated the
error.
183
eXtensible Host Controller Interface Revision 1.0
Note: The xHC shall use the Device Slot’s Slot Context Interrupter Target field to determine the Event
Ring that shall receive the event.
Note: Based on the host interconnect used by the platform and the associated LTR
mechanism, it may be necessary to translated the BELT value into multiple forms before
forwarding to the host.
c. Send the LTR message the host.
184
eXtensible Host Controller Interface Revision 1.0
Step 2 requiring that the xHC keep a record of the value received is necessary to enable the comparison
operation in step 3. In addition, this value shall also be recorded in the event that the device is removed
and under these circumstances the xHC shall set the Current BELT value to tBELTdefault and re-evaluate
for the lowest latency of the remaining Device BELT values by executing Step 3 and step 4 above.
Note: The manner in which the Current BELT and Device BELT variables are stored is implementation
specific and as such falls outside the scope of this specification.
The Set LTV Command TRB provides a means for host software to provide its own “Device BELT” value.
This command is optional normative, however it shall be supported if the xHC also supports a
corresponding host interconnect LTM mechanism.
xHCI Device BELT is an internal variable that maintained by the xHC. The xHCI Device BELT value is
initialized to an “unconfigured” state. While the xHCI Device BELT variables is “unconfigured”, it is not
compared with the other Device BELT variables in Step 3 above.
When a Set LTV Command is executed by the xHC:
• The BELT field of the Set LTV Command TRB is copied to the xHCI Device BELT variable. This action
transitions the xHCI Device BELT variable from “unconfigured” to “configured”. When xHCI Device
BELT is “configured”, it is compared with the other Device BELT variables in Step 3 above.
• Re-evaluate for the lowest latency by executing Step 3 and step 4 above.
Refer to section 4.6.14 for more information on the Set LTV Command.
Refer to section 6.4.3.13 for more information on the Set LTV Command TRB.
Note: The xHC hardware automatically handles LATENCY_TOLERANCE_MESSAGE Device
Notifications (Notification Type = 2) so there is no need to enable Device Notification Event
generation for this notification type.
185
eXtensible Host Controller Interface Revision 1.0
For IN pipes, a device may truncate the data transfer associated with a TD by issuing a Short Packet
before the TD is exhausted. In this case the xHC shall retire the TD that received the Short Packet and
advance to the next TD on the Transfer Ring or the Enqueue Pointer (i.e.Cycle bit transition), whichever is
encountered first.
If the Interrupt On Completion (IOC) or Interrupt-on Short Packet (ISP) flags are set in the TRB that
received the Short Packet, a Transfer Event shall be generated with the Completion Code set to Short
Packet.
An endpoint is considered Active when it is on the xHC’s Pipe Schedule, and Inactive if it is not. Ringing
the Doorbell of an endpoint in the Running state will activate it, and the xHC shall place the endpoint in its
Pipe Schedule. While the endpoint is Active the xHC shall actively process TDs on its Transfer Ring. If the
Transfer Ring for the endpoint is exhausted or the endpoint exits the Running state, the endpoint is pulled
from the xHC’s Pipe Schedule and placed in Inactive state. Software may ring the Doorbell of an endpoint
in the Running state to reactive an inactive endpoint.
A Bus Instance (BI) represents a “unit” bus bandwidth at the speed that the BI supports. The bit rate cited
for a USB bus (e.g. SS 5Gb/s. HS 480Mb/s, etc.) should not be confused with the “Total Available
Bandwidth”, which is the maximum bandwidth available for actually moving data through a BI.
The Total Available Bandwidth identifies a BI’s ability to move real data. As rule of thumb, the Total
Available Bandwidth will be at least 20% lower than the cited bit rate of a BI, or more depending on the mix
of packet sizes. Also note that multiple Root Hub ports may share the bandwidth of a single BI. The
mapping of BI to Root Hub ports is xHC implementation dependent and not exposed to software.
During each IN transaction, the xHC shall use the Max Packet Size to detect packet babble errors. If a
babble error is detected, a Transfer Event shall be generated for the offending TRB, with the Completion
Code set to Babble Detected Error.
When the xHC detects that a Transfer Ring will be exhausted after the execution of a TP or DP (e.g. the
last packet of the last TRB of the last TD on a Transfer Ring), it should clear the ACK TP or DP Packet
Pending (PP) bit to ‘0’. If Max Exit Latency is greater than ‘0’, then the xHC should clear the Packet
Pending flag in the last packet of each Isoch TD. The Packet Pending bit shall be set to ‘1’ in all other ACK
TPs or DPs generated by the xHC.
186
eXtensible Host Controller Interface Revision 1.0
complete, the xHC shall initiate a SO for the next endpoint in the schedule. Retries may terminate the
current SO and continue on the next SO.
Normally SOPC is less than or equal to MSOPC, however the xHC is allowed to limit the SOPC to a value
less that MSOPC. And if only one endpoint is in the Pipe Schedule SOPC may be greater than MSOPC,
e.g. a continuous burst on the bus. Refer to the individual pipe type discussions below for more details on
SOPC usage.
The endpoints assigned to a periodic schedule are closely controlled by the xHC through the Address
Device and Configure Endpoint Commands to ensure that the periodic Pipe Schedule consumes no more
than a maximum percentage of the Total Available Bandwidth. Any USB bandwidth not consumed by
periodic pipes, is available to async pipes.
Note: The “maximum percentage” of the Total Available Bandwidth depends on the speed of the periodic
pipe. Refer to section 4.14.2 for more information.
The endpoints assigned to an async schedule are considered “Best Effort” and may consume any USB
bandwidth not consumed by periodic pipes. Each endpoint in an async Pipe Schedule is given one Service
Opportunity (SO) per pass through the schedule.
IMPLEMENTATION NOTE
TRB Lengths and System Bus Bandwidth
System buses are most efficient when they are moving large transfers. As transfer sizes become smaller,
the throughput of a bus can fall off rapidly.
The xHCI supports byte granularity for the TRB Data Buffer Pointer and Length fields, which enables “fine-
grain” scatter/gather operations. The threshold where it is more efficient to declare many small TRBs and
allow the xHC to use DMA to scatter/gather data vs. having software copy that data to/from larger buffers
will depend on many factors (e.g. the xHC implementation, system I/O bus performance, system memory
performance, etc.). The xHCI does not place lower limits on TRB sizes, which could constrain the ability of
a system developer to optimize the performance/throughput of their entire system. However, an xHC will
place limits on the system bus bandwidth allocated to an individual endpoint, to ensure that other
endpoints are not affected by an endpoint that requires disproportionately large number of system bus
transactions to complete its USB transactions.
187
eXtensible Host Controller Interface Revision 1.0
A programmer should assume that defining large numbers of small TRB Data Buffers will affect USB
throughput and design accordingly. The extent to which the system bandwidth demands of a single
endpoint will affect that endpoint or other endpoints is xHC implementation dependent.
Note that an Average TRB Length of 16 implies that 50% of the system bus bandwidth consumed by an
endpoint moving TRBs, i.e. each 16 byte TRB defines 16 bytes of data. And an Average TRB Length of
1024 implies that 1.5% of the system bus bandwidth consumed by an endpoint moving TRBs. Ideally the
Average TRB Length represents the true average size of the data buffers that the TRBs of an endpoint
reference, which will generally be a class specific or application specific value. If precise values for the
Average TRB Length of an endpoint are not available, software may calculate a running average of the
size of TRBs scheduled for an endpoint in real-time and periodically updating Average TRB Length.
Reasonable initial values of Average TRB Length for Control endpoints would be 8B, Interrupt endpoints
1KB, and Bulk and Isoch endpoints 3KB.
188
eXtensible Host Controller Interface Revision 1.0
The xHC is free to schedule a isoch transfer at any time within an ESIT as long as the complete TD shall
have an opportunity to complete within the ESIT.
For SuperSpeed pipes, if the Endpoint Context Max Exit Latency field is greater than ‘0’, the xHC shall
transmit a PING packet a minimum of Max Exit Latency prior to initiating an Isoch transfer, to transition the
links in the path between the xHC and the device to the U0 state. PING generation is optional for Interrupt
endpoints. Refer to section 4.23.5.2 for more information on Max Exit Latency and its computation.
The Microframe Index (MFINDEX) register is incremented at the beginning of each microframe. Figure 29
illustrates the required relationships between the USB2 SOF FrameNumber and the SS Isoch Timestamp
(ITS) Bus Interval Counter field (refer to section 8.7 of the USB3 spec) 1/8th ms. counter values, and the
MFINDEX register. Figure 29 also illustrates the partitioning of the Frame Index and µFrame Index fields of
the MFINDEX register.
µFrame
Frame Index
Index
10 0
USB2 SOF FrameNumber
To enable software computation of larger Microframe Index values, MFINDEX Wrap Events may be
enabled. If enabled, a MFINDEX Wrap Event is inserted on the Event Ring of the Primary Interrupter every
time the MFINDEX register wraps from 03FFFh to 0. Refer to section 6.4.2.8 for a description of the
MFINDEX Wrap Event. Refer to the definition of the USBCMD register (5.4.1) for details on the Enable
Wrap Event (EWE) flag that may be used to enable MFINDEX Wrap Events.
Note: If the target Event Ring is full, MFINDEX Wrap Events shall be dropped by the xHC.
If all Root Hub ports are in the Disconnected, Disabled, or Powered-off state the MFINDEX counting
action may be stopped by the xHC to reduce power consumption. The EU3S flag in the USBCMD register
may be used to optionally add the U3 state to list of port states that enable the counting action to be
stopped. Exiting any of these states on any port shall automatically restart the MFINDEX counting action.
Refer to section 4.11.2.5 for more information on the use of the MFINDEX register.
189
eXtensible Host Controller Interface Revision 1.0
If the Transfer Ring is empty and there is no TD defined to receive Isoch IN data, the xHC shall remove the
endpoint from the periodic schedule and generate a single Transfer Event with the Completion Code set to
Ring Overrun.
If the Transfer Ring is empty and there is no TD defined to transmit Isoch OUT data, the xHC shall remove
the endpoint from the periodic schedule and generate a single Transfer Event with the Completion Code
set to Ring Underrun.
Ringing the doorbell of a periodic endpoint that has encountered a Ring Overrun or Ring Underrun
condition shall place it on back on the periodic schedule.
Interval values are limited to base 2 multiples. An ESIT Boundary is defined by when the least significant
bits of the MFINDEX register transition to ‘0’. e.g. if the Interval equals 2 microframes, the ESIT Boundary
is defined by the transition of the least significant bit of the MFINDEX register to ‘0’. If the Interval equals 4
microframes, the ESIT Boundary is defined by the transition of the least significant two bits of the
MFINDEX register to ‘0’. And so on.
Note: Section 8.12.6 of the USB3 spec states that “If there is no data to send to an isochronous OUT
endpoint during a service interval, the host does not send anything during the interval.” The USB2
spec is silent on this subject. When xHC encounters a zero-length Isoch OUT TD on a Transfer
Ring, it shall transmit a zero-length DP to the USB bus regardless bus speed, consuming the Isoch
TD for the Service Interval. If the Transfer Ring is empty when the xHC attempts to service an
Isoch TD, no DPs shall be sent, and an Underrun Event shall be generated.
The USB Endpoint Descriptor (refer to section 9.6.6 in the USB2 spec.) wMaxPacketSize field for a high-
speed isochronous endpoint is divided into two fields: the Maximum Packet Size (bits 0-10), and the
Multiplier field (bits 11-12). High-speed USB devices support “high-bandwidth” pipes via the Multiplier
field. The USB2 Maximum Packet Size and Multiplier bit fields of the wMaxPacketSize fields are separated
and passed to the xHC through the Endpoint Context Max Packet Size and Max Burst fields respectively.
For high-speed devices, the xHC shall execute the specified number of Max Packet Sized bus transactions
specified by the Max Burst Size field in a single microframe (MIT). The TD is used to service all
transactions indicated by the Max Burst field.
The maximum sized High-speed isochronous packet size supported is 1024 bytes. The Max Burst Size
field may define up to up to 3 contiguous packets in a burst.
For OUT transfers, the xHC shall transmit data packets with data fields less than or equal to the endpoint’s
Max Packet Size. If a TD defines more information than will fit into the Max Packet Size and the Max Burst
Size is greater than ‘0’, the xHC shall transmit up to Max Burst Size+1 consecutive packets on the USB to
move the TD data. If more than one Max Packet Size packet is required to move the data defined by a TD,
then all packets associated with the TD are transmitted as a contiguous burst in a single microframe of the
ESIT. When all bytes have been transmitted for an Isoch TD the xHC advances its Dequeue Pointer to the
next TD and waits for the next ESIT delay before scheduling the endpoint again.
For IN transfers, the xHC may issue up to Max Burst Size+1 IN transactions of Max Packet Size for a
single Isoch TD. It is assumed that software has properly initialized the Isoch TD to accommodate all of the
possible data that may be received in an ESIT. During each IN transaction, the xHC shall use Max Packet
Size to detect packet babble errors.
For IN transfers, the xHC keeps the sum of bytes received in an internal TD Payload Length register. After
all transactions for the endpoint have completed for the ESIT, the local TD Payload Length register
contains the total bytes received. If the final value of local TD Payload Length register is less than the value
of TD Transfer Size, then less data than was allowed for was received from the associated endpoint. This
short packet condition shall assert a Short Packet completion code only if the ISP or IOC flag was set on
the TRB that the short packet condition was detected on. If the device sends more than Max Packet Size
bytes, then the xHC shall generate a Transfer Event with the Completion Code set to Babble Detected
190
eXtensible Host Controller Interface Revision 1.0
Error for the TRB that the error was detected on. Note, that the xHC is not required to update the Transfer
Event Length field in this error scenario.
If the Max Burst Size field is greater than ‘0’, then the xHC shall automatically attempt to execute Max
Burst Size+1 transactions on the USB. The xHC shall not execute all Max Burst Size transactions if:
• The endpoint is an OUT and the TD is exhausted before all the transactions of the burst have executed
(e.g. ran out of data).
• The endpoint is an IN and the endpoint delivers a short packet, or an error occurs on a transaction
before all the transactions of the burst have been executed.
• The endpoint is an IN and the TD is exhausted before all the transactions of the burst have executed
(e.g. ran out of buffer space). This condition shall result in the xHC terminating the Isoch TD with a
Isoch Buffer Overrun Transfer Event.
Note: The Isoch Buffer Overrun condition shall force a Transfer Event for the TRB, irrespective of the
state of the IOC flag. System software may determine whether to treat this condition as an error or
not.
Refer to Appendix B for a table summary of the host controller required behavior for all the High-speed
USB2 high-bandwidth transaction cases.
The end of a microframe may occur before all packets have been executed for a high-speed or full-speed
endpoint. When this happens, the xHC shall terminate the Isoch TD with a Missed Service Error Transfer
Event.
If the bMaxBurst field of the SuperSpeed Endpoint Companion Descriptor is greater than ‘0’, the
SuperSpeed endpoint supports “high-bandwidth” pipes. Software shall pass the bMaxBurst value to the
xHC through the Endpoint Context Max Burst Size field.
Additionally, the Mult value defined in bits 1:0 of the SuperSpeed Endpoint Companion Descriptor
bmAttributes field identifies the number of Bursts within an ESIT that the device supports. This value is
passed to the xHC through the Endpoint Context Mult field. Note that the range of values for the Mult field
is limited by the USB3 spec to ‘0’ to ‘2’, or 1 to 3 bursts.
The maximum sized SuperSpeed isochronous packet size supported is 1024 bytes. The Max Burst Size
field may define up to up to 16 contiguous packets in a burst, and the Mult field may allow up to 3 bursts in
an ESIT, allowing for up to 48KB per ESIT.
For OUT transfers, the xHC shall transmit data packets with data fields less than or equal to the endpoint’s
Max Packet Size. If a TD defines more information than will fit into the Max Packet Size and the Max Burst
Size is greater than ‘0’, the xHC may transmit a burst of up to Max Burst Size+1 consecutive packets in a
single MIT. If a TD defines more information than will fit into a single burst and Mult is greater than ‘0’, the
xHC shall transmit up to Mult+1 bursts in an ESIT. When all bytes have been transmitted for an Isoch TD
the xHC advances its Dequeue Pointer to the next TD and waits for the next ESIT delay before scheduling
the endpoint again.
For IN transfers, the xHC may issue up to (Max Burst Size+1) * (Mult+1) IN transactions of Max Packet
Size for a single Isoch TD. It is assumed that software has properly initialized the Isoch TD to
accommodate all of the possible data that may be received in an ESIT. During each IN transaction, the
xHC shall use Max Packet Size to detect packet babble errors.
Refer to section 8.12.6.1 of the USB3 spec for more information on xHC execution of SuperSpeed
isochronous transactions.
For IN transfers, the xHC keeps the sum of bytes received in an internal TD Payload Length register. After
all transactions for the endpoint have completed for the ESIT, the local TD Payload Length register
191
eXtensible Host Controller Interface Revision 1.0
contains the total bytes received. If the final value of local TD Payload Length register is less than the value
of TD Transfer Size, then less data than was allowed for was received from the associated endpoint. This
short packet condition shall assert a Short Packet completion code only if the ISP or IOC flag was set on
the TRB that the short packet condition was detected on. If the device sends more than TD Transfer Size
or Max Packet Size bytes (whichever is less), then the xHC shall generate a Transfer Event with the
Completion Code set to Babble Detected Error for the TRB that the error was detected on. Note, that the
xHC is not required to update the Transfer Event Length field in this error scenario.
The host controller shall not execute all (Max Burst Size+1) * (Mult+1) transactions if:
• The endpoint is an OUT and the TD is exhausted before all the transactions of the burst have executed
(ran out of data), or
• The endpoint is an IN and the endpoint delivers a short packet, or an error occurs on a transaction
before all the transactions of the burst have been executed.
• The endpoint is an IN and the TD is exhausted before all the transactions of the burst have executed
(e.g. ran out of buffer space). This condition shall result in the xHC terminating the Isoch TD with a
Isoch Buffer Overrun Transfer Event.
In addition to the Microframe Index (MFINDEX) register, the xHC shall maintain a 13 bit Delta Time down-
counter that is cleared to ‘0’ at the MIT boundary and incremented every 16.666~ ns. (i.e. 8 HS bit times).
The Delta Time counter identifies the delay, in 16.666~ ns. increments, between the start of the current
packet to the previous MIT Boundary. Note: A value of 7500 is reported if the Delta Time counter is
sampled exactly on a MIT Boundary.
The value of the Microframe Index (MFINDEX) register shall be written to bits 13:0 and the value of the
Delta Time register shall be written to bits 26:14 of the Isochronous Timestamp (ITS) field of Isochronous
Timestamp Packets (ITP) when they are sent. Refer to the USB3 specification section 8.7 for more
information on the ITP and the required accuracy of the ITS field.
• If an Isoch IN Transfer Ring is Active and the xHC is unable to send an isochronous IN request (ACK
TP) during an ESIT, (due to problems such as internal buffer overrun, excessive DMA access latency,
etc.) the xHC shall set the Completion Code to Data Buffer Error in the Transfer Event generated for
the associated Isoch TD. Note that this is an error condition that should never occur.
• If an Isoch OUT Transfer Ring is Active and the xHC is unable to send an isochronous OUT DP data
during an ESIT (due to problems such as internal buffer overrun, excessive DMA access latency, etc.),
the xHC discards the data and notifies software by setting the Completion Code to Data Buffer Error in
the Transfer Event generated for the associated Isoch TD. Note that this is an error condition that
should never occur.
• If the xHC receives a corrupted data packet, it discards the data and informs software by setting the
Completion Code to USB Transaction Error in the Transfer Event generated for the associated Isoch
TD.
The Isochronous Scheduling Threshold (IST) field in the HCSPARAMS2 capability register is an indicator
to system software as to how the host controller pre-fetches and caches TRB structures. It is used by
system software when adding isochronous work items. The value of this field indicates to system software
the minimum distance (in time) that it is required to stay ahead of the host controller while adding TRBs in
order to have the host controller process them at the correct time. In other words, software shall add a TRB
to the ring some period of time before that TRB is required to be executed, and the IST indicates a
minimum value for this period of time as required by the specific host controller hardware implementation.
Software shall determine the host controller's current frame/microframe by reading the MFINDEX register,
to account for the uncertainty in the actual read latency and position within the microframe, software shall
always add a value of one microframe to the value read.
192
eXtensible Host Controller Interface Revision 1.0
It is recommended that software post sufficient TRB(s) to the ring to allow uninterrupted processing by the
host controller. This may be accomplished by always placing multiple TD(s) on the ring that either exceed
the time window represented in the IST field or exceeds the round-trip delay in the host software, which
ever is greater.
The Isochronous Scheduling Threshold (IST) field definition can be found in section 5.3.4.
A value of ‘2’ in the Isochronous Scheduling Threshold (IST) field indicates that software can add a TRB no
later than 2 microframes before that TRB is due to be executed.
If bit [3] of IST is cleared to '0', software can add a TRB no later than IST[2:0] Microframes before that TRB
is scheduled to be executed.
If bit [3] of IST is set to '1', software can add a TRB no later than IST[2:0] Frames before that TRB is
scheduled to be executed.
Note: Undefined behavior may result if a partially formed Isoch TD is encountered, i.e. the enqueue
pointer (Cycle bit transition) is encountered before the end of the TD (Chain = ‘0’). This condition
may occur if software fails to honor the IST.
Note: Ideally the IST value declared by an xHC implementation represents a worst case latency,
however the xHC may encounter system latencies that cause it to skip a scheduled Isoch TD even
if software has met the IST requirements. These conditions are normally indicated as a Missed
Service Error. If Missed Service Errors persist, software may choose to use a larger value for IST
than that reported by the xHC.
To minimize the latency impact of retries on an Interrupt pipe, up to MOSPC packets (including
retires) may be transferred in an ESIT even if the initial SOPC value was less than MSOPC.
An xHC implementation may exceed MOSPC packets per ESIT if it can guarantee that additional
193
eXtensible Host Controller Interface Revision 1.0
packets do not affect the bandwidth guarantees that have been established with other periodic
endpoints.
194
eXtensible Host Controller Interface Revision 1.0
• If the xHC is unable to accept a valid Data Packet from a device due to internal issues (e.g.
internal buffer overrun, etc.), it shall set the ACK TP Host Error (HE) bit to ‘1’.
• Interrupt OUT pipes
• If an OUT DP is responded to with an NRDY, then the xHC shall wait indefinitely for a ERDY from
the endpoint. System software is responsible for any timeouts. The only exception to this rule is
when an endpoint that has been flow controlled by an NRDY is stopped with a Stop Endpoint
Command then restarted by ringing its doorbell. When the endpoint transitions to the Running
state, it checks its Transfer Ring and if a TD exists, it shall issue an OUT.
• If a DP was received by the device with an error, the Retry bit shall be set in the returned ACK TP
and the xHC should retry the same DP by the next ESIT at the latest.
• If an OUT DP is responded to with a STALL TP, the xHC shall set the Halted flag for the EP to ‘1’
and pull the endpoint from the Pipe Schedule. USB System Software intervention is required to
recover from the error.
Refer to Table 9 for SS Interrupt pipe actions based on Endpoint Response and Residual Transfer State.
195
eXtensible Host Controller Interface Revision 1.0
Table 8: USB2 Pipe Actions based on Endpoint Response and Residual Transfer State
Transfer State
after
Endpoint
Direction Transaction Pipe Action
Response
(Bytes to
transfer)
Note 8-1:
If Stall
Generate Stall Error Transfer Event.
else
Generate Babble Detected Error Transfer Event.
Set endpoint to the Halted state.
Pull endpoint from Pipe Schedule.
Advance to next Async Pipe.
196
eXtensible Host Controller Interface Revision 1.0
Note 8-2:
Decrement the Bus Error Counter.
If Bus Error Counter = ‘0’:
Generate USB Transaction Error Transfer Event
Set endpoint to the Halted state.
Pull endpoint from Pipe Schedule.
Advance to the next endpoint in the Pipe Schedule.
else
If IN or OUT endpoint, do not advance Data Toggle.
Decrement SOPC.
If SOPC = 0:
Advance to the next endpoint in the Pipe Schedule.
else
Retry the packet.
Note: When retiring a TD, if its Transfer Ring is empty, pull the endpoint from the Pipe Schedule.
197
eXtensible Host Controller Interface Revision 1.0
Table 9: USB3 Pipe Actions based on Endpoint Response and Residual Transfer State
Transfer State
after
Endpoint
Direction Transaction Pipe Action
Response
(Bytes to
transfer)
198
eXtensible Host Controller Interface Revision 1.0
Table 9: USB3 Pipe Actions based on Endpoint Response and Residual Transfer State (Continued)
Transfer State
after
Endpoint
Direction Transaction Pipe Action
Response
(Bytes to
transfer)
a. The assertion of EOB on a short packet may also retire the TD.
199
eXtensible Host Controller Interface Revision 1.0
b. DPP Error may be due to one or more of the following conditions: CRC incorrect, DPP aborted, DPP missing, or the
data length in the DPH does not match the actual data payload length.
c. DPH Error may be due to one or more of the following conditions: an incorrect Device Address, the Endpoint Num-
ber and Direction does not refer to an endpoint that is part of the current configuration, or the DPH does not have an
expected sequence number.
d. The SS Transaction Timeout = 10 μs. Refer to note below Table 8-33 in the USB3 spec.
e. ACK TP Error may be due to one or more of the following conditions: an incorrect Device Address, the Endpoint
Number and Direction does not refer to an endpoint that is part of the current configuration, or the ACK TP does not
have an expected sequence number.
f. TP Error may be due to one or more of the following conditions: Reserved Type or SubType, an incorrect Device
Address, or the Endpoint Number and Direction does not refer to an endpoint that is part of the current configuration.
Note: When retiring a TD, if its Transfer Ring is empty, pull the endpoint from the Pipe Schedule.
The xHC shall concatenate buffers referenced by TRBs in a TD, moving Max Packet Size transfers for all
but possibly the last packet of a TD. The size of the last packet is determined by the TD Residue.
TD Residue = TD Transfer Size - (Max Packet Size *
ROUNDDOWN(TD Transfer Size / Max Packet Size))
200
eXtensible Host Controller Interface Revision 1.0
4.15 Suspend-Resume
The xHC provides an equivalent suspend and resume model as that defined for individual ports in a USB
Hub. Control mechanisms are provided to allow system software to suspend and resume individual ports.
The mechanisms allow the individual ports to be resumed completely via software initiation. Other control
mechanisms are provided to parameterize the host controller's response (or sensitivity) to external resume
events. In this discussion, host-initiated, or software initiated resumes are called Resume Events/Actions.
Bus-initiated resume events are called Wake-up Events. The classes of wakeup events are:
• Remote-wakeup enabled device asserts resume signaling, similar to USB Hubs, The xHC shall always
respond to explicit device resume signaling and wake up the system (if necessary).
• Port connect and disconnect and over-current events. Sensitivity to these events can be turned on or
off by using the per-port control bits in the PORTSC registers.
Selective suspend is a feature supported by every PORTSC register. It is used to place specific ports into
a suspend mode. This feature is used as a functional component for implementing the appropriate power
management policy implemented in a particular operating system.
When system software intends to suspend the entire bus, it should selectively suspend all enabled ports,
then shut off the host controller by setting the Run/Stop (R/S) bit in the USBCMD register to a ‘0’. The xHC
can then be placed into a lower device state via the PCI power management interface (refer to Appendix A
and PCI PM).
When a wake event occurs system software will eventually set the Run/Stop (R/S) bit to a ‘1’ and resume
the suspended ports by writing a ‘0’ to their PLS field. Software shall not set the Run/Stop (R/S) bit to a ‘1’
until it is confirmed that the clock to the host controller is stable. This is usually confirmed in a system
implementation in that all of the clocks in the system are stable before the CPU is restarted. So, by
definition, if software is running, clocks in the system are stable and the Run/Stop (R/S) bit in the USBCMD
register can be set to ‘1’. There are also minimum system software delays defined in the PCI PM
Specification. Refer to this specification for more information.
Note: If software does not place a connected root hub port in the U3 or Disabled state before placing the
xHC into the D3 state undefined behavior may occur.
Note: Any Root Hub port that is in the Resume or U3 state when the xHC is transitioned to the D0 power
state shall require software to drive the port to the U0 state. The xHC shall not automatically
transition a root hub port from the Resume or U3 state to the U0 state.
201
eXtensible Host Controller Interface Revision 1.0
Note that an LFPS Handshake26 is required for a USB3 U3 wakeup. A device generates LFPS to
initiate the resume process. The detection of LFPS while in the U3 state shall transition a USB3
port to the Resume state27. The xHC shall not respond with LFPS to the device, which would
allow the LFPS Handshake to complete, until directed by software.
2) Upon receipt of a Port Status Change Event system software evaluates the Port ID field to
determine the port that generated the event.
3) System software then reads the PORTSC register of the port that generated the event.
PLC = ‘1’ and PLS = Resume if the event was due to a device initiated resume:
a. For a USB3 protocol port, software shall write a ‘0’ to the PLS field to direct the xHC to initiate
LFPS to the device and initiate the LFPS Handshake.
b. For a USB2 protocol port, when a resume signaling is detected from a device the xHC shall
transmit the resume signaling within 1 ms (TURSM). Software shall ensure that resume is
signaled for at least 20 ms (TDRSMDN). Refer to section 7.1.7.7 of the USB2 spec. Software
shall start timing TDRSMDN from the notification of the transition to the Resume state. After
TDRSMDN is complete, software shall write a ‘0’ to the PLS field.
4) The completion of the resume signaling shall cause the port to transition to the U0 state, i.e. the
PORTSC register PLS field shall to be set to U0 (‘0’) and PLC flag to ‘1’. If the assertion of PLC
results in a ‘0’ to ‘1’ transition of PSCEG (4.19.2), the xHC shall generate a Port Status Change
Event.
Note: Software shall ensure that the xHC is in Run (R/S = ‘1’)mode prior to transitioning a root hub port
from the Resume to the U0 state. This action ensures that the xHC is capable of transmitting ITPs
and immediately receiving packets when the device enters the U0 state.
26. Refer to section 6.9.2 in the USB3 spec for more information on the LFPS Handshake.
27. Refer to section 4.19.1.2.13 for more information on the Resume state.
202
eXtensible Host Controller Interface Revision 1.0
203
eXtensible Host Controller Interface Revision 1.0
The xHC State column indicates the response of the xHC to the system as function of its (PCIe) power
state when the event occurs.
Note: A port resume is not gated by a Wake Enable flag.
xHC State
Port State After Event
Port Status and Note
Signaling Device State Type not
PLS CCS PED OCA PCD D0
D0
204
eXtensible Host Controller Interface Revision 1.0
205
eXtensible Host Controller Interface Revision 1.0
setting for the periodic endpoints of the device. As devices reconfigure themselves they will issue
Configure Endpoint Commands which will free part or all of their currently assigned bandwidth. As the xHC
processes the commands it shall recompute the available bandwidth of the USB instance. The Negotiate
Bandwidth command may allow a device to enumerate that would not have been able to without it.
The Negotiate Bandwidth Command uses the value of the Slot ID field in the Negotiate Bandwidth
Command TRB to identify the USB instance that the device requiring the bandwidth is attached to.
The Negotiate Bandwidth command does not block Command Ring execution, e.g the command should
not wait for all BW Requests to be delivered before generating the associated Command Completion
Event.
The Negotiate Bandwidth Command is acknowledged by the xHC with a Success Completion Code.
Bandwidth Request Events shall be generated for the selected device slots. The selection of the device
slots that are targeted by Bandwidth Request Events shall be determined by an xHC implementation
specific algorithm.
After a system defined delay, the software that initiated the negotiation process may reissue the Configure
Endpoint Command that failed, to test whether enough bandwidth has been freed to allow a successful
completion.
Note: The initiator of the Negotiate Bandwidth Command should allow enough time for system software
to receive the Bandwidth Request Events and to reconfigure or choose alternate interface settings
for the target device, before attempting to issue a Configure Endpoint Command.
Whether an xHC implementation supports Bandwidth Negotiation, is identified by the BW Negotiation
Capability (BNC) flag in the HCCPARAMS register.
Note: A important use of the Negotiate Bandwidth Command is with virtualization. It allows one VF to ask
the other VFs for BW. Which means that an OS shall expect to receive a Bandwidth Request
Event asynchronously, e.g. without having previously issued a Negotiate Bandwidth Command.
Refer to section 4.11.4.12 for more information on the Negotiate Bandwidth Command TRB and Bandwidth
Request Event TRB.
206
eXtensible Host Controller Interface Revision 1.0
ID does not reside on a Secondary Bandwidth Domain boundary (e.g. the hub does not contain a TT),
undefined behavior may occur, e.g. the values in the Port Bandwidth Context may be invalid.
Note: When evaluating a Configure Endpoint Command, the xHC shall check the upstream High-speed
Bandwidth Domain of a hub first. If there is enough bandwidth available in the primary (HS)
Bandwidth Domain then the xHC shall check the Secondary (FS) Bandwidth Domain of the hub.
207
eXtensible Host Controller Interface Revision 1.0
4.17 Interrupters
An Interrupter manages events and their notification to the host. The xHCI supports up to 1024
Interrupters. The MaxIntrs field in HCSPARAMS1 determines the Number of Interrupters implemented in
the xHC. Each Interrupter consists of an Interrupter Management Register, an Interrupter Moderation
Register and an Event Ring. Each Interrupter shall be mapped to a single MSI or MSI-X interrupt vector.
An Interrupter shall assert an interrupt if it is enabled and its associated Event Ring contains Event TRBs
that require an interrupt.
IMPLEMENTATION NOTE
PCI MSI and MSI-X Interrupts
MSI-X defines a separate optional extension to basic PCI MSI functionality. Compared to MSI, MSI-X
supports a larger maximum number of vectors per function, the ability for software to control aliasing when
fewer vectors are allocated than requested, plus the ability for each vector to use an independent address
and data value, specified by a table that resides in Memory Space. However, most of the other
characteristics of MSI-X are identical to those of MSI. For more information on MSI-X, refer to the PCI
Specification.
MSI-X maps each of the xHC Interrupters to an interrupt vector that is conveyed by xHC as a posted-write
PCI Express (PCIe) transaction. Each MSI-X interrupt vector has some attributes assigned to it, such as
the address and data for its posted-write message. These are described in section 5.2.6.2 that described
the PCI aspects on MSI-X configuration.
Interrupters and PCI Interrupt Mechanisms
When the PCI Pin Interrupt is activated:
• Interrupter 0 may assert the INTx# pin.
• Interrupters 1 to MaxIntrs-1 shall be disabled.
When MSI is activated:
• If MaxIntrs > 32, then Interrupters 0 to 31 may each trigger a unique interrupt vector, and Interrupters
32 to MaxIntrs-1 shall be disabled.
• If MaxIntrs <= 32, then Interrupters 0 to MaxIntrs-1 may each trigger a unique interrupt vector.
• The MSI Message Control register Multiple Message Capable field reported by the xHC shall be equal
to or less than MaxIntrs.
• If the value of the MSI Message Control register Multiple Message Enable field < MaxIntrs then the
Interrupters 0 through Multiple Message Enable - 1 shall be enabled.
• The allocation of MSI vectors is fixed. Interrupters 0 through 31 shall assert vectors 0 through 31,
respectively.
When MSI-X is activated:
• Interrupters 0 to MaxIntrs-1 may each trigger a unique interrupt vector.
• The allocation of MSI-X vectors is set by the enabling of the respective Interrupter using the MSI-X
Enable field in the Vector Control Dword of the MSI-X Table Structure. (If Interrupter 0 is enabled, the
vector defined by MSI-X Table[0] is allocated, if Interrupter 1 is enabled, the vector defined by MSI-X
Table [1] is allocated, etc.).
208
eXtensible Host Controller Interface Revision 1.0
xHC generated interrupts to the system may be enabled by setting the Interrupter Enable (INTE) flag in the
USBCMD register to ‘1’.
An xHC implementation that supports virtualization shall implement at least one Interrupter for the Physical
Function and a minimum of one Interrupter per Virtual Function. Refer to section 8 for more information on
virtualization.
Note: The xHC is not required to maintain event ordering across Event Rings. e.g. If events that are
generated sequentially within the xHC target separate Event Rings, the events may not be placed
on the respective Event Rings in the same temporal order.
209
eXtensible Host Controller Interface Revision 1.0
The optimal performance setting for this register is very system and configuration specific. An initial
suggested range for the moderation Interval is 651-5580 (28Bh - 15CCh).
The IMODI field shall default to 4000 (1 ms.) upon initialization and reset. It may be loaded with an
alternative value by software when the Interrupter is initialized.
The xHC implements interrupt moderation to reduce the number of interrupts that SW processes. The
moderation scheme is based on the IMOD register and the ERDP Event Handler Busy (EHB) flag. When
an Interrupter is enabled it begins looking for two conditions: 1) Interrupt Pending Enable (IPE = ‘1’) and 2)
the Event Handler not busy (EHB = ‘0’). If these conditions are true, the Interrupt Pending (IP) bit in the
Interrupter Management (IMAN) register and the Event Handler Busy (EHB) flag in the Event Ring
Dequeue Pointer (ERDP) register are set to ‘1’, IMODC is loaded with IMODI, and moderation counter
starts counting down. Another interrupt message will not be asserted to the host bus by the xHC until 1) the
IMODC of the associated Interrupter has counted down to ‘0’, 2) the Interrupt Pending Enable is asserted
(IPE = ‘1’), and 3) the Event Handler is not busy (EHB = ‘0’). When all three conditions are met, IMODC is
reloaded with the value of the IMODI and the process repeats again. Refer to section 5.5.2.2 for more
information on the IMOD register and the IMODC clocking rate. The interrupt flow should follow the
diagram below:
210
eXtensible Host Controller Interface Revision 1.0
Yes
Counter written to 0
Interrupt
Pending
No Enable?
Yes
Event Handler
Busy?
Yes
No
Interrupt Enable = Interrupter Management
Interrupt Pending = ‘1’ Register Interrupt Enable field (IM)
Event Handler Busy = ‘1’
Interrupt Pending = Interrupter Management
Register Interrupt Pending field (IP)
Yes
If PCI Message Signaled Interrupts (MSI or MSI-X) are enabled, then the assertion of the Interrupt Pending
(IP) flag in Figure 30 generates a PCI Dword write. The IP flag is automatically cleared by the completion
of the PCI write.
If the PCI Interrupt Pin mechanism is enabled, then the assertion of Interrupt Pending (IP) asserts the
appropriate PCI INTx# pin. And the IP flag is cleared by software writing the IMAN register.
211
eXtensible Host Controller Interface Revision 1.0
IMODI IMODI
Delay Delay
IMODC > 0
Interrupt Pending
Under heavy load conditions (Figure 31), Interrupt Pending Enable (IPE) is asserted almost constantly, so
if IPE = ‘1’ when the IMODC counts down to ‘0’ and the Event Handler is not busy (EHB = ‘0’), an interrupt
is generated immediately, i.e. Interrupt Pending (IP) is set to ‘1’. When IP is asserted, the IMODC is
reloaded with the IMODI and the IMODC begins counting down again. Thus, the next interrupt event will
be delayed by the IMODI delay. Also note that in this example, the assertion of Interrupt Pending (IP)
triggers the Interrupt Service Routine (ISR). The ISR schedules a Deferred Procedure Call (DPC) that
will process the events on the Event Ring at a later time. The DPC processes events until Event Ring is
empty then clears the Event Handler Busy (EHB) flag. Interrupt Pending Enable is cleared when the Event
Ring goes empty, i.e. the DPC writes the Event Ring Dequeue Pointer (ERDP) register with a value that is
equal to the Event Ring Enqueue Pointer.
212
eXtensible Host Controller Interface Revision 1.0
IMODC > 0
Interrupt Pending
If no Interrupt Pending Enable, IMOD Delay Expired. If Event Handler Busy, IMOD Delay Expired
do not set Interrupt Pending Wait for do not set Interrupt Pending
Interrupt Pending Enable
Under light load conditions (Figure 32) it is desirable to fire off interrupts with minimum latency. In this
case, when the IMODC counts down to ‘0’ and no interrupts are pending(IPE = ‘0’), the IMODC is not
reloaded with the IMODI but stays at ‘0’. Thus, the next assertion of Interrupt Pending Enable will trigger an
interrupt immediately. Triggering the interrupt will also cause the IMODC to be reloaded with the IMODI
and begin counting down again.
In the first case where the IMOD Delay Expires, Interrupt Pending (IP) is not set (so the ISR is not
triggered) because the Event Ring is empty. Since IMODC = 0 when event 3 is posted, Interrupt Pending
(IP) is asserted immediately.
In the second case, Interrupt Pending (IP) is not set because the Event Handler is busy (EHB = ‘1’). The
DPC was not able to empty the Event Ring the first time it was scheduled (i.e. it only processed event 3),
so it rescheduled itself to process the remaining events in the ring (i.e. event 4). While waiting for the DPC
to be scheduled, events 5, 6, and 7 are posted. The rescheduled DPC processes events until Event Ring is
empty then clears the Event Handler Busy (EHB) flag, re-enabling an immediate interrupt the next time an
event is posted.
213
eXtensible Host Controller Interface Revision 1.0
214
eXtensible Host Controller Interface Revision 1.0
• Any TRB type that does not define a BEI flag always generates Non-blocking Events.
• If an error is detected which generates an event while processing a TRB with BEI = '1', then BEI shall
be ignored and the event generated by the TRB shall be a Non-blocking Event.
• Any Transfer Event TRB that is not associated with a Transfer or Event Data TRB shall be a Non-
blocking Event.
To facilitate Interrupt Blocking an Interrupt Pending Enable (IPE) flag may be implemented by the xHC for
each Interrupter. IPE is an internal Interrupter flag that is not exposed through any register. Refer to section
4.17.2 for how IPE affects interrupt generation and the Interrupt Moderation mechanism.
The IPE flag of an Interrupter is managed as follows:
• IPE shall be cleared to ‘0’:
• When the Event Ring is initialized.
• If the Event Ring transitions to empty.
• When an Event TRB is inserted on the Event Ring and BEI = ‘0’ then:
• IPE shall be set to ‘1’.
Note: Only Normal, Isoch, and Event Data TRBs support a BEI flag.
4.18.1 No snoop
This feature is optional for PCIe implementations.
If the Enable No Snoop bit (Bit Location 11, Table 7-12) in the PCI Express Capability Structure (5.2.6)
Device Control Register (PCIe spec section 7.8.4) is set, the xHC is permitted to set the No Snoop bit in
the Requester Attributes of PCIe transactions it initiates that do not require hardware enforced cache
coherency (refer to Section 2.2.6.5 of the PCIe spec). Note that setting this bit to ‘1’ will not cause the xHC
to set the No Snoop attribute on all PCIe transactions that it initiates. Even when this bit is ‘1’, the xHC is
only permitted to set the No Snoop attribute on a PCIe transaction when it can guarantee that the address
of the transaction is not stored in any cache in the system.
215
eXtensible Host Controller Interface Revision 1.0
If Enabled in the PCI Express Capability Structure and directed by software in (e.g. TRB No Snoop (NS)
flag is set to ‘1’), then the xHC may set the No Snoop bit in the Requester Attributes of PCIe transactions
it initiates that do not require hardware enforced cache coherency. Refer to Table 11 for recommended No
Snoop behavior.
The xHC shall not assert the No Snoop attribute on PCIe transactions for memory requests that are
Message Signaled Interrupts, and Message Requests (except where specifically permitted).
Relaxed
Transfer Type No Snoop Comments
Ordering
Note: “N” means that the respective Requester Attribute is not set in the PCIe Transaction. “Y” means
that the respective Requester Attribute is set in the PCIe Transaction.
Section 2.2.6.4 of the PCIe spec describes the Relaxed Ordering Attribute field. And this attribute is
discussed further in section 2.4 of the PCIe spec.
216
eXtensible Host Controller Interface Revision 1.0
217
eXtensible Host Controller Interface Revision 1.0
State Name
Port Link State
Signal State
Where the State Name is an informative name defined by the xHCI spec.,the Port Link State identifies the
possible values for the PORTSC PLS field, and Signal State values are:
Port Power (PP), Current Connect Status (CCS), Port Enabled/Disabled (PED), and Port Reset (PR),
respectively, e.g. 0,0,0,0 all signals are ‘0’.
Note: Transitions associated with the large bubble may occur from any state defined within the bubble as
long as the Conditions match.
Refer to Appendix E for state machine notation.
Note: In each state, the Signal State values defined by the state are forced when entering the state, so
actions are not declared for changing the respective bits when transitioning from another state.
e.g. If the Disconnected State is entered from the Enabled state, the CCS and PED flags are
cleared. If the Disconnected State is entered from the Reset state, the CCS and PR flags are
cleared. Notice that the big bubble to Disconnected state transition does define any actions related
to these flags.
Note: For transition Actions: The notation Wr(Field Name=value) indicates a software write to the
PORTSC register of “value” to the respective field, and Field Name=value without the “Wr()”
wrapper indicates a transition of the respective field to the “value”.
Note: The figures in this section are provided to illustrate state transition conditions and actions, however
refer to the textual descriptions of the respective states for their explicit definition.
Note: The Root Hub Port state machines in the following subsections only references the Port Link State
Change (PLC) flag, refer to section 4.19.2 for information on how the remaining change flags are
affected by the Root Hub Port state machines.
Refer to section 5.4.8 for the details of change bit operation
218
eXtensible Host Controller Interface Revision 1.0
Powered-off
Disabled
0,0,0,0 CCS=0
Reset
Undefined
1,1,0,1
Wr(PR=1) Wr(PR=1)
Wr(PP=1)
Wr(Test Mode>0) Disconnected PR=0
RxDetect
1,0,0,0
Disabled Enabled
Polling U0, U2, U3,
1,1,0,0 or Resume
1,1,1,0
Test Mode
Test Mode CCS=1 Wr(PED=1) |
1,x,x,0 Port_Error
Figure 33 illustrates the top level transitions in a USB2 Protocol Root Hub state machine.
Note: The “Change” flags (CSC, PEC, POCC, PRC, PLC, and CEC) are set to ‘1’ upon the detection of
the respective condition. Refer to Table 35 for the definition of the change flags.
The initial state is Disconnected.
4.19.1.1.1 Powered-off
A write to the PORTSC register with PP set to ‘0’ or an Over-current condition shall transition from the any
state to the Powered-off state.
A write to the PORTSC register with PP set to ‘1’ shall transition from the Powered-off state to the
Disconnected state.
A write to the USB2 PORTPMSC register with Test Mode greater than ‘0’ shall transition from the
Powered-off state to the Test Mode state.
A write to the PORTSC register with PP cleared to ‘0’, or an over-current condition (OCA => ‘1’) shall
transition from the port from any state to the Powered-off state.
4.19.1.1.2 Disconnected
This is the initial state after initial xHC Aux power-up or HCRST.
A device connect detect (CCS = ‘1’) shall transition the port from the Disconnected state to the Disabled
state and set the CSC flag to ‘1’.
A disconnect detect (CCS = ‘0’) in the Disabled, Enabled, or Reset state shall transition the port to the
Disconnected state, set the CSC flag to ‘1’, and if PR or PED flags are set to ‘1’, they shall be cleared to
‘0’.
219
eXtensible Host Controller Interface Revision 1.0
4.19.1.1.3 Disabled
A write to the PORTSC register with PR set to ‘1’ shall transition the port from the Disabled state to the
Reset state.
4.19.1.1.4 Reset
When the Reset operation completes (PR = ‘0’), the port shall automatically advance to the Enabled state,
setting PED and PRC to ‘1’.
Software shall ignore the value of the Port Link State (PLS) field while in the Reset state.
4.19.1.1.6 Enabled
While in the Enabled state a write to the PORTSC register with PED set to ‘1’, or a Port_Error (refer to
section 11.8.1 of the USB2 spec for conditions that may cause a Port_Error) shall transition the port from
any Enabled substate to the Disabled state. If the transition was due to a Port_Error the PEC flag shall be
set to ‘1’.
Wr(PLS=U3 U0 Wr(PLS=U2
& LWS=1) U0 & LWS=1)
U3Entry U2Entry
1,1,1,0
U0 U0
1,1,1,0 1,1,1,0 ACK
PLC=1
RExit PLC=1 L1 Entry Reject
U3 Resume PLC=1 U2
U3 1,1,1,0 U2
U2Exit
1,1,1,0 1,1,1,0
Wr(PLS=Resume U2
& LWS=1) 1,1,1,0 Wr(PLS=U0
& LWS=1) |
Device L1
Device Wr(PLS=U0 Resume
Resume & LWS=1) Signaling
Signaling Resume
PLC=1 Resume
1,1,1,0
Wr(PR=1)
Reset
CCS=0
Disconnected
Wr(PP=0) | OCA=1
Powered-off
Figure 34 illustrates the Enabled substate transitions in a USB2 Protocol Root Hub state machine.
While in any of the Enabled substates:
• If the PORTSC register is written with PP = ‘0’ or and over-current condition is detected (OCA = ‘1’)
then the respective substate shall exit to the Powered-off state.
220
eXtensible Host Controller Interface Revision 1.0
• If a Disconnect condition is detected (CCS = ‘0’) then the respective substate shall exit to the
Disconnected state.
• If the PORTSC register is written with PR = ‘1’ then the respective substate shall exit to the Reset
state.
4.19.1.1.7 U0
4.19.1.1.8 U2Entry
In this state the xHC shall attempt to transition the device to the L1 suspend state by issuing an LPM
transaction to the device:
• If the device responds with an ACK handshake (the L1 suspend attempt was successful), the port shall
set the L1S field to Success (‘1’) and transition to the U2 substate, and the device shall enter the L1
standby state.
• If the device responds with a NYET handshake (the L1 suspend attempt was rejected by the device),
the port shall set the L1S field to Not Yet (‘2’) and transition to the U0 substate and set the PLC flag to
‘1’ (PLC Condition: L1 Entry Reject), and the device shall remain in the L0 state. Note that in this case
there is no PLS transition, it shall remain in the U0 state.
• If the device responds with a STALL handshake (the L1 suspend attempt was not recognized by the
device), the port shall set the L1S field to Not Supported (‘3’), transition to the U0 substate, and set the
PLC flag to ‘1’ (PLC Condition: L1 Entry Reject).
• If a Timeout occurs or a Transaction Error is detected (the L1 suspend attempt was unsuccessful), the
port shall set the L1S field to Timeout/Error (‘4’), transition to the U0 substate, and set the PLC flag to
‘1’ (PLC Condition: L1 Entry Reject).
Note that when the STALL, Timeout, or transaction Error cases above occur software may inspect the
USB2 PORTPMSC register L1S field to determine the specific cause of the transition. Refer to section
4.23.5.1.1 for more information on the L1S result values.
Refer to sections 4.15.2 and 4.23.5 for more information on USB2 LPM operation.
4.19.1.1.9 U2
The port is in the L1Suspended state and shall remain in the U2 substate until a Host or Device Initiated
Resume occurs.
Host Initiated L1 Resume - A write to the PORTSC register with the PLS field set to U0 and LWS set to ‘1’
shall cause the port to initiate resume signaling to the device and transition to the U2Exit substate.
Device Initiated L1 Resume - If Resume Signaling is generated by the device, then the port shall
transition to the U2Exit substate.
4.19.1.1.10 U2Exit
When the resume signaling is complete and the device has entered the L0 state, the port shall transition to
the U0 substate and set the PLC flag to ‘1’ (PLC Condition: USB2 L1 Resume complete).
221
eXtensible Host Controller Interface Revision 1.0
4.19.1.1.11 U3Entry
In this state the xHC shall suspend the device. When the device has been suspended, the port shall
transition to the U3 substate.
4.19.1.1.12 U3
The port is suspended and shall remain in the U3 state until a Host or Device Initiated Resume occurs.
Host Initiated Resume - A write to the PORTSC register with the PLS field set to Resume and LWS set to
‘1’ shall cause the xHC to initiate resume signaling to the device and transition to the Resume substate. To
meet the requirements of the USB2 spec (TRSTRCY) software shall wait at least 10 ms. before attempting a
Host Initiated Resume after entering the U3 state.
Device Initiated Resume - If Resume Signaling is generated by the device, the port shall transition to the
Resume substate, initiate resume signaling to the device, and set the PLC flag to ‘1’ (PLC Condition:
Wakeup signaling from a device).
4.19.1.1.13 Resume
A write to the PORTSC register with the PLS field set to U0 and LWS set to ‘1’ shall cause the port to
transition to the RExit substate and complete the resume signaling.
Note: Software shall time the duration of the Resume state. Software shall remain in the Resume state
long enough to ensure the reset sequence, as specified in the USB2 spec, completes successfully.
4.19.1.1.14 RExit
When the resume signaling is complete and the device has entered the L0 state, the port shall transition to
the U0 substate and set the PLC flag to ‘1’ (PLC Condition: USB2 Device Resume complete).
222
eXtensible Host Controller Interface Revision 1.0
Disabled
HCRST |
Disabled Wr(PED=1)
(PLS !=RxDetect &
1,0,0,0
Wr(PR=1 | WPR=1))
HCRST=1 | SError
Reset Success
Wr(PLS=RxDetect
Undefined
& LWS=1) Enabled
Wr(PP=0) | OCA=1 1,1,0,1
U0, U1, U2,
Unsuccessful U3, Resume,
Downstream or Recovery
Config Successful 1,1,1,0 Error
Disconnect Detect Inactive
Link Timeout 1,0,0,0
Disconnected
RxDetect
Polling
1,0,0,0
Polling, U0,
RxDetect, or
Compliance
Disabled
Compliance
Connect 1,0,0,0
1,0,0,0
HCRST=1 | Detect
Wr(PP=1) Exit
Loopback Loopback bit 1st LFPS
OCA=1 Test Mode set in TS2 Timeout
1,0,0,0 ordered sets
Powered-
off Wr(PP=0)
Disabled
0,0,0,0
4.19.1.2.1 Disabled
A write to the PORTSC register with the PED field set to ‘1’ shall transition the port, from any state except
Powered-off, to the Disabled state.
A write to the PORTSC register with the PLS field set to RxDetect and LWS set to ‘1’ shall transition the
port to the Disconnected state.
A write to the USBCMD register with the HCRST flag set to ‘1’ shall transition the port to the Disconnected
state.
A write to the PORTSC register with PP cleared to ‘0’ or an over-current condition (OCA = ‘1’) shall
transition the port to the Powered-off state.
4.19.1.2.2 Powered-off
A write to the PORTSC register with PP cleared to ‘0’ shall transition from the port from any state to the
Powered-off state.
223
eXtensible Host Controller Interface Revision 1.0
An over-current condition (OCA = ‘1’) shall transition from the port from any state to the Powered-off state,
and if the CCS, PR or PED flags are set to ‘1’, they shall be cleared to ‘0’.
A write to the PORTSC register with PP set to ‘1’ shall transition the port to the Disconnected state.
A write to the USBCMD register with the HCRST flag set to ‘1’ shall transition the port to the Disconnected
state.
4.19.1.2.3 Disconnected
A device Connect Detect28 shall transition the port to the Polling state.
A Disconnect Detect29 in the any state, except Powered-off or Disabled shall transition the port to the
Disconnected state.
4.19.1.2.4 Polling
While in the Polling state the port may transition between the Training, CfgExcg, and DbC substates.
CfgExcg Disabled
Disconnected Polling U0
Complete 1,0,0,0 Powered-off
Config
Training Error
Polling Error
CEC=1
1,0,0,0 Downstream
Config
Successful
Enabled
Loopback bit
set in TS2
ordered sets
Loopback
1st LFPS
Timeout
Compliance
Figure 36 illustrates the Polling substate transitions in a USB3 Protocol Root Hub state machine.
Note: The dashed arrows represent optional state transitions that may occur if the Debug Capability is
supported. Refer to section 4.19.1.2.4.3 for more information.
224
eXtensible Host Controller Interface Revision 1.0
4.19.1.2.4.1 Training
If Training fails due to a Link Timeout30 or a Disconnect Detect29, the substate shall exit to the
Disconnected state.
The detection of the first LFPS Timeout shall transition the substate to the Compliance state.
The reception of a TS2 Ordered Set with the Loopback bit set shall transition the substate to the
Loopback state.
4.19.1.2.4.2 CfgExcg
In this state, the Port Capabilities and Port Configuration LMPs are exchanged as described in sections
8.4.5 and 8.4.6 of the USB3 spec.
If the port is successfully configured as a downstream facing port (Downstream Config Successful), the
substate shall exit to the Enabled state.
If the port is successfully configured as an upstream facing port (Upstream Config Successful), the
substate shall transition to the DbC substate. Note that this transition shall never occur if the xHC does not
support the xHCI Debug Capability.
Note: If the xHCI Debug Capability is enabled and a Debug Host has not been detected yet, the
Direction field of the Port Capabilities LMP shall be set to ‘3’ for all ports, indicating that the Root
Hub port is both upstream and downstream capable. Detection of a downstream facing port
attached to a Root Hub port implies that a Debug Host is attached. Once a port is mapped to the
Debug Capability, all remaining ports shall assert ‘1’ (i.e. the port shall only be configured as
downstream) in the Direction field of subsequent Port Capabilities LMPs. Refer to section 7.6 for
more information on the operation of the xHCI Debug Capability.
If the port fails to successfully configure (Config Error), the substate shall set the CEC flag to ‘1’ and exit to
the Error state.
4.19.1.2.4.3 DbC
In this substate, the port is mapped to the Debug Capability and the DbgCap substates shall emulate a port
that never detects an attach
Note: This substate is optional, and shall only exist for xHC implementations that support the xHCI
Debug Capability.
While in the DbC (Debug Capability) substate the port may transition between the DbC Disconnected,
DbC Disabled, and the DbC Powered-off substates.
Note: Section 7.5 of the USB3 spec describes the behavior of the LTSSM for upstream and downstream
facing ports. The default behavior of an xHC Root Hub is that of a downstream facing port.
However, while in the DbC state the LTSSM of a Root Hub port is mapped to the Debug Capability
and shall behave as an upstream facing port.
30. Refer to section 7.5.4 in the USB3 spec for the LTSSM conditions that shall transition a downstream port from the
Polling to the Rx.Detect state. Note, the LTSSM Rx.Detect state maps to the USB3 Port state machine Discon-
nected state.
225
eXtensible Host Controller Interface Revision 1.0
DbC
Powered-off
Disabled
Wr(PP=0) 0,0,0,0
DbC
Wr(PP=1) Wr(PP=0)
Disabled
Disabled
1,0,0,0 Wr(PED=1)
DbC
Disconnected
RxDetect
1,0,0,0
Wr(PLS=RxDetect
& LWS=1)
Wr(DCE=0) |
Disconnect Detect Disconnected
CfgExcg
Figure 37 illustrates the DbC substate transitions in a USB3 Protocol Root Hub state machine.
Entry to the DbC substate always transitions to the DbC Disconnected substate.
A write to the PORTSC register with the PED field set to ‘1’ shall transition the port to the DbC Disabled
substate.
A write to the PORTSC register with the PP field set to ‘0’ shall transition the port to the DbC Powered-off
substate.
A write to the DCCTRL register with the DCE field set to ‘0’ or a Disconnect Detect29, shall transition the
port to the Disconnected state.
A write to the PORTSC register with the PLS field set to RxDetect and LWS set to ‘1’ shall transition the
port to the DbC Disconnected substate.
A write to the PORTSC register with the PP field set to ‘0’ shall transition the port to the DbC Powered-off
substate.
A write to the DCCTRL register with the DCE field set to ‘0’ or a Disconnect Detect29, shall transition the
port to the Disabled state.
A write to the PORTSC register with the PP field set to ‘1’ shall transition the port to the DbC
Disconnected substate.
A write to the DCCTRL register with the DCE field set to ‘0’ or a Disconnect Detect29, shall transition the
port to the Disconnected state.
4.19.1.2.5 Reset
A write to the PORTSC register with PR or WPR set to ‘1’ shall transition the port from any state except the
Powered-off, Disabled, or Disconnected states, to the Reset state.
226
eXtensible Host Controller Interface Revision 1.0
A write to the USBCMD register with HCRST set to ‘1’, shall transition the port from any state except the
Powered-off or Disabled states, to the Reset state.
If the Reset operation completes successfully, the port shall transition to the Enabled state, clearing PR to
‘0’ and setting PED to ‘1’.
If the Reset operation does not complete successfully, the port shall transition to the Disconnected state.
Note: If a port has transitioned to this state due to the assertion of HCRST by software, then a Hot or
Warm Reset shall be issued by the port when its LTSSM enters to the Rx.Detect state. Depending
on the link state when HCRST is asserted, an xHC implementation may choose to issue a Hot
Reset rather than a Warm Reset to accelerate the USB recovery process.
Note: PRC shall be set upon exiting the Reset state. However the WRC flag shall also be set, if software
set the PR flag and the “Hot” Reset transitioned to a Warm Reset or if software set the WPR flag
initially to enter the Reset state. Refer to section 10.3.1.6 in the USB3 spec.
4.19.1.2.6 Error
The port shall transition to the Error state if a serious error condition (SError) occurs while attempting to
operate the link, i.e. the LTSSM transitions to the SS.Inactive state, an unsuccessful LTSSM
Loopback.Exit, etc. Refer to section 10.3.1.4 “DSPORT.ERROR” of the USB3 spec for the SError
conditions that shall cause a Root Hub port to transition to the SError state.
The transition to the Error state shall set the PLC flag to ‘1’ (PLC Condition: Error).
4.19.1.2.7 Compliance
4.19.1.2.8 Loopback
A successful Exit (LFPS handshake in the LTSSM Loopback.Exit state) or a Disconnect Detect29 shall
transition the port to the Disconnected state.
Refer to section 4.19.1.2.2 for the conditions that shall transition the port to the Powered-off state.
A Timeout in the LTSSM Loopback.Exit state shall transition the port to the Error state.
Note: Refer to note in section 4.19.1.2.14 for additional information on transitions to the Loopback state.
4.19.1.2.9 Enabled
While in the Enabled state a the port may transition between the U0, U1’, U2’, U3’ and Recovery
substates.
227
eXtensible Host Controller Interface Revision 1.0
Error Error
LGO_U1 |
U1 Timeout U0
U0
1,1,1,0
U3'
U1' Wr(PLS=U3
U0, U3,
U0 or U1 & LWS=1)
Resume or
1,1,1,0 Error Recovery
LGO_U2 | 1,1,1,0
U2 Timeout
Recovery
Recovery
1,1,1,0
U2'
U0 or U2
1,1,1,0
U2 Timeout
Wr(PR=1 | WPR=1)
Reset
CCS=0
Powered-off
Figure 38 illustrates the Enabled substate transitions in a USB3 Protocol Root Hub state machine.
While in any Enabled substates:
• If the PORTSC register is written with PP = ‘0’ or and over-current condition is detected (OCA = ‘1’)
then the respective substate shall exit to the Powered-off state.
• If a Disconnect condition is detected (CCS = ‘0’) then the respective substate shall exit to the
Disconnected state.
• If the PORTSC register is written with PR = ‘1’ or WPR = ‘1’ then the respective substate shall exit to
the Reset state.
Refer to sections 4.19.1.2.10, 4.19.1.2.11, 4.19.1.2.12, 4.19.1.2.13, and 4.19.1.2.14 for more information
on the Enabled substates.
Note: Figure 38 does not illustrate a transition from the Recovery or U3’ states to the Loopback state,
however they may occur. Refer to note in section 4.19.1.2.14 for additional information on
transitions to the Loopback state.
4.19.1.2.10 U0
228
eXtensible Host Controller Interface Revision 1.0
4.19.1.2.11 U1’
U1_Rx
U0 LXU
1,1,1,0
LGO_U1 U0
LAU Wr(PLS=U0
& LWS=1)
LFPS Handshake
U1
U0 & U1 Recovery
1,1,1,0
Link
Activity
LAU
U1 Timeout U2 Timeout LXU
LGO_U1
U1_Tx U2'
U0
1,1,1,0
Figure 39 illustrates the U1’ substate transitions in a USB3 Protocol Root Hub state machine.
If the transition to the U1’ substate was due to an LGO_U1 received from the device, the xHC shall
transition to the U1_Rx substate.
If the transition to the U1 substate was due to a U1 Timeout, the xHC shall transition to the U1_Tx
substate.
Refer to sections 4.19.1.2.11.1, 4.19.1.2.11.2, and 4.19.1.2.11.3 for more information on the U1’ substates.
4.19.1.2.11.1 U1_Rx
xHC implementation specific power management policies determined whether to accept or reject the
LGO_U1 request. If the request is accepted the xHC shall transmit an LAU and transition to the U1
substate. If the request is rejected the xHC shall transmit an LXU and transition to the U0 substate.
4.19.1.2.11.2 U1_Tx
Device implementation specific power management policies determined whether the LGO_U1 request
from the host shall be accepted or rejected. If the request is accepted the xHC shall receive an LAU and
transition to the U1 substate. If the request is rejected the xHC shall receive an LXU and transition to the
U0 substate.
4.19.1.2.11.3 U1
229
eXtensible Host Controller Interface Revision 1.0
4.19.1.2.12 U2’
U2_Rx
U0 LXU
1,1,1,0
U0
LGO_U2
LAU Wr(PLS=U0
& LWS=1)
U1' LFPS Handshake
U2
U2 Recovery
U0 1,1,1,0
&
Link
Activity
LAU
LXU
U2 Timeout
LGO_U2 U2_Tx
U0
1,1,1,0
Figure 40 illustrates the U2’ substate transitions in a USB3 Protocol Root Hub state machine.
If the transition to the U2’ substate was due to an LGO_U2 received from the device, the xHC shall
transition to the U2_Rx substate.
If the transition to the U2’ substate was due to a U2 Timeout, the xHC shall transition to the U2_Tx
substate.
If the transition to the U2’ substate was from the U1’ state (due to an L2 Timeout), the xHC shall transition
to the U2 substate.
Refer to sections 4.19.1.2.12.1, 4.19.1.2.12.2, and 4.19.1.2.12.3 for more information on the U2’
substates.
4.19.1.2.12.1 U2_Rx
xHC implementation specific power management policies determined whether to accept or reject the
LGO_U2 request. If the request is accepted the xHC shall transmit an LAU and transition to the U2
substate. If the request is rejected the xHC shall transmit an LXU and transition to the U0 substate.
4.19.1.2.12.2 U2_Tx
Device implementation specific power management policies determined whether the LGO_U2 request
from the host shall be accepted or rejected. If the request is accepted the xHC shall receive an LAU and
transition to the U2 substate. If the request is rejected the xHC shall receive an LXU and transition to the
U0 substate.
4.19.1.2.12.3 U2
230
eXtensible Host Controller Interface Revision 1.0
4.19.1.2.13 U3’
RExit
U0 Wr(PLS=U3 Recovery
& LWS=1) Wr(PLS=U0 1,1,1,0
LGO_U3 & LWS=1)
U3Entry PLC=1
Resume
U0 Resume U0
1,1,1,0 1,1,1,0
PLC=1
LAU
Link
Activity
U3 PLC=1 U3Exit
U3 Recovery
1,1,1,0 1,1,1,0
Wr(PLS=U0
& LWS=1)
Figure 41 illustrates the U3’ substate transitions in a USB3 Protocol Root Hub state machine.
Upon entry into the U3’ substate machine transitions to the U3Entry substate.
Refer to sections 4.19.1.2.13.1, 4.19.1.2.13.2, 4.19.1.2.13.3, and 4.19.1.2.13.4 for more information on the
U3 substates.
Note: Figure 41 does not illustrate a transition from the RExit or U3Exit states to the Loopback state,
however it may occur. Refer to note in section 4.19.1.2.14 for additional information on transitions
to the Loopback state.
4.19.1.2.13.1 U3Entry
The port shall remain in this substate until a LAU is received from the device, then transition to the U3
substate.
4.19.1.2.13.2 U3
The port is suspended and shall remain in the U3 substate until a Host or Device Initiated Resume occurs.
Host Initiated Resume - A write to the PORTSC register with the PLS field set to U0 and LWS set to ‘1’
shall cause the xHC to initiate Link Activity (LFPS Handshake) with the device and transition to the U3Exit
substate.
Device Initiated Resume - If Link Activity (LFPS Handshake) is initiated by the device, the port shall not
respond, exit the U3 substate machine, transition to the Resume substate, and set the PLC flag to ‘1’ (PLC
Condition: Wakeup signaling from a device).
4.19.1.2.13.3 Resume
A write to the PORTSC register with the PLS field set to U0 and LWS set to ‘1’ shall cause the xHC to
initiate Link Activity (LFPS Handshake) with the device and transition to the RExit substate.
4.19.1.2.13.4 RExit
The LTSSM is in the Recovery state. Refer to section 7.5.10 in the USB3 spec.
When the handshake is successful; the port shall exit the U3’ substate machine, transition to the U0
substate, and set PLC flag to ‘1’ (PLC Condition: USB3 Device Resume completion). Note that a USB
device is not allowed to reject a resume request from the host.
231
eXtensible Host Controller Interface Revision 1.0
If a TS2 Ordered Set is received with the Loopback bit set, the port shall transition to the Loopback state.
If a TS2 Ordered Set is received with the Reset bit set, the port shall transition to the Reset state.
Note: Refer to note in section 4.19.1.2.14 for additional information on transitions to the Loopback state.
4.19.1.2.13.5 U3Exit
The LTSSM is in the Recovery state. Refer to section 7.5.10 in the USB3 spec.
When the handshake is successful; the port shall exit the U3’ substate machine, transition to the U0
substate, and set PLC flag to ‘1’ (PLC Condition: USB3 Software Resume complete). Note that a USB
device is not allowed to reject a resume request from the host.
If a TS2 Ordered Set is received with the Loopback bit set, the port shall transition to the Loopback state.
If a TS2 Ordered Set is received with the Reset bit set, the port shall transition to the Reset state.
Note: Refer to note in section 4.19.1.2.14 for additional information on transitions to the Loopback state.
4.19.1.2.14 Recovery
The LTSSM is in the Recovery state. Refer to section 7.5.10 in the USB3 spec.
If the recovery completes successfully; the port shall transition to the U0 substate.
If the recovery does not complete successfully; the port shall transition to the Error state.
If a TS2 Ordered Set is received with the Loopback bit set, the port shall transition to the Loopback state.
Note: The xHC USB3 Root Hub Port state machine figures do not illustrate a transition from the
Enabled, Recovery, RExit, or U3Exit to Loopback state transition, however they may occur.
The LTSSM shall transition from the Recovery.Idle state to the Loopback state if a TS2 Ordered
Set is received with the Loopback bit set. A xHC Root Hub port is a Loopback Slave. To perform
loopback tests a specialized Test Device is required. The Test Device, which acts as Loopback
Master, may transition a port to the Enabled state before transitioning the port to Loopback state.
However, typically a Loopback Master will only assert the Loopback bit in a TS2 Ordered Set when
it is initially connected, asserting an LTSSM Polling.Idle to Loopback transition.
232
eXtensible Host Controller Interface Revision 1.0
The Port Enabled/Disabled Change (PEC) shall be asserted only by a USB2 protocol port when the Port
Enabled/Disabled (PED) flag transitions to Disabled due to a Port_Error, i.e. a ‘1’ to ‘0’ transition of PED.
The Warm Port Reset Change (WRC) bit is set only when a warm reset completes, i.e. a ‘1’ to ‘0’ transition
of WPR.
The Over-current Change (OCC) bit is set when an over-current condition is detected, i.e. a ‘0’ to ‘1’
transition of OCA.
The Port Reset Change (PRC) bit is set when any reset (hot or warm) completes, i.e. a ‘1’ to ‘0’ transition
of PR or WPR.
Note: The definition of PRC states that it is set “when any reset processing (Warm or Hot) on this port is
complete”. If an over-current condition (OCA => ‘1’) occurs while a port is in the Reset state, then
reset processing is aborted and the PR flag shall be cleared. Hardware may or may not set the
PRC and WRC flags under these conditions. If the OCC flag is set, then the PRC and WRC flags
should be ignored by software.
The Port Link State Change (PLC) bit is asserted for specific Port Link State (PLS) field transitions. Refer
to section 4.19.1 for the specific Root Hub port state transitions that will assert PLC.
The Port Config Error Change (CEC) bit is set only when a Port Configuration error is detected. Note that
there is no corresponding port config status or error flag in the PORTSC register, so the assertion of CEC
is the only means of flagging this error condition.
The Port Status Change Event reports port status changes on a per-port basis. The Port ID field of the Port
Status Change Event TRB (shown in Figure 86), indicates which port has experienced a status change.
System software shall acknowledge status change(s) by clearing the respective PORTSC status change
bit(s). The acknowledgment clears the change state for that port so future status changes may be
reported.
Note: There are no coherency guarantees between a software read of PORTSC register and
corresponding Events reflecting PORTSC changes, i.e., If software reads the PORTSC and sees a
change bit set, there is no guarantee that the corresponding event has been written into the Event ring.
Figure 42 shows an example creation mechanism for Port Status Change Event and PME# generation.
A ‘0’ to ‘1’ transition of the Port Status Change Event Generation (PSCEG) signal shall cause a Port
Status Change Event to be generated. PSCEG is an internal xHC variable, not directly exposed to
software.
Note: The generation of a Port Status Change Event is triggered by the assertion of the PSCEG signal.
Due to internal xHC scheduling and system delays, there will be a lag between a change bit being
set and the Port Status Change Event that it generated being written to the Event Ring. If SW
reads the PORTSC and sees a change bit set, there is no guarantee that the corresponding Port
Status Change Event has already been written into the Event Ring.
Note: There are no ordering requirements between Transfer Events and Port Status Change Events. e.g.
a due to a disconnect, transfer events for the disconnected device may be placed on an Event
Ring after the Port Status Change Event generated by the port.
The change bits (CSC. PEC, etc.) of each port are ORed together and gated by the HCHalted (HCH) flag
to form the Port Status Change Event Generation signal. A port shall generate a Port Status Change Event
when there is ‘0’ to ‘1’ transition of the PSCEG signal.
The PME wake events detected by each port (PEx) are ORed together and gated by the PCI PM
PMSCR.PME_En flag. Refer to Appendix A.1.1 for more information. PME# shall be asserted when there
is a ‘0’ to ‘1’ transition of the PME# Generation signal.
233
eXtensible Host Controller Interface Revision 1.0
Figure 42: Example Port Change Bit Port Status Change Event Generation
PORTSC 1 Per Port Logic Logic for all Ports
HCHalted
Port Status Change Event
CSC Generation (PSCEG)
PEC
Change WRC
Detect OCC
Logic PRC
PLC
CEC
WOE
Connect Detect
PE1
WCE
... PME#
WDE Generation
PLS=Resume PEn
PMCSR.PME_En
Note: A Port Status Change Event may be the result of multiple status change bits being set.
Note: Port Status Change Events for a port are blocked until all status change bits are cleared (‘0’), i.e.
PSCEG = ‘0’.
Note: Under some conditions the xHC may not be capable of generating Port Status Change Events, i.e.
if HCHalted (HCH) = ‘1’ or the Event Ring is full. If the HCHalted (HCH) = ‘0’ and the Event Ring is
not full, the xHC shall generate Port Status Change Events.
Note: For USB2 ports the Connect Detect signal is identical to CCS.
For USB3 ports the Connect Detect signal is asserted when SuperSpeed far-end receiver
terminations are detected, and negated if there is a LTSSM transition from the any state to the
Rx.Detect state due to Removal(DS Port Only). Refer to section 7.5 in the USB3 spec.
234
eXtensible Host Controller Interface Revision 1.0
When software parses the Port Status Change Event, it can evaluate the Port ID field to determine the
Root Hub port that was the source of the change event. And examine the port’s PORTSC register to
determine that the event was generated by a Connect Status Change (CSC = ‘1’) and that the change was
an Attach (CCS = ‘1’).
For a USB2 Protocol port, “device presence” is indicated by the PORTSC PLS field transitioning from the
RxDetect to the Polling state. Software shall reset the port to transition it to the U0 state.
For a USB3 Protocol port, “device presence” is indicated by the PORTSC PLS field transitioning from the
Polling to the U0 state.
• The port’s receiver and transmitter are disabled, and its terminations are removed31.
When PP transitions from ‘0’ to ‘1’:
• If device is not connected, then a USB2 or USB3 protocol port shall transition to the Disconnected
state.
• If a device is connected:
• A USB2 protocol port shall transition to the Disabled state.
• A USB3 protocol port shall transition to the Disconnected state, detect the device and
immediately transition to the Polling state.
• If training is successful, the port sets the CSC flag to ‘1’ and transitions to the Enabled state.
• If training is not successful32, the port transitions to the Disconnected state.
• If a timeout is detected on the first LFPS handshake, the port transitions to the Compliance
31. Removing the receiver terminations, forces a SS device to the USPORT.Powered-off state, whether Vbus is
asserted or not.
32. Refer to section 7.5.4 in the USB3 spec for the LTSSM conditions that shall transition a downstream port from the
Polling to the Rx.Detect state. Note, the LTSSM Rx.Detect state maps to the USB3 Port State Machine Discon-
nected state.
235
eXtensible Host Controller Interface Revision 1.0
33. The value defined by the U1 Timeout field. Refer to Table 37 for U1 Timeout values.
34. The value defined by the U2 Timeout field. Refer to Table 37 for U2 Timeout values.
236
eXtensible Host Controller Interface Revision 1.0
• If the U2 Timeout = FFh, the port shall be disabled from initiating U2 entry but shall accept U2 entry
requests by the link partner unless the xHC has one or more packets/link commands to transmit on the
port.
• If the U2 Timeout < FFh and the U2 PM Timer reaches Y, the port’s link shall initiate a direct transition
from U0 to U2. In this case the delay defined by the U2 Timeout field represents an amount of inactive
time in U0.
U1 Timeout =X > 0, U2 Timeout = Y > 0
• The PM Timers shall be reset when this state is entered and is active.
• The port’s link shall accept U1 or U2 entry requests by its link partner unless the xHC has one or more
packets/link commands to transmit on the port.
• If the U1 Timeout = FFh, the port shall be disabled from initiating U1 entry but shall accept U1 entry
requests by the link partner unless the xHC has one or more packets/link commands to transmit on the
port.
• If the U1 Timeout < FFh and the U1 PM Timer reaches X the port’s link shall initiate a transition to U1.
• If the U2 Timeout < FFh and the U2 PM Timer reaches Y the port’s link shall initiate a direct transition
from U1 to U2. In this case the delay defined by the U2 Timeout field represents an amount of time in
U1.
• If the U2 Timeout = FFh, the port shall be disabled from initiating U2 entry but shall accept U2 entry
requests by the link partner unless the xHC has one or more packets/link commands to transmit on the
port.
A port transitions to one of the Enabled U0 states (depending on the U1 Timeout and U2 Timeout values)
in any of the following situations:
• From any state if software writes the PORTSC register and sets the PLS field to U0 (‘0’).
• From U1 if the link partner successfully initiates a transition to U0.
• From U2 if the link partner successfully initiates a transition to U0.
• From U1 if the xHC successfully initiates a transition to U0 after receiving a packet routed to the port.
• From U2 if the xHC successfully initiates a transition to U0 after receiving a packet routed to the port
• From an attempt to transition from the U0 to the U1 state if the downstream port’s link partner rejects
the transition attempt
• From an attempt to transition from the U0 to the U2 state if the downstream port’s link partner rejects
the transition attempt
• From U3 if software writes the PORTSC register and sets the PLS field to U3 (‘3’) and the Root Hub
port received wakeup signaling while it was in U3.
237
eXtensible Host Controller Interface Revision 1.0
If the bus reset sequence completes successfully, the xHC shall update the PORTSC register:
• Set the PLS field to U0 (‘0’).
• Clear the PR bit (‘0’).
• Set PED to the enabled state (‘1’).
• Set the PRC bit (‘1’).
• For a USB3 protocol port, if a Hot Reset transitioned to a Warm Reset, set the WRC bit (‘1’).
• Set Port Speed field to the speed of the newly attached device.
If the bus reset sequence does NOT complete successfully, the xHC shall update the PORTSC register:
• Set the PLS field to RxDetect (‘5’).
• Clear the PR bit (‘0’).
• Set the PRC bit (‘1’).
• For a USB3 protocol port, if a Hot Reset transitioned to a Warm Reset, set the WRC bit (‘1’).
• Set the Port Speed field to Undefined Speed (‘0’).
• Clear the CCS bit (‘0’).
If setting PRC results in a ‘0’ to ‘1’ transition of PSCEG, then generate a Port Status Change Event with the
following field values.
• TRB Type = Port Status Change Event.
• Port ID = Port Number of the Root Hub Port that detected the Reset change transition.
• Completion Code = Success.
• Cycle bit = Current Event Ring Producer Cycle State.
Note: Only a USB3 protocol port may fail the bus reset sequence. USB2 protocol ports never fail the bus
reset sequence.
Note: When PR transitions from ‘1’ to ‘0’, the USB device is in the “Default state” (i.e. Responding to
USB Device Address 0). System software should immediately transition the device to the Address
state (with an Address Device Command) or disable the port, to allow the enumeration of other
newly attached USB devices.
Note: Speed detection is performed by the port hardware during the bus reset sequence, hence the Port
Speed field of the PORTSC register shall not be considered valid by software until after the PR bit
transitions from a ‘1’ to a ‘0’.
Note: A “Successful Reset” is determined by the xHC hardware for the attached device.
238
eXtensible Host Controller Interface Revision 1.0
Note: The PORTSC WPR and WRC bits only apply to USB3 protocol ports. The bits shall be RsvdZ for
USB2 protocol ports.
35. Refer to section 10.3.1.6 of the USB3 spec, “Note: If the port initiates a hot reset on the link and the hot reset TS1/
TS2 handshake fails a warm reset is automatically tried.”
239
eXtensible Host Controller Interface Revision 1.0
Note: xHC Root Hub ports are numbered from 1 to MaxPorts. MaxPorts is defined in the HCSPARAMS1
register (5.3.3).
Consider the example of an xHC implementation illustrated in Figure 43 that supports two protocols (USB2
and USB3) and 6 connections, where 4 connections are USB2 compatible and 2 are USB3 compatible. In
this case, two xHCI Supported Protocol Extended Capability data structures would be declared. If the
USB2 xHCI Supported Protocol Extended Capability data structure defined the Compatible Port Offset
equal to ‘1’ and the Compatible Port Count equal to ‘4’, and the USB3 xHCI Supported Protocol Extended
Capability data structure defined the Compatible Port Offset equal to ‘5’ and the Compatible Port Count
equal to ‘2’, then Root Hub Ports 1 through 4 would reflect the attachment of USB2 devices, and Root Hub
Ports 5 and 6 would reflect the attachment of USB3 devices.
Connections
Physical USB
1 2 3 4 Connectors
LS/FS/HS
SS
USB Cables
IMPLEMENTATION NOTE
Port Power
Implementations shall OR together the output of the PORTSC register Port Power pins for Root Hub Ports
that map to the same Physical USB Connector. Refer to section 10.10 in the USB3 spec for more
information on hub port power control.
In Figure 43, asserting the Port Power flag in Root Hub Port 3 or 5 shall assert Vbus to Physical USB
Connector 3, asserting the Port Power flag in Root Hub Port 4 or 6 shall assert Vbus to Physical USB
Connector 4, etc.
240
eXtensible Host Controller Interface Revision 1.0
• The Core Power Well (4.23.1) is off (i.e. D3cold state), and
• The LTSSM is not in the U3 or Disabled state.
Note that CAS is only asserted under these circumstances. It is not a general purpose indicator that a
USB3 device is attached. Also, CAS does not apply to USB2 protocol ports and shall always be ‘0’.
A transition of CAS shall assert Connect Status Change (CSC).
Before software places the xHC into the D3 state it should perform the following operations:
• Halt any device activity.
• For each USB3 device that it wants to be awakened by:
• Issue a SetFeature(FUNCTION_SUSPEND, Function Remote Wake Enable) request.
• For all USB3 devices:
• Transition their Root Hub ports to the Enabled:U3 state (suspend).
• Set the PORTSC Wake On Disconnect Enable (WDE) flag, if wake on disconnect is desired.
• For all ports in the Disconnected state:
• Set the PORTSC Wake On Connect Enable (WCE) flag, if wake on connect is desired.
• For all ports:
• Set the PORTSC Wake On Over-current Enable (WOE) flag, if wake on over-current is desired.
The state of any port in the Disconnected, Powered-off, or Disabled state is not changed.
This approach allows wake enabled devices to wake up the system, provides suspend current to all other
devices, and enables PME# to be asserted if a disconnect, connect, or overcurrent condition is detected.
When software is awaked by a PME it should:
• Turn on the Core Power Well to transition the xHC from the D3cold to the D0 state.
• Restore the Scratchpad, and all xHC register values and memory data structures that were saved
before the xHC was placed in the D3cold state.
• Set the xHC running (R/S = ‘1’).
• Follow the recommendations in section 4.15.2.2 for resuming any Root Hub ports that it had previously
suspended.
• Check all remaining xHC Root Hub ports for CAS = ‘1’ and issue a Warm Port Reset (WPR) to any port
if it is asserted.
The assertion of WPR clears CAS.
Note: The assertion of CCS may also clear CAS if, after turning on the Core Power Well, the LTSSM of a
port is able to successfully transition to the U0 state.
241
eXtensible Host Controller Interface Revision 1.0
System software shall allocate the Scratchpad Buffer(s) before placing the xHC in to Run mode (Run/Stop
(R/S) = ‘1’).
The Scratchpad Buffer Array contains pointers to the Scratchpad Buffers. Entry 0 of the Device Context
Base Address Array points to the Scratchpad Buffer Array. The Scratchpad Buffer Array data structure is
described in section 6.6.
Features of xHC Scratchpad Allocation:
• The xHC may request multiple Scratchpad Buffers.
• When accessing a Scratchpad Buffer the xHC shall not access system memory addresses outside of
the PAGESIZE memory block allocated by system software.
• System software shall not read or write a Scratchpad buffer. System software writes to the Scratchpad
buffer memory may result in undefined xHC operation.
• The content of the Scratchpad Buffers shall remain intact across system power events including
D3.cold if SPR = ‘1’. Refer to the SPR definition in Table 21.
The following operations take place to allocate Scratchpad Buffers to the xHC:
1) Software examines the Max Scratchpad Buffers field in the HCSPARAMS2 register.
2) Software allocates a Scratchpad Buffer Array with Max Scratchpad Buffers entries.
3) Software writes the base address of the Scratchpad Buffer Array to the DCBAA (Slot 0) entry.
4) For each entry in the Scratchpad Buffer Array:
a. Software allocates a PAGESIZE Scratchpad Buffer.
b. Software writes the base address of the allocated Scratchpad Buffer to associated entry in the
Scratchpad Buffer Array.
Note: If the Scratchpad Restore (SPR) field in the HSCPARAMS2 register = ‘1’, then the xHC shall use
Scratchpad Buffers to store its internal state when executing the Save State operation. For the
Restore State operation to work successfully, the content of the Scratchpad Buffers shall be intact
when exiting a power down state (D3.cold). Refer to section 4.23.2 for more information.
Note: xHC references to the Scratchpad Buffer Array and Scratchpad Buffers should not snoop. Refer to
section 4.18.2.2.
242
eXtensible Host Controller Interface Revision 1.0
PCI Configuration register space, to '0'. The xHC should be Halted, i.e. with the Run/Stop (R/S) bit set to
'0', and HCHalted (HCH) verified as being '1' before system software disables bus master activity by
clearing the BME bit. If the BME bit is set to '0' when the xHC is running, the xHC may treat this as a Host
Controller Error, asserting HCE (‘1’) and immediately halt (R/S = ‘0’ and HCH = ‘1’). Recovery from this
state will require an HCRST. Refer to section 4.24.1 for more information.
243
eXtensible Host Controller Interface Revision 1.0
244
eXtensible Host Controller Interface Revision 1.0
BIOS Owned1
HC BIOS Owned semaphore = 1 HC BIOS Owned semaphore = 1
Notes:
1
The BIOS is allowed to claim control of the xHCI as a result of POST (Power On System Test) or as
a result of the OS relinquishing control of the xHCI. The BIOS must never attempt to claim the xHCI
once it has relinquished control.
When power is applied to the Auxiliary power well, the BIOS Owned and OS Owned semaphores in the
USBLEGSUP go to their default values (e.g. ‘0’s). BIOS may take ownership of the xHC by setting the
BIOS Owned semaphore to a ‘1’. BIOS is only allowed to take ownership of the xHC when the OS Owned
bit is a ‘0’. BIOS then may configure the SMI events it needs including the SMI on OS Ownership Change.
The BIOS now owns the xHC, so it can configure the controller, enumerate the bus and use the devices
found as necessary.
Eventually, the operating system will load. If the operating system has support for the xHC, it will need
exclusive control over the xHC. The OS driver shall utilize the protocol defined in Figure 45 to request
ownership of the xHC before it takes ownership and uses the controller. The OS driver initiates an
ownership request by setting the OS Owned semaphore to a ‘1’. The OS waits for the BIOS Owned bit to
go to a ‘0’ before attempting to use the xHC. The time that OS shall wait for BIOS to respond to the request
for ownership should not exceed ‘1’ second. Note that there is no similar SMI-type of event defined
allowing BIOS to request ownership from the OS.
If the BIOS has set SMI on OS Ownership Enable in the USBLEGCTLSTS register to a ‘1’, it receives an
SMI when the OS Driver sets the OS Owned semaphore to a ‘1’ (above). BIOS observes that OS has
changed the value of the OS Owned bit to a ‘0’, there-by notifying BIOS that it intends to relinquish control
of the xHC.
Below are some recommended steps for software implementers to consider just prior to the transition of
xHC ownership.
1) Gracefully pause any outstanding bus activity. (e.g. allow completion of in-flight transactions,
suspend signaling, reset signaling, etc.)
2) Disable all interrupts,
3) Save all critical state from the xHC and relevant USB devices (e.g. Human Interface Device, Mass
Storage, etc.)
4) Enable “Wake” events from USB devices (e.g. Human Interface Device, Network, etc.) before
suspending platform.
245
eXtensible Host Controller Interface Revision 1.0
5) Disable all other USB root ports not enabled for wake events in step 4.
Driver Load
HC OS Owned semaphore = 11
OS Not Owned
OS Owned
(DX) HC BIOS Owned semaphore = 0
Notes:
1
Modifications to the OS Owned semaphore results in an SMI when the SMI on OS Ownership Enable
bit in the USBLEGCTLSTS is set to a one.
In the event that the OS driver unloads and/or wants to relinquish ownership of the xHC, it shall set the OS
Owned semaphore to a ‘0’. Again, if BIOS has set SMI on OS Ownership Enable in the USBLEGCTLSTS
register to a ‘1’, it receives an SMI when the OS Driver sets the OS Owned semaphore to a ‘0’. The BIOS
observes that the OS has relinquished control and can then take over control of the xHC as appropriate.
Once system software has relinquished control of the controller, it shall then request ownership as
described above.
Note that this mechanism is intended only to ensure that an exchange of ownership of the xHC can be
accomplished in a very deterministic and reliable manner.
4.22.3 Virtualization
Refer to section 8.
246
eXtensible Host Controller Interface Revision 1.0
Note: The specification and white paper references provided in this section do not represent an
exhaustive list and the reader is encouraged to refer to other specifications that may be relevant to
the designer’s specific implementation.
247
eXtensible Host Controller Interface Revision 1.0
Example system software steps for saving xHC state and powering it down are:
1) Stop all USB activity by issuing Stop Endpoint Commands for each endpoint in the Running state.
This shall cause the xHC to update the respective Endpoint or Stream Context TR Dequeue
Pointer and DCS fields.
2) Stop the controller by setting Run/Stop (R/S) = ‘0’.
3) Read the USBCMD, DNCTRL, CRCR, DCBAAP, and CONFIG Operational registers and the
IMAN, IMOD, ERSTSZ, ERSTBA, and ERDP Runtime Registers and save their state.
4) Set the Controller Save State (CSS) flag in the USBCMD register (5.4.1) and wait for the Save
State Status (SSS) flag in the USBSTS register (5.4.2) to transition to ‘0’.
5) Remove Core Well power.
Note: The DCBAA and the complete tree of data structures that it references (Device Contexts, Transfer
Rings, Stream Arrays, etc.), as well as the Command and Event Rings, and Scratchpad Buffers
shall be preserved by system software.
Example system software steps for powering up and restoring xHC state are:
1) Enable Core Well power.
2) Restore the Operational and Runtime Registers defined above with their previously saved state.
3) Set the Controller Restore State (CRS) flag in the USBCMD register (5.4.1) to ‘1’ and wait for the
Restore State Status (RSS) flag in the USBSTS register (5.4.2) to transition to ‘0’.
4) Enable the controller by setting Run/Stop (R/S) = ‘1’.
5) Software shall walk the USB topology and initialize each of the xHC PORTSC, PORTPMSC, and
PORTLI registers, and external hub ports attached to USB devices.
6) Restart each of the previously Running endpoints by ringing their doorbells.
Note: It is critical for correct xHC restore operation that all data structures referenced by xHC registers
when it is stopped are intact when it is restarted. Software shall not modify any Contexts, data
structures, or Opaque areas referenced by the xHC when it is stopped if the intent is to use the
Restore State operation to restart the xHC.
Note: After a Save or Restore State operation completes, the Save/Restore Error (SRE) flag in the
USBSTS register should be checked to ensure that the operation completed successfully.
Note: To properly restore the xHC it is critical that the registers are written (step 2) before the Restore
operation is performed (step 3). The Restore operation overwrites internal default values asserted
by a xHC reset,
The internal state of the xHC shall be valid until it enters the D3cold state. When the xHC is Stopped,
software may issue a Save State operation with the expectation of subsequently placing the xHC in the
D3cold state. If prior to setting the xHC into the D3cold state, software decides to restart the xHC, then a
Restore State operation is not required.
248
eXtensible Host Controller Interface Revision 1.0
“snapshot” of the xHC state after set of Device Slots is configured. The snapshot could then be used to
bring the xHC to the same state, without having to run through the initial command sequence. This
approach may be useful to quickly bring a set of permanently attached USB devices on a motherboard on
line, i.e. the USB topology is fixed.
If the Scratchpad Restore (SPR) flag is set in the HCSPARAMS2 register, the xHC Save and Restore State
operations use the Scratchpad Buffer space for storing the internal xHC state while it is powered down,
and it is critical that the system maintain the integrity of the Scratchpad Buffer space across power events
if the xHC is to be restored correctly. Refer to section 5.3.4 for more information.
Note: An xHC implementation is responsible for checking the saved state during a Restore State
operation. If the saved state is corrupted, the Save/Restore Error (SRE) flag in the USBSTS
register shall be set to ‘1’, the Restore operation terminated, and the Restore State Status (RSS)
flag cleared to ‘0’.
Note: The state of a Root Hub port is not covered by a Save or Restore operation. Refer to sections
5.4.8, 5.4.9, and 4.19 for more information on how xHC ports are managed during power events.
4.23.4.2 USB3
Refer to USB3 Specification.
249
eXtensible Host Controller Interface Revision 1.0
Refer to the section 11 of the USB3 spec for more information on Link Power Management.
Refer to the USB2 LPM ECR for more information on USB2 Link Power Management.
USB2 defines 3 ‘L’ link states and USB3 defines 4 “U” link states.
Encoding
Link State Description
USB2a USB3
On L0 U0 This is the normal link operational state. All packet
communication, whether for control or data transfers, occurs in
this state.
A USB2 port in L0 is either actively transmitting or receiving data
(L0-Active) or able to do so but not currently transmitting or
receiving information (L0-Idle).
Fine-grain NA U1 U1 is a low exit latency standby state. Refer to section 11.4.1.2 of
LPM the USB3 spec for more information. In this state the port is
capable exiting to the On state in less than ~10 μs.
Coarse-grain L1b U2 U1 is a low to medium range exit latency standby state. Refer to
LPM (Sleep) section 11.4.1.2 of the USB3 spec for more information. In this
state the port is capable exiting to the On state in ~1 ms.
Suspend L2 U3 This is a deep power saving state where interface (e.g., Physical
Layer) power may be removed, except as needed to perform the
various functions such as reset signaling, connect/disconnect
detection, and wakeup.
This is the formalized name for USB Suspend.
Entry in to this state is nominally triggered by a command to a hub
or root hub port to transition to suspend, at which point the port
ceases signaling to the downstream port.
This state also imposes power draw requirements (from VBUS)
on the attached device. Exit from this state is via remote wake,
resume signaling, reset signaling or disconnect.
VBUS remains on in this state.
Refer to section 11.4.1.4 of the USB3 spec for more information.
Refer to Section 7.1.7.6 in the USB2 specification.
Off L3 Not In this state, the port is not capable of performing any data
defined signaling. It corresponds to the powered-off, disconnected, and
disabled states.
VBUS is off in this state.
a. This table provides USB3 extensions to Table 1-1 in the USB2 LPM ECN.
b. The USB2 L1 state is mapped to the USB3 U2 state because both represent coarse-grain LPM modes, i.e. they take
approximately 1 ms. to enter.
The xHCI reports the current Link State in the Port Link State (PLS) field of the PORTSC register. The
interpretation of the PLS field depends on the PORTSC Port Speed field. If Port Speed reports Low-, Full-,
or High-speed, then the PLS field shall never report a U1 state.
This section applies only if a USB2 xHCI Supported Protocol Capability structure (section 7.2) is declared
(i.e. the Major Revision field = 02h).
250
eXtensible Host Controller Interface Revision 1.0
When system software is ready to transition a USB2 port from L0 to a deeper power savings state, it writes
a ‘2’ (U2) to the Port Link State (PLS) field, which results in setting the L1 Status (L1S) field to Invalid (‘0’),
and an LPM transaction on the USB2 bus. While a USB2 link is attempting to transition to the L1 state, the
PLS field shall continue to report the previous state (U0).
Note: The device responds to the LPM transaction with an ACK if it is ready to make the transition or a
NYET if it is not currently ready to make the transition, usually because it has data pending for the
host.
L1 Status (L1S) results for a LPM Transaction:
• Success - Upon receipt of an ACK, the xHC shall set the PLS field in the PORTSC register to the L1
state (U2) and the L1S field in the USB2 PORTPMSC register to Success (‘1’). The Port Link Status
Change bit is not set and no Port Status Change Event is generated.
• Not Yet - Upon receipt of a NYET, the xHC shall set the L1S field in the USB2 PORTPMSC register to
Not Yet (‘2’), set the Port Link Status Change (PLC) bit to ‘1’. If the assertion of PLC results in a ‘0’ to
‘1’ transition of PSCEG (4.19.2), a Port Status Change Event shall be generated for the port.
• Not Supported - A USB2 device shall transmit a STALL handshake if it does not support the requested
link state (Lx, refer to the bmAttributes field of the extended LPM transaction, Table 2-3 in the USB2
LPM ECR). Upon the receipt of a STALL handshake the xHC shall set the L1S field in the USB2
PORTPMSC register to Not Supported (‘3’), set the PLC flag to ‘1’. If the assertion of PLC results in a
‘0’ to ‘1’ transition of PSCEG (4.19.2), a Port Status Change Event shall be generated for the port.
• Timeout/Error - If the xHC detects a transaction error (including timeout), it shall retry the LPM
transaction up to two more times. If there are three consecutive errors then the xHC shall set the L1S
field in the USB2 PORTPMSC register to Timeout/Error (‘4’), set the PLC bit to ‘1’. If the assertion of
PLC results in a ‘0’ to ‘1’ transition of PSCEG (4.19.2), a Port Status Change Event shall be generated
for the port.
Note: The PLC flag is not set (and an event is not generated) if the port successfully enters the L1 state.
In the latter three cases above, the port asserts the PLC flag (PLC Condition: USB2 L1 Entry
Reject), however the PLS field does not change, i.e. the port’s link remains in the U0 state.
Software may examine the L1 Status (L1S) field of the PORTPMSC register when the Port Status
Change Event is received for the port to determine the problem with entering the L1 state.
This information allows software to tune its use of the L1 state, identify misbehaving device, etc. For
example, software could identify a device which consistently NAKs L1 entry but rarely moves data and
notify the end user.
The xHC shall meet the following requirements:
• If the port is enabled (PED = ‘1’) and in the L1 (PLS = ‘2’) state, the xHC shall treat an L1 request (write
of ‘2’ to PLS field) as a functional no-operation and set the L1S field in the USB2 PORTPMSC register
to Success (‘0’).
• If the device detects errors in either of the token packets or does not understand the protocol extension
transaction, no handshake shall be returned. In this case the xHC shall timeout and the L1S field in the
USB2 PORTPMSC register shall be set to Timeout/Error (‘3’). Refer to the USB2 LPM ECR for L1
timeout details.
The L1 state may be reset to the L0 state by a software request or from the device attached to the port. To
accommodate this operation, software may write a ‘0’ (U0) to the PLS field of a USB2 protocol port
attached to a Low-, Full-, or High-Speed device that supports LPM. Refer to the definition of the PLS field
in Table 35 for more information.
Note: The Remote Wake Enable (RWE) flag (Table 38) shall be used to enable or disable xHC remote
wake from L1.
251
eXtensible Host Controller Interface Revision 1.0
USB 2 ports may support hardware controlled Link Power Management, as indicated by the Hardware
LMP Capability (HLC) flag equal ‘1’ in the USB2 xHCI Supported Protocol Capability structure
(7.2.2.1.3.2). If Hardware USB2 LMP is supported, then the Hardware LMP Enable (HLE) bit in the USB2
PORTPMSC register may be used to enable or disable it.
Prior to enabling hardware controlled USB2 LMP, software shall initialize the HIRD and RWE fields of the
USB2 PORTPMSC register. Note that the hardware management mechanism may use modified HIRD and
RWE values in the LMP Transactions that it generates to a device.
While Hardware USB2 LMP (HLE = ‘1’) is enabled, software shall not modify the HIRD or RWE fields of the
USB2 PORTPMSC register, or attempt to transition the port to the U2 state, i.e. shall not write the
PORTSC register with PLS = ‘2’ and LWS = ‘1’.
252
eXtensible Host Controller Interface Revision 1.0
Note: The xHC shall complete any changes to its internal Pipe Schedules before it generates a
Command Completion Event for Evaluate Context Command that modifies Max Exit Latency.
This error only applies to SuperSpeed Isoch endpoints. A No Ping Response Error Completion Code
indicates that the xHC was unable to complete the data transfer associated with an Isoch TD within the
ESIT because it did not receive a PING_RESPONSE in time.
The xHC schedules the data transfer for a SS Isoch endpoint, and if the Slot Context Max Exit Latency
value is non-zero, it shall send a PING TP to the endpoint Max Exit Latency µs. before the scheduled data
transfer to wake up all the links in the path. If a PING_RESPONSE TP is not received by the time the data
transfer is scheduled to take place, a No Ping Response Error should be generated for the TD.
If the error occurs, the data associated with the TD in error shall be lost and the xHC shall advance to the
next TD for the next ESIT.
In response to a No Ping Response Error Completion Code software should reevaluate the value assigned
to Max Exit Latency.
Refer to section 6.2.2 for the definition of the Slot Context the Max Exit Latency field.
Refer to section C.2 in the USB3 spec for U1 and U2 Exit Latency calculation examples.
The Max Exit Latency Too Large Error may be generated by an Evaluate Context Command and informs
software that the specified Max Exit Latency value would not allow the xHC to reliably schedule Isoch
transfers for the Device Slot.
When software receives this error it knows that it can change some of the link power state options in the
path to the device to less aggressive settings (which allows it to assert a smaller Max Exit Latency value)
and retry the configuration with the same Interval and Max ESIT Payload size.
Note: In addition to waiting for the PING_RESPONSE and transferring the Isoch data, the xHC must
include the Isoch Scheduling Delay. The Isoch Scheduling Delay comprehends the additional time
the xHC requires to parse the PING_RESPONSE TP then enable the associated Isoch transfer,
and to accommodate schedule jitter the PING and the Isoch transfer may incur within the Interval
due to the other transfers that it must manage. The Isoch Scheduling Delay is an xHC
implementation specific value. The Max Exit Latency Too Large Error allows the xHC to reject a
proposed Max Exit Latency value because it could not be made to work after it evaluated the Isoch
Scheduling Delay by the other endpoints that it had to schedule.
253
eXtensible Host Controller Interface Revision 1.0
An xHC may integrate one or more Tier36 2 USB 2.0 hubs. These hubs shall be referred to as Integrated
Hubs. An Integrated Hub may be connected to a Root Hub port associated with a High-speed Bus
Instance to provide Low-speed (LS), Full-speed (FS), and High-speed (HS) functionality on External Ports
presented by the xHC device or to expand the number of USB2 Protocol External Ports.
A USB 3.0 hub is the logical combination of two hubs: a USB 2.0 hub and a SuperSpeed (SS) hub. Each
hub operates independently on a separate data bus. Typically, the only shared logic between the two hubs
is for controlling VBus on their downstream facing ports. The paring of USB 2.0 and SS hubs means that
downstream facing ports of the USB 3.0 hub are at the same Tier. Matched Tiers simplify the software
management of the shared port power logic in a USB 3.0 hub.
When the xHC External Ports associated with an Integrated Hub and the External Ports associated with a
USB3 Protocol Root Hub port are assigned to the same USB connector, a mismatch is created between
the Tiers presented at the connector. The USB 2.0 signal pair from the External Hub is at Tier 2 and the
SuperSpeed signal pairs from the Root Hub port are at Tier 1. To minimize the impact on software
management of power at the connector, the Tier mismatch created by Integrated Hubs is limited to 1.
• When Integrated Hub(s) are implemented:
• Only a single Integrated Hub (i.e. one additional Hub Tier) shall be allowed between a xHC Root
Hub port and External Port.
• The only allowed USB 2.0/SS Hub Tier mismatch case is where the USB2 Protocol External Ports
are at Tier 2 and USB3 Protocol External Ports are at Tier 1.
• The xHC vendor shall provide a description of the Root Hub port / Integrated Hub / External Port
mapping. Refer to Appendix D for an example of how ACPI may be used to provide this mapping.
36. Refer to section 4.1.1 of the USB2 spec for more information on Tiers and USB Topologies.
254
eXtensible Host Controller Interface Revision 1.0
• Ports of like protocols shall be grouped when defining External Port numbering. e.g. Given n USB2
protocol External Ports and m USB3 protocol External Ports, External Ports 1 through n shall be
USB2 protocol ports and External Ports n+1 through n+m shall be USB3 protocol ports.
• The USB2 xHCI Supported Protocol Capability Integrated Hub Implemented (IHI) flag shall be ‘1’.
• When Integrated Hub(s) are not implemented:
• There shall be a 1:1 mapping between xHC Root Hub ports and xHC External Ports, where the
Root Hub port 1 shall map to External Port 1, Root Hub port 2 shall map to External Port 2, and so
on. This mapping means that the protocol of each Root Hub port is identical to the protocol of the
respective External Port, as defined by the USB2 and USB3 xHCI Supported Capabilities, refer to
section 7.2.
• The USB2 xHCI Supported Protocol Capability Integrated Hub Implemented (IHI) flag shall be ‘0’.
Given n USB2 protocol External Ports numbered 1 to n, m USB3 protocol External Ports
numbered n+1 to n+m, and c USB connectors numbered 1 to c; External Ports 1 and n+1 shall
map to USB connector 1 to form a USB 3.0 compatible port, External Ports 2 and n+2 shall map to
USB connector 2 to form a USB 3.0 compatible port, and so on. If there n is greater than m then
there will be m USB 3.0 compatible ports and n-m USB 2.0 compatible ports, or vice versa if m is
greater than n.
Note: If USB2 and USB3 protocol ports share the same over-current detection logic (whether Integrated
or Embedded hub(s) are implemented or not), then an over-current condition shall assert OCA on
both ports and transition both ports to the Powered-off state.
255
eXtensible Host Controller Interface Revision 1.0
Motherboard
xHC
Root Hub
Integrated Hub
Tier 2 Integrated
IP1 IP2 IP2 IP4
Hub Ports
P1 P2 P3 P4 P5 P6 External
Ports
Tier Mismatch
C1 C2 C3 C4 USB
Connectors
USB Cables
256
eXtensible Host Controller Interface Revision 1.0
• The Tier Mismatch occurs at connectors C1 and C2 due to assigning Tier 2 Integrated Hub ports and
Tier 1 Root Hub ports to the same USB 3.0 connectors.
257
eXtensible Host Controller Interface Revision 1.0
258
5 Register Interface
The extensible USB Host Controller contains many software accessible hardware registers. A large portion
of the registers appear as Memory-mapped Host Controller Registers. Other registers may appear using
non-memory address mechanisms, as in the case of a PCI or PCIe based Host Controller. For these
designs it is required to implement the required registers as defined by the respective specification.
Note that the xHCI does not require support for exclusive-access mechanisms (such as PCI LOCK) for
accesses to the memory-mapped register space. Therefore, if software attempts exclusive-access
mechanisms to the host controller memory-mapped register space, the results are undefined.
Refer to section 3.1 for a summary of the xHCI register architecture.
Refer to Table 138 for a breakdown of the xHCI Extended Capability register sets.
Alignment in
Register Section
Bytes
259
eXtensible Host Controller Interface Revision 1.0
5.1.1 Attributes
The following notation is used to describe register access attributes:
Table 15: Register Attributes
Register
Description
Attribute
HwInit Hardware Initialized: Register bits are initialized by firmware or hardware mechanisms
such as pin strapping or serial EEPROM. (System firmware hardware initialization is only
allowed for system integrated devices.) Bits are read-only after initialization and may only
be reset (for write-once by firmware) with a HCRST.
RO Read-only: Register bits are read-only and may not be altered by software. Register bits
may be initialized by hardware mechanisms such as pin strapping or serial EEPROM.
RW Read-Write: Register bits are read-write and may be either set or cleared by software to the
desired state. Note that individual bits in some read/write registers may be Read-Only.
RW1C Write-1-to-clear status: Register bits indicate status when read, a set bit indicating a status
event may be cleared by writing a ‘1’. Writing a ‘0’ to RW1C bits has no effect.
RW1S Write-1-to-set status: Register bits indicate status when read, a clear bit may be set by
writing a ‘1’. Writing a ‘0’ to RW1S bits has no effect.
ROS Sticky - Read-only: Register bits are read-only and may not be altered by software. Where
noted, registers that consume AUX power shall preserve sticky register values when AUX
power consumption (either via AUX power or PME Enable) is enabled. In these cases,
registers are not initialized or modified by Chip Hardware Reset.
RWS Sticky - Read-Write: Register bits are read-write and may be either set or cleared by
software to the desired state. Where noted, registers that consume AUX power shall
preserve sticky register values when AUX power consumption (either via AUX power or
PME Enable) is enabled. In these cases, registers are not initialized or modified by Chip
Hardware Reset.
RW1CS Sticky - Write-1-to-clear status: Register bits indicate status when read, a set bit indicating
a status event may be cleared by writing a ‘1’. Writing a ‘0’ to RW1CS bits has no effect.
Where noted, registers that consume AUX power shall preserve sticky register values when
AUX power consumption (either via AUX power or PME Enable) is enabled. In these cases,
registers are not initialized or modified by Chip Hardware Reset.
Rsvd Reserved: Reserved for future RO implementations. Registers or memory that shall be
treated as read-only by system software. Rsvd registers shall return ‘0’ when read. Software
shall ignore the value read from these bits.
260
eXtensible Host Controller Interface Revision 1.0
Register
Description
Attribute
RsvdO Reserved and Opaque: Reserved for exclusive xHC use, e.g. temporary xHC workspace.
Register or memory values may be modified by the xHC at any time. Software manipulation
of this space may cause undetermined results. Software shall not write this space unless
explicitly allowed by vendor specific instruction.
RsvdP Reserved and Preserved: Reserved for future RW implementations. Software shall
preserve the value read for writes to bits.
RsvdZ Reserved and Zero: Reserved for future RW1C implementations.Software shall use ‘0’ for
writes to these bits.
Note: System software shall mask all reserved fields (Rsvd, RsvdP or RsvdZ) to ‘0’ before evaluating a
register or data structure value. This will enable current system software to run with future xHCI
implementations that define the reserved fields.
Note: When a Reserved attribute (Rsvd, RsvdP, RsvdO or RsvdZ) is used to define a data structure field,
system software shall set all reserved register fields to ‘0’ when initially allocating the data
structure.
Note: Registers that define “Sticky” bits shall preserve their values when the Aux power well is enabled
and the xHC is in the D3cold state. Refer to section 4.23.1 for more information on power wells
and register initialization.
IMPLEMENTATION NOTE
BAR0 Size Allocation
If virtualization is supported, the Capability and Operational Register sets, and the Extended Capabilities
may reside in a single page of virtual memory, however the RTSOFF and DBOFF Registers shall position
the Runtime and Doorbell Registers to reside on their own respective virtual memory pages. The BAR0
size shall provide space that is sufficient to cover the offset between the respective register spaces
261
eXtensible Host Controller Interface Revision 1.0
(Capability, Operational, Runtime, etc.) and the register spaces themselves (e.g. a minimum of 3 virtual
memory pages).
If virtualization is not supported, all xHCI register spaces may reside on a single page pointed to by the
BAR0.
Many of the fields of the PCI header space contain hardware default values, which are either fixed or, if an
implementation permits, may be overridden using EEPROM, but may not be independently specified for
each logical xHC instance in a platform. These fields include: Revision, Header Type, Subsystem ID,
Subsystem Vendor ID, Class Code, Capability Pointer, Max Latency, and Min Grant.
The following fields are unique to each xHC instance: Device ID, Command, Status, Latency Timer, Cache
Line Size37, Memory BAR, and Interrupt Pin.
37. The Cache Line Size is used to align xHC DMA operations.
262
eXtensible Host Controller Interface Revision 1.0
Bit Description
7:0 Programming Interface (PI). 30h = USB 3.0 Host Controller that conforms to this
specification.
15:8 Sub-Class Code (SCC). 03h = Universal Serial Bus Host Controller.
23:16 Base Class Code (BASEC). 0Ch = Serial Bus controller.
Bit Description
7:0 Serial Bus Specification Release Number. All other combinations are reserved.
Bits[7:0] Release Number
30h Release 3.0
263
eXtensible Host Controller Interface Revision 1.0
Bit Description
5:0 Frame Length Timing Value. Each decimal value change to this register corresponds to 16
high-speed bit times. The SOF cycle time (number of SOF counter clock periods to generate a
SOF microframe length) is equal to 59488 + value in this field. The default value is decimal 32
(20h), which gives a SOF cycle time of 60000.
Frame Length
(# HS bit times) FLADJ Value
(decimal) (decimal)
59488 0 (00h)
59504 1 (01h)
59520 2 (02h
…
59984 31 (1Fh)
60000 32 (20h)
…
60480 62 (3Eh)
60496 63 (3Fh)
7:6 RsvdP.
Note: A USB3 Bus Interval Adjustment Message is used by the host to adjust its 125 μs. bus interval up
to +/-13.333 μs. The FLADJ establishes the center point for this adjustment. The contents of this
register are not affected by the receipt of a BUS_INTERVAL_ADJUSTMENT_MESSAGE from a
USB3 device. Refer to section 8.5.6.6 in the USB3 spec.
264
eXtensible Host Controller Interface Revision 1.0
31 24 23 16 15 8 7 0
The following section describes the PCI Power Management capability structure, which fields are required
or optional for compliance, and how they are implemented by the xHC.
The PCI Capability List38 is used to provide a standard way for software to find and use the PCI Power
Management. Refer to section 3.2 in the PCI PM specification for the definition of Power Management
Register Block.
38. PCI Capability List is defined in the PCI Local Bus Specification (Section 6.7)
265
eXtensible Host Controller Interface Revision 1.0
31 16 15 8 7 0
MSI Message Control NXT_PTR CAP_ID (05H) Dword0
31 16 15 8 7 3 2 0
Refer to section 6.8.2 in the PCI specification for the definition of the MSI-X Capability and Table
Structures. The following subsections describe xHC related MSI-X implementation issues.
266
eXtensible Host Controller Interface Revision 1.0
267
eXtensible Host Controller Interface Revision 1.0
31 16 15 8 7 0
PCI Express Capabilities Register Next Cap Pointer PCI Express Cap ID 00h
Device Capabilities 04h
Device Status Device Control 08h
Link Capabilities 0Ch
Link Status Link Control 10h
14h
18h
RsvdZ
1Ch
20h
Device Capabilities 2 24h
Device Status 2 Device Control 2 28h
Link Capabilities 2 2Ch
Link Status 2 Link Control 2 30h
34h
RsvdZ
38h
268
eXtensible Host Controller Interface Revision 1.0
Base
Size Mnemonic Register Name Section
Offset
269
eXtensible Host Controller Interface Revision 1.0
This register defines basic structural parameters supported by this xHC implementation: Number of Device
Slots support, Interrupters, Root Hub ports, etc.
Bits Description
7:0 Number of Device Slots (MaxSlots). This field specifies the maximum number of Device
Context Structures and Doorbell Array entries this host controller can support. Valid values are
in the range of 1 to 255. The value of ‘0’ is reserved.
18:8 Number of Interrupters (MaxIntrs). This field specifies the number of Interrupters implemented
on this host controller. Each Interrupter is allocated to a vector of MSI-X and controls its
generation and moderation.
The value of this field determines how many Interrupter Register Sets are addressable in the
Runtime Register Space (refer to section 5.5). Valid values are in the range of 1h to 400h. A ‘0’
in this field is undefined.
23:19 Rsvd.
31:24 Number of Ports (MaxPorts). This field specifies the maximum Port Number value, i.e. the
number of Port Register Sets that are addressable in the Operational Register Space (refer to
Table 26). Valid values are in the range of 1h to FFh.
The value in this field shall reflect the maximum Port Number value assigned by an xHCI
Supported Protocol Capability, described in section 7.2. Software shall refer to these capabilities
to identify whether a specific Port Number is valid, and the protocol supported by the associated
Port Register Set.
270
eXtensible Host Controller Interface Revision 1.0
Bit Description
0:3 Isochronous Scheduling Threshold (IST). Default = implementation dependent. The value in
this field indicates to system software the minimum distance (in time) that it is required to stay
ahead of the host controller while adding TRBs, in order to have the host controller process
them at the correct time. The value shall be specified in terms of number of frames/
microframes.
If bit [3] of IST is cleared to '0', software can add a TRB no later than IST[2:0] Microframes
before that TRB is scheduled to be executed.
If bit [3] of IST is set to '1', software can add a TRB no later than IST[2:0] Frames before that
TRB is scheduled to be executed.
Refer to Section 4.14.2 for details on how software uses this information for scheduling
isochronous transfers.
7:4 Event Ring Segment Table Max (ERST Max). Default = implementation dependent. Valid
values are 0 – 15. This field determines the maximum value supported the Event Ring
Segment Table Base Size registers (5.5.2.3.1), where:
The maximum number of Event Ring Segment Table entries = 2 ERST Max.
e.g. if the ERST Max = 7, then the xHC Event Ring Segment Table(s) supports up to 128
entries, 15 then 32K entries, etc.
25:8 Rsvd.
26 Scratchpad Restore (SPR). Default = implementation dependent. If Max Scratchpad Buffers
is > ‘0’ then this flag indicates whether the xHC uses the Scratchpad Buffers for saving state
when executing Save and Restore State operations. If Max Scratchpad Buffers is = ‘0’ then this
flag shall be ‘0’. Refer to section 4.23.2 for more information.
A value of ‘1’ indicates that the xHC requires the integrity of the Scratchpad Buffer space to be
maintained across power events.
A value of ‘0’ indicates that the Scratchpad Buffer space may be freed and reallocated between
power events.
31:27 Max Scratchpad Buffers (Max Scratchpad Bufs). Default = implementation dependent. Valid
values are 0-31. This field indicates the number of Scratchpad Buffers system software shall
reserve for the xHC. Refer to section 4.20 for more information.
271
eXtensible Host Controller Interface Revision 1.0
Bit Description
7:0 U1 Device Exit Latency. Worst case latency to transition a root hub Port Link State (PLS) from
U1 to U0. Applies to all root hub ports.
The following are permissible values:
Value Description
00h Zero
01h Less than 1 µs
02h Less than 2 µs.
…
0Ah Less than 10 µs.
0B-FFh Reserved
15:8 Rsvd.
31:16 U2 Device Exit Latency. Worst case latency to transition from U2 to U0. Applies to all root hub
ports.
The following are permissible values:
Value Description
0000h Zero
0001h Less than 1 µs.
0002h Less than 2 µs.
…
07FFh Less than 2047 µs.
0800-FFFFh Reserved
272
eXtensible Host Controller Interface Revision 1.0
Bits Description
0 64-bit Addressing Capabilitya (AC64). This flag documents the addressing range capability
of this implementation. The value of this flag determines whether the xHC has implemented the
high order 32 bits of 64 bit register and data structure pointer fields. Values for this flag have
the following interpretation:
Value Description
0 32-bit address memory pointers implemented
1 64-bit address memory pointers implemented
If 32-bit address memory pointers are implemented, the xHC shall ignore the high order 32 bits
of 64 bit data structure pointer fields, and system software shall ignore the high order 32 bits of
64 bit xHC registers.
1 BW Negotiation Capability (BNC). This flag identifies whether the xHC has implemented the
Bandwidth Negotiation. Values for this flag have the following interpretation:
Value Description
0 BW Negotiation not implemented
1 BW Negotiation implemented
Refer to section 4.16 for more information on Bandwidth Negotiation.
2 Context Size (CSZ). If this bit is set to ‘1’, then the xHC uses 64 byte Context data structures.
If this bit is cleared to ‘0’, then the xHC uses 32 byte Context data structures.
Note: This flag does not apply to Stream Contexts.
3 Port Power Control (PPC). This flag indicates whether the host controller implementation
includes port power control. A ‘1’ in this bit indicates the ports have port power switches. A ‘0’ in
this bit indicates the port do not have port power switches. The value of this flag affects the
functionality of the PP flag in each port status and control register (refer to Section 5.4.8).
4 Port Indicators (PIND). This bit indicates whether the xHC root hub ports support port
indicator control. When this bit is a ‘1’, the port status and control registers include a read/
writeable field for controlling the state of the port indicator. Refer to Section 5.4.8 for definition
of the Port Indicator Control field.
5 Light HC Reset Capability (LHRC). This flag indicates whether the host controller
implementation supports a Light Host Controller Reset. A ‘1’ in this bit indicates that Light Host
Controller Reset is supported. A ‘0’ in this bit indicates that Light Host Controller Reset is not
supported. The value of this flag affects the functionality of the Light Host Controller Reset
(LHCRST) flag in the USBCMD register (refer to Section 5.4.1).
273
eXtensible Host Controller Interface Revision 1.0
Bits Description
6 Latency Tolerance Messaging Capability (LTC). This flag indicates whether the host
controller implementation supports Latency Tolerance Messaging (LTM). A ‘1’ in this bit
indicates that LTM is supported. A ‘0’ in this bit indicates that LTM is not supported. Refer to
section 4.13.1 for more information on LTM.
7 No Secondary SID Support (NSS). This flag indicates whether the host controller
implementation supports Secondary Stream IDs. A ‘1’ in this bit indicates that Secondary
Stream ID decoding is not supported. A ‘0’ in this bit indicates that Secondary Stream ID
decoding is supported. (refer to Sections 4.12.2 and 6.2.3).
118 Rsvd.
15:12 Maximum Primary Stream Array Size (MaxPSASize). This fields identifies the maximum size
Primary Stream Array that the xHC supports. The Primary Stream Array size = 2MaxPSASize+1.
Valid MaxPSASize values are 1 to 15.
31:16 xHCI Extended Capabilities Pointer (xECP). This field indicates the existence of a
capabilities list. The value of this field indicates a relative offset, in 32-bit words, from Base to
the beginning of the first extended capability.
For example, using the offset of Base is 1000h and the xECP value of 0068h, we can
calculated the following effective address of the first extended capability:
1000h + (0068h << 2) -> 1000h + 01A0h -> 11A0h
a. This is not tightly coupled with the USBBASE address register mapping control. The 64-bit Addressing Capability
(AC64) flag indicates whether the host controller can generate 64-bit addresses as a master. The USBBASE regis-
ter indicates the host controller only needs to decode 32-bit addresses as a slave.
274
eXtensible Host Controller Interface Revision 1.0
Bit Description
1:0 Rsvd.
31:2 Doorbell Array Offset - RO. Default = implementation dependent. This field defines the
Dword offset of the Doorbell Array base address from the Base (i.e. the base address of
the xHCI Capability register address space).
Note: Normally the Doorbell Array is Dword aligned, however if virtualization is supported by the xHC
then it shall be PAGESIZE aligned. e.g. If the PAGESIZE = 4K (1000h), and the Doorbell Array is
positioned at a 3 page offset from the Base, then this register shall report 0000 3000h.
275
eXtensible Host Controller Interface Revision 1.0
Bit Description
4:0 Rsvd.
31:5 Runtime Register Space Offset - RO. Default = implementation dependent. This field
defines the 32-byte offset of the xHCI Runtime Registers from the Base. i.e. Runtime
Register Base Address = Base + Runtime Register Set Offset.
Note: Normally the Runtime Register Space is 32-byte aligned, however if virtualization is supported by
the xHC then it shall be PAGESIZE aligned. e.g. If the PAGESIZE = 4K and the Runtime Register
Space is positioned at a 1 page offset from the Base, then this register shall report 0000 1000h.
276
eXtensible Host Controller Interface Revision 1.0
Note: The MaxPorts value in the HCSPARAMS1 register defines the number of Port Register Sets (e.g.
PORTSC, PORTPMSC, and PORTLI register sets). The PORTSC, PORTPMSC, and PORTLI
register sets are grouped (consecutive Dwords). Refer to their respective sections for their
addressing.
The Offset referenced in Table 26 is the offset from the beginning of the Operational Register space.
The Operational registers are located at a positive offset from the Capabilities Registers (refer to Section
5.3).
Table 27: Host Controller USB Port Register Set
When the Operational Registers are exposed by a Virtual Function (VF), they are emulated and managed
by the VMM for the xHC instance presented by the selected VF. The VMM has full discretion as to how
277
eXtensible Host Controller Interface Revision 1.0
writes to these registers will affect the operation of a VF and the value of the read data returned by a VF,
however recommendations are provided where appropriate. Refer to section 8 for more information.
Bits Description
0 Run/Stop (R/S) – RW. Default = ‘0’. ‘1’ = Run. ‘0’ = Stop. When set to a ‘1’, the xHC proceeds
with execution of the schedule. The xHC continues execution as long as this bit is set to a ‘1’.
When this bit is cleared to ‘0’, the xHC completes any current or queued commands or TDs,
and any USB transactions associated with them, then halts.
Refer to section 5.4.1.1 for more information on how R/S shall be managed.
The xHC shall halt within 16 ms. after software clears the Run/Stop bit if the above conditions
have been met.
The HCHalted (HCH) bit in the USBSTS register indicates when the xHC has finished its
pending pipelined transactions and has entered the stopped state. Software shall not write a ‘1’
to this flag unless the xHC is in the Halted state (i.e. HCH in the USBSTS register is ‘1’). Doing
so may yield undefined results. Writing a ‘0’ to this flag when the xHC is in the Running state
(i.e. HCH = ‘0’) and any Event Rings are in the Event Ring Full state (refer to section 4.9.4)
may yield undefined results.
When this register is exposed by a Virtual Function (VF), this bit only controls the run state of
the xHC instance presented by the selected VF. Refer to section 8 for more information.
278
eXtensible Host Controller Interface Revision 1.0
Bits Description
1 Host Controller Reset (HCRST) – RW. Default = ‘0’. This control bit is used by software to
reset the host controller. The effects of this bit on the xHC and the Root Hub registers are
similar to a Chip Hardware Reset.
When software writes a ‘1’ to this bit, the Host Controller resets its internal pipelines, timers,
counters, state machines, etc. to their initial value. Any transaction currently in progress on the
USB is immediately terminated. A USB reset shall not be driven on USB2 downstream ports,
however a Hot or Warm Reseta shall be initiated on USB3 Root Hub downstream ports.
PCI Configuration registers are not affected by this reset. All operational registers, including
port registers and port state machines are set to their initial values. Software shall reinitialize
the host controller as described in Section 4.1 in order to return the host controller to an
operational state.
This bit is cleared to ‘0’ by the Host Controller when the reset process is complete. Software
cannot terminate the reset process early by writing a ‘0’ to this bit and shall not write any xHC
Operational or Runtime registers until while HCRST is ‘1’. Note, the completion of the xHC
reset process is not gated by the Root Hub port reset process.
Software shall not set this bit to ‘1’ when the HCHalted (HCH) bit in the USBSTS register is a
‘0’. Attempting to reset an actively running host controller may result in undefined behavior.
When this register is exposed by a Virtual Function (VF), this bit only resets the xHC instance
presented by the selected VF. Refer to section 8 for more information.
2 Interrupter Enable (INTE) – RW. Default = ‘0’. This bit provides system software with a means
of enabling or disabling the host system interrupts generated by Interrupters. When this bit is a
‘1’, then Interrupter host system interrupt generation is allowed, e.g. the xHC shall issue an
interrupt at the next interrupt threshold if the host system interrupt mechanism (e.g. MSI, MSI-
X, etc.) is enabled. The interrupt is acknowledged by a host system interrupt specific
mechanism.
When this register is exposed by a Virtual Function (VF), this bit only enables the set of
Interrupters assigned to the selected VF. Refer to section 7.7.2 for more information.
3 Host System Error Enable (HSEE) – RW. Default = ‘0’. When this bit is a ‘1’, and the HSE bit
in the USBSTS register is a ‘1’, the xHC shall assert out-of-band error signaling to the host.
The signaling is acknowledged by software clearing the HSE bit. Refer to section 4.10.2.6 for
more information.
When this register is exposed by a Virtual Function (VF), the effect of the assertion of this bit on
the Physical Function (PF0) is determined by the VMM. Refer to section 8 for more information.
6:4 RsvdP.
7 Light Host Controller Reset (LHCRST) – RO or RW. Optional normative. Default = ‘0’. If the
Light HC Reset Capability (LHRC) bit in the HCCPARAMS register is ‘1’, then this flag allows
the driver to reset the xHC without affecting the state of the ports.
A system software read of this bit as ‘0’ indicates the Light Host Controller Reset has
completed and it is safe for software to re-initialize the xHC. A software read of this bit as a ‘1’
indicates the Light Host Controller Reset has not yet completed.
If not implemented, a read of this flag shall always return a ‘0’.
All registers in the Auxiliary well shall maintain the values that had been asserted prior to the
Light Host Controller Reset. Refer to section 4.23.1 for more information.
When this register is exposed by a Virtual Function (VF), this bit only generates a Light Reset
to the xHC instance presented by the selected VF, e.g. Disable the VFs’ device slots and set
the associated VF Run bit to Stopped. Refer to section 8 for more information.
279
eXtensible Host Controller Interface Revision 1.0
Bits Description
8 Controller Save State (CSS) - RW. Default = ‘0’. When written by software with ‘1’ and
HCHalted (HCH) = ‘1’, then the xHC shall save any internal state that may be restored by a
subsequent Restore State operation. When written by software with ‘1’ and HCHalted (HCH) =
‘0’, or written with ‘0’, no Save State operation shall be performed. This flag always returns ‘0’
when read. Refer to the Save State Status (SSS) flag in the USBSTS register for information on
Save State completion. Refer to section 4.23.2 for more information on xHC Save/Restore
operation. Note that undefined behavior may occur if a Save State operation is initiated while
Restore State Status (RSS) = ‘1’.
When this register is exposed by a Virtual Function (VF), this bit only controls saving the state
of the xHC instance presented by the selected VF. Refer to section 8 for more information.
9 Controller Restore State (CRS) - RW. Default = ‘0’. When set to ‘1’, and HCHalted (HCH) =
‘1’, then the xHC shall perform a Restore State operation and restore its internal state. When
set to ‘1’ and Run/Stop (R/S) = ‘1’ or HCHalted (HCH) = ‘0’, or when cleared to ‘0’, no Restore
State operation shall be performed. This flag always returns ‘0’ when read. Refer to the Restore
State Status (RSS) flag in the USBSTS register for information on Restore State completion.
Refer to section 4.23.2 for more information. Note that undefined behavior may occur if a
Restore State operation is initiated while Save State Status (SSS) = ‘1’.
When this register is exposed by a Virtual Function (VF), this bit only controls restoring the
state of the xHC instance presented by the selected VF. Refer to section 8 for more
information.
10 Enable Wrap Event (EWE) - RW. Default = ‘0’. When set to ‘1’, the xHC shall generate a
MFINDEX Wrap Event every time the MFINDEX register transitions from 03FFFh to 0. When
cleared to ‘0’ no MFINDEX Wrap Events are generated. Refer to section 4.14.2 for more
information.
When this register is exposed by a Virtual Function (VF), the generation of MFINDEX Wrap
Events to VFs shall be emulated by the VMM.
11 Enable U3 MFINDEX Stop (EU3S) - RW. Default = ‘0’. When set to ‘1’, the xHC may stop the
MFINDEX counting action if all Root Hub ports are in the U3, Disconnected, Disabled, or
Powered-off state. When cleared to ‘0’ the xHC may stop the MFINDEX counting action if all
Root Hub ports are in the Disconnected, Disabled, or Powered-off state. Refer to section
4.14.2 for more information.
31:12 RsvdP.
a. Depending on the link state when HCRST is asserted, an xHC implementation may choose to issue a Hot Reset
rather than a Warm Reset to accelerate the USB recovery process.
Note: The R/S, and LHCRST flags have no effect on the operation of the Debug Capability.
280
eXtensible Host Controller Interface Revision 1.0
Software should apply the following rules to determine when a Busy Transfer Ring becomes Idle:
• For Isoch endpoints:
• Wait for a Ring Underrun or Ring Overrun Transfer Event or,
• Issue a Stop Endpoint Command and wait for the associated Command Completion Event.
• For non-Isoch endpoints:
• If the IOC flag is set in the last TRB on the Transfer Ring, then wait for its Transfer Event.
• If the IOC flag is not set in the last TRB on the Transfer Ring, then there will be no Transfer Event
generated when the last TRB on the ring is completed, so software shall issue a Stop Endpoint
Command and wait for the associated Command Completion Event and Stopped Transfer Events.
Refer to section 4.6.9.
Note: Software shall ensure that any pending reset on a USB2 port is completed before R/S is cleared to
‘0’.
Note: The xHC should halt within 16 ms. of software clearing the R/S bit to ‘0’.
281
eXtensible Host Controller Interface Revision 1.0
Bit Description
0 HCHalted (HCH) – RO. Default = ‘1’. This bit is a ‘0’ whenever the Run/Stop (R/S) bit is a ‘1’. The
xHC sets this bit to ‘1’ after it has stopped executing as a result of the Run/Stop (R/S) bit being
cleared to ‘0’, either by software or by the xHC hardware (e.g. internal error).
If this bit is '1', then SOFs, microSOFs, or Isochronous Timestamp Packets (ITP) shall not be
generated by the xHC, and any received Transaction Packet shall be dropped.
When this register is exposed by a Virtual Function (VF), this bit only reflects the Halted state of
the xHC instance presented by the selected VF. Refer to section 8 for more information.
1 RsvdP.
2 Host System Error (HSE) – RW1C. Default = ‘0’. The xHC sets this bit to ‘1’ when a serious
error is detected, either internal to the xHC or during a host system access involving the xHC
module. (In a PCI system, conditions that set this bit to ‘1’ include PCI Parity error, PCI Master
Abort, and PCI Target Abort.) When this error occurs, the xHC clears the Run/Stop (R/S) bit in
the USBCMD register to prevent further execution of the scheduled TDs. If the HSEE bit in the
USBCMD register is a ‘1’, the xHC shall also assert out-of-band error signaling to the host. Refer
to section 4.10.2.6 for more information.
When this register is exposed by a Virtual Function (VF), the assertion of this bit affects all VFs
and reflects the Host System Error state of the Physical Function (PF0). Refer to section 8 for
more information.
3 Event Interrupt (EINT) – RW1C. Default = ‘0’. The xHC sets this bit to ‘1’ when the Interrupt
Pending (IP) bit of any Interrupter transitions from ‘0’ to ‘1’. Refer to section 7.1.2 for use.
Software that uses EINT shall clear it prior to clearing any IP flags. A race condition may occur if
software clears the IP flags then clears the EINT flag, and between the operations another IP ‘0’
to '1' transition occurs. In this case the new IP transition shall be lost.
When this register is exposed by a Virtual Function (VF), this bit is the logical 'OR' of the IP bits
for the Interrupters assigned to the selected VF. And it shall be cleared to ‘0’ when all associated
interrupter IP bits are cleared, i.e. all the VF’s Interrupter Event Ring(s) are empty. Refer to
section 8 for more information.
39.Note, the CNR flag may be asserted (‘1’) when the USBSTS is first examined by software.
282
eXtensible Host Controller Interface Revision 1.0
4 Port Change Detect (PCD) – RW1C. Default = ‘0’. The xHC sets this bit to a ‘1’ when any port
has a change bit transition from a ‘0’ to a ‘1’.
This bit is allowed to be maintained in the Auxiliary power well. Alternatively, it is also acceptable
that on a D3 to D0 transition of the xHC, this bit is loaded with the OR of all of the PORTSC
change bits. Refer to section 4.19.3.
This bit provides system software an efficient means of determining if there has been Root Hub
port activity. Refer to section 4.15.2.3 for more information.
When this register is exposed by a Virtual Function (VF), the VMM determines the state of this bit
as a function of the Root Hub Ports associated with the Device Slots assigned to the selected VF.
Refer to section 8 for more information.
7:5 RsvdZ.
8 Save State Status (SSS) - RO. Default = ‘0’. When the Controller Save State (CSS) flag in the
USBCMD register is written with ‘1’ this bit shall be set to ‘1’ and remain 1 while the xHC saves
its internal state. When the Save State operation is complete, this bit shall be cleared to ‘0’. Refer
to section 4.23.2 for more information.
When this register is exposed by a Virtual Function (VF), the VMM determines the state of this bit
as a function of the saving the state for the selected VF. Refer to section 8 for more information.
9 Restore State Status (RSS) - RO. Default = ‘0’. When the Controller Restore State (CRS) flag in
the USBCMD register is written with ‘1’ this bit shall be set to ‘1’ and remain 1 while the xHC
restores its internal state. When the Restore State operation is complete, this bit shall be cleared
to ‘0’. Refer to section 4.23.2 for more information.
When this register is exposed by a Virtual Function (VF), the VMM determines the state of this bit
as a function of the restoring the state for the selected VF. Refer to section 8 for more
information.
10 Save/Restore Error (SRE) - RW1C. Default = ‘0’. If an error occurs during a Save or Restore
operation this bit shall be set to ‘1’. This bit shall be cleared to ‘0’ when a Save or Restore
operation is initiated or when written with ‘1’. Refer to section 4.23.2 for more information.
When this register is exposed by a Virtual Function (VF), the VMM determines the state of this bit
as a function of the Save/Restore completion status for the selected VF. Refer to section 8 for
more information.
11 Controller Not Ready (CNR) – RO. Default = ‘1’. ‘0’ = Ready and ‘1’ = Not Ready. Software
shall not write any Doorbell or Operational register of the xHC, other than the USBSTS register,
until CNR = ‘0’. This flag is set by the xHC after a Chip Hardware Reset and cleared when the
xHC is ready to begin accepting register writes. This flag shall remain cleared (‘0’) until the next
Chip Hardware Reset.
12 Host Controller Error (HCE) – RO. Default = 0. 0’ = No internal xHC error conditions exist and
‘1’ = Internal xHC error condition. This flag shall be set to indicate that an internal error condition
has been detected which requires software to reset and reinitialize the xHC. Refer to section
4.24.1 for more information.
31:13 RsvdP.
Note: The Event Interrupt (EINT) and Port Change Detect (PCD) flags are typically only used by system
software for managing the xHCI when interrupts are disabled or during an SMI.
Note: The EINT flag does not generate an interrupt, it is simply a logical OR of the IMAN register IP flag
‘0’ to ‘1’ transitions. As such, it does not need to be cleared to clear an xHC interrupt.
283
eXtensible Host Controller Interface Revision 1.0
Bit Description
15:0 Page Size – RO. Default = Implementation defined. This field defines the page size supported by
the xHC implementation. This xHC supports a page size of 2^(n+12) if bit n is Set. For example,
if bit 0 is Set, the xHC supports 4k byte page sizes.
For a Virtual Function, this register reflects the page size selected in the System Page Size field
of the SR-IOV Extended Capability structure. For the Physical Function 0, this register reflects
the implementation dependent default xHC page size.
Various xHC resources reference PAGESIZE to describe their minimum alignment requirements.
The maximum possible page size is 128M.
31:16 Rsvd.
284
eXtensible Host Controller Interface Revision 1.0
Bit Description
15:0 Notification Enable (N0-N15) – RW. When a Notification Enable bit is set, a Device Notification
Event shall be generated when a Device Notification Transaction Packet is received with the
matching value in the Notification Type field. For example, setting N1 to ‘1’ enables Device
Notification Event generation if a Device Notification TP is received with its Notification Type
field set to ‘1’ (FUNCTION_WAKE), etc.
31:16 RsvdP.
Note: Of the currently defined USB3 Device Notification Types, only the FUNCTION_WAKE type is not
handled automatically by the xHC. Only under debug conditions would software write the DNCTRL
register with a value other than 0002h. Refer to section 8.5.6 in the USB3 specification for more
information on Notification Types.
285
eXtensible Host Controller Interface Revision 1.0
Bit Description
0 Ring Cycle State (RCS) - RW. This bit identifies the value of the xHC Consumer Cycle State
(CCS) flag for the TRB referenced by the Command Ring Pointer. Refer to section 4.9.3 for
more information.
Writes to this flag are ignored if Command Ring Running (CRR) is ‘1’.
If the CRCR is written while the Command Ring is stopped (CRR = ‘0’), then the value of this
flag shall be used to fetch the first Command TRB the next time the Host Controller Doorbell
register is written with the DB Reason field set to Host Controller Command.
If the CRCR is not written while the Command Ring is stopped (CRR = ‘0’), then the Command
Ring shall begin fetching Command TRBs using the current value of the internal Command Ring
CCS flag.
Reading this flag always returns ‘0’.
1 Command Stop (CS) - RW1S. Default = ‘0’. Writing a ‘1’ to this bit shall stop the operation of
the Command Ring after the completion of the currently executing command, and generate a
Command Completion Event with the Completion Code set to Command Ring Stopped and the
Command TRB Pointer set to the current value of the Command Ring Dequeue Pointer. Refer to
section 4.6.1.1 for more information on stopping a command.
The next write to the Host Controller Doorbell with DB Reason field set to Host Controller
Command shall restart the Command Ring operation.
Writes to this flag are ignored by the xHC if Command Ring Running (CRR) = ‘0’.
Reading this bit shall always return ‘0’.
2 Command Abort (CA) - RW1S. Default = ‘0’. Writing a ‘1’ to this bit shall immediately terminate
the currently executing command, stop the Command Ring, and generate a Command
Completion Event with the Completion Code set to Command Ring Stopped. Refer to section
4.6.1.2 for more information on aborting a command.
The next write to the Host Controller Doorbell with DB Reason field set to Host Controller
Command shall restart the Command Ring operation.
Writes to this flag are ignored by the xHC if Command Ring Running (CRR) = ‘0’.
Reading this bit always returns ‘0’.
3 Command Ring Running (CRR) - RO. Default = 0. This flag is set to ‘1’ if the Run/Stop (R/S)
bit is ‘1’ and the Host Controller Doorbell register is written with the DB Reason field set to Host
Controller Command. It is cleared to ‘0’ when the Command Ring is “stopped” after writing a ‘1’
to the Command Stop (CS) or Command Abort (CA) flags, or if the R/S bit is cleared to ‘0’.
286
eXtensible Host Controller Interface Revision 1.0
Table 32: Command Ring Control Register Bit Definitions (CRCR) (Continued)
Bit Description
5:4 RsvdP.
64:6 Command Ring Pointer - RW. Default = ‘0’. This field defines high order bits of the initial value
of the 64-bit Command Ring Dequeue Pointer.
Writes to this field are ignored when Command Ring Running (CRR) = ‘1’.
If the CRCR is written while the Command Ring is stopped (CCR = ‘0’), the value of this field
shall be used to fetch the first Command TRB the next time the Host Controller Doorbell register
is written with the DB Reason field set to Host Controller Command.
If the CRCR is not written while the Command Ring is stopped (CCR = ‘0’) then the Command
Ring shall begin fetching Command TRBs at the current value of the internal xHC Command
Ring Dequeue Pointer.
Reading this field always returns ‘0’.
Note: Refer to section 4.6 for more information on Command Ring Stop and Abort operation.
Note: Setting the Command Stop (CS) or Command Abort (CA) flags while CRR = ‘1’ shall generate a
Command Ring Stopped Command Completion Event.
Note: Setting both the Command Stop (CS) and Command Abort (CA) flags with a single write to the
CRCR while CRR = ‘1’ shall be interpreted as a Command Abort (CA) by the xHC.
Note: The Command Ring is 64 byte aligned, so the low order 6 bits of the Command Ring Pointer shall
always be ‘0’.
Note: The values of the internal xHC Command Ring CCS flag and Dequeue Pointer are undefined after
hardware reset, so these fields shall be initialized before setting USBCMD Run/Stop (R/S) to ‘1’.
Refer to section 4.6.1.
Note: After asserting Command Stop (CS) if the Command doorbell is rung before CRR = ‘0’, (i.e. the
ring is not fully stopped), then the behavior is undefined, e.g. the Command Ring may not restart.
287
eXtensible Host Controller Interface Revision 1.0
Figure 62: Device Context Base Address Array Pointer Register (DCBAAP)
31 6 5 0
Table 33: Device Context Base Address Array Pointer Register Bit Definitions (DCBAAP)
Bit Description
5:0 RsvdZ.
63:6 Device Context Base Address Array Pointer - RW. Default = ‘0’. This field defines high order
bits of the 64-bit base address of the Device Context Pointer Array. A table of address pointers
that reference Device Context structures for the devices attached to the host.
288
eXtensible Host Controller Interface Revision 1.0
31 8 7 0
Bit Description
7:0 Max Device Slots Enabled (MaxSlotsEn) – RW. Default = ‘0’. This field specifies the maximum
number of enabled Device Slots. Valid values are in the range of 0 to MaxSlots. Enabled Devices
Slots are allocated contiguously. e.g. A value of 16 specifies that Device Slots 1 to 16 are active.
A value of ‘0’ disables all Device Slots. A disabled Device Slot shall not respond to Doorbell
Register references.
This field shall not be modified by software if the xHC is running (Run/Stop (R/S) = ‘1’).
31:8 RsvdP.
Note: Writing the Max Device Slots Enabled (MaxSlotsEn) field with a non-zero value, signals to the xHC
that the host controller driver for the xHC is loaded. The Run/Stop (R/S) flag in the USBCMD
register can be checked to determine if the driver is running.
Note: The value of the Max Device Slots Enabled (MaxSlotsEn) field may allow software to scale back its
memory usage, in cases where it doesn’t need to support the full number of slots supported by the
xHC hardware. It may also be used by the xHC to modify internal algorithms for distributing its
internal resource, i.e. More data buffering per slot, modify its endpoint scheduling algorithms, etc.
Note: If the xHC is stopped to reduce the MaxSlotsEn value, software shall ensure that no active Device
Slots (i.e. not in the Disabled state) are being disabled, otherwise undefined behavior may occur.
e.g. if MaxSlotsEn is being changed from 16 to 8, Device Slots 9 through 16 shall be in the
Disabled state before MaxSlotsEn is changed.
289
eXtensible Host Controller Interface Revision 1.0
290
eXtensible Host Controller Interface Revision 1.0
Table 35: Port Status and Control Register Bit Definitions (PORTSC)
Bits Description
0 Current Connect Status (CCS) – ROS. Default = ‘0’. ‘1’ = Device is present on port. ‘0’ = No
device is present. This value reflects the current state of the port, and may not correspond
directly to the event that caused the Connect Status Change (CSC) bit to be set to ‘1’. Refer to
sections 4.19.3 and 4.19.4 for more details on the Connect Status Change (CSC) assertion
conditions.
This flag is ‘0’ if PP is ‘0’.
1 Port Enabled/Disabled (PED) – RW1CS. Default = ‘0’. ‘1’ = Enabled. ‘0’ = Disabled.
Ports may only be enabled by the xHC. Software cannot enable a port by writing a ‘1’ to this
flag.
A port may be disabled by software writing a ‘1’ to this flag.
This flag shall automatically be cleared to ‘0’ by a disconnect event or other fault condition.
Note that the bit status does not change until the port state actually changes. There may be a
delay in disabling or enabling a port due to other host controller or bus events.
When the port is disabled (PED = ‘0’) downstream propagation of data is blocked on this port,
except for reset.
For USB2 protocol ports:
When the port is in the Disabled state, software shall reset the port (PR = ‘1’) to transition
PED to ‘1’ and the port to the Enabled state.
For USB3 protocol ports:
When the port is in the Polling state (after detecting an attach), the port shall automatically
transition to the Enabled state and set PED to ‘1’ upon the completion of successful link
training.
When the port is in the Disabled state, software shall write a ‘5’ (RxDetect) to the PLS field
to transition the port to the Disconnected state. Refer to section 4.19.1.2.
PED shall automatically be cleared to ‘0’ when PR is set to ‘1’, and set to ‘1’ when PR
transitions from ‘1’ to ‘0’ after a successful reset. Refer to Port Reset (PR) bit for more
information on how the PED bit is managed.
Note that when software writes this bit to a ‘1’, it shall also write a ‘0’ to the PR bita.
This flag is ‘0’ if PP is ‘0’.
2 RsvdZ.
3 Over-current Active (OCA) – RO. Default = ‘0’. ‘1’ = This port currently has an over-current
condition. ‘0’ = This port does not have an over-current condition. This bit shall automatically
transition from a ‘1’ to a ‘0’ when the over-current condition is removed.
4 Port Reset (PR) – RW1S. Default = ‘0’. ‘1’ = Port Reset signaling is asserted. ‘0’ = Port is not in
Reset. When software writes a ‘1’ to this bit (from a ‘0’) the bus reset sequence is initiated;
USB2 protocol ports shall execute the bus reset sequence as defined in the USB2 Spec. USB3
protocol ports shall execute the Hot Reset sequence as defined in the USB3 Spec. PR remains
set until reset signaling is completed by the root hub.
Note that software shall write a ‘1’ to the this flag to transition a USB2 port from the Polling
state to the Enabled state. Refer to sections 4.15.2.3 and 4.19.1.1.
This flag is ‘0’ if PP is ‘0’.
291
eXtensible Host Controller Interface Revision 1.0
Table 35: Port Status and Control Register Bit Definitions (PORTSC) (Continued)
Bits Description
8:5 Port Link State (PLS) – RWS. Default = RxDetect (‘5’). This field is used to power manage the
port and reflects its current link state.
When the port is in the Enabled state, system software may set the link U state by writing this
field. System software may also write this field to force a Disabled to Disconnected state
transition of the port.
Write Value Description
0 The link shall transition to a U0 state from any of the U states.
2b USB2 protocol ports only. The link should transition to the U2 State.
3 The link shall transition to a U3 state from any of the U states. This action
selectively suspends the device connected to this port. While the Port Link
State = U3, the hub does not propagate downstream-directed traffic to this
port, but the hub shall respond to resume signaling from the port.
5 USB3 protocol ports only. If the port is in the Disabled state (PLS =
Disabled, PP = 1), then the link shall transition to a RxDetect state and the
port shall transition to the Disconnected state, else ignored.
b
1 ,4,6-14 Ignored.
15 USB2 protocol ports only. If the port is in the U3 state (PLS = U3), then the
link shall remain in the U3 state and the port shall transition to the U3Exit
substate, else ignored. Refer to section 4.15.2 for more information.
Note: The Port Link State Write Strobe (LWS) shall also be set to ‘1’ to write this field.
For USB2 protocol ports: Writing a value of '2' to this field shall request LPM, asserting L1
signaling on the USB2 bus. Software may read this field to determine if the transition to the U2
state was successful. Writing a value of '0' shall deassert L1 signaling on the USB. Writing a
value of '1' shall have no effect. The U1 state shall never be reported by a USB2 protocol port.
292
eXtensible Host Controller Interface Revision 1.0
Table 35: Port Status and Control Register Bit Definitions (PORTSC) (Continued)
Bits Description
9 Port Power (PP) – RWS. Default = ‘1’. This flag reflects a port's logical, power control state.
Because host controllers can implement different methods of port power switching, this flag
may or may not represent whether (VBus) power is actually applied to the port. When PP
equals a '0' the port is nonfunctional and shall not report attaches, detaches, or Port Link State
(PLS) changes. However, the port shall report over-current conditions when PP = ‘0’ if PPC =
‘0’. After modifying PP, software shall read PP and confirm that it is reached its target state
before modifying it againh, undefined behavior may occur if this procedure is not followed.
0 = This port is in the Powered-off state.
1 = This port is not in the Powered-off state.
If the Port Power Control (PPC) flag in the HCCPARAMS register is '1', then xHC has port
power control switches and this bit represents the current setting of the switch ('0' = off, '1' =
on).
If the Port Power Control (PPC) flag in the HCCPARAMS register is '0', then xHC does not
have port power control switches and each port is hard wired to power, and not affected by this
bit.
When an over-current condition is detected on a powered port, the xHC shall transition the PP
bit in each affected port from a ‘1’ to ‘0’ (removing power from the port).
Refer to section 4.19.4 for more information.
13:10 Port Speed (Port Speed) – ROS. Default = ‘0’. This field identifies the speed of the attached
USB Device. This field is only relevant if a device is attached (CCS = ‘1’) in all other cases this
field shall indicate Undefined Speed.
Value Meaning
0 Undefined Speed
1-15 Protocol Speed ID (PSI), refer to section 7.2.1 for the definition of PSIs.
Note: This field is invalid on a USB2 protocol port until after the port is reset.
15:14 Port Indicator Control (PIC) – RWS. Default = 0. Writing to these bits has no effect if the Port
Indicators (PIND) bit in the HCCPARAMS register is a ‘0’. If PIND bit is a ‘1’, then the bit
encodings are:
Value Meaning
0 Port indicators are off
1 Amber
2 Green
3 Undefined
Refer to the USB2 Specification section 11.5.3 for a description on how these bits shall be
used.
This field is ‘0’ if PP is ‘0’.
16 Port Link State Write Strobe (LWS) – RW. Default = ‘0’. When this bit is set to ‘1’ on a write
reference to this register, this flag enables writes to the PLS field. When ‘0’, write data in PLS
field is ignored. Reads to this bit return ‘0’.
17 Connect Status Change (CSC) – RW1CS. Default = ‘0’. ‘1’ = Change in CCS. ‘0’ = No
change. This flag indicates a change has occurred in the port’s Current Connect Status (CCS)
or Cold Attach Status (CAS) bits. Note that this flag shall not be set if the CCS transition was
due to software setting PP to ‘0’, or the CAS transition was due to software setting WPR to ‘1’.
The xHC sets this bit to ‘1’ for all changes to the port device connect status, even if system
software has not cleared an existing Connect Status Change. For example, the insertion status
changes twice before system software has cleared the changed condition, root hub hardware
will be “setting” an already-set bit (i.e., the bit will remain ‘1’). Software shall clear this bit by
writing a ‘1’ to it. Refer to section 4.19.2 for more information on change bit usage.
293
eXtensible Host Controller Interface Revision 1.0
Table 35: Port Status and Control Register Bit Definitions (PORTSC) (Continued)
Bits Description
18 Port Enabled/Disabled Change (PEC) – RW1CS. Default = ‘0’. ‘1’ = change in PED. ‘0’ = No
change. Note that this flag shall not be set if the PED transition was due to software setting PP
to ‘0’. Software shall clear this bit by writing a ‘1’ to it. Refer to section 4.19.2 for more
information on change bit usage.
For a USB2 protocol port, this bit shall be set to ‘1’ only when the port is disabled due to the
appropriate conditions existing at the EOF2 point (refer to section 11.8.1 of the USB2
Specification for the definition of a Port Error).
For a USB3 protocol port, this bit shall never be set to ‘1’.
19 Warm Port Reset Change (WRC) – RW1CS/RsvdZ. Default = ‘0’. This bit is set when Warm
Reset processing on this port completes. ‘0’ = No change. ‘1’ = Warm Reset complete. Note
that this flag shall not be set to ‘1’ if the Warm Reset processing was forced to terminate due to
software clearing PP or PED to '0'. Software shall clear this bit by writing a '1' to it. Refer to
section 4.19.5.1. Refer to section 4.19.2 for more information on change bit usage.
This bit only applies to USB3 protocol ports. For USB2 protocol ports it shall be RsvdZ.
20 Over-current Change (OCC) – RW1CS. Default = ‘0’. This bit shall be set to a ‘1’ when there
is a ‘0’ to ‘1’ or ‘1’ to ‘0’ transition of Over-current Active (OCA). Software shall clear this bit by
writing a ‘1’ to it. Refer to section 4.19.2 for more information on change bit usage.
21 Port Reset Change (PRC) – RW1CS. Default = ‘0’. This flag is set to ‘1’ due a '1' to '0'
transition of Port Reset (PR). e.g. when any reset processing (Warm or Hot) on this port is
complete. Note that this flag shall not be set to ‘1’ if the reset processing was forced to
terminate due to software clearing PP or PED to '0'. ‘0’ = No change. ‘1’ = Reset complete.
Software shall clear this bit by writing a '1' to it. Refer to section 4.19.5. Refer to section 4.19.2
for more information on change bit usage.
22 Port Link State Change (PLC) – RW1CS. Default = ‘0’. This flag is set to ‘1’ due to the
following PLS transitions:
Transition Condition
U3 -> Resume Wakeup signaling from a device
Resume -> Recovery -> U0 Device Resume complete (USB3 protocol ports only)
Resume -> U0 Device Resume complete (USB2 protocol ports only)
U3 -> Recovery -> U0 Software Resume complete (USB3 protocol ports only)
U3 -> U0 Software Resume complete (USB2 protocol ports only)
U2 -> U0 L1 Resume complete (USB2 protocol ports only)i
U0 -> U0 L1 Entry Reject (USB2 protocol ports only)i
Any state -> Inactive Error (USB3 protocol ports only). Note: PLC is asserted
only if there is an SS.Inactive.Disconnect.Detect to
SS.Inactive.Quiet transition in the LTSSM.
Note that this flag shall not be set if the PLS transition was due to software setting PP to ‘0’.
Refer to section 4.23.5 for more information. '0' = No change. '1' = Link Status Changed.
Software shall clear this bit by writing a '1' to it. Refer to “PLC Condition:” references in section
4.19.1 for the specific port state transitions that set this flag. Refer to section 4.19.2 for more
information on change bit usage.
23 Port Config Error Change (CEC) – RW1CS/RsvdZ. Default = ‘0’. This flag indicates that the
port failed to configure its link partner. 0 = No change. 1 = Port Config Error detected. Software
shall clear this bit by writing a '1' to it. Refer to section 4.19.2 for more information on change bit
usage.
Note: This flag is valid only for USB3 protocol ports. For USB2 protocol ports this bit shall be
RsvdZ.
294
eXtensible Host Controller Interface Revision 1.0
Table 35: Port Status and Control Register Bit Definitions (PORTSC) (Continued)
Bits Description
24 Cold Attach Status (CAS) – RO. Default = ‘0’. ‘1’ = Far-end Receiver Terminations were
detected in the Disconnected state and the Root Hub Port State Machine was unable advance
to the Enabled state. Refer to sections 4.19.8 for more details on the Cold Attach Status (CAS)
assertion conditions. Software shall clear this bit by writing a '1' to WPR or the xHC shall clear
this bit if CCS transitions to ‘1’.
This flag is ‘0’ if PP is ‘0’ or for USB2 protocol ports.
25 Wake on Connect Enable (WCE) – RWS. Default = ‘0’. Writing this bit to a ‘1’ enables the port
to be sensitive to device connects as system wake-up eventsj. Refer to section 4.15 for
operational model.
26 Wake on Disconnect Enable (WDE) – RWS. Default = ‘0’. Writing this bit to a ‘1’ enables the
port to be sensitive to device disconnects as system wake-up eventsj. Refer to section 4.15 for
operational model.
27 Wake on Over-current Enable (WOE) – RWS. Default = ‘0’. Writing this bit to a ‘1’ enables the
port to be sensitive to over-current conditions as system wake-up eventsj. Refer to section 4.15
for operational model.
29:28 RsvdZ.
30 Device Removablek (DR) - RO. This flag indicates if this port has a removable device
attached. ‘1’ = Device is non-removable. ‘0’ = Device is removable.
31 Warm Port Reset (WPR) – RW1S/RsvdZ. Default = ‘0’. When software writes a ‘1’ to this bit,
the Warm Reset sequence as defined in the USB3 Specification is initiated and the PR flag is
set to ‘1’. Once initiated, the PR, PRC, and WRC flags shall reflect the progress of the Warm
Reset sequence. This flag shall always return ‘0’ when read. Refer to section 4.19.5.1.
This flag only applies to USB3 protocol ports. For USB2 protocol ports it shall be RsvdZ
a. The PED and PR flags are mutually exclusive. Writing the PORTSC register with PED and PR set to ‘1’ shall result
in undefined behavior.
b. The USB3 spec allows software to issue a SetPortFeature(PORT_LINK_STATE, U1 or U2) request. These requests
are strictly used for compliance testing to generate an LGO_U1 or LGO_U2 LMP. The xHCI does not support this
capability directly, e.g. by writing the PORTSC register with PLS = U1 or U2 and LWS = ‘1’ to immediately transition
a Root Hub port link to a U1 or U2 state.
To initiate the transition of a Root Hub port link to a U1 or U2 state, software should write the USB3 PORTPMSC reg-
ister and set the U1 Timeout or U2 Timeout fields, respectively, to a value of ‘1’. This shall cause an LGO_U1 or
LGO_U2 LMP to be generated after the respective minimum delay, which is sufficient for compliance testing.
c. Disabled corresponds to the SS.Disabled Port Link State defined by the USB3 spec (section 10.14.2.6.1).
d. RxDetect corresponds to the Rx.Detect Port Link State defined by the USB3 spec (section 10.14.2.6.1).
e. Inactive corresponds to the SS.Inactive Port Link State defined by the USB3 spec (section 10.14.2.6.1).
f. Test Mode indicates that the PORTPMSC Test Mode field of a USB2 protocol port is non-zero or a USB3 protocol
port is in the Loopback link state.
g. The Resume state is not defined as a Port Link State by the USB3 spec (section 10.14.2.6.1). Refer to section
4.15.2. for xHCI use of the Resume state.
h. A port implementation shall initiate a Port Power change immediately when PP is written, however the PP flag may
be delayed in reflecting this change, e.g. due to waiting for a port related state machine to complete reset signaling
or other operation.
i. Refer to section 4.23.5.1.1 for more information on USB2 LPM support.
j. If host software sets this bit to a ‘1’ when the port is not enabled (i.e. PED = ‘0’) the results are undefined.
k. The DR field mimics the function of the USB Hub Descriptor DeviceRemovable flag for xHC Root Hub ports. Refer to
section 10.12.2.1 in the USB3 spec for more information.
295
eXtensible Host Controller Interface Revision 1.0
L1Suspendf U2
L1Resumingf Resume
296
eXtensible Host Controller Interface Revision 1.0
Figure 65: USB3 Port Power Management Status and Control Register (PORTPMSC)
31 17 16 15 8 7 0
Table 37: USB3 Port Power Management Status and Control Register Bit Definitions (PORTPMSC)
Bit Description
7:0 U1 Timeout – RWS. Default = ‘0’. Timeout value for U1 inactivity timer. If equal to FFh, the port
is disabled from initiating U1 entry. This field shall be set to ‘0’ by the assertion of PR to ‘1’. Refer
to section 4.19.4.1 for more information on U1 Timeout operation. The following are permissible
values:
Value Description
00h Zero (default)
01h 1 µs.
02h 2 µs.
…
7Fh 127 µs.
80h–FEh Reserved
FFh Infinite
15:8 U2 Timeout – RWS. Default = ‘0’. Timeout value for U2 inactivity timer. If equal to FFh, the port
is disabled from initiating U2 entry. This field shall be set to ‘0’ by the assertion of PR to ‘1’. Refer
to section 4.19.4.1 for more information on U2 Timeout operation. The following are permissible
values:
Value Description
00h Zero (default)
01h 256 µs
02h 512 µs
…
FEh 65.024 ms
FFh Infinite
A U2 Inactivity Timeout LMP shall be sent by the xHC to the device connected on this port when
this field is written. Refer to Sections 8.4.3 and 10.4.2.10 of the USB3 specification for more
details.
297
eXtensible Host Controller Interface Revision 1.0
Table 37: USB3 Port Power Management Status and Control Register Bit Definitions (PORTPMSC)
Bit Description
16 Force Link PM Accept (FLA) - RW. Default = ‘0’. When this bit is set to ‘1’, the port shall
generate a Set Link Function LMP with the Force_LinkPM_Accept bit asserted.
This flag shall be set to ‘0’ by the assertion of PR to ‘1’ or when CCS = transitions from ‘0’ to ‘1’.
Writes to this flag have no effect if PP = ‘0’.
The Set Link Function LMP is sent by the xHC to the device connected on this port when this bit
transitions from ‘0’ to ‘1’. Refer to Sections 8.4.1, 10.4.2.2 and 10.4.2.9 of the USB3 specification
for more details.
Improper use of the SS Force_LinkPM_Accept functionality can impact the performance of the
link significantly. This bit shall only be used for compliance and testing purposes. Software shall
ensure that there are no pending packets at the link level before setting this bit.
This flag is ‘0’ if PP is ‘0’.
31:17 RsvdP.
Refer to the section 10.4.2.1 of the USB3 spec for more information on U1 and U2 Timeouts.
298
eXtensible Host Controller Interface Revision 1.0
Figure 66: USB2 Port Power Management Status and Control Register (PORTPMSC)
31 28 27 17 16 15 8 7 4 3 2 0
Table 38: USB2 Port Power Management Status and Control Register Bit Definitions (PORTPMSC)
Bit Description
2:0 L1 Status (L1S) - RO. Default = 0. This field is used by software to determine whether an L1-
based suspend request (LMP transaction) was successful, specifically:
Value Meaning
0 Invalid - This field shall be ignored by software.
1 Success - Port successfully transitioned to L1 (ACK)
2 Not Yet - Device is unable to enter L1 at this time (NYET)
3 Not Supported - Device does not support L1 transitions (STALL)
4 Timeout/Error - Device failed to respond to the LPM Transaction or an error
occurred
5-7 Reserved
The value of this field is only valid when the port resides in the L0 or L1 state (PLS = ‘0’ or ‘2’).
Refer to section 4.23.5.1.1 for more information.
3 Remote Wake Enable (RWE) - RW. Default = ‘0’. System software sets this flag to enable or
disable the device for remote wake from L1. The value of this flag shall temporarily (while in L1)
override the current setting of the Remote Wake feature set by the standard Set/ClearFeature()
commands defined in Universal Serial Bus Specification, revision 2.0, Chapter 9.
7:4 Host Initiated Resume Duration (HIRD) - RW. Default = ‘0’. System software sets this field to
indicate to the recipient device how long the xHC will drive resume if it (the xHC) initiates an exit
from L1. The HIRD value is encoded as follows: The value of 0000b is interpreted as 50 µs. Each
incrementing value up adds 75 µs to the previous value. For example, 0001b is 125 µs, 0010b is
200 µs and so on. Based on this rule, the maximum value resume drive time is at encoding value
1111b which represents 1.2ms.
Refer to Section 4.1 of the USB2 LPM spec for more information on the use of the HIRD field.
15:8 L1 Device Slot - RW. Default = ‘0’. System software sets this field to indicate the ID of the
Device Slot associated with the device directly attached to the Root Hub port. A value of ‘0’
indicates no device is present. The xHC uses this field to lookup information necessary to
generate the LMP Token packet.
16 Hardware LPM Enable (HLE) - RW. Default = ‘0’. If this bit is set to ‘1’, then hardware controlled
LPM shall be enabled for this port. Refer to section 4.23.5.1.1.1.
If the USB2 Hardware LMP Capability is not supported (HLC = ‘0’) this field shall be RsvdZ.
27:15 RsvdP.
299
eXtensible Host Controller Interface Revision 1.0
Table 38: USB2 Port Power Management Status and Control Register Bit Definitions (PORTPMSC)
Bit Description
31:28 Port Test Control – RW. Default = ‘0’. When this field is ‘0’, the port is NOT operating in a test
mode. A non-zero value indicates that it is operating in test mode and the specific test mode is
indicated by the specific value.
A non-zero Port Test Control value is only valid to a port that is in the Powered-Off state (PLS =
Disabled). If the port is not in this state, the xHC shall respond with the Port Test Control field set
to Port Test Control Error. Refer to section 4.19.6 for the operational model for using these test
modes.
The encoding of the Test Mode bits for a USB2 protocol port are:
Value Test Mode
0 Test mode not enabled
1 Test J_STATE
2 Test K_STATE
3 Test SE0_NAK
4 Test Packet
5 Test FORCE_ENABLE
6-14 Reserved.
15 Port Test Control Error.
Refer to the sections 7.1.20 and 11.24.2.13 of the USB2 spec for more information on Test
Modes.
Note: All fields in this register apply only to the device attached to and immediately downstream of the
associated Root Hub port. It is the responsibility of system software to ensure the L1 Device Slot
field is consistent with the selected port.
Note: L0 and L1 refer to the USB 2.0 “Line” states referred to in the USB2 LPM ECR. These “Line” states
map to the xHCI Port Link States (PLS) U0 and U2, respectively.
Note: Due to similar exit latencies (~1ms.), the USB 2.0 L1 state is mapped to the USB 3.0 U2 state.
Note: The L1 Device Slot field provides the device address for generating USB2 LPM transactions to the
device attached to the Root Hub port.
300
eXtensible Host Controller Interface Revision 1.0
Figure 67: USB3 Port Power Management Status and Control Register (PORTPMSC)
31 16 15 0
Table 39: USB3 Port Power Management Status and Control Register Bit Definitions (PORTPMSC)
Bit Description
15:0 Link Error Count – RO. Default = ‘0’. This field returns the number of link errors detected by the
port. This value shall be reset to ‘0’ by the assertion of a Chip Hardware Reset, HCRST, when
PR transitions from ‘1’ to ‘0’, or when CCS = transitions from ‘0’ to ‘1’.
31:16 RsvdP.
301
eXtensible Host Controller Interface Revision 1.0
The Offset referenced in Table 40 is the offset from the beginning of the Runtime Register space.
302
eXtensible Host Controller Interface Revision 1.0
Bit Description
13:0 Microframe Index – RO. The value in this register increments at the end of each microframe
(e.g. 125us.). Bits [13:3] may be used to determine the current 1ms. Frame Index.
31:14 RsvdZ.
303
eXtensible Host Controller Interface Revision 1.0
RsvdP IM IP 03-00H
RsvdP 0F-0CH
Refer to section 4.9.4.3 for a discussion of Primary and Secondary Interrupters and Event Rings.
Note: All registers of the Primary Interrupter shall be initialized before setting the Run/Stop (RS) flag in
the USBCMD register to ‘1’. Secondary Interrupters may be initialized after RS = ‘1’, however all
Secondary Interrupter registers shall be initialized before an event that targets them is generated.
Not following these rules, shall result in undefined xHC behavior.
304
eXtensible Host Controller Interface Revision 1.0
Bit Description
0 Interrupt Pending (IP) - RW1C. Default = ‘0’. This flag represents the current state of the
Interrupter. If IP = ‘1’, an interrupt is pending for this Interrupter. A ‘0’ value indicates that no
interrupt is pending for the Interrupter. Refer to section 4.17.5 for the conditions that modify the
state of this flag.
1 Interrupt Enable (IE) – RW. Default = ‘0’. This flag specifies whether the Interrupter is capable
of generating an interrupt. When this bit and the IP bit are set (‘1’), the Interrupter shall generate
an interrupt when the Interrupter Moderation Counter reaches ‘0’. If this bit is ‘0’, then the
Interrupter is prohibited from generating interrupts.
31:2 RsvdP.
Note: In systems that do not support MSI or MSI-X, the IP bit may be cleared by writing a ‘1’ to it. Most
systems have write buffers that minimize overhead, but this may require a read operation to
guarantee that the write has been flushed from posted buffers.
Refer to section 4.17.2 for more information.
305
eXtensible Host Controller Interface Revision 1.0
Bit Description
15:0 Interrupt Moderation Interval (IMODI) – RW. Default = ‘4000’ (~1ms). Minimum inter-interrupt
interval. The interval is specified in 250ns increments. A value of ‘0’ disables interrupt throttling
logic and interrupts shall be generated immediately if IP = ‘0’, EHB = ‘0’, and the Event Ring is
not empty.
31:16 Interrupt Moderation Counter (IMODC) – RW. Default = undefined. Down counter. Loaded
with the IMODI value whenever IP is cleared to ‘0’, counts down to ‘0’, and stops. The associated
interrupt shall be signaled whenever this counter is ‘0’, the Event Ring is not empty, the IE and IP
flags = ‘1’, and EHB = ‘0’.
This counter may be directly written by software at any time to alter the interrupt rate.
Software may use this register to pace (or even out) the delivery of interrupts to the host CPU. This register
provides a guaranteed inter-interrupt delay between interrupts asserted by the xHC, regardless of USB
traffic conditions. To independently validate configuration settings, software may use the following
algorithm to convert the inter-interrupt Interval value to the common 'interrupts/sec' performance metric:
306
eXtensible Host Controller Interface Revision 1.0
Table 45: Event Ring Segment Table Size Register Bit Definitions (ERSTSZ)
Bit Description
15:0 Event Ring Segment Table Size – RW. Default = ‘0’. This field identifies the number of valid
Event Ring Segment Table entries in the Event Ring Segment Table pointed to by the Event
Ring Segment Table Base Address register. The maximum value supported by an xHC
implementation for this register is defined by the ERST Max field in the HCSPARAMS2 register
(5.3.4).
For Secondary Interrupters: Writing a value of ‘0’ to this field disables the Event Ring. Any
events targeted at this Event Ring when it is disabled shall result in undefined behavior of the
Event Ring.
For the Primary Interrupter: Writing a value of ‘0’ to this field shall result in undefined behavior of
the Event Ring. The Primary Event Ring cannot be disabled.
31:16 RsvdP.
Note: The Event Ring Segment Table Size may be set to any value up to ERST Max, however software
shall allocate a buffer for the Event Ring Segment Table that rounds up its size to the nearest 64B
boundary to allow full cache-line accesses.
307
eXtensible Host Controller Interface Revision 1.0
Table 46: Event Ring Segment Table Base Address Register Bit Definitions (ERSTBA)
Bit Description
5:0 RsvdP.
63:6 Event Ring Segment Table Base Address Register – RW. Default = ‘0’. This field defines the
high order bits of the start address of the Event Ring Segment Table.
Writing this register sets the Event Ring State Machine:EREP Advancement to the Start state.
Refer to Figure 20 for more information.
This field shall not be modified if HCHalted (HCH) = ‘0’.
Note: Refer to section 5.1 for register 64-bit address write conventions.
308
eXtensible Host Controller Interface Revision 1.0
Bit Description
2:0 Dequeue ERST Segment Index (DESI). Default = ‘0’. This field may be used by the xHC to
accelerate checking the Event Ring full condition. This field is written with the low order 3 bits of
the offset of the ERST entry which defines the Event Ring segment that the Event Ring
Dequeue Pointer resides in.
3 Event Handler Busy (EHB) - RW1C. Default = ‘0’. This flag shall be set to ‘1’ when the IP bit is
set to ‘1’ and cleared to ‘0’ by software when the Dequeue Pointer register is written. Refer to
section 4.17.2 for more information
63:4 Event Ring Dequeue Pointer - RW. Default = ‘0’. This field defines the high order bits of the 64-
bit address of the current Event Ring Dequeue Pointer.
309
eXtensible Host Controller Interface Revision 1.0
All registers are 32 bits in length. Software should read and write these registers using only Dword
accesses.
Note: Software shall not write the Doorbell of an endpoint until after it has issued a Configure Endpoint
Command for the endpoint and received a successful Command Completion Event.
310
eXtensible Host Controller Interface Revision 1.0
Bit Description
7:0 DB Target – RW. Doorbell Target. This field defines the target of the doorbell reference. The
table below defines the xHC notification that is generated by ringing the doorbell. Note that
Doorbell Register 0 is dedicated to Command Ring and decodes this field differently than the
other Doorbell Registers.
Device Context Doorbells (1-255)
Value Definition
0 Reserved
1 Control EP 0 Enqueue Pointer Update
2 EP 1 OUT Enqueue Pointer Update
3 EP 1 IN Enqueue Pointer Update
4 EP 2 OUT Enqueue Pointer Update
5 EP 2 IN Enqueue Pointer Update
… ...
30 EP 15 OUT Enqueue Pointer Update
31 EP 15 IN Enqueue Pointer Update
32:247 Reserved
248:255 Vendor Defined
Host Controller Doorbell (0)
Value Definition
0 Command Doorbell
1:247 Reserved
248:255 Vendor Defined
This field returns ‘0’ when read and should be treated as “undefined” by software.
When the Command Doorbell is written, the DB Stream ID field shall be cleared to ‘0’.
15:8 RsvdZ.
31:16 DB Stream ID - RW. Doorbell Stream ID. If the endpoint of a Device Context Doorbell defines
Streams, then this field shall be used to identify which Stream of the endpoint the doorbell
reference is targeting. System software is responsible for ensuring that the value written to this
field is valid.
If the endpoint defines Streams (MaxPStreams > 0), then 0, 65535 (No Stream) and 65534
(Prime) are reserved Stream ID values and shall not be written to this field.
If the endpoint does not define Streams (MaxPStreams = 0) and a non-'0' value is written to this
field, the doorbell reference shall be ignored.
This field only applies to Device Context Doorbells and shall be cleared to ‘0’ for Host
Controller Command Doorbells.
This field returns ‘0’ when read.
Note: If virtualization is supported, an xHC implementation shall ensure that an invalid values do not
affect another function (PF0 of VFx).
311
eXtensible Host Controller Interface Revision 1.0
312
6 Data Structures
This section defines the interface data structures used to communicate control, status and data between
HCD (software) and the eXtensible Host Controller (hardware). The data structure definitions in this
chapter support a 32-bit or 64-bit memory buffer address space. The interface consists of Transfer
Request Buffers (TRBs) that are managed in TRB Rings.
All transfer types (Isoch, Interrupt, Control, and Bulk) utilize the same basic TRB structure. TRBs also
support Scatter/Gather operations for Data Page concatenation in systems that employ Virtual Memory.
TRBs are optimized to reduce the total memory footprint of the schedule and to reduce (on average) the
number of memory accesses needed to execute a USB transaction.
Table 49 identifies the Max Size and alignment requirements of the various xHCI data structures. Note that
software shall ensure that no interface data structure with a Max Size less than or equal to 64KB spans a
64KB boundary, and that no interface data structure with a Max Size less than or equal to PAGESIZE
spans a PAGESIZE boundary.
The data structures defined in this chapter are (from the host controller’s perspective) a mix of read-only
and read/writable fields. Software shall preserve the read-only fields on all data structure writes.
Note: Refer to notes at the end of section 5.1.1 for a description of the Reserved field (RsvdZ, RsvdO,
etc.) use in data structures.
Note: Whenever possible, software should read and write xHCI data structures as “cache line”
operations.
All multi-byte data structure fields follow little-endian ordering; i.e. lower addresses contain the least
significant parts of the field. Bytes/characters within a field shall be in little-endian order, i.e. first char of
string in least significant byte, second char next significant byte, etc.
313
eXtensible Host Controller Interface Revision 1.0
Table 49: Data Structure Max Size, Boundary, and Alignment Requirement Summary
314
eXtensible Host Controller Interface Revision 1.0
The address of the Device Context Base Address Array shall be written to the Device Context Base
Address Array Pointer Register (DCBAAP, refer to section 5.4.6) before the xHC is placed into “run” mode
(R/S = ‘1’).
The Device Context Base Address Array data structure is also used to reference the Scratchpad Buffer
Array data structure. Refer to section 4.20 for more information on Scratchpad Buffer allocation.
If the Max Scratchpad Buffers field of the HCSPARAMS2 register is > ‘0’, then the first entry (entry_0) in
the DCBAA shall contain a pointer to the Scratchpad Buffer Array. If the Max Scratchpad Buffers field of
the HCSPARAMS2 register is = ‘0’, then the first entry (entry_0) in the DCBAA is reserved and shall be
cleared to ‘0’ by software.
Individual elements of the Device Context Base Address Array are defined in Table 50 and Table 51.
Table 50: Device Context Base Address Array Element 1-n Field Bit Definitions
Bit Description
5:0 RsvdZ.
63:6 Device Context Base Address – RW. Default = ‘0’. This field contains a pointer to a Device
Context data structure. Device Context data structure is aligned on a 64 byte boundary; hence
the low order 6 bits are reserved and always cleared to ‘0’ when initialized by software.
Table 51: Device Context Base Address Array Element 0 Field Bit Definitions
Bit Description
5:0 RsvdZ.
63:6 Scratchpad Buffer Array Base Address – RW. Default = ‘0’. This field contains the high
order bits of a 64-bit pointer to a Scratchpad Buffer Array data structure. Scratchpad Buffers
are aligned on a Page Size boundary; hence the low order bits are reserved and always
cleared to ‘0’ when initialized by software. The number of low order bits cleared to ‘0’ depend
on the value of the Page Size register.
Note: The xHCI shall not access the Device Context Base Address Array entry associated with a Device
Slot that is in the Enabled state prior to receiving the first Address Device Command for the slot,
or a Device Slot that is in the Disabled state.
315
eXtensible Host Controller Interface Revision 1.0
6.2 Contexts
xHC Contexts are data structures that act as containers for state information. In some cases a Context
may contain other Contexts.
Note: Software shall not modify Contexts “owned” by the xHC unless specifically stated.
Slot Context 0
020h
EP Context 0 BiDir
1
Direction = N/A
040h
EP Context 1 OUT
2
Direction = 0
060h
EP Context 1 IN
3
Direction = 1
080h
The Device Context data structure is used in the xHCI architecture as Output by the xHC to report device
configuration and state information to system software. The Device Context data structure is pointed to by
an entry in the Device Context Base Address Array (refer to section 6.1).
The Device Context Index (DCI) is used to reference the respective element of the Device Context data
structure.
All unused entries of the Device Context shall be initialized to ‘0’ by software.
Note: Figure 71 illustrates offsets with 32 byte Device Context data structures. i.e. the Context Size
(CSZ) field in the HCCPARAMS register = '0'. If the Context Size (CSZ) field = '1' then the Device
Context data structures consume 64 bytes each. The offsets shall be 040h for the EP Context 0,
080h for EP Context 1, and so on.
Note: Ownership of the Output Device Context data structure is passed to the xHC when software rings
the Command Ring doorbell for the first Address Device Command issued to a Device Slot after
an Enable Slot Command, i.e. the first transition of the Slot from the Enabled to the Default or
Addressed state. Software shall initialize the Output Device Context to 0 prior to the execution of
the first Address Device Command.
Ownership of the Device Context data structure is passed back to software when the Device Slot
transitions to the Disabled state.
Software shall not write the Device Context data structure while the xHC has ownership of it. This
316
eXtensible Host Controller Interface Revision 1.0
means that software shall not attempt to allocate an Input Context data structure that overlaps or
overlays an Output Device Context that is owned by the xHC.
317
eXtensible Host Controller Interface Revision 1.0
Number of Ports Root Hub Port Number Max Exit Latency 07-04H
Bits Description
19:0 Route String. This field is used by hubs to route packets to the correct downstream port. The
format of the Route String is defined in section 8.9 the USB3 specification.
As Input, this field shall be set for all USB devices, irrespective of their speed, to indicate their
location in the USB topologya.
23:20 Speed. This field indicates the speed of the device. Refer to the PORTSC Port Speed field in
Table 35 for the definition of the valid values.
24 RsvdZ.
25 Multi-TT (MTT)b. This flag is set to '1' by software if this is a High-speed hub (Speed = ‘3’ and
Hub = ‘1’) that supports Multiple TTs and the Multiple TT Interface has been enabled by
software, or if this is a Low-/Full-speed device (Speed = ‘1’ or ‘2’, and Hub = ‘0’) and connected
to the xHC through a parentc High-speed hub that supports Multiple TTs and the Multiple TT
Interface of the parent hub has been enabled by software, or ‘0’ if not.
26 Hub. This flag is set to '1' by software if this device is a USB hub, or '0' if it is a USB function.
31:27 Context Entries. This field identifies the index of the last valid Endpoint Context within this
Device Context structure. The value of ‘0’ is Reserved and is not a valid entry for this field.
Valid entries for this field shall be in the range of 1-31. This field indicates the size of the Device
Context structure. For example, ((Context Entries+1) * 32 bytes) = Total bytes for this structure.
a. If HS or FS hub in the path supports more than 14 ports the associated Route String Port field shall be set to 15.
b. Software shall issue a Set Interface request to select the Multi-TT Interface of the hub prior to issuing any transac-
tions to devices attached to the hub.
c. A “parent High-speed hub” is the hub whose downstream facing port isolates the High-speed signaling environment
from the Low-/Full-speed signaling environment for a device.
318
eXtensible Host Controller Interface Revision 1.0
Bits Description
15:0 Max Exit Latency. The Maximum Exit Latency is in microseconds, and indicates the worst
case time it takes to wake up all the links in the path to the device, given the current USB link
level power management settings.
Refer to section 4.23.5.2 for more information on the use of this field.
23:16 Root Hub Port Number. This field identifies the Root Hub Port Number used to access the
USB device. Refer to section 4.19.7 for port numbering information.
Note: Ports are numbered from 1 to MaxPorts.
31:24 Number of Ports. If this device is a hub (Hub = ‘1’), then this field is set by software to identify
the number of downstream facing ports supported by the hub. Refer to the bNbrPorts field
description in the Hub Descriptor (Table 11-13) of the USB2 spec. If this device is not a hub
(Hub = ‘0’), then this field shall be ‘0’.
Bits Description
7:0 TT Hub Slot ID. If this device is Low-/Full-speed and connected through a High-speed hub,
then this field shall contain the Slot ID of the parent High-speed huba. If this device is attached
to a Root Hub port or it is not Low-/Full-speed then this field shall be '0'.
15:8 TT Port Number. If this device is Low-/Full-speed and connected through a High-speed hub,
then this field contains the number of the downstream facing port of the parent High-speeda.
hub. If this device is attached to a Root Hub port or it is not Low-/Full-speed then this field shall
be '0'.
17:16 TT Think Time (TTT). If this is a High-speed hub (Hub = ‘1’ and Speed = High-Speed), then
this field shall be set by software to identify the time the TT of the hub requires to proceed to
the next full-/low-speed transaction.
Value Think Time
0 TT requires at most 8 FS bit times of inter-transaction gap on a full-/low-
speed downstream bus.
1 TT requires at most 16 FS bit times.
2 TT requires at most 24 FS bit times.
3 TT requires at most 32 FS bit times.
Refer to the TT Think Time sub-field of the wHubCharacteristics field description in the Hub
Descriptor (Table 11-13) and section 11.18.2 of the USB2 spec for more information on TT
Think Time. If this device is not a High-speed hub (Hub = ‘0’ or Speed != High-speed), then this
field shall be ‘0’.
21:18 RsvdZ.
31:22 Interrupter Target. This field defines the index of the Interrupter that will receive Bandwidth
Request Events and Device Notification Events generated by this slot, or when a Ring
Underrun or Ring Overrun condition is reported (refer to section 4.10.3.1). Valid values are
between 0 and MaxIntrs-1.
a. A “parent High-speed hub” is the hub whose downstream facing port isolates the High-speed signaling environment
from the Low-/Full-speed signaling environment for a device.
319
eXtensible Host Controller Interface Revision 1.0
Bits Description
7:0 USB Device Address. This field identifies the address assigned to the USB device by the
xHC, and is set upon the successful completion of a Set Address Command. Refer to the
USB2 spec for a more detailed description.
As Output, this field is invalid if the Slot State = Disabled or Default.
As Input, software shall initialize the field to ‘0’.
26:8 RsvdZ.
31:27 Slot State. This field is updated by the xHC when a Device Slot transitions from one state to
another.
Value Slot State
0 Disabled/Enabled
1 Default
2 Addressed
3 Configured
31-4 Reserved
Slot States are defined in section 4.5.3.
As Output, since software initializes all fields of the Device Context data structure to ‘0’, this
field shall initially indicate the Disabled state.
As Input, software shall initialize the field to ‘0’.
Refer to section 4.5.3 for more information on Slot State.
Note: The remaining bytes (10-1Fh) within the Slot Context are dedicated for exclusive use by the xHC
and shall be treated by system software as Reserved and Opaque (RsvdO).
Note: Figure 72 illustrates a 32 byte Slot Context. i.e. the Context Size (CSZ) field in the HCCPARAMS
register = ‘0’. If the Context Size (CSZ) field = ‘1’ then each Slot Context data structure consumes
64 bytes, where bytes 32 to 63 are also xHCI Reserved (RsvdO).
Note: The Speed, TT Hub Slot ID and TT Port Number are used to construct the Split Transaction token
to the parent hub’s Transaction Translator. Refer to section 4.3.7 for more information on these
fields.
Note: Depending on the internal organization of an xHC implementation, the USB Device Address may
not be unique across all Slot Contexts, however the USB Device Address/Root Hub Port Number
combination shall be.
Note: The value of Max Exit Latency shall depend on the link states that software has allowed the links in
the path to go to. This value is used by the xHC for generating PINGs for periodic endpoints. Its
value does not need to be modified when the device is placed on the U3 state because the
expectation is that all periodic endpoints of the device are stopped before the device is placed in
U3 state, e.g. no Pings will be generated if the periodic Transfer Rings are empty.
320
eXtensible Host Controller Interface Revision 1.0
Prior to the first command execution, a 'valid' Output Slot Context for the first Address Device Command
issued for a Device Slot requires that the value of the Slot State field shall be equal to Disabled and all
other Slot Context fields should be cleared to ‘0’. Refer to section 4.6.5 for more information on valid Slot
Context field values.
Any Output Slot Context is 'valid' for subsequent Address Device Commands because all fields of the
Output Slot Context are overwritten by the xHC.
321
eXtensible Host Controller Interface Revision 1.0
Bits Description
2:0 Endpoint State (EP State). The Endpoint State identifies the current operational state of the
endpoint.
Value Definition
0 Disabled The endpoint is not operational
1 Running The endpoint is operational, either waiting for a doorbell
ring or processing TDs.
2 Halted The endpoint is halted due to a Halt condition detected on
the USB. SW shall issue Reset Endpoint Command to
recover from the Halt condition and transition to the
Stopped state. SW may manipulate the Transfer Ring
while in this state.
3 Stopped The endpoint is not running due to a Stop Endpoint
Command or recovering from a Halt condition. SW may
manipulate the Transfer Ring while in this state.
4 Error The endpoint is not running due to a TRB Error. SW may
manipulate the Transfer Ring while in this state.
5-7 Reserved
As Output, a Running to Halted transition is forced by the xHC if a STALL condition is detected
on the endpoint. A Running to Error transition is forced by the xHC if a TRB Error condition is
detected.
As Input, this field is initialized to ‘0’ by software.
Refer to section 4.8.3 for more information on Endpoint State.
7:3 RsvdZ.
9:8 Mult. This field indicates the maximum number of bursts within an Interval that this endpoint
supports, where the valid range of values is ‘0’ to ‘2’, where ‘0’ = 1 burst, ‘1’ = 2 bursts, etc.a
This field shall be ‘0’ for all endpoint types except for SS Isochronous.
322
eXtensible Host Controller Interface Revision 1.0
Bits Description
14:10 Max Primary Streams (MaxPStreams). This field identifies the maximum number of Primary
Stream IDs this endpoint supports. Valid values are defined below. If the value of this field is
‘0’, then the TR Dequeue Pointer field shall point to a Transfer Ring. If this field is > '0' then the
TR Dequeue Pointer field shall point to a Primary Stream Context Array. Refer to section 4.12
for more information.
A value of ‘0’ indicates that Streams are not supported by this endpoint and the Endpoint
Context TR Dequeue Pointer field references a Transfer Ring.
A value of ‘1’ to ‘15’ indicates that the Primary Stream ID Width is MaxPstreams+1 and the
Primary Stream Array contains 2MaxPStreams+1 entries.
For SS Bulk endpoints, the range of valid values for this field is defined by the MaxPSASize
field in the HCCPARAMS register (refer to Table 23).
This field shall be '0' for all SS Control, Isoch, and Interrupt endpoints, and for all non-SS
endpoints.
15 Linear Stream Array (LSA). This field identifies how a Stream ID shall be interpreted.
Setting this bit to a value of ‘1’ shall disable Secondary Stream Arrays and a Stream ID shall be
interpreted as a linear index into the Primary Stream Array, where valid values for
MaxPStreams are ‘1’ to ‘15’.
A value of ‘0’ shall enable Secondary Stream Arrays, where the low order (MaxPStreams+1)
bits of a Stream ID shall be interpreted as a linear index into the Primary Stream Array, where
valid values for MaxPStreams are ‘1’ to ‘7’. And the high order bits of a Stream ID shall be
interpreted as a linear index into the Secondary Stream Array.
If MaxPStreams = ‘0’, this field RsvdZ.
Refer to section 4.12.2 for more information.
23:16 Interval. The period between consecutive requests to a USB endpoint to send or receive data.
Expressed in 125 μs. increments. The period is calculated as 125 μs * 2Interval; e.g., an Interval
value of 0 means a period of 125 μs. (20 = 1 * 125 μs.), a value of 1 means a period of 250 μs.
(22 = 2 * 125 μs.), a value of 4 means a period of 2 ms. (24 = 16 * 125 μs.), etc. The legal range
of values is 3 to 11 for Full- or Low-speed Interrupt endpoints (1 to 256 ms.) and 0 to 15 for all
other endpoint types (125 μs. to 4096 ms.). See further discussion of this field below. Refer to
section 6.2.3.6 for more information.
31:24 RsvdZ.
a. Note that there is no requirement that Max Burst Size must equal 16 if Mult is greater than 0.
323
eXtensible Host Controller Interface Revision 1.0
Bits Description
0 RsvdZ.
2:1 Error Count (CErr)a. This field defines a 2-bit down count, which identifies the number of
consecutive USB Bus Errors allowed while executing a TD. If this field is programmed with a
non-zero value when the Endpoint Context is initialized, the xHC loads this value into an
internal Bus Error Counter before executing a USB transaction and decrements it if the
transaction fails. If the Bus Error Counter counts from ‘1’ to ‘0’, the xHC ceases execution of the
TRB, sets the endpoint to the Halted state, and generates a USB Transaction Error Event for
the TRB that caused the internal Bus Error Counter to decrement to ‘0’. If system software
programs this field to ‘0’, the xHC shall not count errors for TRBs on the Endpoint’s Transfer
Ring and there shall be no limit on the number of TRB retries. Refer to section 4.10.2.7 for
more information on the operation of the Bus Error Counter.
Note: CErr does not apply to Isoch endpoints and shall be set to ‘0’ if EP Type = Isoch Out ('1')
or Isoch In ('5').
5:3 Endpoint Type (EP Type). This field identifies whether an Endpoint Context is Valid, and if so,
what type of endpoint the context defines.
Value Endpoint Type Direction
0 Not Valid N/A
1 Isoch Out
2 Bulk Out
3 Interrupt Out
4 Control Bidirectional
5 Isoch In
6 Bulk In
7 Interrupt In
6 RsvdZ.
7 Host Initiate Disable (HID). This field affects Stream enabled endpoints, allowing the Host
Initiated Stream selection feature to be disabled for the endpoint. Setting this bit to a value of ‘1’
shall disable the Host Initiated Stream selection feature. A value of ‘0’ will enable normal
Stream operation. Refer to section 4.12.1.1 for more information.
15:8 Max Burst Size. This field indicates to the xHC the maximum number of consecutive USB
transactions that should be executed per scheduling opportunity. This is a “zero-based” value,
where 0 to 15 represents burst sizes of 1 to 16, respectively. Refer to section 6.2.3.4 for more
information.
31:16 Max Packet Size. This field indicates the maximum packet size in bytes that this endpoint is
capable of sending or receiving when configured. Refer to section 6.2.3.5 for more information.
a. Software should set CErr to ‘3’ for normal operations. The values of ‘1’ or ‘2’ should be avoided during normal oper-
ation because they will reduce transfer reliability. The value of ‘0’ is typically only used for test or debug.
Note that the xHCI handles CErr differently than the EHCI did.
EHCI – if software programs a value of ‘1’ or ‘2’, that value will apply only for the first load of the EHCI Bus Error
Counter. And all subsequent reloads of the EHCI Bus Error Counter will use ‘3’. If software programmed ‘0’, then the
EHCI will leave it at ‘0’ and disable error counting.
xHCI – the Bus Error Counter is always reloaded with the value of CErr, which means transactions will be less
robust (e.g. devices may halt due intermittent errors more frequently) if CErr = ‘1’ or ‘2’.
324
eXtensible Host Controller Interface Revision 1.0
Bits Description
0 Dequeue Cycle State (DCS). This bit identifies the value of the xHC Consumer Cycle State
(CCS) flag for the TRB referenced by the TR Dequeue Pointer. Refer to section 4.9.2 for more
information. This field shall be ‘0’ if MaxPStreams > ‘0’.
3:1 RsvdZ.
63:4 TR Dequeue Pointer. As Input, this field represents the high order bits of the 64-bit base
address of a Transfer Ring or a Stream Context Array associated with this endpoint. If
MaxPStreams = '0' then this field shall point to a Transfer Ring. If MaxPStreams > '0' then this
field shall point to a Stream Context Array.
As Output, if MaxPStreams = ‘0’ this field shall be used by the xHC to store the value of the
Dequeue Pointer when the endpoint enters the Halted or Stopped states, and the value of the
this field shall be undefined when the endpoint is not in the Halted or Stopped states. if
MaxPStreams > ‘0’ then this field shall point to a Stream Context Array.
The memory structure referenced by this physical memory pointer shall be aligned to a 16-byte
boundary.
Bits Description
15:0 Average TRB Length. This field represents the average Length of the TRBs executed by this
endpoint. The value of this field shall be greater than ‘0’. Refer to section 4.14.1.1 and the
implementation note TRB Lengths and System Bus Bandwidth for more information.
The xHC shall use this parameter to calculate system bus bandwidth requirements.
31:16 Max Endpoint Service Time Interval Payload (Max ESIT Payload). This field represents the
total number of bytes this endpoint will transfer during an ESIT. This field is only valid for
periodic endpoints. Refer to section 4.14.2 for the definition of an “ESIT”.
For periodic endpoints, this value is used by the xHC to reserve the bus time in the Pipe
Schedule.
Note: The remaining bytes (14-1Fh) within the Endpoint Context are dedicated for exclusive use by the
xHC and shall be treated by system software as Reserved and Opaque (RsvdO).
Note: Figure 73 illustrates a 32 byte Endpoint Context. i.e. the Context Size (CSZ) field in the
HCCPARAMS register = ‘0’. If the Context Size (CSZ) field = ‘1’ then each Endpoint Context data
structure consumes 64 bytes, where bytes 32 to 63 are xHCI Reserved (RsvdO).
Note: The requirement that TD Fragments shall not span Transfer Ring Segments places a lower limit on
the value of Average TRB Length. E.g. a 4KB Transfer Ring Segment may describe up to 256
TRBs, where the last TRB of the segment is a Link TRB. If the MBP is 16K, then the 16KB payload
defined by a TD Fragment may not be contain more than 255 Transfer TRBs, which means that
software shall not specify an Average TRB Length value less than 65B. Larger Transfer Ring
Segments allow smaller Average TRB Length values. Refer to section 4.11.7.1.
Note: Software shall set Average TRB Length to ‘8’ for control endpoints.
325
eXtensible Host Controller Interface Revision 1.0
The Input Endpoint 0 Context is considered “valid” by the Address Device Command if: 1) the EP Type
field = Control, 2) the values of the Max Packet Size, Max Burst Size, and the Interval are considered
within range for endpoint type and the speed of the device, 3) the TR Dequeue Pointer field points to a
valid Transfer Ring, 4) the DCS field = ‘1’, 5) the MaxPStreams field = ‘0’, and 6) all other fields are within
the valid range of values.
Note: The Max Packet Size field of the Control Endpoint Context 0 shall be set by system software to the
default max packet size for the endpoint as function of the devices’ speed. e.g. 8 bytes for a Low/
Full-speed device etc. After the Device Descriptor is read from the device using the default Max
Packet Size, software may issue an Evaluate Context Command to inform the xHC of the actual
Max Packet Size for the control endpoint if it is different than the default value.
After the first Address Device Command execution, any Output Endpoint Context is 'valid' for an Address
Device Command because all fields of the Output Endpoint Context are over written by the command.
326
eXtensible Host Controller Interface Revision 1.0
6.2.3.6 Interval
The Interval field defines the Interval for polling endpoint for data transfers, expressed in 125 µs units. The
periodic interval defined by the Endpoint Context Interval field is computed as 125μs * 2Interval, where
Interval = 0 to 15.
For high-speed bulk and high-speed control OUT endpoints:
• The Interval shall specify the maximum NAK rate of the endpoint.
• A value of 0 indicates the endpoint never NAKs.
• Other values indicate at most 1 NAK each Interval number of microframes.
Refer to the definition of Interval in Table 56 for the range of valid values.
For SuperSpeed bulk and control endpoints, the Interval field shall not be used by the xHC.
For all other endpoint types and speeds, system software shall translate the bInterval field in the USB
Endpoint Descriptor to the appropriate value for this field.
For example:
For high-speed and SuperSpeed Interrupt and Isoch endpoints the bInterval field the Endpoint Descriptor
is computed as 125μs * 2bInterval-1, where bInterval = 1 to 16, therefore Interval = bInterval - 1.
For low-speed Interrupt and full-speed Interrupt and Isoch endpoints the bInterval field declared by a Full-
or Low-speed device is computed as bInterval * 1ms., where bInterval = 1 to 255. For Full- and Low-speed
devices software shall round the value of Endpoint Context Interval field down to the nearest base 2
multiple of bInterval * 8.
327
eXtensible Host Controller Interface Revision 1.0
Table 60: Offset 00h and 04h – Stream Context Field Definitions
Bits Description
0 Dequeue Cycle State (DCS). This bit identifies the value of the xHC Consumer Cycle State
(CCS) flag for the TRB referenced by the TR Dequeue Pointer. Refer to section 4.9.2 for more
information.
3:1 Stream Context Type (SCT). This field identifies whether the Stream Context is a member of a
Primary or Secondary Stream Context Array, if the TR Dequeue Pointer field references a
Transfer Ring or a Stream Context Array, and if a Stream Context Array is referenced, the size
of the array.
Value Stream Array Type Dequeue Ptr Secondary Stream Array Size
0 Secondary Transfer Ring N/A
1 Primary Transfer Ring N/A
2 Primary SSA 8
3 Primary SSA 16
4 Primary SSA 32
5 Primary SSA 64
6 Primary SSA 128
7 Primary SSA 256
Refer to section 4.12.2.1 for more information.
63:4 TR Dequeue Pointer. This field represents the high order bits of the 64-bit base address of the
TRB ring or Stream Context Array associated with this Stream.
The memory structure referenced by this physical memory pointer shall be aligned to a 16-byte
boundary. This field is initialized by software and shall be overwritten by the xHC to save the
value of the Dequeue Pointer when the endpoint enters the Halted or Stopped states. The
value of the this field shall be undefined when the endpoint is not in the Halted or Stopped
states.
Note: The remaining bytes (08-0Fh) within the Stream Context are dedicated for exclusive use by the
xHC and shall be treated by system software as Reserved and Opaque (RsvdO).
328
eXtensible Host Controller Interface Revision 1.0
Note: The Context Size (CSZ) field in the HCCPARAMS register does not apply to Stream Context data
structures, they are always 16 bytes in size.
Note: A “valid” Stream Context requires:
• The TR Dequeue Pointer is ‘0’, i.e. no Transfer Ring or Stream Context is assigned yet.
• The TR Dequeue Pointer points to a valid Transfer Ring and the DCS flag represents the
Cycle State of the segment referenced by the TR Dequeue Pointer.
• The TR Dequeue Pointer points to a valid Stream Array.
329
eXtensible Host Controller Interface Revision 1.0
Slot 1 0
040h
EP Context 0 2 1
060h
EP Context 1 OUT
3 2
Direction = 0
080h
EP Context 1 IN
4 3 Device
Direction = 1
0C0h Context
The first entry (offset 000h) of the Input Context shall be the Input Control Context data structure. The
remaining entries shall be organized identically to the Device Context data structures. Refer to section
6.2.5.1 for the definition of the Input Control Context data structure. Refer to section 6.2 for the definition of
the Device Context and its data structures.
If the Add Context flag is set for an entry in the Input Context, then the entry shall be initialized
appropriately by software. All other entries of the Input Context are ignored by the xHC. The Add Context
and Drop Context flag indices are calculated identically to the Device Context Index (DCI) described in
section 4.5.1 for the Device Context portion of the Input Context. e.g. EP context 1 OUT maps to D2 and
A2, and so on, up to EP 15 IN mapping to D31 and A31.
Note: Figure 75 illustrates offsets with 32 byte Input Control Context data structures. i.e. the Context
Size (CSZ) field in the HCCPARAMS register = '0'. If the Context Size (CSZ) field = '1' then the
Input Control Context data structures consume 64 bytes each. The offsets shall be 040h for the
Slot Context, 080h for EP Context 0, and so on.
Note: The Input Context shall be physically contiguous within a page.
330
eXtensible Host Controller Interface Revision 1.0
D31 D30 D29 D28 D27 D26 D25 D24 D23 D22 D21 D20 D19 D18 D17 D16 D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 RsvdZ 03-00H
A31 A30 A29 A28 A27 A26 A25 A24 A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 07-04H
RsvdZ 0B-08H
RsvdZ 0F-0CH
RsvdZ 13-10H
RsvdZ 17-14H
RsvdZ 1B-18H
RsvdZ 1F-1CH
Note: Figure 76 illustrates a 32 byte Input Control Context data structure. i.e. the Context Size (CSZ)
field in the HCCPARAMS register = '0'. If the Context Size (CSZ) field = '1' then the Input Control
Context data structure consumes 64 bytes, where bytes 32 to 63 are RsvdZ.
Bits Description
1:0 RsvdZ.
31:2 Drop Context flags (D2 - D31). These single bit fields identify which Device Context data
structures should be disabled by command. If set to ‘1’, the respective Endpoint Context shall
be disabled. If cleared to ‘0’, the Endpoint Context is ignored.
Bits Description
31:0 Add Context flags (A0 - A31). These single bit fields identify which Device Context data
structures shall be evaluated and/or enabled by a command. If set to ‘1’, the respective
Context shall be evaluated. If cleared to ‘0’, the Context is ignored.
Note: The specific operations to be performed on a context by a command as a function of the Drop
Context and Add Context flag settings are defined in detail in section 4.6.
Note: The fields in this data structure shall not be modified by software from the time the command is
placed on the Command Ring until the associated Command Completion Event is received.
Note: The Add Context and Delete Context flag indices are calculated identically to the Device Context
Index (DCI) described in section 4.5.1 for the Device Context portion of the Input Context. e.g. EP
context 1 OUT maps to D2 and A2, and so on, up to EP 15 IN mapping to D31 and A31.
The Add Context and Delete Context flag indices relative to Input Context are calculated as
follows:
The Input Context Index (ICI) (refer to Figure 75) of the Input Control Context is 0.
The ICI of the Slot Context is 1.
For the remaining Input Context indices 2-31, the following rules apply:
1) For Isoch, Interrupt, or Bulk type endpoints the ICI is calculated using the Endpoint Number and
331
eXtensible Host Controller Interface Revision 1.0
332
eXtensible Host Controller Interface Revision 1.0
...
Port n Port n-1 Port n-2 Port n-3
...
Note: Figure 77 illustrates a generic Port Bandwidth Context data structure. System sizes this data
structure as a function of the number of Root Hub ports supported by the xHC (i.e. MaxPorts).
Software shall round up the size of the buffer to the nearest 8-byte boundary.
Bits Description
7:0 RsvdZ.
15:8 Port 1 Bandwidth (Port 1). Percentage of Total Available Bandwidth available on Port 1.
23:16 Port 2 Bandwidth (Port 2). Percentage of Total Available Bandwidth on Port 2.
31:24 Port 3 Bandwidth (Port 3). Percentage of Total Available Bandwidth on Port 3.
Bits Description
7:0 Port n-3 Bandwidth (Port n-3). Percentage of Total Available Bandwidth on Port n-3.
15:8 Port n-2 Bandwidth (Port n-2). Percentage of Total Available Bandwidth on Port n-2.
23:16 Port n-1 Bandwidth (Port n-1). Percentage of Total Available Bandwidth on Port n-1.
31:24 Port n Bandwidth (Port n). Percentage of Total Available Bandwidth on Port n.
Note: Refer to section 4.14 for the definition of “Total Available Bandwidth”.
Note: The range of valid values depends on the value of the Dev Speed field in the Get Port Bandwidth
Command. 0 to 80% for HS, and 0 to 90% for SS and FS. Refer to section 4.14.2 for more
information.
Note: The Port fields of the Port Bandwidth Context shall report decimal percentage values in hex, i.e.
0Ah = 10%, 50h = 80%, etc.
333
eXtensible Host Controller Interface Revision 1.0
334
eXtensible Host Controller Interface Revision 1.0
RsvdZ TRB Type BEI RsvdZ IDT IOC CH NS ISP ENT C 0F-0CH
Table 65: Offset 00h and 04h – Normal TRB Field Definitions
Bits Description
63:0 Data Buffer Pointer Hi and Lo. These fields represent the 64-bit address of the TRB data
area for this transaction or 8 bytes of immediate data. The Immediate Data (IDT) control flag
selects this option for each Normal TRB.
The memory structure referenced by this physical memory pointer is allowed to begin on a byte
address boundary. However, user may find other alignments, such as 64-byte or 128-byte
alignments, to be more efficient and provide better performance.
Bits Description
16:0 TRB Transfer Length. For an OUT, this field defines the number of data bytes the xHC shall
send during the execution of this TRB. If the value of this field is ‘0’ when the xHC fetches this
TRB, the xHC shall execute a zero-length transaction and retires the TD.
Note: If a zero-length transfer is specified, the Data Buffer Pointer field is ignored by the xHC,
irrespective of the state of the IDT flag. Refer to section 4.9.1 for more information on
zero-length Transfer TRB handling.
For an IN, the value of the field identifies the size of the data buffer referenced by the Data
Buffer Pointer, i.e. the number of bytes the host expects the endpoint to deliver.
Valid values are 0 to 64K.
21:17 TD Size. This field provides an indicator of the number of packets remaining in the TD. Refer to
section 4.11.2.4 for how this value is calculated.
31:22 Interrupter Target. This field defines the index of the Interrupter that will receive events
generated by this TRB. Valid values are between 0 and MaxIntrs-1.
335
eXtensible Host Controller Interface Revision 1.0
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of the Transfer ring.
1 Evaluate Next TRB (ENT). If this flag is ‘1’ the xHC shall fetch and evaluate the next TRB
before saving the endpoint state. Refer to section 4.12.3 for more information.
2 Interrupt-on Short Packet (ISP). If this flag is ‘1’ and a Short Packet is encountered for this
TRB (i.e., less than the amount specified in TRB Transfer Length), then a Transfer Event TRB
shall be generated with its Completion Code set to Short Packet. The TRB Transfer Length
field in the Transfer Event TRB shall reflect the residual number of bytes not transferred into
the associated data buffer. In either case, when a Short Packet is encountered, the TRB shall
be retired without error and the xHC shall advance to the next Transfer Descriptor (TD).
Note that if the ISP and IOC flags are both ‘1’ and a Short Packet is detected, then only one
Transfer Event TRB shall be queued to the Event Ring.
3 No Snoop (NS). When set to ‘1’, the xHC is permitted to set the No Snoop bit in the Requester
Attributes of the PCIe transactions it initiates if the PCIe configuration Enable No Snoop flag is
also set. When cleared to ‘0’, the xHC is not permitted to set PCIe packet No Snoop Requester
Attribute. Refer to section 4.18.1 for more information.
NOTE: If software sets this bit, then it is responsible for maintaining cache consistency.
4 Chain bit (CH). Set to ‘1’ by software to associate this TRB with the next TRB on the Ring. A
Transfer Descriptor (TD) is defined as one or more TRBs. The Chain bit is used to identify the
TRBs that comprise a TD. The Chain bit is always ‘0’ in the last TRB of a TD.
5 Interrupt On Completion (IOC). If this bit is set to ‘1’, it specifies that when this TRB
completes, the Host Controller shall notify the system of the completion by placing an Transfer
Event TRB on the Event ring and asserting an interrupt to the host at the next interrupt
threshold. Note that the interrupt assertion may be blocked for the Transfer Event by BEI. Refer
to section 4.17.5.
6 Immediate Data (IDT). If this bit is set to ‘1’, it specifies that the Data Buffer Pointer field of this
TRB contains data, not a pointer, and the Length field shall contain a value between ‘0’ and ‘8’
to indicate the number of valid bytes from offset 0 in the TRB that should be used as data.
Note: If the IDT flag is set in one Transfer TRB of a TD, then it shall be the only Transfer TRB
of the TD. An Event Data TRB may be included in the TD. Failure to follow this rule
may result in undefined xHC operation.
Note: IDT shall not be set (‘1’) for TRBs on IN endpoints.
8:7 RsvdZ.
9 Block Event Interrupt (BEI). If this bit is set to ‘1’ and IOC = ‘1’, then the Transfer Event
generated by IOC shall not assert an interrupt to the host at the next interrupt threshold. Refer
to section 4.17.5.
15:10 TRB Type. This shall be set to Normal TRB type. Refer to Table 131 for the definition of the
valid Transfer TRB type IDs.
31:16 RsvdZ.
336
eXtensible Host Controller Interface Revision 1.0
A Setup Stage TRB is created by system software to initiate a USB Setup packet on a control endpoint.
Refer to section 3.2.9 for more information on Setup Stage TRBs and the operation of control endpoints.
Also refer to section 8.5.3 in the USB2 spec. for a description of “Control Transfers”.
Bits Description
7:0 bmRequestType. Refer to Table 9-2 “Format of Setup Data” in the USB2 or USB3
specification.
15:8 bRequest. Refer to Table 9-2 “Format of Setup Data” in the USB2 or USB3 specification.
31:16 wValue. Refer to Table 9-2 “Format of Setup Data” in the USB2 or USB3 specification.
Bits Description
15:0 wIndex. Refer to Table 9-2 “Format of Setup Data” in the USB2 or USB3 specification.
31:16 wLength. Refer to Table 9-2 “Format of Setup Data” in the USB2 or USB3 specification.
Bits Description
16:0 TRB Transfer Length. Always 8.
21:17 RsvdZ.
31:22 Interrupter Target. This field defines the index of the Interrupter that will receive events
generated by this TRB. Valid values are between 0 and MaxIntrs-1.
337
eXtensible Host Controller Interface Revision 1.0
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue point of a Transfer ring.
4:1 RsvdZ.
5 Interrupt On Completion (IOC). If this bit is set to ‘1’, it specifies that when this TRB
completes, the Host Controller shall notify the system of the completion by placing an Event
TRB on the Event ring and sending an interrupt at the next interrupt threshold.
6 Immediate Data (IDT). This bit shall be set to ‘1’ in a Setup Stage TRB. It specifies that the
Parameter component of this TRB contains Setup Data.
9:7 RsvdZ.
15:10 TRB Type. This field is set to Setup Stage TRB type. Refer to Table 131 for the definition of the
Type TRB IDs.
17:16 Transfer Type (TRT). This field indicates the type and direction of the control transfer.
Value Definition
0 No Data Stage
1 Reserved
2 OUT Data Stage
3 IN Data Stage
Refer to section 4.11.2.2 for more information on the use of TRT.
31:18 RsvdZ.
338
eXtensible Host Controller Interface Revision 1.0
A Data Stage TRB is used generate the Data stage transaction of a USB Control transfer. Refer to section
3.2.9 for more information on Control transfers and the operation of control endpoints. Also refer to section
8.5.3 in the USB2 spec. for a description of “Control Transfers”.
RsvdZ DIR TRB Type RsvdZ IDT IOC CH NS ISP ENT C 0F-0CH
Table 72: Offset 00h and 04h – Data Stage TRB Field Definitions
Bits Description
63:0 Data Buffer Pointer Hi and Lo. These fields represent the 64-bit address of the Data buffer
area for this transaction
The memory structure referenced by this physical memory pointer is allowed to begin on a byte
address boundary. However, user may find other alignments, such as 64-byte or 128-byte
alignments, to be more efficient and provide better performance.
Bits Description
16:0 TRB Transfer Length. For an OUT, this field is the number of data bytes the xHC will send
during the execution of this TRB.
For an IN, the initial value of the field identifies the size of the data buffer referenced by the
Data Buffer Pointer, i.e. the number of bytes the host expects the endpoint to deliver.
Valid values are 0 to 64K.
21:17 TD Size. This field provides an indicator of the number of packets remaining in the TD. Refer to
section 4.11.2.4 for how this value is calculated.
31:22 Interrupter Target. This field defines the index of the Interrupter that will receive events
generated by this TRB. Valid values are between 0 and MaxIntrs-1.
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of the Transfer ring.
1 Evaluate Next TRB (ENT). If this flag is ‘1’ the xHC shall fetch and evaluate the next TRB
before saving the endpoint state. Refer to section 4.12.3 for more information.
2 Interrupt-on Short Packet (ISP). If this flag is ‘1’ and a Short Packet is encountered for this
TRB (i.e., less than the amount specified in TRB Transfer Length), then a Transfer Event TRB
shall be generated with its Completion Code set to Short Packet. The TRB Transfer Length
field in the Transfer Event TRB shall reflect the residual number of bytes not transferred into
the associated data buffer. In either case, when a Short Packet is encountered, the TRB shall
be retired without error and the xHC shall advance to the Status Stage TD.
Note: if the ISP and IOC flags are both ‘1’ and a Short Packet is detected, then only one
Transfer Event TRB shall be queued to the Event Ring.
339
eXtensible Host Controller Interface Revision 1.0
Table 74: Offset 0Ch – Data Stage TRB Field Definitions (Continued)
Bits Description
3 No Snoop (NS). When set to ‘1’, the xHC is permitted to set the No Snoop bit in the Requester
Attributes of the PCIe transactions it initiates if the PCIe configuration Enable No Snoop flag is
also set. When cleared to ‘0’, the xHC is not permitted to set PCIe packet No Snoop Requester
Attribute. Refer to section 4.18.1 for more information.
NOTE: If software sets this bit, then it is responsible for maintaining cache consistency.
4 Chain bit (CH). Set to ‘1’ by software to associate this TRB with the next TRB on the Ring. A
Data Stage TD is defined as a Data Stage TRB followed by zero or more Normal TRBs. The
Chain bit is used to identify a multi-TRB Data Stage TD. The Chain bit is always ‘0’ in the last
TRB of a Data Stage TD.
5 Interrupt On Completion (IOC). If this bit is set to ‘1’, it specifies that when this TRB
completes, the Host Controller shall notify the system of the completion by placing an Event
TRB on the Event ring and asserting an interrupt to the host at the next interrupt threshold.
6 Immediate Data (IDT). If this bit is set to ‘1’, it specifies that the Data Buffer Pointer field of this
TRB contains data, not a pointer. If this is a “Normal” TRB, the Length field shall
contain a value between 1 and 8 to indicate the number of valid bytes from offset 0 in
the TRB that should be used as data.
9:7 RsvdZ.
15:10 TRB Type. This shall be set to Data Stage TRB type. Refer to Table 131 for the definition of the
valid Transfer TRB type IDs.
16 Direction (DIR). This bit indicates the direction of the data transfer as defined in the Data State
TRB Direction column of Table 7. If cleared to ‘0’, the data stage transfer direction is OUT
(Write Data). If set to ‘1’, the data stage transfer direction is IN (Read Data). Refer to section
4.11.2.2 for more information on the use of DIR.
31:17 RsvdZ.
340
eXtensible Host Controller Interface Revision 1.0
A Status Stage TRB is used to generate the Status stage transaction of a USB Control transfer. Refer to
section 3.2.9 for more information on Control transfers and the operation of control endpoints.
RsvdZ 03-00H
RsvdZ 07-04H
Bits Description
21:0 RsvdZ.
31:22 Interrupter Target. This field defines the index of the Interrupter that will receive events
generated by this TRB. Valid values are between 0 and MaxIntrs-1.
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of the Transfer ring.
1 Evaluate Next TRB (ENT). If this flag is ‘1’ the xHC shall fetch and evaluate the next TRB
before saving the endpoint state. Refer to section 4.12.3 for more information.
3:2 RsvdZ.
4 Chain bit (CH). Set to ‘1’ by software to associate this TRB with the next TRB on the Ring. A
Status Stage TD is defined as a Status Stage TRB followed by zero or one Event Data TRB.
The Chain bit is used to identify a multi-TRB Status Stage TD. The Chain bit is always ‘0’ in the
last TRB of a Status Stage TD.
5 Interrupt On Completion (IOC). If this bit is set to ‘1’, it specifies that when this TRB
completes, the Host Controller shall notify the system of the completion by placing an Event
TRB on the Event ring and asserting an interrupt to the host at the next interrupt threshold.
9:6 RsvdZ.
15:10 TRB Type. This field shall be set to Status Stage TRB type. Refer to Table 131 for the definition
of the valid Transfer TRB type IDs.
16 Direction (DIR). This bit indicates the direction of the data transfer as defined in the Status
State TRB Direction column of Table 7. If cleared to ‘0’, the status stage transfer direction is
OUT (Host-to-device). If set to ‘1’, the status stage transfer direction is IN (Device-to-host).
Refer to section 4.11.2.2 for more information on the use of DIR.
31:17 RsvdZ.
A Transfer Event generated by this TRB shall reflect the status state response from the USB device.
341
eXtensible Host Controller Interface Revision 1.0
SIA Frame ID TLBPC TRB Type BEI TBC IDT IOC CH NS ISP ENT C 0F-0CH
Table 77: Offset 00h and 04h – Isoch TRB Field Definitions
Bits Description
63:0 Data Buffer Pointer Hi and Lo. This field represents the 64-bit address of the TRB data area
for this transaction or 8 bytes of immediate data. The Immediate Data (IDT) control flag selects
this option for each Isoch TRB.
The memory structure referenced by this physical memory pointer is allowed to begin on a byte
address boundary. However, user may find other alignments, such as 64-byte or 128-byte
alignments, to be more efficient and provide better performance.
Bits Description
16:0 TRB Transfer Length. For an OUT, this field is the number of data bytes the host controller will
send during the execution of this TRB.
For an IN, the initial value of the field is the number of bytes the host expects the endpoint to
deliver, i.e. the number of bytes the host expects the endpoint to deliver.
Refer to section 4.9.1 for more information on zero-length Transfer TRB handling.
Valid values are 0 to 64K.
21:17 TD Size. This field provides an indicator of the number of bytes remaining in the TD. Refer to
section 4.11.2.4 for how this value is calculated.
31:22 Interrupter Target. This field defines the index of the Interrupter that will receive events
generated by this TRB. Valid values are between 0 and MaxIntrs-1.
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue point of a Transfer ring.
1 Evaluate Next TRB (ENT). If this flag is ‘1’ the xHC shall fetch and evaluate the next TRB
before saving the endpoint state. Refer to section 4.12.3 for more information.
2 Interrupt-on Short Packet (ISP). If this flag is ‘1’ and a Short Packet is encountered for this
TRB (i.e., less than the amount specified in TRB Transfer Length), then a Transfer Event TRB
shall be generated with the with its Completion Status set to Short Packet. In either case when
a Short Packet is encountered, the TRB shall be retired without error and the xHC shall
advance to the next Transfer Descriptor (TD).
Note: if the ISP and IOC flags are both ‘1’ and a Short Packet is detected, then only one
Transfer Event TRB shall be queued to the Event Ring.
342
eXtensible Host Controller Interface Revision 1.0
Bits Description
3 No Snoop (NS). When set to ‘1’, the xHC is permitted to set the No Snoop bit in the Requester
Attributes of the PCIe transactions it initiates if the PCIe configuration Enable No Snoop flag is
also set. When cleared to ‘0’, the xHC is not permitted to set PCIe packet No Snoop Requester
Attribute. Refer to section 4.18.1 for more information.
NOTE: If software sets this bit, then it is responsible for maintaining cache consistency.
4 Chain bit (CH). Set to ‘1’ by software to associate this TRB with the next TRB on the Ring. An
Isoch Transfer Descriptor is defined as an Isoch TRB followed by zero or more Normal TRBs.
The Chain bit is used to identify the TRBs that comprise the TD. The Chain bit is always ‘0’ in
the last TRB of an Isoch TD.
5 Interrupt On Completion (IOC). If this bit is set to ‘1’, it specifies that when this TRB
completes, the Host Controller shall notify the system of the completion by placing an Event
TRB on the Event ring and sending an interrupt at the next interrupt threshold.
6 Immediate Data (IDT). If this bit is set to ‘1’, it specifies that the Data Buffer Pointer field of this
TRB contains data, not a pointer, and the Length field shall contain a value between ‘0’ and ‘8’
to indicate the number of valid bytes from offset 0 in the TRB that should be used as data.
8:7 Transfer Burst Count (TBC). This field indentifies number of bursts - 1 that shall be required
to move this Isoch TD. All bursts except the last shall transfer Max Burst Size packets. The last
burst shall transfer TLBPC + 1 packets. Refer to section 4.11.2.3 for more information.
9 Block Event Interrupt (BEI). If this bit is set to ‘1’ and IOC = ‘1’, then the Transfer Event
generated by IOC shall not assert an interrupt to the host at the next interrupt threshold. Refer
to section 4.17.5.
15:10 TRB Type. This field is set to Isoch TRB type. Refer to Table 131 for the definition of the Type
TRB IDs.
19:16 Transfer Last Burst Packet Count (TLBPC). This field indentifies number of packets -1 that
shall be in the last burst of this Isoch TD, e.g. ‘0’ = 1 packet, ‘1’ = 2 packets, etc. Refer to
section 4.11.2.3 for more information.
30:20 Frame ID. The value in this field identifies the target 1ms. frame that the Interval associated
with this Isochronous Transfer Descriptor will start on. Bits [13:3] of the Microframe Index field
of the MFINDEX register may be used to determine the current periodic frame. This field is
ignored by the xHC if the Start Isoch ASAP flag is set (‘1’). For more information on the
programming of this field refer to section 4.11.2.5.
31 Start Isoch ASAP (SIA). If this flag is set (‘1’), the Frame ID is ignored and the Isoch TD is
scheduled as soon as possible. If this flag is cleared (‘0’), the Frame ID is valid and the Isoch
TD is scheduled the next time there is a match between the Frame ID and the Frame Index
portion (bits 13:3) of the Microframe Index (MFINDEX) register. Refer to Figure 29. For more
information refer to section 4.11.2.3.
343
eXtensible Host Controller Interface Revision 1.0
6.4.1.4 No Op TRB
The No Op TRB provides a simple means for verifying the operation of the basic Transfer Ring mecha-
nisms offered by the xHCI. It may be inserted on a Transfer Ring to generate a Transfer Event.
Note: Consecutive No Op TRBs may impact xHC performance and should be avoided by software.
Refer to section 4.11.7 for more information on No Op TRB placement rules.
RsvdZ 03-00H
RsvdZ 07-04H
Bits Description
21:0 RsvdZ.
31:22 Interrupter Target. This field defines the index of the Interrupter that will receive Transfer
Events generated by this TRB. Valid values are between 0 and MaxIntrs-1.
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Transfer Ring.
1 Evaluate Next TRB (ENT). If this flag is ‘1’ the xHC shall fetch and evaluate the next TRB
before saving the endpoint state. Refer to section 4.12.3 for more information.
3:2 RsvdZ.
4 Chain bit (CH). Set to ‘1’ by software to associate this TRB with the next TRB on the Ring. A
Transfer Descriptor (TD) is defined as one or more TRBs. The Chain bit is used to identify the
TRBs that comprise a TD. The Chain bit is always ‘0’ in the last TRB of a TD.
5 Interrupt On Completion (IOC). If this bit is set to ‘1’, it specifies that when this TRB
completes, the Host Controller shall notify the system of the completion by placing a Transfer
Event TRB on the Event ring and sending an interrupt at the next interrupt threshold.
9:6 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
No Op TRB type ID.
31:16 RsvdZ.
344
eXtensible Host Controller Interface Revision 1.0
Table 82: Offset 00h and 04h – Transfer Event TRB Field Definitions
Bits Description
63:0 TRB Pointer Hi and Lo. This field represents the 64-bit address of the TRB that generated this
event or 64 bits of Event Data if the ED flag is ‘1’.
If a TRB memory structure is referenced by this field (ED = ‘0’), then it shall be physical
memory pointer aligned on a 16-byte boundary, i.e. bits 0 through 3 of the address are ‘0’.
Bits Description
23:0 TRB Transfer Length. This field shall reflect the residual number of bytes not transferred.
For an OUT, this field shall indicate the value of the Length field of the Transfer TRB, minus the
data bytes that were successfully transmitted. A successful OUT transfer shall return a Length
of ‘0’.
For an IN, the this field shall indicate the value of the Length field of the Transfer TRB, minus
the data bytes that were successfully received. If the device terminates the receive transfer
with a short packet, then this field shall indicate the difference between the expected transfer
size (defined by the Transfer TRB) and the actual number of bytes received. If the receive
transfer completed with an error, then this field shall indicated the difference between the
expected transfer size and the number of bytes successfully received.
If the Event Data flag is ‘0’ the legal range of values is 0 to 10000h. If the Event Data flag is ‘1’
this field is set to the value of the Event Data Transfer Length Accumulator (EDTLA). Refer to
section 4.11.5.2 for a description of EDTLA.
31:24 Completion Code. This field encodes the completion status that can be identified by a TRB.
Refer to section 6.4.5 for an enumerated list of possible error conditions.
345
eXtensible Host Controller Interface Revision 1.0
Bits Description
0 Cycle bit (C). This bit is used to mark the Dequeue Pointer of an Event Ring.
1 RsvdZ.
2 Event Data (ED). When set to ‘1’, the event was generated by an Event Data TRB and the
Parameter Component (TRB Pointer field) contains a 64-bit value provided by the Event Data
TRB. If cleared to ‘0’, the Parameter Component (TRB Pointer field) contains a pointer to the
TRB that generated this event. Refer to section 4.11.5.2 for more information.
9:3 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Transfer Event TRB type ID.
20:16 Endpoint ID. The ID of the Endpoint that generated the event. This value is used as an index
in the Device Context to select the Endpoint Context associated with this event.
23:21 RsvdZ.
31:24 Slot ID. The ID of the Device Slot that generated the event. This is value is used as an index in
the Device Context Base Address Array to select the Device Context of the source device.
Note: For multi-TRB TDs, if ED = ‘0’, the TRB Transfer Length only reflects the number of bytes
transferred for the buffer associated with the Transfer TRB pointed to by the Transfer Event, not
the total bytes transferred for the TD.
Note: A Ring Overrun or Ring Underrun Event utilizes a Transfer Event TRB to report the error. In this
case, the TRB Pointer field is invalid.
Note: If an error occurs during the execution of a Transfer TRB that does not have its IOC or ISP flags
set, a Transfer Event shall be generated for the error and the Transfer Event shall point to the
offending TRB. The Transfer Ring Dequeue Pointer shall advance to the next TD.
Note: CStream is not valid until a Streams endpoint transitions to the Start Stream state for the first time.
A Transfer Event generated by a Stop Endpoint Command shall report ‘0’ in the TRB Pointer and
TRB Length fields if the command is executed and CStream is invalid. Refer to section 4.12.1.
346
eXtensible Host Controller Interface Revision 1.0
Table 85: Offset 00h and 04h – Command Completion Event TRB Field Definition
Bits Description
3:0 RsvdZ.
63:4 Command TRB Pointer Hi and Lo. This field represents the high order bits of the 64-bit
address of the Command TRB that generated this event. Note that this field is not valid for
some Completion Code values. Refer to Table 130 for specific cases.
The memory structure referenced by this physical memory pointer shall be aligned on a 16-
byte address boundary.
Table 86: Offset 08h – Command Completion Event TRB Field Definitions
Bits Description
23:0 RsvdZ.
31:24 Completion Code. This field encodes the completion status of the command that generated
the event. Refer to the respective command definition for a list of the possible Completion
Codes associated with the command. Refer to section 6.4.5 for an enumerated list of possible
error conditions.
Table 87: Offset 0Ch – Command Completion Event TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Dequeue Pointer of an Event Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Command Completion Event TRB type ID.
23:16 VF ID. The ID of the Virtual Function that generated the event. Note that this field is valid only if
Virtual Functions are enabled. If they are not enabled this field shall be cleared to ‘0’.
347
eXtensible Host Controller Interface Revision 1.0
Table 87: Offset 0Ch – Command Completion Event TRB Field Definitions (Continued)
Bits Description
31:24 Slot ID. The Slot ID field shall be updated by the xHC to reflect the slot associated with the
command that generated the event, with the following exceptions:
- The Slot ID shall be cleared to ‘0’ for No Op, Set Latency Tolerance Value, Get Port
Bandwidth, and Force Event Commands.
- The Slot ID shall be set to the ID of the newly allocated Device Slot for the Enable Slot
Command.
- The value of Slot ID shall be vendor defined when generated by a vendor defined command.
This value is used as an index in the Device Context Base Address Array to select the Device
Context of the source device. If this Event is due to a Host Controller Command, then this field
shall be cleared to ‘0’.
Note: All commands for a Device Slot or VF are executed in order.
Note: All Vendor Defined Event TRBs shall support the Completion Code, Cycle bit, and TRB Type
fields. The remaining fields and reserved areas may be vendor defined/allocated.
348
eXtensible Host Controller Interface Revision 1.0
RsvdZ 07-04H
Table 88: Offset 00h – Port Status Change Event TRB Field Definitions
Bits Description
23:0 RsvdZ.
31:24 Port ID. The Port Number of the Root Hub Port that generated this event.
Table 89: Offset 08h – Port Status Change Event TRB Field Definitions
Bits Description
23:0 RsvdZ.
31:24 Completion Code. This field encodes the completion status that can be identified by a TRB.
The Completion Code field shall be set to Success.
Table 90: Offset 0Ch – Port Status Change Event TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Dequeue Pointer of an Event Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Port Status Change Event TRB type ID.
31:16 RsvdZ.
349
eXtensible Host Controller Interface Revision 1.0
ResvZ 07-04H
Table 91: Offset 08h – Bandwidth Request Event TRB Field Definitions
Bits Description
23:0 RsvdZ.
31:24 Completion Code. This field encodes the completion status that can be identified by a TRB.
The Completion Code field shall always be set to Success for a Bandwidth Request Event.
Table 92: Offset 0Ch – Bandwidth Request Event TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Dequeue Pointer of an Event Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Bandwidth Request TRB type ID.
23:16 RsvdZ.
31:24 Slot ID. The ID of the Device Slot that should evaluate its bandwidth requirements. This is
value is used as an index in the Device Context Base Address Array to select the Device
Context of the source device.
350
eXtensible Host Controller Interface Revision 1.0
ResvZ 07-04H
Bits Description
4:0 DB Reason. This field contains the value written to the DB Target field of the associated
Doorbell.
31:5 RsvdZ.
Bits Description
23:0 RsvdZ.
31:24 Completion Code. This field encodes the completion status that can be identified by a TRB.
The Completion Code field shall always be set to Success for a Doorbell Event.
Bits Description
0 Cycle bit (C). This bit is used to mark the Dequeue Pointer of an Event Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Doorbell Event TRB type ID.
23:16 VF ID. The ID of the Virtual Function that generated the event.
31:24 Slot ID. The ID of the Device Slot that generated the event. This is value is used as an index in
the Device Context Base Address Array to select the Device Context of the source device. If
this Event is due to a Host Controller Command, then this field shall be cleared to ‘0’.
351
eXtensible Host Controller Interface Revision 1.0
RsvdZ 03-00H
RsvdZ 07-04H
Table 96: Offset 08h – Host Controller Event TRB Field Definitions
Bits Description
23:0 RsvdZ.
31:24 Completion Code. This field encodes the completion status that can be identified by a TRB.
Refer to section 6.4.5 for an enumerated list of possible completion code values.
Table 97: Offset 0Ch – Host Controller Event TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Dequeue Pointer of an Event Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Host Controller Event TRB type ID.
31:16 RsvdZ.
352
eXtensible Host Controller Interface Revision 1.0
Table 98: Offset 00h and 04h – Device Notification Event TRB Field Definitions
Bits Description
3:0 RsvdZ.
7:4 Notification Type. This field reports the value of the Notification Type field of the received USB
Device Notification Transaction Packet.
63:8 Device Notification Data. This field reports the value of bytes 05h through 0Bh of the received
USB Device Notification Transaction Packet (DNTP), i.e. Device Notification Event (DNE) TRB
byte 01h = DNTP byte 05h,..., DNE TRB byte 07h = DNTP byte 0Bh.
Table 99: Offset 08h – Device Notification Event TRB Field Definitions
Bits Description
23:0 RsvdZ.
31:24 Completion Code. This field encodes the completion status of the TRB, and shall always be
set to Success. Refer to section 6.4.5 for an enumerated list of the completion code values.
Table 100: Offset 0Ch – Device Notification Event TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Dequeue Pointer of an Event Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Device Notification Event TRB type ID.
23:16 RsvdZ.
31:24 Slot ID. The ID of the Device Slot that generated the event. This value is used as an index in
the Device Context Base Address Array to select the Device Context of the source device.
353
eXtensible Host Controller Interface Revision 1.0
RsvdZ 03-00H
RsvdZ 07-04H
Table 101: Offset 08h – MFINDEX Wrap Event TRB Field Definitions
Bits Description
23:0 RsvdZ.
31:24 Completion Code. This field encodes the completion status of the TRB, and shall always be
set to Success. Refer to section 6.4.5 for an enumerated list of the completion code values.
Table 102: Offset 0Ch – MFINDEX Wrap Event TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Dequeue Pointer of an Event Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
MFINDEX Wrap Event TRB type ID.
31:16 RsvdZ.
354
eXtensible Host Controller Interface Revision 1.0
RsvdZ 03-00H
RsvdZ 07-04H
RsvdZ 0B-08H
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
No Op Command TRB type ID.
31:16 RsvdZ.
355
eXtensible Host Controller Interface Revision 1.0
RsvdZ 03-00H
RsvdZ 07-04H
RsvdZ 0B-08H
Table 104: Offset 0Ch – Enable Slot Command TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Enable Slot Command TRB type ID.
31:16 RsvdZ.
356
eXtensible Host Controller Interface Revision 1.0
RsvdZ 03-00H
RsvdZ 07-04H
RsvdZ 0B-08H
Table 105: Offset 0Ch – Disable Slot Command TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Disable Slot Command TRB type ID.
23:16 RsvdZ.
31:24 Slot ID. The ID of the Device Slot to disable.
357
eXtensible Host Controller Interface Revision 1.0
RsvdZ 0B-08H
Table 106: Offset 00h and 04h – Address Device Command TRB Field Definitions
Bits Description
3:0 RsvdZ.
63:4 Input Context Pointer Hi and Lo. This field represents the high order bits of the 64-bit base
address of the Input Context data structure associated with this command. Refer to section
6.2.5 for more information on the Input Context data structure.
The memory structure referenced by this physical memory pointer shall be aligned on a 16-
byte address boundary.
Table 107: Offset 0Ch – Address Device Command TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
8:1 RsvdZ.
9 Block Set Address Request (BSR). When this flag is set to ‘0’ the Address Device Command
shall generate a USB SET_ADDRESS request to the device. When this flag is set to ‘1’ the
Address Device Command shall not generate a USB SET_ADDRESS request. Refer to
section 4.6.5 for more information on the use of this flag.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Address Device Command TRB type ID.
23:16 RsvdZ.
31:24 Slot ID. The ID of the Device Slot that is the target of this command.
358
eXtensible Host Controller Interface Revision 1.0
RsvdZ 0B-08H
Table 108: Offset 00h and 04h – Configure Endpoint Command TRB Field Definitions
Bits Description
3:0 RsvdZ.
63:4 Input Context Pointer Hi and Lo. This field represents the high order bits of the 64-bit base
address of the Input Context data structure associated with this event. Refer to section 6.2.5 for
more information on the Input Context data structure.
The memory structure referenced by this physical memory pointer shall be aligned on a 16-
byte address boundary.
Table 109: Offset 0Ch – Configure Endpoint Command TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
8:1 RsvdZ.
9 Deconfigure (DC). Set to ‘1’ by software to “deconfigure” the Device Slot. If the DC flag = ‘1’,
the Input Context Pointer field is ignored by the xHC.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Configure Endpoint Command TRB type ID.
23:16 RsvdZ.
31:24 Slot ID. The ID of the Device Slot that is the target of this command.
359
eXtensible Host Controller Interface Revision 1.0
RsvdZ 0B-08H
The Evaluate Context Command TRB uses the same format as the Address Device Command TRB, with
the following exceptions: 1) the TRB Type field is set to the Evaluate Context Command TRB type ID, and
2) the BSR field is not used. Refer to Table 107 for the definitions of the remaining fields in the Address
Device Command Control component.
360
eXtensible Host Controller Interface Revision 1.0
RsvdZ 03-00H
RsvdZ 07-04H
RsvdZ 0B-08H
Table 110: Offset 0Ch – Reset Endpoint Command TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
8:1 RsvdZ.
9 Transfer State Preserve (TSP). Set to ‘1’ by software if the Reset operation does not affect the
current transfer state of the endpoint. Cleared to ‘0’ by software if the Reset operation resets
the current transfer state of the endpoint, i.e. The Data Toggle of a USB2 device or the
Sequence Number of a USB3 device is cleared to ‘0’. Also refer to section 4.6.8.1.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Reset Endpoint Command TRB type ID.
20:16 Endpoint ID. This field identifies the DCI of the endpoint to be reset.
23:21 RsvdZ.
31:24 Slot ID. The ID of the Device Slot.
361
eXtensible Host Controller Interface Revision 1.0
RsvdZ 03-00H
RsvdZ 07-04H
RsvdZ 0B-08H
Table 111: Offset 0Ch – Stop Endpoint Command TRB Field Definitions
Bits Description
0 Cycle (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Stop Endpoint Command TRB type ID.
20:16 Endpoint ID. This field identifies the DCI of the endpoint to be stopped. Valid values are ‘1’ to
Slot Context Context Entries.
22:21 RsvdZ.
23 Suspend (SP). When ‘1’ this bit indicates that the Stop Endpoint Command is being issued to
stop activity on an endpoint that is about to be suspended, and the endpoint shall be stopped
for at least 10 ms. The xHC may use this information to power manage the endpoint hardware
resources. Refer to section 4.15 for more information.
31:24 Slot ID. The ID of the Device Slot.
In order to assure proper USB device operation, software shall wait for at least 10 ms. after a port indicates
that it is suspended (PLS = ‘3’) before initiating a port resume.
362
eXtensible Host Controller Interface Revision 1.0
Table 112: Offset 00h and 04h – Set TR Dequeue Pointer Command TRB Field Definitions
Bits Description
0 Dequeue Cycle State (DCS). This bit identifies the value of the xHC Consumer Cycle State
(CCS) flag for the TRB referenced by the TR Dequeue Pointer.
3:1 Stream Context Type (SCT). If the Stream ID field is non-zero, this field identifies the type of
the Stream Context, otherwise this field shall be ‘0’. Refer to section Table 60 for the definition
the SCT field values.
63:4 New TR Dequeue Pointer Hi and Lo. This field represents the high order bits of the 64-bit
base address to be written to the TR Dequeue Pointer field in the target Endpoint or Stream
Context.
The memory structure referenced by this physical memory pointer shall be aligned on a 16-
byte address boundary.
Table 113: Offset 08h – Set TR Dequeue Pointer Command TRB Field Definitions
Bits Description
15:0 RsvdZ.
31:16 Stream ID. If Streams are enabled for this endpoint, this field identifies the Stream Context that
will receive the new TR Dequeue Pointer. Refer to section 4.12.2.1 for the bounds checking
that the xHC shall perform on this value.
Table 114: Offset 0Ch – Set TR Dequeue Pointer Command TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Set TR Dequeue Pointer Command TRB type ID.
20:16 Endpoint ID. This field identifies the DCI of the endpoint that is the target of this command. If
Streams are not enabled for the endpoint, the Endpoint Context will receive the new TR
Dequeue Pointer.
23:21 RsvdZ.
31:24 Slot ID. The ID of the Device Slot.
363
eXtensible Host Controller Interface Revision 1.0
Note: This command shall not be issued by software unless the target Transfer Ring is in the Error or
Stopped state or if it is a Streams endpoint and the target Stream ID is active.
364
eXtensible Host Controller Interface Revision 1.0
RsvdZ 03-00H
RsvdZ 07-04H
RsvdZ 0B-08H
Table 115: Offset 0Ch – Reset Device Command TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Reset Device Command TRB type ID.
23:16 RsvdZ.
31:24 Slot ID. The ID of the Device Slot that is being reset.
365
eXtensible Host Controller Interface Revision 1.0
Table 116: Offset 00h and 04h – Force Event Command TRB Field Definitions
Bits Description
3:0 RsvdZ.
63:4 Event TRB Pointer Hi and Lo. This field represents the high order bits of the 64-bit address of
the Event TRB that will be posted to the target Event Ring.
The memory structure referenced by this physical memory pointer shall be aligned on a 16-
byte address boundary.
Table 117: Offset 08h – Force Event Command TRB Field Definitions
Bits Description
21:0 RsvdP.
31:22 VF Interrupter Target. This field shall indicate the ID of the Interrupter, whose Event Ring will
receive the forced event. The Interrupter ID is the virtual value used by the target VF (based on
the Interrupter Offset field of the VF Interrupter Range Register), not a physical value. Refer to
section 7.7.2 for more information on virtual Interrupter mapping.
Table 118: Offset 0Ch – Force Event Command TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Force Event Command TRB type ID.
23:16 VF ID. The ID of the Virtual Function who’s Event Ring will receive this Event.
31:24 RsvdZ.
366
eXtensible Host Controller Interface Revision 1.0
6.4.3.13 Set Latency Tolerance Value (LTV) Command TRB (Optional Normative)
The Set LTV Command TRB provides a simple means for host software to provide a single Best Effort
Latency Tolerance (BELT) value. This command is optional normative, however it shall be supported if the
xHC also supports a corresponding host interconnect LTM mechanism. Refer to sections 4.6.14 and 4.13.1
for more information.
RsvdZ 03-00H
RsvdZ 07-04H
RsvdZ 0B-08H
RsvdZ Best Effort Latency Tolerance Value (BELT) TRB Type RsvdZ C 0F-0CH
Table 119: Offset 0Ch – Set Latency Tolerance Value Command TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Set Latency Tolerance Value Command TRB type ID.
27:16 Best Effort Latency Tolerance Value. The Best Effort Latency Tolerance (BELT) value
provided by software. This value shall be formatted as defined in the section of the USB3
Specification describing Device Notification (DEV_NOTIFICATION) Transaction Packet (TP).
31:28 RsvdZ.
367
eXtensible Host Controller Interface Revision 1.0
RsvdZ 0B-08H
Table 120: Offset 00h and 04h – Get Port Bandwidth Command TRB Field Definitions
Bits Description
3:0 RsvdZ.
63:4 Port Bandwidth Context Pointer Hi and Lo. This field represents the high order bits of the
64-bit address of the Port Bandwidth Context data structure that will receive the Port Bandwidth
information.
The memory structure referenced by this physical memory pointer shall be aligned on a 16-
byte address boundary.
Table 121: Offset 0Ch – Get Port Bandwidth Command TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer of a Command Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Get Port Bandwidth Command TRB type ID.
19:16 Dev Speed. The bus speed of interest. Refer to the Speed field in Table 35 for a definition of
the allowed values. Note: The Undefined and Reserved Speeds are invalid values for this field.
23:20 RsvdZ.
31:24 Hub Slot ID. This field identifies the hub ports that the bandwidth information shall be returned
for. A value of ‘0’ shall update the Port Bandwidth Context with the Root Hub port bandwidth
information. If this field is set to the Slot ID of a High-speed hub, the Port Bandwidth Context
shall be updated with that port’s bandwidth information. This field is ignored if SBD = ‘0’. Refer
to section 4.16.2 for more information on the use of this field.
368
eXtensible Host Controller Interface Revision 1.0
Table 122: Offset 00h, 04h, and 08h – Force Header Command TRB Field Definitions
Bits Description
4:0 Packet Type (Type). This field identifies the packet type. Refer to section 8.3.1.2 in the USB3
specification for valid values.
95:5 Header Info. This field defines the value of bytes 00h through 0Bh of the transmitted USB
Transaction or Link Management Packet.
Refer to Section 8 in the USB3 specification for the definition of this field.
Table 123: Offset 0Ch – Force Header Command TRB Field Definitions
Bits Description
0 Cycle bit (C). This bit is used to mark the Dequeue Pointer of an Event Ring.
9:1 RsvdZ.
15:10 TRB Type. This field identifies the type of the TRB. Refer to Table 131 for the definition of the
Force Header Command TRB type ID.
23:16 RsvdZ.
31:24 Root Hub Port Number. This field identifies the number of the Root Hub Port that the header
packet shall be issued to. Refer to section 4.19.7 for port numbering information.
369
eXtensible Host Controller Interface Revision 1.0
Table 124: Offset 00h and 04h – Link TRB Field Definitions
Bits Description
3:0 RsvdZ. Ring Segments are TRB aligned (16 Byte boundaries).
63:4 Ring Segment Pointer Hi and Lo. These fields represent the high order bits of the 64-bit base
address of the next Ring Segment.
The memory structure referenced by this physical memory pointer shall begin on a 16-byte
address boundary.
Bits Description
21:0 RsvdZ.
31:22 Interrupter Target. This field defines the index of the Interrupter that will receive Transfer
Events generated by this TRB. Valid values are between 0 and MaxIntrs-1.
This field is ignored by the xHC on Command Rings.
Bits Description
0 Cycle bit (C). This bit is used to mark the Enqueue Pointer location of a Transfer or Command
Ring.
1 Toggle Cycle (TC). When set to ‘1’, the xHC shall toggle its interpretation of the Cycle bit.
When cleared to ‘0’, the xHC shall continue to the next segment using its current interpretation
of the Cycle bit.
3:2 RsvdZ.
4 Chain bit (CH). Set to ‘1’ by software to associate this TRB with the next TRB on the Ring. A
Transfer Descriptor (TD) is defined as one or more TRBs. The Chain bit is used to identify the
TRBs that comprise a TD. Refer to section 4.11.7 for more information on Link TRB placement
within a TD. On a Command Ring this bit is ignored by the xHC.
370
eXtensible Host Controller Interface Revision 1.0
Bits Description
5 Interrupt On Completion (IOC). If this bit is set to ‘1’, it specifies that when this TRB
completes, the Host Controller shall notify the system of the completion by placing an Event
TRB on the Event ring and sending an interrupt at the next interrupt threshold.
9:6 RsvdZ.
15:10 TRB Type. This field is set to Link TRB type. Refer to Table 131 for the definition of the Type
TRB IDs.
31:16 RsvdZ.
371
eXtensible Host Controller Interface Revision 1.0
RsvdZ TRB Type = Translate BEI RsvdZ IOC CH RsvdZ ENT C 0F-0CH
Table 127: Offset 00h and 04h – Event Data TRB Field Definitions
Bits Description
63:0 Event Data Hi and Lo. This field represents the 64-bit value that shall be copied to the TRB
Pointer field (Parameter Component) of the Transfer Event TRB.
Bits Description
21:0 RsvdZ.
31:22 Interrupter Target. This field defines the index of the Interrupter that will receive Transfer
Events generated by this TRB. Valid values are between 0 and MaxIntrs-1.
Bits Description
0 Cycle bit (C). This bit is ignored by the xHC in a Link TRB.
1 Evaluate Next TRB (ENT). If this flag is ‘1’ the xHC shall fetch and evaluate the next TRB
before saving the endpoint state. Refer to section 4.12.3 for more information.
3:2 RsvdZ.
4 Chain bit (CH). Set to ‘1’ by software to associate this TRB with the next TRB on the Transfer
Ring. The Chain bit is used to identify the TRBs that comprise a TD. The Chain bit is always ‘0’
in the last TRB of a TD.
5 Interrupt On Completion (IOC). If this bit is set to ‘1’, it specifies that when this TRB
completes, the Host Controller shall notify the system of the completion by placing an Event
TRB on the Event ring and sending an interrupt at the next interrupt threshold.
98:6 RsvdZ.
372
eXtensible Host Controller Interface Revision 1.0
Table 129: Offset 0Ch – Event Data TRB Field Definitions (Continued)
Bits Description
9 Block Event Interrupt (BEI). If this bit is set to '1' and IOC = '1', then the Transfer Event
generated by IOC shall not assert an interrupt to the host at the next interrupt threshold. Refer
to section 4.17.5.
15:10 TRB Type. This field is set to Event Data TRB type. Refer to Table 131 for the definition of the
Type TRB IDs.
31:16 RsvdZ.
373
eXtensible Host Controller Interface Revision 1.0
0 Invalid Indicates that the Completion Code field has not been updated by
the TRB producer.
1 Success Indicates successful completion of the TRB operation.
2 Data Buffer Error Indicates that the Host Controller is unable to keep up with the
reception of incoming data (overrun) or is unable to supply data fast
enough during transmission (underrun). Section 4.10.2.5 defines
the requirements of the host controller when a Data Buffer Error
occurs.
3 Babble Detected Error Asserted when “babbling” is detected during the transaction
generated by this TRB.
4 USB Transaction Error Asserted in the case where the host did not receive a valid
response from the device (Timeout, CRC, Bad PID, unexpected
NYET, etc.).
5 TRB Error Asserted when a TRB parameter error condition (e.g., out of range
or invalid parameter) is detected in a TRB. Refer to section 4.10.2.2
for examples.
6 Stall Error Asserted when a Stall condition (e.g., a Stall PID received from a
device) is detected for a TRB. Refer to section 4.10.2.1 for more
information on Stalls.
This code also indicates that the USB device has an error that
prevents it from completing a command issued through a Control
endpoint. Refer to section 8.5.3.1 of the USB2 specification for
more information.
7 Resource Error Asserted by a Configure Endpoint Command if there are not
adequate xHC resources available to enable the requested set of
endpoints. Refer to section 4.11.4.5 for an example.
8 Bandwidth Error Asserted by a Configure Endpoint Command if periodic endpoints
are declared and the xHC is not able to allocate the required
Bandwidth. Refer to section 4.16 for more information.
9 No Slots Available Asserted if a adding one more device would result in the host
Error controller to exceed the maximum Number of Device Slots
(MaxSlots) for this implementation. Refer to section 4.6.3 for more
information.
10 Invalid Stream Type Asserted if a invalid Stream Context Type (SCT) value is detected.
Error Refer to section 4.12.2.1 for more information.
11 Slot Not Enabled Error Asserted if a command is issued to a Device Slot that is in the
Disabled state. The Slot ID is reported.
12 Endpoint Not Enabled Asserted if a doorbell is rung for an endpoint that is in the Disabled
Error state. The Slot ID and error Endpoint ID are reported. Also refer to
section 4.7.
374
eXtensible Host Controller Interface Revision 1.0
13 Short Packet Asserted if the number of bytes received was less than the TD
Transfer Size.
14 Ring Underrun Asserted in a Transfer Event TRB if the Transfer Ring is empty
when an enabled Isoch endpoint is scheduled to transmit data.
Refer to section 4.10.3.1.
Note that the Transfer Event TRB Pointer field is not valid when this
condition is indicated and should be ignored by software.
15 Ring Overrun Asserted in a Transfer Event TRB if the Transfer Ring is empty
when an enabled Isoch endpoint is scheduled to receive data. Refer
to section 4.10.3.1.
Note that the Transfer Event TRB Pointer field is not valid when this
condition is indicated and should be ignored by software.
16 VF Event Ring Full Asserted by a Force Event command if the target VF’s Event Ring
Error is full. Refer to section 4.9.4 for more information.
Note that the Transfer Event TRB Pointer field is not valid when this
error is indicated and should be ignored by software.
17 Parameter Error Asserted by a command if a Context parameter is invalid.
18 Bandwidth Overrun Asserted during an Isoch transfer if the TD exceeds the bandwidth
Error allocated to the endpoint.
19 Context State Error Asserted if a command is issued to transition from an illegal context
state.
20 No Ping Response Asserted if the xHC was unable to complete a periodic data transfer
Error associated within the ESIT, because it did not receive a
PING_RESPONSE in time. Refer to section 4.23.5.2.1 for more
information.
21 Event Ring Full Error Asserted if the Event Ring is full, the xHC is unable to post an Event
to the ring (refer to section 4.9.4). This error is reported in a Host
Controller Event TRB.
22 Incompatible Device Asserted if the xHC detects a problem with a device that does not
Error allow it to be successfully accessed. e.g. due to a device
compliance or compatibility problem. This error may be returned by
any command or transfer, and is fatal as far as the Slot is
concerned. Software shall issue a Disable Slot Command to
recoverb,a.
23 Missed Service Error Asserted if the xHC was unable to service a Isochronous endpoint
within the Interval time. Refer to sections 4.9.4 and 4.10.3.2 for
more information.
24 Command Ring Asserted in a Command Completion Event due to a Command Stop
Stopped (CS) operation. Refer to section 4.6 for more information.
25 Command Aborted Asserted in a Command Completion Event of an aborted command
if the command was terminated by a Command Abort (CA)
operation. Refer to section 4.6 for more information.
26 Stopped Asserted in a Transfer Event if the transfer was terminated by a
Stop Endpoint Command. Refer to section 4.6.9 for more
information.
375
eXtensible Host Controller Interface Revision 1.0
If multiple error conditions occur during the execution of a TRB only the first detected condition will be
reported.
376
eXtensible Host Controller Interface Revision 1.0
377
eXtensible Host Controller Interface Revision 1.0
System software should provide interface extensions that allow vendor access to proprietary xHC
vendor defined features through the xHCD.
Table 132 defines the allowable Transfer Ring TRB Types as function of endpoint type.
378
eXtensible Host Controller Interface Revision 1.0
Note: If the xHC detects a disallowed TRB type on a Transfer Ring, it shall generate Transfer Event for
the TD with the TRB Error completion code set and set the state of the ring to Error.
Table 133 defines the allowable Transfer Ring TRB Types as function of Transaction type.
Note: If the xHC detects a disallowed TRB type on a Transfer Ring, it shall generate Transfer Event for
the TD with the TRB Error completion code set and set the state of the endpoint to Error.
379
eXtensible Host Controller Interface Revision 1.0
RsvdZ 0F-0CH
Table 134: Offset 00 and 04 – Event Ring Segment Table Entry Field Definitions
Bits Description
5:0 RsvdZ.
63:6 Ring Segment Base Address Hi and Lo. These fields represent the high order bits of the 64-
bit base address of the Event Ring Segment.
The memory structure referenced by this physical memory pointer shall begin on a 64-byte
address boundary.
Table 135: Offset 08 – Event Ring Segment Table Entry Field Definitions
Bits Description
15:0 Ring Segment Size. This field defines the number of TRBs supported by the ring segment,
Valid values for this field are 16 to 4096, i.e. an Event Ring segment shall contain at least 16
entries.
32:16 RsvdZ.
Note: The Ring Segment Size may be set to any value from 16 to 4096, however software shall allocate
a buffer for the Event Ring Segment that rounds up its size to the nearest 64B boundary to allow
full cache-line accesses.
380
eXtensible Host Controller Interface Revision 1.0
Bit Description
11:0 RsvdZ.
PSZ:12 RsvdZ.
Valid values for PSZ are 12 to 20, depending on the value of PAGESIZE. Note if PAGESIZE =
4K, then this field is zero bits wide. Refer to section 6.6.1 for how PSZ is calculated. If PSZ =
12, then no bits are reserved by this field.
63:PSZ Scratchpad Buffer Base Address – RW. Default = ‘0’. This field contains bits 63 to PSZ of a
pointer to a Scratchpad Buffer.
The actual number of bits used for the Scratchpad Buffer Base Address field depends on the
value of the PAGESIZE register. If PAGESIZE = 4K then bits 31-12 of the Scratchpad Buffer
Base Address field are valid, if PAGESIZE = 8K then bits 31-13 of the Scratchpad Buffer Base
Address field are valid, and so on. Valid values for PSZ are 12 to 20.
6.6.1 PSZ
The Page Size register determines the low-order boundary of the Scratchpad Buffer Base Address field of
a Scratchpad Buffer Array Element. This boundary is referred to as “PSZ”. The calculation of the PSZ bit
offset equals the Page Size bit offset + 12. For example, if the Page Size register defines a 4K system
page size, then the bit offset of PSZ = 12, if the Page Size register defines a 16K system page size, then
the bit offset of PSZ = 14.
381
eXtensible Host Controller Interface Revision 1.0
382
7 xHCI Extended Capabilities
The xHC exports xHCI-specific extended capabilities utilizing a method similar to the PCI extended
capabilities. If an xHC implements any extended capabilities, it specifies a non-zero value in the xHCI
Extended Capabilities Pointer (xECP) field of the HCCPARAMS register (5.3.6). This value is an offset into
xHC MMIO space from the Base, where the Base is the beginning of the host controller’s MMIO address
space. Each capability register has the format illustrated in Table 137.
Bit Description
7:0 Capability ID – RO. This field identifies the xHCI Extended capability. Refer to Table 138 for a
list of the valid xHCI extended capabilities.
15:8 Next xHCI Extended Capability Pointer – RO. This field points to the xHC MMIO space offset
of the next xHCI extended capability pointer. A value of 00h indicates the end of the extended
capability list. A non-zero value in this register indicates a relative offset, in Dwords, from this
Dword to the beginning of the next extended capability.
For example, assuming an effective address of this data structure is 350h and assuming a
pointer value of 068h, we can calculate the following effective address:
350h + (068h << 2) -> 350h + 1A0h -> 4F0h
31:16 Capability Specific. The definition and attributes of these bits depends on the specific capability.
0 Reserved
1 USB Legacy Support This capability provides the xHCI Pre-OS to OS 8B 7.1
Handoff Synchronization support capability.
2 Supported Protocol This capability enumerates the protocols and 12B 7.2
revisions supported by this xHC. At least one of
these capability structures is required for all xHC
implementations.
3 Extended Power This capability is required for all xHC non-PCI Refer to 7.3
Management implementations. PCI PM
spec.
4 I/O Virtualization This capability is optional-normative for xHC Up to 7.7
implementations that require hardware 1280B
virtualization support.
5 Message Interrupt Either this or the xHCI Extended Message Refer to 7.5
Interrupt capability is required for all xHC non- PCI
PCI implementations. spec.
6 Local Memory This capability is optional-normative for xHC Up to 7.8
implementations that require local memory 4TB
support.
7-9 Reserved
383
eXtensible Host Controller Interface Revision 1.0
384
eXtensible Host Controller Interface Revision 1.0
Bit Description
7:0 Capability ID – RO. This field identifies the extended capability. Refer to Table 138 for the value
that identifies the capability as Legacy Support.
This extended capability requires one additional 32-bit register for control/status information
(USBLEGCTLSTS), and this register is located at offset xECP+04h.
15:8 Next Capability Pointer - RO. This field indicates the location of the next capability with respect
to the effective address of this capability. Refer to Table 137 for more information on this field.
16 HC BIOS Owned Semaphore – RW. Default = ‘0’. The BIOS sets this bit to establish ownership
of the xHC. System BIOS will set this bit to a ‘0’ in response to a request for ownership of the
xHC by system software.
23:17 RsvdP.
24 HC OS Owned Semaphore – RW. Default = ‘0’. System software sets this bit to request
ownership of the xHC. Ownership is obtained when this bit reads as ‘1’ and the HC BIOS Owned
Semaphore bit reads as ‘0’.
31:25 RsvdP.
385
eXtensible Host Controller Interface Revision 1.0
Bit Description
0 USB SMI Enable – RW. Default = ‘0’. When this bit is a ‘1’, and the SMI on Event Interrupt bit
(below) in this register is a ‘1’, the host controller will issue an SMI immediately.
3:1 RsvdP.
4 SMI on Host System Error Enable – RW. Default = ‘0’. When this bit is a ‘1’, and the SMI on
Host System Error bit (below) in this register is a ‘1’, the host controller will issue an SMI
immediately.
12:5 RsvdP.
13 SMI on OS Ownership Enable – RW. Default = ‘0’. When this bit is a ‘1’ AND the OS
Ownership Change bit is ‘1’, the host controller will issue an SMI.
14 SMI on PCI Command Enable – RW. Default = ‘0’. When this bit is ‘1’ and SMI on PCI
Command is ‘1’, then the host controller will issue an SMI.
15 SMI on BAR Enable – RW. Default = ‘0’. When this bit is ‘1’ and SMI on BAR is ‘1’, then the
host controller will issue an SMI.
16 SMI on Event Interrupt – RO. Default = ‘0’. Shadow bit of Event Interrupt (EINT) bit in the
USBSTS register. Refer to Section 5.4.2 for definition.
This bit follows the state the Event Interrupt (EINT) bit in the USBSTS register, e.g. it
automatically clears when EINT clears or set when EINT is set.
19:17 RsvdP.
20 SMI on Host System Error – RO. Default = ‘0’. Shadow bit of Host System Error (HSE) bit in
the USBSTS register refer to Section 5.4.2 for definition and effects of the events associated
with this bit being set to ‘1’.
To clear this bit to a ‘0’, system software shall write a ‘1’ to the Host System Error (HSE) bit in
the USBSTS register.
28:21 RsvdZ.
29 SMI on OS Ownership Change – RW1C. Default = ‘0’. This bit is set to ‘1’ whenever the HC
OS Owned Semaphore bit in the USBLEGSUP register transitions from ‘1’ to a ‘0’ or ‘0’ to a ‘1’.
30 SMI on PCI Command – RW1C. Default = ‘0’. This bit is set to ‘1’ whenever the PCI Command
Register is written.
31 SMI on BAR – RW1C. Default = ‘0’. This bit is set to ‘1’ whenever the Base Address Register
(BAR) is written.
Note: For all enable register bits, ‘1’ = Enabled, ‘0’ = Disabled.
Note: SMI – System Management Interrupt.
Note: BAR – Base Address Register.
386
eXtensible Host Controller Interface Revision 1.0
PSIC Protocol Defined Compatible Port Count Compatible Port Offset 0B-08H
RsvdP 0F-0CH
... ...
(PSIC*4)+13-
Protocol Speed ID Mantissa RsvdP PFD PLT PSIE PSIV
(PSIC*4)+10H
Table 142: Offset 00h - xHCI Supported Protocol Capability Field Definitions
Bits Description
7:0 Capability ID – RO. Refer to Table 138 for the value that identifies the capability as Supported
Protocol.
15:8 Next Capability Pointer – RO. This field indicates the location of the next capability with
respect to the effective address of this capability. Refer to Table 137 for more information on
this field.
23:16 Minor Revision – RO. Minor Specification Release Number in Binary-Coded Decimal (i.e.,
version x.10 is 10h). This field identifies the minor release number component of the
specification with which the xHC is compliant.
31:24 Major Revision – RO. Major Specification Release Number in Binary-Coded Decimal (i.e.,
version 3.x is 03h). This field identifies the major release number component of the
specification with which the xHC is compliant.
Table 143: Offset 04h - xHCI Supported Protocol Capability Field Definitions
Bits Description
31:0 Name String – RO. This field is a mnemonic name string that references the specification with
which the xHC is compliant. Four ASCII characters may be defined. Allowed characters are:
alphanumeric, space, and underscore. Alpha characters are case sensitive. Refer to section
7.2.2 for defined values.
387
eXtensible Host Controller Interface Revision 1.0
Table 144: Offset 08h - xHCI Supported Protocol Capability Field Definitions
Bits Description
7:0 Compatible Port Offset – RO. This field specifies the starting Port Number of Root Hub Ports
that support this protocol. Valid values are ‘1’ to MaxPorts.
15:8 Compatible Port Count – RO. This field identifies the number of consecutive Root Hub Ports
(starting at the Compatible Port Offset) that support this protocol. Valid values are 1 to
MaxPorts.
27:16 Protocol Defined. This field is reserved for protocol specific definitions. Refer to section
7.2.2.1.3.
31:28 Protocol Speed ID Count (PSIC). This field indicates the number of Protocol Speed ID (PSI)
Dwords that the xHCI Supported Protocol Capability data structure contains.
If this field is non-zero, then all speeds supported by the protocol shall be defined using PSI
Dwords, i.e. no implied Speed ID mappings apply.
Refer to section 7.2.2 and its subsections for protocol specific requirements related to this field.
Table 145: Offset 10h to (PSIC*4)+10h - xHCI Supported Protocol Capability Field Definitions
Bits Description
3:0 Protocol Speed ID Value (PSIV). If a device is attached that operates at the bit rate defined by
this PSI Dword, then the value of this field shall be reported in the Port Speed field of PORTSC
register (5.4.8) of a compatible port.
Note, the PSIV value of ‘0’ is reserved and shall not be defined by a PSI.
5:4 Protocol Speed ID Exponent (PSIE). This field defines the base 10 exponent times 3, that
shall be applied to the Protocol Speed ID Mantissa when calculating the maximum bit rate
represented by this PSI Dword.
PSIE Value Bit Rate
0 Bits per second
1 Kb/s
2 Mb/s
3 Gb/s
388
eXtensible Host Controller Interface Revision 1.0
Table 145: Offset 10h to (PSIC*4)+10h - xHCI Supported Protocol Capability Field Definitions
7:6 PSI Type (PLT). This field identifies whether the PSI Dword defines a symmetric or asymmetric
bit rate, and if asymmetric, then this field also indicates if this Dword defines the receive or
transmit bit rate.
Note that the Asymmetric PSI Dwords shall be paired, i.e. an Rx immediately followed by a Tx,
and both Dwords shall define the same value for the PSIV.
PLT Value Bit Rate Note
0 Symmetric Single PSI Dword
1 Reserved
2 Asymmetric Rx Paired with Asymmetric Tx PSI Dword
3 Asymmetric Tx Immediately follows Rx Asymmetric PSI Dword
8 PSI Full-duplex (PFD). If this bit is ‘1’ the link is full-duplex, and if ‘0’ the link is half-duplex.
15:9 RsvdP.
31:16 Protocol Speed ID Mantissa (PSIM). This field defines the mantissa that shall be applied to
the PSIE when calculating the maximum bit rate represented by this PSI Dword.
Note: An xHC implementation that employs an Integrated Hub to provide USB Full-speed and Low-
speed support and only provided a USB 2.0 High-speed BI may define a USB2 xHCI Supported
Protocol Capability data structure with a single PSI Dword (PSIC = 1), where the PSI Dword at
offset 0Ch would define PSIV = 3, PLT = 0, PFD = 0, PSIE = 2, and PSIM = 480.
Major Minor
Name String Specification Reference
Revision Revision
Note: One xHCI Supported Protocol Capability shall define a Compatible Port Offset of ‘1’.
Note: Gaps are allowed in the port numbers assigned by xHCI Supported Protocol Capabilities, e.g. the
Compatible Port Offset of a xHCI Supported Protocol Capability may not be equal to the sum of
the Compatible Port Offset and Compatible Port Offset fields of the previous xHCI Supported
Protocol Capability.
Note: Multiple xHCI Supported Protocol Capabilities of the same type (i.e. identical Name String, Major
Revision, Minor Revision) may be declared by an xHCI implementation, however the port numbers
assigned by them shall not overlap.
Note: Undefined behavior may occur if software references Root Hub port numbers not defined by xHCI
Supported Protocol Capabilities.
389
eXtensible Host Controller Interface Revision 1.0
The following default mappings apply to the USB 2.0 and USB 3.0 protocols.
USB xHCI Supported Protocol Capability data structures may define PSIC = ‘0’ field under the following
conditions:
• For a USB 3.0 xHCI Supported Protocol Capability data structure (i.e. Name String = 20425355h,
Major Revision = 03h, and Minor Revision = 00h) a PSIC value of ‘0’ implies that only the default
SuperSpeed bit rate is supported. Refer to Table 147 for default USB 3.0 Speed ID mappings.
• For a USB 2.0 xHCI Supported Protocol Capability data structure (i.e. Name String = 20425355h,
Major Revision = 02h, and Minor Revision = 00h) a PSIC value of ‘0’ implies that the default Full-
speed, Low-speed, and High-speed bit rates are supported. Refer to Table 147 for default USB 2.0
Speed ID mappings.
• Only these two protocols/revisions support implied mappings. All other protocols or revisions of these
protocols shall define a non-zero PSIC value.
The Protocol Defined field only applies to the specific protocol referenced by its xHCI Supported Protocol
Capability. This section identifies how the Protocol Defined field applies to each of the protocols defined in
this specification.
7.2.2.1.3.1 USB3
No Protocol Defined fields are reserved by a USB 3.0 xHCI Supported Protocol Capability.
All USB3 ports shall support Link Power Management.
390
eXtensible Host Controller Interface Revision 1.0
7.2.2.1.3.2 USB2
The following Protocol Defined fields are reserved by a USB 2.0 xHCI Supported Protocol Capability.
Bits Description
16 RsvdP.
17 High-speed Only (HSO) - RO. Default = Implementation dependent. If this bit is cleared to ‘0’,
the USB2 ports described by this capability are Low-, Full-, and High-speed capable. If this bit
is set to ‘1’, the USB2 ports described by this capability are High-speed only, e.g. the ports
don’t support Low- or Full-speed operation. High-speed only implementations may introduce a
“Tier mismatch”, refer to section 4.24.2 for more information.
18 Integrated Hub Implemented (IHI) - RO. Default = Implementation dependent. If this bit is
cleared to ‘0’, the Root Hub to External xHC port mapping adheres to the default mapping
described in section 4.24.2.1. If this bit is set to ‘1’, the Root Hub to External xHC port mapping
does not adhere to the default mapping described in section 4.24.2.1, and an ACPI or other
mechanism is required to define the mapping.
19 Hardware LMP Capability (HLC) - RO. Default = Implementation dependent. If this bit is set to
‘1’, the ports described by this xHCI Supported Protocol Capability support hardware controlled
USB2 Link Power Management. Refer to section 4.23.5.1.1.1.
27:20 RsvdP.
391
eXtensible Host Controller Interface Revision 1.0
392
eXtensible Host Controller Interface Revision 1.0
393
eXtensible Host Controller Interface Revision 1.0
System 1 Debug
Capability
Debug Host (Disabled)
P1 P2 P3
Debug
System 2
Capability
Hub Debug Target (Enabled)
P1 P2 P3
P1 P2
Debug
System 3
Capability
Device A Debug Target (Enabled)
P1 P2 P3
Device B Device C
In the example illustrated by Figure 111, System 1 is the Debug Host. It is attached to two Debug Targets;
Systems 2 and 3. Port 1 (P1) of System 2 is attached to a Root Hub port of System 1 and Port 2 (P2) of
System 3 is attached to the downstream facing port of a Hub controlled by System 1. Note that other (non-
Debug Target) USB devices may also be attached to a Debug Host or Target system. Device A is attached
to System 1, and Devices B and C are attached to System 3. All 3 systems support xHCI Debug Capability
hardware, software distinguishes a Debug Target from a Debug Host by enabling the Debug Capability on
Targets.
The Debug Host provides a USB Debug Capability class driver, which will manage Debug Targets when
they are enumerated and provide an API for debugger applications.
The Debug Target provides software to manage communications between the Debug Device and the
Debug Host. The Debug Target software interfaces to the xHCI Debug Capability to manage Debug Device
emulation and service Debug Device Class specific requests from the Debug Host.
Note: A Debug Target may only expose its USB Debug Capability through a Root Hub port. A Debug
Target cannot connect to a Debug Host through the downstream facing port of a hub owned by the
Debug Target.
394
eXtensible Host Controller Interface Revision 1.0
Debug
Class ... Class
Class
Class ... Class
Driver Driver Driver Driver
Driver
Debug
Capability
USB Bus Driver Driver USB Bus Driver
Debug Debug
xHCI Capability Capability xHCI
(Disabled) (Enabled)
P1 P2 P3 P1 P2 P3
In Figure 112, the Debug Host provides a Debug Class Driver which communicates with the System
Debug Hooks in the Debug Target, through the Debug Capability (blue path).
On the Debug Target, the Debug Capability Driver is completely independent of the OS Stack (USB Bus
Driver, xHCI driver, etc.). The Debug Capability Driver is expected to be loaded immediately after POST so
that the OS stack can be debugged. The Debug Capability Driver manages the xHCI Debug Capability
register set, and the standard USB OS stack manages all non-Debug USB devices attached to the system.
On the Debug Host, the xHCI Debug Capability is disabled and there is no driver associated with it. And
the standard USB OS stack manages all USB devices attached to the system, including the Debug device
presented by the Debug Capability Driver on the Debug Target.
The user interface through which a programmer enables a system’s xHCI USB Debug Capability or its
features are outside the scope of this specification. The Debug Device Class is defined in section 7.6.10.
395
eXtensible Host Controller Interface Revision 1.0
396
eXtensible Host Controller Interface Revision 1.0
40. Note that a DbC implementation may utilize a smaller Max Burst Size than set by software.
397
eXtensible Host Controller Interface Revision 1.0
• Initialize the Debug Capability Event Ring Segment Table Dequeue Pointer Register (DCERDP) with
the physical memory address of the Event Ring Segment pointed to by Event Ring Segment Table
entry 0.
• Initialize the Debug Capability Context Pointer (DCCP) with the physical memory address of the
Debug Capability Context.
• Set the Debug Capability Enable (DCE) bit to ‘1’ in the Debug Capability Control Register (DCCTRL).
At this point, the Debug Capability is initialized, the Root Hub ports are looking for an attached Debug Host,
and the DCPORTSC register is enabled to report a Debug Host connection.
When a Debug Host connection is detected, a Port Status Change Event will be generated on the DbC
Event Ring.
To detect the Debug Host connection, or any event generated by the DbC, software shall periodically poll
the Event Ring Not Empty bit in the Debug Capability Status Register (DCST), or evaluate the DbC Event
Ring for change in the Event Ring Enqueue Pointer (i.e. a Cycle bit change, refer to section 4.9.4 for more
information on the Event Ring Enqueue Pointer).
After the Debug Host connection is detected, software shall wait for the Debug Device to be configured by
the Debug Host. The transition of the DbC Run (DCR) bit to ‘1’ indicates the successful configuration of the
Debug Device.
Software shall impose a timeout between the detection of the Debug Host connection and the DbC Run
transition to ‘1’. If the DbC Run transition takes too long, software may toggle the DCE bit to disable then
re-enable the DbC to retry the Debug Device enumeration process.
Note: If the OS code that is being debugged resets the xHC (e.g. asserts HCRST), then the Debug
Capability will also be reset. This condition may be detected by the Debug Capability Driver if DCE
= ‘0’, after having previously been enabled (set to ‘1’). If this condition occurs, the Debug
Capability Driver is required to re-initialize the Debug Capability to continue communication with
the Debug Host.
398
eXtensible Host Controller Interface Revision 1.0
Debug
Capability xHCI Driver
Driver
xHC Debug
xHCI
Capability
DCPORTSC 1 2 3 4
PORTSC
Register Registers
Port Mux
Root Hub ports P1 P2 P3 P4
Debug Device
Host
The xHCI Driver accesses the xHCI Port Status and Control (PORTSC) registers (5.4.8) and the Debug
Capability Driver accesses the Debug Capability Port Status and Control (DCPORTSC) register (7.6.8.6).
When the Root Hub port (P1 in Figure 114) is assigned to the Debug Capability, the associated PORTSC
register (PORTSC 1 in Figure 114) shall mimic operations as if no device is attached it. Refer to section
4.19.1.2.4.3 for the states presented by PORTSC register to system software during this condition.The
remaining PORTSC registers are still associated with their respective Root Hub ports and are fully
operational through the xHCI.
399
eXtensible Host Controller Interface Revision 1.0
After the Root Hub port is assigned to the DbC, the xHC shall begin emulating a USB Debug Class device,
responding to enumeration related USB requests from the Debug Host, transitioning the Debug Device
emulator through the standard USB Device States described in section 8.1 of the USB3 specification.
State Name
Port Link State
Signal State
Where the State Name is an informative name defined by the xHCI specification, the Port Link State
identifies the possible values for the DCPORTSC PLS field, and Signal State values are:
DCCTRL Debug Capability Enable (DCE), DCPORTSC Current Connect Status (CCS), DCPORTSC
Port Enabled/Disabled (PED), DCPORTSC Port Reset (PR), and DCCTRL DbC Run (DCR),
respectively, e.g. 0,0,0,0,0 all signals are ‘0’.
Note that in all states except for DbC-Off and DbC-Disconnected, the Root Hub port is assigned to the
Debug Capability (Debug Port Number > ‘0’) and in operating in a Upstream facing mode.
7.6.6.1 DbC-Off
This is the initial state after a Chip Hardware Reset or the assertion of HCRST.
In this DbC port state:
• The DbC Capability is off.
• All Root Hub ports act as normal downstream facing ports, i,e, only assert the Downstream Direction
400
eXtensible Host Controller Interface Revision 1.0
flag in the Port Capability LMPs that they generate and the Debug Capability Port Multiplexing
mechanism will not switch the link to the DbC Port if a Downstream Direction flag is detected in a
received Port Capability LMP.
• The Debug Port Number = ‘0’.
• The DbC Capability shall be in the Attached USB Device State.
• The ports’ LTSSM is not applicable.
A write to the DCCTRL register with DCE cleared to ‘0’ or a write to the USBCMD register with the HCRST
flag set to ‘1’ shall transition from the DbC port from any state to the DbC-Off state (Wr(DCE=0)).
A write to the DCCTRL register with DCE set to ‘1’ shall transition from the DbC port to the DbC-
Disconnected state (Wr(DCE=1)).
7.6.6.2 DbC-Disconnected
In this DbC port state:
• The DbC Capability shall be in the Attached USB Device State.
• The ports’ LTSSM state is not applicable
• The Debug Port Number = ‘0’.
A transition of the USB3 Root Hub Port Polling substate machine (4.19.1.2.4) from the CfgExg state to the
DbC state shall transition the DbC port to the DbC-Enabled state (DbC Port LMP Exchange Successful).
This transition shall set the CSC flag to ‘1’.
A Disconnect Detect in the any state, except DbC-Off, shall transition the DbC port to the DbC-
Disconnected state (Disconnect Detect). This transition shall set the CSC flag to ‘1’.
7.6.6.3 DbC-Enabled
In this DbC port state:
• The Debug Host enumerates the DbC Capability, and the USB Device State of the DbC Capability
attempts to advance from the Powered state, through the Default and Address states, to the
Configured state. Refer to section 9.1 of the USB3 spec for more information on USB Device States.
• The ports’ LTSSM shall not be in the SS.Inactive or SS.Disabled states.
• The Debug Port Number > ‘0’.
If the USB Device State of the DbC Capability successfully advances to the Configured state, the DbC Port
shall transition to the DbC-Configured state (Set_Config Successful).
If the USB Device State of the DbC Capability fails to enumerate successfully (i.e. the DbC USB Device
State fails to advance to the Configured state), the DbC Port shall transition to the DbC-Error state (Enum
Error).
If any LTSSM Polling substate times out or if a tPortCongfigurationTimeout occurs, the DbC Port shall
transition to the DbC-Disabled state (Error). An LTSSM Polling timeout shall set the PLC flag to ‘1’ (PLC
Condition: Training Error or Error). A tPortCongfigurationTimeout shall set the CEC flag to ‘1’.
If a Hot or Warm Reset is detected, the DbC Port shall transition to the DbC-Resetting state (Reset Rcvd).
7.6.6.4 DbC-Configured
In this DbC port state:
• DCR is asserted (‘1’).
• The USB Device State of the DbC Capability is the Configured state.
• The ports’ LTSSM may be in the U0, U1, U2, U3, or Recovery states.
401
eXtensible Host Controller Interface Revision 1.0
If the Debug Host deconfigures the device (i.e. issues a SET_CONFIGURATION(0) request), the DbC Port
shall transition to the DbC-Enabled state (Deconfigure).
If the LTSSM exits the Recovery state after a timeout, the DbC Port shall transition to the DbC-Error state
(Timeout). This transition shall set the PLC flag to ‘1’ (PLC Condition: Error).
If a Hot or Warm Reset is detected, the DbC Port shall transition to the DbC-Resetting state (Reset Rcvd).
Note: While in this state the PLC flag shall be set to ‘1’ if the DbC enters or exits the suspend state (PLC
Condition: U0 -> U3 or U3 -> U0).
7.6.6.5 DbC-Resetting
In this DbC port state:
• The Debug Host is signaling a Hot or Warm reset.
• PED = ‘0’ and PR = ‘1’.
• The USB Device State of the DbC Capability is the Powered state.
• The ports’ LTSSM shall be in the Rx.Detect or Hot Reset state.
When the reset signaling is complete, the DbC Port shall transition to the DbC-Enabled state, and PED
and PRC shall be asserted (‘1’) (Reset Cmp).
7.6.6.6 DbC-Disabled
Software may place the DbC Port in this state to disconnect from the Debug Host but maintain ownership
of the Root Hub Port (i.e. the USB3 Root Hub Port Polling substate machine remains in the DbC state).
In this DbC port state:
• The USB Device State of the DbC Capability is the Attached state.
• The ports’ LTSSM shall be in the SS.Disabled state.
A write to the DCPORTSC register with PED cleared to ‘0’ shall transition from the DbC port from the DbC-
Enabled, DbC-Configured, DbC-Resetting, or DbC-Error state to the DbC-Disabled state (Wr(PED=0)).
A write to the DCPORTSC register with PED set to ‘1’ shall transition the DbC port to the DbC-Enabled
state (Wr(PED=1)).
7.6.6.7 DbC-Error
This state is entered due to the detection of an error condition detected in the DbC port DbC-Enabled or
Configured states.
In this DbC port state:
• The PED flag shall maintain the value asserted by the previous state.
• The USB Device State of the DbC Capability shall maintain the value asserted by the previous state.
• The ports LTSSM shall be in the SS.Inactive state.
If a Hot or Warm Reset is detected, the DbC Port shall transition to the DbC-Resetting state (Reset Rcvd).
402
eXtensible Host Controller Interface Revision 1.0
Configured state, where the two bulk endpoints are enabled. When the Debug Device is configured and
the bulk endpoints are operational, the DbC Run bit in the DCCTRL register shall transition to ‘1’.
The Debug Host will expect the SS Debug Device to be ready to accept standard requests
(GET_DESCRIPTOR, SET_ADDRESS, etc.) as soon as an attach is detected.
The USB descriptors presented by the Debug Device during the enumeration process are defined in
section 7.6.10.
The protocol used to move debugger information between a Debug Host and a Debug Target is outside the
scope of this specification.
Software use Normal TRBs on the IN and OUT Transfer Rings to transfer data from/to the Debug Host.
Software rings the Debug Capability Data IN or OUT doorbells to notify the xHC that work items are
available on the respective Transfer Ring.
The operation of a Debug Capability Data endpoint is identical to a standard xHCI bulk endpoint, with the
following exception: The Debug Capability Transfer Ring direction is the opposite of the TP/DP direction
responded to by the Debug Capability. i.e. the Debug Capability IN Transfer Ring is used to receive data
transferred by OUT DPs from the Debug Host, and the OUT Transfer Ring is used to send data transferred
by Debug Host IN TPs.
If a DbC Bulk pipe had previously sent an NRDY, a doorbell ring shall cause the xHC to generate an ERDY.
If an IN TP or OUT DP had not been received, the xHCI shall wait for the TP/DP transaction from the
Debug Host. Software may use the TRB IOC flag to generate a Transfer Event on the Debug Event Ring
when a Data TD completes.
403
eXtensible Host Controller Interface Revision 1.0
Software shall use the TRB IOC flag to generate Transfer Events on the Debug Event Ring when a TD
completes.
The Debug Capability automatically generates Port Status Change Events to report Debug Capability port
state changes. Refer to section 7.6.4.2 for a discussion on Event Generation, and section 7.6.8.6 for more
information on the individual Debug Capability status change flags.
404
eXtensible Host Controller Interface Revision 1.0
RsvdP DCERST Max Next Capability Pointer Capability ID = Debug Port 03-00H
RsvdZ 0F-0CH
DCE Device Address Debug Max Burst Size RsvdP DRC HIT HOT LSE DCR 23-20H
RsvdP 2F-2CH
405
eXtensible Host Controller Interface Revision 1.0
Bits Description
7:0 Capability ID – RO. Refer to Table 138 for the value that identifies that the function supports a
Debug Device.
15:8 Next Capability Pointer – RO. Default = Implementation defined. This field indicates the
location of the next capability with respect to the effective address of this capability. Refer to
Table 137 for more information on this field.
20:16 Debug Capability Event Ring Segment Table Max (DCERST Max) – RO. Default =
implementation dependent. Valid values are 0 – 15. This field determines the maximum value
supported the Debug Capability Event Ring Segment Table Base Size registers (7.6.8.3.1),
where:
The maximum number of Event Ring Segment Table entries = 2 DCERST Max.
e.g. if DCERST Max = 7, then the Debug Capability Event Ring Segment Table(s) supports up
to 128 entries, 15 then 32K entries, etc.
31:21 RsvdP.
Bits Description
7:0 RsvdP.
15:8 Doorbell Target (DB Target) – RW. This field defines the target of the doorbell reference. The
table below defines the Debug Capability notification that is generated by ringing the doorbell.
Value Definition
0 Data EP 1 OUT Enqueue Pointer Update
1 Data EP 1 IN Enqueue Pointer Update
2:255 Reserved
This field returns ‘0’ when read and the value should be treated as undefined by software.
23:16 RsvdP.
406
eXtensible Host Controller Interface Revision 1.0
Bit Description
15:0 Event Ring Segment Table Size – RW. Default = ‘0’. This field identifies the number of valid
Event Ring Segment Table entries in the Event Ring Segment Table pointed to by the Debug
Capability Event Ring Segment Table Base Address register. The maximum value supported by
an xHC implementation for this register is defined by the DCERST Max field in the DCID register
(7.6.8.1).
Software shall initialize this register before setting the Debug Capability Enable field in the
DCCTRL register to ‘1’.
31:16 RsvdP.
7.6.8.3.2 Debug Capability Event Ring Segment Table Base Address Register (DCERSTBA)
Address: Debug Capability Base + 10h
Default Value: 0000 0000 0000 0000h
Attribute: RW
Size: 64 bits
The Debug Capability Event Ring Segment Table Base Address Register identifies the start address of the
Debug Capability Event Ring Segment Table.
Bit Description
3:0 RsvdP.
63:4 Event Ring Segment Table Base Address Register – RW. Default = ‘0’. This field defines the
high order bits of the start address of the Debug Capability Event Ring Segment Table.
Software shall initialize this register before setting the Debug Capability Enable field in the
DCCTRL register to ‘1’.
407
eXtensible Host Controller Interface Revision 1.0
Bit Description
2:0 Dequeue ERST Segment Index (DESI). Default = ‘0’. This field may be used by the xHC to
accelerate checking the Event Ring full condition. This field is written with the low order 3 bits of
the offset of the ERST entry which defines the Event Ring segment that the Event Ring
Dequeue Pointer resides in.
3 RsvdP.
63:4 Dequeue Pointer - RW. Default = ‘0’. This field defines the high order bits of the 64-bit address
of the current Debug Capability Event Ring Dequeue Pointer.
Software shall initialize this register before setting the Debug Capability Enable field in the
DCCTRL register to ‘1’.
Bits Description
0 DbC Run (DCR) – RO. Default = 0. When ‘0’, Debug Device is not in the Configured state.
When ‘1’, Debug Device is in the Configured state and bulk Data pipe transactions are
accepted by Debug Capability and routed to the IN and OUT Transfer Rings. A ‘0’ to ‘1’
transition of the Port Reset (DCPORTSC:PR) bit will clear this bit to ‘0’.
1 Link Status Event Enable (LSE) - RW. Default = ‘0’. Setting this bit to a ‘1’ enables the Debug
Capability to generate Port Status Change Events due the Port Link Status Change bit
transitioning from a ‘0’ to a ‘1’. Refer to section 4.19.2 for more information.
2 Halt OUT TR (HOT) - RW1S. Default = 0. While this bit is ‘1’ the Debug Capability shall
generate STALL TPs for all IN TPs received for the OUT TR. The Debug Capability shall clear
this bit when a ClearFeature(ENDPOINT_HALT) request is received for the endpoint. This field
is valid only when the Debug Capability is in Run Mode (DCR = ‘1’). When not in Run Mode,
this field shall return ‘0’ when read, and writes will have no effect. Refer to section 7.6.4.3.
408
eXtensible Host Controller Interface Revision 1.0
Table 155: Offset 20h - Debug Capability Field Definitions (DCCTRL) (Continued)
Bits Description
3 Halt IN TR (HIT) - RW1S. Default = 0. While this bit is ‘1’ the Debug Capability shall generate
STALL TPs for all OUT DPs received for the IN TR. The Debug Capability shall clear this bit
when a ClearFeature(ENDPOINT_HALT) request is received for the endpoint. This field is valid
only when the Debug Capability is in Run Mode (DCR = ‘1’). When not in Run Mode, this field
shall return ‘0’ when read, and writes will have no effect. Refer to section 7.6.4.3.
4 DbC Run Change (DRC) - RW1C. Default = 0. This bit shall be set to '1' when DCR bit is
cleared to '0', i.e. by any DbC Port State transition that exits the DbC-Configured state. While
this bit is ‘1’ the Debug Capability Doorbell Register (DCDB) is disabled. Software shall clear
this bit to re-enable the DCDB.
15:5 RsvdP.
23:16 Debug Max Burst Size - RO. Default = xHC Vendor defined. This field identifies the maximum
burst size supported by the bulk endpoints of this DbC implementation.
30:24 Device Address – RO. Default = 0. This field reports the USB device address assigned to the
Debug Device during the enumeration process. This field is valid when the DbC Run bit is ‘1’.
31 Debug Capability Enable (DCE) – RW. Default = 0. Setting this bit to a ‘1’ enables xHCI USB
Debug Capability operation. This bit is a ‘0’ if the USB Debug Capability is disabled. Clearing
this bit releases the Root Hub port assigned to the Debug Capability, and terminates any
Debug Capability Transfer or Event Ring activity.
Bits Description
0 Event Ring Not Empty (ER) – RO. Default = ‘0’. When ‘1’, this field indicates that the Debug
Capability Event Ring has a Transfer Event on it. It is automatically cleared to ‘0’ by the xHC
when the Debug Capability Event Ring is empty, i.e. the Debug Capability Enqueue Pointer is
equal to the Debug Capability Event Ring Dequeue Pointer register.
23:1 RsvdP.
31:24 Debug Port Number – RO. Default = 0. This field provides the ID of the Root Hub port that the
Debug Capability has been automatically attached to. The value is ‘0’ when the Debug
Capability is not attached to a Root Hub port.
409
eXtensible Host Controller Interface Revision 1.0
The fields of the Debug Capability PORTSC Register are defined below and provide information about the
state of the Root Hub port that is assigned to the Debug Capability. Note that the fields in this register
function differently than those in a normal Port Status and Control Register (described in section 5.4.8)
because the Root Hub port assigned to the Debug Capability is acting as an Upstream Facing Port, not a
Downstream Facing Port.
Bits Description
0 Current Connect Status (CCS) – RO. Default = ‘0’. ‘1’ = A Root Hub port is connected to a
Debug Host and assigned to the Debug Capability. ‘0’ = No Debug Host is present. This value
reflects the current state of the port, and may not correspond to the value reported by the
Connect Status Change (CSC) field in the Port Status Change Event that was generated by a
‘0’ to ‘1’ transition of this bit.
This flag is ‘0’ if Debug Capability Enable (DCE) is ‘0’.
1 Port Enabled/Disabled (PED) – RW. Default = ‘0’. ‘1’ = Enabled. ‘0’ = Disabled. This flag shall
be set to '1' by a '0' to '1' transition of DBC or a '1' to '0' transition of the PR. When PED
transitions from '0' to '1' the port's link shall transition to the Rx.Detect state. This flag may be
used by software to enable or disable the operation of the Root Hub port assigned to the
Debug Capability. The Debug Capability Root Hub port operation may be disabled by a fault
condition (disconnect event or other fault condition, e.g. a LTSSM Polling substate timeout,
tPortConfiguration timeout error, etc.), the assertion of DCPORTSC PR, or by software.
0 = Debug Capability Root Hub port is disabled.
1 = Debug Capability Root Hub port is enabled.
When the port is disabled (PED = ‘0’) the port’s link shall enter the SS.Disabled state and
remain there until PED is reasserted ('1') or DCE is negated ('0'). Note that the Root Hub port is
remains mapped to Debug Capability while PED = '0'. While PED = '0' the Debug Capability will
appear to be disconnected to the Debug Host.
Note, this bit is not affected by PORTSC PR bit transitions.
This field is ‘0’ if DCE or CCS are ‘0’.
3:2 RsvdZ.
4 Port Reset (PR) – RO. Default = ‘0’. ‘1’ = Port is in Reset. ‘0’ = Port is not in Reset. This bit is
set to ‘1’ when the bus reset sequence as defined in the USB Specification is detected on the
Root Hub port assigned to the Debug capability. It is cleared when the bus reset sequence is
completed by the Debug Host, and the DbC shall transition to the USB Default state.
A ‘0’ to ‘1’ transition of this bit shall clear DCPORTSC PED (‘0’).
This field is ‘0’ if DCE or CCS are ‘0’.
410
eXtensible Host Controller Interface Revision 1.0
Table 157: Offset 28h - Debug Capability Field Definitions (DCPORTSC) (Continued)
Bits Description
8:5 Port Link State (PLS) – RO. Default = undefined. This field reflects its current link state. This
field is only relevant when a Debug Host is attached (Debug Port Number > ‘0’).
Value Meaning
0 Link is in the U0 State
1 Link is in the U1 State
2 Link is in the U2 State
3 Link is in the U3 State (Device Suspended)
4 Link is in the Disabled State
5 Link is in the RxDetect State
6 Link is in the Inactive State
7 Link is in the Polling State
8 Link is in the Recovery State
9 Link is in the Hot Reset State
15:10 Reserved
Note: Transitions between different states are not reflected until the transition is complete.
9 RsvdZ.
13:10 Port Speed (Port Speed) – RO. Default = ‘0’. This field identifies the speed of the port. This
field is only relevant when a Debug Host is attached (CCS = ‘1’) in all other cases this field shall
indicate Undefined Speed.
Value Meaning
0 Undefined Speed
1-3 Reserved
4 SuperSpeed host attached
5-15 Reserved
Note: The Debug Capability only supports SS operation.
16:14 RsvdZ.
17 Connect Status Change (CSC) – RW1C. Default = ‘0’. ‘1’ = Change in Current Connect
Status. ‘0’ = No change. Indicates a change has occurred in the port’s Current Connect Status.
The xHC sets this bit to ‘1’ for all changes to the Debug Device connect status, even if system
software has not cleared an existing DbC Connect Status Change. For example, the insertion
status changes twice before system software has cleared the changed condition, hardware will
be “setting” an already-set bit (i.e., the bit will remain ‘1’). Software shall clear this bit by writing
a ‘1’ to it.
This field is ‘0’ if DCE is ‘0’.
20:18 RsvdZ.
21 Port Reset Change (PRC) – RW1C. Default = ‘0’. This bit is set when reset processing on this
port is complete (i.e. a '1' to '0' transition of PR). ‘0’ = No change. ‘1’ = Reset
complete.Software shall clear this bit by writing a '1' to it.
This field is ‘0’ if DCE is ‘0’.
411
eXtensible Host Controller Interface Revision 1.0
Table 157: Offset 28h - Debug Capability Field Definitions (DCPORTSC) (Continued)
Bits Description
22 Port Link Status Change (PLC) = RW1C. Default = ‘0’. This flag is set to ‘1’ due to the
following PLS transitions:
Transition Condition
U0 -> U3 Suspend signaling detected from Debug Host
U3 -> U0 Resume complete
Polling -> Disabled Training Error
Ux or Recovery -> Inactive Error
Software shall clear this bit by writing a '1' to it.
This field is ‘0’ if DCE is ‘0’.
23 Port Config Error Change (CEC) – RW1C. Default = ‘0’. This flag indicates that the port failed
to configure its link partner. 0 = No change. 1 = Port Config Error detected. Software shall clear
this bit by writing a '1' to it.
31:24 RsvdZ.
Note: If the Debug Capability Event Ring is full, the xHC will be unable to generated Port Status Change
Events due to transitions in the Change bits. In this case, a Change bit will remain set until cleared
by software.
Bits Description
3:0 RsvdP.
63:4 Debug Capability Context Pointer Register – RW. Default = ‘0’. This field defines the high
order bits of the start address of the Debug Capability Context data structure (refer to section
7.6.9) associated with the Debug Capability.
Software shall initialize this register before setting the Debug Capability Enable bit in the
Debug Capability Control Register to ‘1’.
412
eXtensible Host Controller Interface Revision 1.0
This register shall be initialized before enabling the DbC (DCE = ‘1’).
Bits Description
7:0 DbC Protocol – RW. This field is presented by the Debug Device in the USB Interface
Descriptor bInterfaceProtocol field.
Value Function
0 Debug Target vendor defined.
1 GNU Remote Debug Command Set supported.
2-255 Reserved.
15:8 RsvdZ.
31:16 Vendor ID – RW. This field is presented by the Debug Device in the USB Device Descriptor
idVendor field.
Table 160: Offset 3Ch - Debug Capability Info Context Field Definitions (DbCIC)
Bits Description
15:0 Product ID – RW. This field is presented by the Debug Device in the USB Device Descriptor
idProduct field.
31:16 Device Revision – RW. This field is presented by the Debug Device in the USB Device
Descriptor bcdDevice field.
413
eXtensible Host Controller Interface Revision 1.0
Ring. The Transfer Rings referenced by the Endpoint Contexts are Bulk endpoints as described in section
7.6.3.2.
Note: Figure 117 illustrates the Debug Capability Context, which includes 64 byte DbC Info and Endpoint
Contexts. The Context Size (CSZ) field in the HCCPARAMS register does not apply to DbC
related contexts. All DbC data structure consume 64 bytes. Refer to section 6.2.3 for more
information on the Endpoint Context data structure.
The Debug Capability Event Ring Registers work identically to the normal Event Ring Registers described
in section 4.9.4. i.e. the Debug Capability Event Ring Segment Table Base Address Register references an
Event Ring Segment Table data structure as described in section 6.5.
The Debug Capability Context data structures are initialized by software. While the Debug Capability
Enable (DCE) bit in the Debug Capability Control Register (DCCTRL) is ‘1’, the xHC maintains ownership
of the data structures.
The String referenced by this field shall be returned when the Debug Device receives a
GET_DESCRIPTOR(STRING, 0) request.
414
eXtensible Host Controller Interface Revision 1.0
Table 161: Offset 00h - Debug Capability Info Context Field Definitions (DbCIC)
Bits Description
0 RsvdZ.
63:1 String 0 Descriptor Address. This field represents the high order bits of the 64-bit pointer to a
USB String Descriptor that contains which specifies the Languages Supported by the DbC.
The String referenced by this field shall be returned when the Debug Device receives a
GET_DESCRIPTOR(STRING, 1) request.
Table 162: Offset 08h - Debug Capability Info Context Field Definitions (DbCIC)
Bits Description
0 RsvdZ.
63:1 Manufacturer String Descriptor Address. This field represents the high order bits of the 64-
bit pointer to a USB String Descriptor that contains which describes the manufacturer.
The String referenced by this field shall be returned when the Debug Device receives a
GET_DESCRIPTOR(STRING, 2) request.
Table 163: Offset 10h - Debug Capability Info Context Field Definitions (DbCIC)
Bits Description
0 RsvdZ.
63:1 Product String Descriptor Address. This field represents the high order bits of the 64-bit
pointer to a USB String Descriptor that contains which describes the product.
The String referenced by this field shall be returned when the Debug Device receives a
GET_DESCRIPTOR(STRING, 3) request.
Table 164: Offset 18h - Debug Capability Info Context Field Definitions (DbCIC)
Bits Description
0 RsvdZ.
63:1 Serial Number String Descriptor Address. This field represents the high order bits of the 64-
bit pointer to a USB String Descriptor that contains which describes the device’s serial number.
Note: If a string is not defined for a specific attribute (Manufacture, Product, or Serial Number), software
shall point the respective String Length to ‘0’ and the String Descriptor Address field shall be
ignored by the xHC.
415
eXtensible Host Controller Interface Revision 1.0
Table 165: Offset 20h - Debug Capability Info Context Field Definitions (DbCIC)
Bits Description
416
eXtensible Host Controller Interface Revision 1.0
Offset Size
Part Description Value
(Byte) (Bytes)
417
eXtensible Host Controller Interface Revision 1.0
Offset Size
Part Description Value
(Byte) (Bytes)
418
eXtensible Host Controller Interface Revision 1.0
Offset Size
Part Description Value
(Byte) (Bytes)
Offset Size
Part Description Value
(Byte) (Bytes)
419
eXtensible Host Controller Interface Revision 1.0
Offset Size
Part Description Value
(Byte) (Bytes)
420
eXtensible Host Controller Interface Revision 1.0
Offset Size
Part Description Value
(Byte) (Bytes)
Offset Size
Part Description Value
(Byte) (Bytes)
421
eXtensible Host Controller Interface Revision 1.0
422
eXtensible Host Controller Interface Revision 1.0
Offset Size
Part Description Value
(Byte) (Bytes)
Offset Size
Part Description Value
(Byte) (Bytes)
423
eXtensible Host Controller Interface Revision 1.0
Offset Size
Part Description Value
(Byte) (Bytes)
424
eXtensible Host Controller Interface Revision 1.0
31 0
... ...
RsvdP 103-100h
... ...
VF Device Slot Assignment Register 255 4FF-4FCh
Note: No VF Interrupter Range Register 0 is defined. VM Interrupter Range Register 0 would logically
reference Physical Function 0 (PF0), however PF0 provides the pool from which all Interrupters
are allocated.
Note: The xHCI limits the maximum number of VFs supported to 63, i.e. the SR-IOV Extended
Capabilities structure TotalVFs field shall be <= 63 for xHCI implementations.
For example, Logically the PF0 Interrupter Base Offset and Interrupter Count are initialized to ‘0’ and
MaxIntrs, respectively. As Interrupters are allocated to VFs, the number of Interrupters available to PF0 are
reduced accordingly. At any time, the number of Interrupters available to PF0 is equal to the MaxIntrs –
SUM(Interrupter Count 1-1024).
Interrupter 0 shall not be assigned to a VF.
An xHC implementation shall provide MaxSlots VF Device Slot Assignment Registers. Each VF Device
Slot Assignment Register defines a Slot Emulated and Device Slot n VF field. The VM Device Slot
Assignment Registers shall be used by the VMM to assign a Device Slot to a VF. The Device Slot n VF
field contains the VF ID of the PF or VF that owns the Device Slot. After hardware reset all Device Slots are
assigned the Physical Function 0 (Device Slot n VF = 0). The Slot Emulated field identifies whether a
Device Slot is being emulated by the VMM for a VM or direct-assigned to a VM. Refer to section 8.1.1 for
more information on device emulation.
425
eXtensible Host Controller Interface Revision 1.0
IMPLEMENTATION NOTE
Page Size Management
The page size selected by software affects the following registers:
• The RTOFF and DBOFF registers - If virtualization is enabled, then the Capability/Operational,
Runtime, and Doorbell registers are all required to reside on separate memory pages. The boundaries
between them depend on the selected page size and affect the size of the required MMIO space. If
virtualization is not supported, the register sets may be packed on a single page.
• PCI Configuration Space BAR0 register - The page size may affect the size of the MMIO space
declared by the BAR0 register.
• SR-IOV Page Size register - The page size defined in the SR-IOV Page Size register shall be identical
the page size defined in the Operational Page Size register.
• Operational Registers Page Size and Supported Page Sizes registers - These registers are defined to
provide the page size definition for non-PCI implementation xHCI implementations.
To ensure page size consistency, the following rules shall be followed:
1) If the xHC is a PCI implementation:
a. The xHCI PCI System Page Size and PCI Supported Page Sizes registers exist in the PCI
Configuration Register space at offsets 64h and 68h, respectively. When the xHCI PCI System
Page Size register is written:
i) BAR0 shall reflect a MMIO size of 4 times the value of the PCI System Page Size register.
Note, the PCI System Page Size register shall be written prior to reading BAR0.
ii) The Operational Register Supported Page Sizes Register shall define a single supported
page size which is equal to that defined in the PCI System Page Size register.
iii) The RTOFF register shall indicate a value of 1x the value of the PCI System Page Size
register. And the PSZ value used by the RTOFF register shall reflect the value of the PCI
System Page Size register.
iv) The DBOFF register shall indicate a value of 3x the value of the PCI System Page Size
register. The PSZ value used by the DBOFF register shall reflect the value of the PCI
System Page Size register.
a) If the SR-IOV Capability is defined, then:
i) The SR-IOV System Page Size register Register shall define a single supported page size
which is equal to that defined in the PCI System Page Size register.
2) Else, a non-PCI xHC implementation shall:
a. The Operational Supported Page Sizes register shall define the page sizes supported by the
xHC. When the xHCI Page Size register is written:
i) The PSZ value used by the RTOFF register shall reflect the value of the xHCI Page Size
register.
ii) The PSZ value used by the DBOFF register shall reflect the value of the xHCI Page Size
register.
426
eXtensible Host Controller Interface Revision 1.0
31 16 15 8 7 0
Bits Description
7:0 Capability ID – RO. Refer to Table 138 for the value that identifies the capability as xHCI I/O
Virtualization.
15:8 Next Capability Pointer – RO. This field indicates the location of the next capability with
respect to the effective address of this capability. Refer to Table 137 for more information on
this field.
31:16 RsvdP.
427
eXtensible Host Controller Interface Revision 1.0
428
eXtensible Host Controller Interface Revision 1.0
Bit Description
9:0 Interrupter Offset (IRROFF) – RW. Default = ‘0’. This field specifies the zero-based, starting
Interrupter ID of PF0 Interrupters allocated to the VF. Valid values set by software are ‘0’ to
MaxIntrs-1. A value of ‘0’ “unmaps” the Interrupters from the VF.
19:10 Interrupter Count (IRRCNT) – RW. Default = ‘0’. This field identifies the number of PF0
Interrupters allocated to the VF. Valid values set by software are ‘1’ to MaxIntrs-1.
20 VF Run (VFR) – RW. Default = ‘0’. ‘1’ = Run. ‘0’ = Stop. When set to ‘1’, the Host Controller
places endpoints associated with this VF on its Pipe Schedule. When this bit is cleared to ‘0’, the
xHC completes the current and any actively pipelined transactions on the USB associated with
this VF, then removes all endpoints associated with this VF from its Pipe Schedule. The Host
Controller shall halt VF endpoints within 16 microframes after software clears the VFR bit. The
VF Halted bit indicates when the xHC has finished its pending pipelined transactions and has
entered the stopped state for this VF. Software shall not write a ‘1’ to this field unless the VF is in
the Halted state (i.e. VF Halted is a ‘1’). Doing so will yield undefined results.
21 VF Halted (VFH) – RO. Default = ‘1’. This bit is a ‘0’ whenever the VF Run bit is a ‘1’. The xHC
sets this bit to ‘1’ after it has stopped executing as a result of the VF Run bit being cleared to ‘0’,
either by software or by the xHC hardware (e.g. internal error).
31:22 RsvdP.
429
eXtensible Host Controller Interface Revision 1.0
31 7 6 5 0
Bit Description
5:0 Device Slot VF ID (DSAVFID) – RW. Default = ‘0’ (all slots are assigned to PF0). This field
specifies the ID of VM that the respective Device Slot is allocated. Valid values set by software
are ‘0’ to NumVFs (defined in the SR-IOV Capability). A value of ‘0’ reassigns this Device Slot to
PF0.
6 Slot Emulated (DSASE) – RW. Default = ‘0’. This field specifies if the Device Slot is emulated
or direct-assigned. A value of ‘1’ shall cause the host controller to generate a Doorbell Event to
the PF0 Primary Event Ring when the doorbell is rung. A value of ‘0’ shall cause the host
controller to process the DB Target code when the doorbell is rung.
31:7 RsvdP.
Note: The USB Device Address for the slot shall be cleared to ‘0’ by the xHC when this register is
written.
Note: The VMM shall issue a Slot Enable Command to obtain an emulated (DSASE = ‘1’) Device Slot to
assign to a VF.
430
eXtensible Host Controller Interface Revision 1.0
Size 07-04H
... ...
(Size*256)
Memory Dword (Size*256)
+(0C-08)H
Table 178: Offset 00h - xHCI Local Memory Capability Field Definitions
Bits Description
7:0 Capability ID – RO. Refer to Table 138 for the value that identifies the capability as Local
Memory Protocol.
15:8 Next Capability Pointer – RO. This field indicates the location of the next capability with
respect to the effective address of this capability. Refer to Table 137 for more information on
this field.
16 Local Memory Enable (LME) - RW. Default = ‘0’. Setting this bit to a ‘1’ enables the Local
Memory Capability. Clearing this bit to a ‘0’ disables the Local Memory Capability.
31:17 RsvdZ.
Bits Description
31:0 Size – RO. This field identifies the size of the Local Memory space exposed by this
capability in 1KB blocks.
Bits Description
(Size*256) Local Memory – RW. This field is a byte addressable array of read/write memory locations
31:0 that is exposed by the xHCI Local Memory Capability.
Note: The xHCI Debug Capability requires that the data structures necessary to manage it (Debug
Capability Data Structure, Transfer Rings, Event Ring, etc.) are set up in read/write memory. This
is problematic if attempting to debug the code that initializes the system memory controller, and
system memory is not available. This capability allows the xHC to temporarily map a portion of its
internal SRAM in to MMIO space for use by the debugger prior to system memory being available.
431
eXtensible Host Controller Interface Revision 1.0
432
8 Virtualization
Virtualization allows multiple Operating System Instances (OSI) to concurrently run within a platform.
The default interface (i.e. virtualization is disabled) presented by the xHC to the host system is a single
Physical Function (PF or PF0) or eXtensible Host Controller Interface (e.g. Figure 3). When the xHC
virtualization capabilities are turned on, multiple Virtual Functions (VF) are enabled. To minimize
hardware requirements, the physical interface presented by an xHC VF is a subset of that presented by the
PF and the virtualization software shall emulate portions of the VF interface to fill the gaps.
Only the PF shall present xHC virtualization capabilities, i.e. SR-IOV and xHCI-IOV Capability Structures.
All VFs appear as non-virtualization capable xHC instances.
Note that the xHC virtualization capabilities discussed in this document rely heavily on the virtualization
concepts and mechanisms defined in the PCIe Single Root – I/O Virtualization (SR-IOV) specification.
This specification assumes three principal classes of software are supported under the virtual machine
architecture:
• Virtual Machine Manager (VMM): The VMM acts as a host and has full control of the processor(s)
and other platform hardware. The VMM presents guest software (refer to the Virtual Machine (VM)
description below) with an abstraction of a virtual processor and allows it to execute directly on a
logical processor. There is only one instance of a VMM in a virtualized environment, and it is able to
retain selective control of platform resources: processor resources, physical memory, interrupt
management, I/O, etc. A VMM may own a physical resource and provide services to share that
resource across multiple VMs. Or it may Direct-Assign a physical resource exclusively to a VM.
• Virtual Machine (VM): Each Virtual Machine (VM) is a guest software environment that supports a
stack consisting of operating system (OS) and application software. Each VM operates independently
of other VMs and uses the same interface to processor(s), memory, storage, graphics, and I/O
provided by a physical platform. The VM software stack (or OSI) may act as if it were running on a
platform with no VMM. Software executing in a VM shall operate with reduced privilege so that the
VMM can retain control of platform resources.
• Hypervisor: The hypervisor is a transport mechanism, which provides a communication path between
VMs and the VMM. Features of the hypervisor allow it to trap VM requests for platform resources and
forward those requests to the VMM.
Some virtualization environments combine the VMM and Hypervisor functionality into a single entity.
To reduce hardware requirements, the xHC architecture depends on the VMM to emulate the PCI
Configuration Space, the xHCI Capability and Operational Registers, and several other features of a Virtual
Function (VF).
To minimize the hardware requirements associated with a VF the xHCI architecture partitions its registers
in to “low touch” and “high touch”. Low touch registers are referenced infrequently, i.e. only at initialization
time or when a USB device is enumerated. High touch registers are referenced regularly during the normal
operation of the xHC.
Low touch registers can be trapped and emulated by the VMM because the performance impact of VMM
intervention is minimal. The xHCI Capability Registers and Operational Registers are considered to be
Low Touch registers. The Capability Registers are generally only referenced at initialization time, and the
Operational Registers are referenced infrequently during runtime, i.e. during initialization or when a USB
device is attached or detached.
The high touch registers are the Interrupt and Event Ring management registers, and the Doorbell
registers. The Interrupt and Event Ring registers reside in the Runtime Register Space. The Runtime and
Doorbell Registers are physically presented by the xHC to each VF.
433
eXtensible Host Controller Interface Revision 1.0
The xHCI is designed such that the interface presented by a combination of xHC hardware and VMM
hardware emulation to a VM may be indistinguishable from the interface that the VM would see though the
PF if it exclusively owned the xHC. This is accomplished through VMM emulation of the Capability and
Operation registers, and xHC hardware support for filtering VF access to the physical Doorbell and
Runtime register sets. The result allows a VMM to handle the emulation of the xHCI registers associated
with device enumeration and other non-time critical xHCI operations, and the xHC to present hardware
registers to a VM for the time critical USB device control and data transfer management.
The xHCI defines independent base addresses in MMIO space for the Runtime and Doorbell Registers so
that they can be positioned on page boundaries to allow easy mapping to a VM.
Additionally, the xHCI supports the ability for the VMM to emulate a USB device to a VM. In cases were the
resources of single USB device needs to be shared across multiple VMs, the VMM may own the physical
device and emulate the operation of that device to multiple VMs. For example, the VMM would own the
Device Slot assigned to a USB keyboard, and create emulated versions of that keyboard for each of the
VM. The VMM will manage switching the keystroke stream to the VM that currently has user focus. The
USB device emulation support of the xHCI also allows the VMM to emulate external USB hubs to VMs, the
importance of which will be discussed below.
8.1 Operation
For the VMM to provide xHCI functionality to a VM, it shall present an xHC VF in the VM’s address space.
To enable the xHC virtualization capabilities the VMM shall perform the following basic steps:
• Create the VFs by enabling and configuring the PCIe Single Root – IO Virtualization (SR-IOV)
capability.
• Assign xHC resources to a VF (Interrupters and Device Slots) by enabling and configuring the xHCI –
IO Virtualization (xHCI-IOV) capability.
• Allocate PCI Configuration Space and Memory Mapped I/O (MMIO) Space in the VMs address space
for the VF.
• Establish Hypervisor traps for VM references to the emulated VF registers.
These steps allow the combination of xHC hardware and VMM register-level emulation to present a fully
functional xHC to a VM, without requiring hardware support for every feature of a VF. They also allow the
VMM to act as an intermediary, managing the shared xHC resources across many VMs.
434
eXtensible Host Controller Interface Revision 1.0
fields. The size decoded by VFBAR0 is referred to as VFBAR0.Size. The amount of address space
decoded by VFBAR0 shall be an integral multiple of SR-IOV System Page Size field. VFBAR0 determines
the alignment requirement and size (VFBAR0.Size) for a single VF. The total MMIO space consumed by
the xHC is VFBAR0.Size * NumVFs. The MMIO space associated with each VF begins on a page
boundary as defined by the System Page Size field of the SR-IOV Extended Capability structure.
i.e. if VFBAR0.size = 16KB and NumVFs = 4, then the MMIO space allocated to all VFs is 64KB (16K * 4)
bytes.
PF0 MMIO Register locations:
• Capability Registers reside at PBAR0.
• Operational Registers reside at PBAR0 + CAPLENGTH.
• Runtime Registers reside at PBAR0 + RTSOFF.
• Doorbell Register Array resides at PBAR0 + DBOFF.
VF n MMIO Register locations, where n = 1 to NumVFs:
• Capability Registers reside at VFBAR0 + (VFBAR0.Size * (n-1)).
• Operational Registers reside at VFBAR0 + (VFBAR0.Size * (n-1)) + CAPLENGTH.
• Runtime Registers reside at VFBAR0 + (VFBAR0.Size * (n-1)) + RTSOFF.
• Doorbell Register Array resides at VFBAR0 + (VFBAR0.Size * (n-1)) + DBOFF.
435
eXtensible Host Controller Interface Revision 1.0
Doorbell
Array
Pad
On Page
Boundaries Runtime
Registers VF2
VFBAR0.Size
(Aperture 2)
PF0 Doorbell Pad
Array
Pad
Operational
Registers
Runtime Capability
Registers Standard Registers
VFBAR0.Size x NumVFs
Pad MMIO
Space
DBOFF xHCI-IOV Doorbell Virtual
Extended Array Function
RTSOFF Capability
Pad
Operational Physical
xECP Registers Function
Runtime
Capability Registers VF1
Registers VFBAR0.Size xHCI
BAR 0,1
(Aperture 1) Extended
Pad Capability
VFBAR0 Emulated
Operational Registers
Registers
Capability Physical
Registers Registers
Figure 124 illustrates an xHC implementation that supports two VFs. Note that the MMIO address space
allocated for VFs is a contiguous array. Each VFBAR0.Size space may also be referred to as an
“aperture”.
Note: The SR-IOV VF MSE field shall be set to ‘1’ for the xHC to respond to VF MMIO memory space
accesses.
436
eXtensible Host Controller Interface Revision 1.0
8.1.1.3 Interrupters
The VF Interrupter Range Registers (section 7.7.2) allow the VMM to map specified Interrupters out of its
(PF0) Runtime Register space and into a VFs Runtime Register space. The Primary Interrupter Register
Set (0) is always assigned to PF0. Only secondary Interrupter Register Sets (1 to MaxIntrs-1) may be
assigned to a VF. Assignment of an Interrupter Register Set to a VF is exclusive.
Virtualization is not enabled (default Interrupter Register Set addressing):
n = Physical Interrupter Register Set ID (0 to MaxIntrs-1)
Interrupter Register Set n shall be located at physical address:
PBAR0 + RTSOFF + (n * 32), where 32 is the size of the Interrupter Register Set.
If Virtualization is enabled:
IRROFF = VF Device Interrupter Range Register:Interrupter Offset, valid values = 1 to MaxIntrs-1
IRRCNT = VF Device Interrupter Range Register:Interrupter Count, valid values = 1 to MaxIntrs-1
IRRINDX = VF Device Interrupter Range Register index, valid values = 0 to TotalVFs
np = Physical Interrupter Register Set ID, valid values = 0 to MaxIntrs
nv = VM Interrupter Register Set ID, valid values = 0 to IRRCNT-1
Interrupter Register Set np + IRROFF shall be located at physical address:
VFBAR0 + (VFBAR0.Size * (IRRINDX -1)) + RTSOFF + (nv * 32)
The sum of IRRCNT values for all VF Device Interrupter Range Registers shall not exceed MaxIntrs -
1.
Note: Interrupter Register Sets are mapped exclusively. i.e. If virtualization is enabled and Interrupter
Register Set np is remapped via a VF Interrupter Range Register, then Interrupter Register Set np
is no longer accessible at PBAR0 + RTSOFF + (np * 32).
Note: The Event Ring of physical Interrupter Register Set 0 shall receive all non-Transfer Events
generated by the xHC. And until reassigned by the VMM or a VM, the Event Ring of physical
Interrupter Register Set 0 shall also receive all Transfer Events generated by the xHC.
Note: A minimum of one Interrupter Register Set shall be implemented per supported VF. System
software is responsible for mapping the Interrupter Register Sets to VFs when VFs are enabled.
Note: Only secondary Interrupter Register Sets may be assigned to VFs, therefore only Transfer Events
may be redirected to an Interrupter owned by a VF, including its Interrupter Register Set 0. All
other Event types presented on the VFs’ (“Primary”) Interrupter Register Set 0 Event Ring are
generated by the VMM through Force Event Commands.
Note: All Events generated by a Force Event Command are automatically directed to Interrupter
Register Set 0 Event Ring of the VF specified in the Force Event Command. e.g. if the Interrupter
Offset field for VF Interrupter Range Register 1 = 4, then the Event Ring of Interrupter 4 shall
receive the Event TRBs pointed to by all Force Event Commands targeted at VF 1.
If more than one Interrupter Register Set is available to a VF, a VM can direct the Transfer Events of
selected device slots to the alternate Interrupters (1-n), using the Interrupter Target field in Transfer TRBs.
437
eXtensible Host Controller Interface Revision 1.0
The xHC shall translate the Interrupter Target field of TRBs associated with Device Slots owned by a VF
with the following formula:
Physical Interrupter Register Set index = VF Interrupter Target + IRROFF
438
eXtensible Host Controller Interface Revision 1.0
a. When the VMM detects the PR bit set in the VM reference to the emulated PORTSC register it
will assert the PR bit in the physical PORTSC register.
Note that the VMM may filter VM references to physical PORTSC registers, e.g. in a case
where the VM is attempting to reset a Root Hub Port attached to a hub, as some of the
devices attached to that hub are owned by other VMs.
4) After the appropriate timeout the VM will obtain a Device Slot for the “newly” attached device.
a. It does this by placing an Enable Slot Command on its Command Ring, and writing the Host
Controller (VM Device Slot 0) Doorbell register with a DB Target code of Host Controller
Command.
5) The VM reference to the Doorbell register generates a Doorbell Event to the VMM.
a. The VMM parses the Doorbell Event and determines that the Command Ring has been
modified.
b. The VMM retrieves the Command TRB from the VM’s Command Ring, updating the VM
Command TRB Status field and advancing the Ring Indices appropriately.
6) The VMM examines the retrieved Command TRB, decoding the Enable Slot Command, and
processes it for the VM.
a. The VMM uses the appropriate VM Slot Assignment Register to map the Device Slot that it
used to enumerate the device to the VF owned by the VM.
b. Releases any data structures that it was using to manage the device.
c. Generates a Command Completion Event to the VM by issuing a Force Event Command. The
Force Event Command points to a Command Completion Event TRB. The Command
Response field of the Command Completion TRB will include the ID of the Device Slot that the
VMM had assigned to the VM.
7) Upon reception of the Command Completion Event, the VM will proceed to initialize its Device
Context data structures, Device Context Base Address Array, etc., finally issuing an Address
Device Command to enable the control endpoint of the device.
8) When the VMM examines VM’s Command Ring it finds the Address Device Command and
processes it for the VM. The Address Device Command informs the xHC that the Device Context
data structures associated with the Device Slot have changed.
a. The VMM forwards the Address Device Command to the xHC by placing the identical
command on the PF0 Command Ring.
b. Then returns the PF0 Command Completion Event to the VM using a Force Event Command.
9) After receiving the Command Completion Event, the VM will then issue several requests directly to
the device’s control endpoint, reading Device and Configuration Descriptors to determine the
configuration that it wants to select.
10) When a decision has been made, the VM shall issue a Configure Endpoint Command to enable
the endpoints defined by the target configuration.
11) Again, the VMM which is trapping VM Command Ring operations simply forwards the Configure
Endpoint Command to the xHC on the PF0 Command Ring and returns the returned Command
Completion Event to the VM using a Force Event Command. This operation also informs the xHC
that the Endpoint Context data structures associated with the Device Slot have changed.
From this point on, unless the device is detached or the VM attempts to power manage or reconfigure the
device, the VMM is not involved. The direct-assignment feature of the xHCI allows the VM to communicate
directly with the xHC hardware interface and the device.
439
eXtensible Host Controller Interface Revision 1.0
440
eXtensible Host Controller Interface Revision 1.0
VMM VM A VM B
If VM B decides to place the Device B into suspend mode, it will generate the appropriate requests to its
emulated hub. Since as far as VM B is concerned there are no other devices attached to the hub, it will
attempt to propagate the power state up the topology by placing the hub in suspend mode as well. The
VMM shall filter these requests to ensure that Device A remains operational for VM A. Since the VMM
owns the physical external hub, it determines whether the hub will be placed in the suspend state or not.
The VMM can fake a response back to VM B for the emulated hub, allowing the VM to think that it has
placed the emulated hub in the suspend state.
441
eXtensible Host Controller Interface Revision 1.0
...
Extended
SR-IOV Array
Capability
Extended
Capability Operational
VF BAR0 Registers
Capability
Other Extended Registers Cmd
Capabilities Ring
VFn
VF n
BAR0
MMIO
...
Aperture
...
VF1
VF 1
BAR0
MMIO
...
Aperture
Figure 126 illustrates the VF MMIO Aperture configuration for the xHC. To minimize the hardware
requirements for virtualization, many of the xHC MMIO registers are emulated by the VMM. The SR-IOV
and xHCI-IOV Extended Capability structures (blue bordered) exists only for PF0. The SR-IOV capability
defines the starting memory space address of VF1 MMIO Aperture. The xHCI-IOV Extended Capability
defines the xHC registers needed to manage the individual Virtual Functions. The (orange bordered) xHCI
Capability Registers, Operational Registers, and Extended Capabilities presented by a VF are emulated by
the VMM. The (green bordered) xHCI Extended Runtime Registers and Doorbell arrays are physical
registers presented by a VF. The (orange bordered) PCI Configuration Space as seen by the VMs is
emulated by the VMM.
The physical VF register spaces (Operational, Runtime, etc.) reside on System Page Size boundaries. The
details of their mapping are described below.
442
eXtensible Host Controller Interface Revision 1.0
443
eXtensible Host Controller Interface Revision 1.0
shall ignore the Transfer TRB Interrupter Target field and all Transfer Events for the VF are targeted at the
Interrupter identified by the Interrupter Offset field.
Refer to section 6.4.1 for more information on the Interrupter Target field.
Interrupter Mapping may be used to facilitate distribution of interrupts across cores in a multi-core platform.
444
Appendix A - xHCI PCI Power
Management Interface
An advanced power management capabilities interface compliant with PCI Bus Power Management
Interface Specification (PCI PM) is incorporated into the xHCI. This interface allows the xHCI to be placed
in various power management states offering a variety of power savings for a host system.
Table 181 highlights the xHCI support for power management states and features supported for each of
the power management states. An xHC implementation may internally gate-off USB clocks and suspend
the USB transceivers (low power consumption mode) to provide these power savings. The methods
utilized by each xHC vendor to achieve the required behavior, is implementation specific. The xHC will
assert PME# and retain chip context in accordance with the rules defined in the PCI PM Specification and
this specification.
The controller software driver shall place all enabled downstream USB ports of the xHC in the USB
suspended state before exiting the D0 state. This is to ensure all downstream devices are in an inactive,
low-power mode.
Table 181: xHCI Support for Power Management States
D0 Required Fully awake backwards compatible state. All logic in full power
mode.
D1 Optional USB Sleep state with xHC bus master capabilities disabled. All
USB ports in suspended state. All logic in low latency power
savings mode because of low latency returning to D0 state.
D2 Optional USB Sleep state with xHC bus master capabilities disabled. All
USB ports in suspended state.
D3hot Required Deep USB Sleep state with xHC bus master capabilities disabled.
All USB ports in suspended state.
D3cold Required Fully asleep backwards compatible state. All downstream devices
are either suspended or disconnected based on the
implementation’s capability to supply downstream port power
within the power budget.
445
eXtensible Host Controller Interface Revision 1.0
PME# from D3cold, then the Aux_Current field or Data Register (D3 Power Consumed, D3 Power
Dissipated) shall report “000”.
All other registers and field should follow the PCI PM specification.
446
eXtensible Host Controller Interface Revision 1.0
All xHC contexts are retained in all power states except D3cold. For D3cold, the same context that is
described in the previous section relative to the D3hot-to-D0 internal reset shall be retained.
The functional and wake-up characteristics for the xHC power states are summarized in Table 182.
Note: Software is responsible for placing root hub ports associated with devices that have been enabled
for Remote Wakeup into the suspend before transitioning to a non-D0 state.
447
eXtensible Host Controller Interface Revision 1.0
448
eXtensible Host Controller Interface Revision 1.0
Inputs Response
Results Explanation
Remaining
Burst Cnt PID (data size)
Buffer
a.Note that the ≥ Maxpacket where the > applies is just to account for the case where software has incor-
rectly programmed Burst or Max Packet Size.
Any time there is a buffer error (in this case a buffer under-run), the host controller will abandon the
remaining portions of a high-bandwidth transaction. For example, if the current PID was an MDATA, and
there was a buffer error on getting the data from main memory to the HC in a timely fashion, then the host
controller will set the Buffer Error status bit to a ‘1’ and immediately clear the Active status bit to ‘0’. This
will cause the host controller to effectively skip the remaining bus transactions (if there was any pending,
based on the value of Cnt).
The xHC’s requirements for managing a high-bandwidth IN bus transaction sequence are described using
a state machine model. The model is summarized in the state-transition table Table 184. This is only an
example state machine whose intent is to define the operational requirements of the host controller.
449
eXtensible Host Controller Interface Revision 1.0
The intent of this section is to clearly define the appropriate data PID sequences for a high bandwidth
isochronous data stream and set a priority on detection and reporting of errors that are detectable during a
high-bandwidth transaction sequence.
The premise of the high-bandwidth PID tracking state machine is that the sequence of DATA PIDs for the
current microframe is determined by the device’s response to the first IN of the microframe. Based on PID
response, the host controller sets an internal count variable (Cnt) that is used to drive the state machine
through the remaining phases (states) of the high-bandwidth transaction sequence.
Each microframe, the machine is initialized to the Start state. In this state, the value of the internal counter
is a don’t care (X). The host controller issues the initial IN, and then sets the internal counter (Cnt) to the
value number (Y) of the data PID received. For example, if the PID response is DATA2, then Cnt is loaded
with the value ‘2’. When the PID is a DATA1 or DATA2, then two additional checks are performed. If neither
of these checks fail, then the host controller transitions to the Next state.
1) The size of the data payload shall be equal to maximum packet length (Maxpacket), and
2) The host controller shall check that the starting PID response is in the range configured for this
endpoint, as specified in Mult. If the PID value number (Y) is less than the value of Burst, then the
received data PID is in the appropriate range. For example, if Burst is 2 and the device returns a
DATA1, then Y=1 is less than Burst so the received PID is acceptable.
When the PID received in the Start state is DATA0, then the high-bandwidth transaction is complete for this
microframe and the host controller shall set the Active to Inactive. A valid DATA0 PID is allowed to have a
data payload size less than or equal to Maxpacket. If a babble error is detected, then the host controller will
additionally set the Babble bit to a ‘1’.
Current
Endpoint Response
State Next
Results Explanation
State
Cnt PID[Y]
450
eXtensible Host Controller Interface Revision 1.0
Current
Endpoint Response
State Next
Results Explanation
State
Cnt PID[Y]
Next 2 PID← DATA2 Don’t care Advance, Done Endpoint responded twice
XactEr with DATA2 PID.
PID← DATA1 = Maxpacket Cnt = Acceptable PID response. If
1 no babble error, then go to
Next state.
< Maxpacket Advance, Done Data payload shall be equal
XactErr to maximum packet size.
> Maxpacket Advance, Done Data payloads larger than
Babble maximum packet size are a
babble condition.
PID← DATA0 Don’t care Advance, Done Device went from DATA2 to
XactErr DATA0; invalid transition.
1 PID← DATA[2,1] Don’t care Advance, Done Endpoint repeated a DATA2
XactErr1 or DATA1 PID.
PID← DATA0 ≤ Maxpacket Advance Done Acceptable PID response. If
no babble error, transaction
sequence completed
normally.
> Maxpacket Advance, Done Data payloads larger than
Babble maximum packet size are a
babble condition.
In the Next state, the xHC issues an IN token and checks the value number (Y) of the PID response
against the value of the internal counter (Cnt). If the value number (Y) is equal to (Cnt – 1), then the PID
response is correct and the host controller sets the internal counter (Cnt) to the value number of the data
PID received.
When the received PID response is acceptable and is a DATA1, then the xHC shall also check that the size
of the data payload is equal to the configured maximum packet length (Maxpacket). If the length check
passes, the PID check has passed and the xHC does a final babble check. If no babble error, the xHC
remains in the Next state and executes another bus transaction. If there was an error, the xHC flags the
error and advances to the next TD. If the length check fails, the xHC generates a Transaction Error
(XactErr) for the TD. If the babble check fails, the xHC shall generate a Babble Error (Babble) for the TD.
When the received PID response is acceptable and is a DATA0, then the high-bandwidth transaction is
complete for this microframe and the xHC shall advance to the next TD and wait for the next Interval. The
data payload is allowed to be less than or equal to the configured maximum packet size. If a babble error is
detected, then the xHC shall generate a Babble Error (Babble) for the TD.
Any time the individual transaction completes in a Timeout, the xHC shall Advance to the next TD and
generate a Transaction Error (XactErr→1) for the TD.
Note that this state machine is for illustrative purposes. Implementations may optimize appropriately to
avoid arithmetic operations where possible, as long as the resultant behavior is correct.
451
eXtensible Host Controller Interface Revision 1.0
Host
Cmd
Data Data Status Bulk
IN OUT
(Streams) (Streams)
(Streams)
Endpoints
USB Mass Storage devices utilize a three phase command execution sequence; Command, Data, And
Status. Figure 127 illustrates an example where 4 USB pipes are employed to support read and write
commands to the disk; a Command OUT (Cmd) pipe, Data IN and OUT pipes, and a Status IN pipe. All are
Bulk pipes, however the Data pipes also support Streams.
Consider a disk read: Before posting a disk command to the Cmd pipe, system software would first post a
buffer to the Status pipe to receive the completion status for the command, and set up a Stream to receive
the data associated with the command. Once both the Data and Status were set up for the command,
software would post the Command to the Cmd pipe.
To post the Status buffer, software simply adds a TD to the Status IN Transfer Ring.
To set up the Stream associated with the Read Data transfer, software would select an available Stream
ID, initialize a Transfer Ring to point to the host memory that will receive the read data, load a pointer to the
Transfer Ring into the TR Dequeue Pointer field of the Stream Context in the Stream Array associated with
the selected Stream ID, and ring the doorbell for the Data IN Endpoint. Note that the selected Stream ID is
written to the Doorbell register when software rings the Data IN doorbell, however it is not necessary for
basic Stream Protocol operation.
To post the Command, software adds a TD to the Cmd OUT Transfer Ring. The data portion of the
Command packet will include the Stream ID allocated for the Command.
When the Device returns the Read Data for the Command, it uses the Stream ID provided by the
Command to set the Current Stream in the xHC for the pipe, then moves the Read Data. The xHC uses the
Current Stream to select a Stream Context in the Stream Array. The Transfer Ring referenced by the
Stream Context will be used to move the Read Data into host memory.
When the Data transfer is complete, the Device sends the completion Status up the waiting Status pipe.
After software receives the completion Status for the command it can free the associated Stream ID for
reuse by another disk command.
Disk Command Queuing allows software to queue multiple Commands to a drive and the drive to decide
on their order of execution. Due to the physical geometry of the disk or other internal parameters, the disk
reorders Commands to minimize latency and maximize throughput. The ability for the drive to complete
commands out of order is critical for Command Queuing to work. Because the disk can control Stream
452
eXtensible Host Controller Interface Revision 1.0
selection in the xHC and a different Stream ID is associated with each Command, the disk may set the
Current Stream in xHC as function of the Command that it is currently completing.
FPDMA is enabled by the fact that separate data buffers may be assigned to each Stream. This allows the
disk, as the “First Party”, to direct the data associated with a particular Command to specific buffers in host
memory as a function of the Stream ID.
Streams may also be used for Core Targeting. Core Targeting is the ability to direct the interrupt
associated with a transfer (or Command) to a specific core in a multi-core system. The fact that separate
Transfer Rings may be specific for each Stream and that the Transfer Event for a TRB in a Transfer Ring
can be directed at any Interrupter via the Interrupter Target field allows the device to direct completions at
specific cores as function of the Current Stream that it selects.
453
eXtensible Host Controller Interface Revision 1.0
D.1 Example
The following is an example of the ACPI objects defined for an xHC that implements a High-speed and
SuperSpeed Bus Instance, that are associated with USB2 and USB3 Protocol Root Hub Ports,
respectively. The xHC also supports an integrated High-speed hub to provide Low- and Full-speed
functionality. The External Ports defined by the xHC implementation provide either a USB2 data bus (i.e. a
D+/D- signal pair) or a SuperSpeed (or future USB speed) data bus (i.e. SSRx+/SSRx- and SSTx+/SSTx-
signal pairs).
Where:
• The motherboard presents 5 user visible connectors C1 – C5.
• Motherboard connectors C1 and C2 support USB2 (LS/FS/HS) devices.
• Motherboard connectors C3, C4 and C5 support USB3 (LS/FS/HS/SS) devices.
• The xHC implements a High-speed Bus Instance associated with USB2 Protocol Root Hub ports, e.g.
HCP1 and HCP2 are High-speed only, i.e. they provide no Low- or Full-speed support.
• The xHC presents 7 External Ports (P1 – P7).
• External Port 1 (P1) is HS only and is not visible or connectable.
• External Ports 2 – 5 (P2 – P5) support LS/FS/HS devices.
• P2 is attached to motherboard USB2 connector C1.
• P3 is attached to motherboard USB2 connector C2.
• P4 is attached to the USB 2.0 logical hub of the Embedded USB3 Hub on the motherboard.
The USB 2.0 logical hub supports the LS/FS/HS connections for 2 ports (EP1 – EP2).
• The USB 2.0 connections of motherboard hub ports EP1 and EP2 are attached to
motherboard connectors C3 and C4 respectively, providing the LS/FS/HS support for the
USB3 connectors.
• P5 is attached to motherboard connector C5, providing the LS/FS/HS support to the
motherboard USB3 connector C5.
• External Port 6 (P6) is attached to the SuperSpeed logical hub of the Embedded USB3 Hub on
the motherboard. The SuperSpeed logical hub supports the SS connections of 2 ports (EP1 –
EP2).
• The SuperSpeed connections of motherboard hub ports EP1 and EP2 are attached to
motherboard connectors C3 and C4 respectively, providing the SS support for the USB3
connectors.
• External Port 7 (P7) is attached to motherboard connectors C5, providing the SS support for the
USB3 connector.
454
eXtensible Host Controller Interface Revision 1.0
• The xHC implements 4 internal HS Root Hub ports (HCP1 – HCP4), 2 High-speed and 2 SuperSpeed.
• Internal Port 1 (HCP1) maps directly to External Port 1 (P1).
• Internal Port 2 (HCP2) is attached to a HS Integrated Hub. The Integrated Hub supports 4 ports
(IP1 – IP4).
• Ports 1 to 4 (IP1-IP4) of the Integrated Hub attach to External Ports 2 to 5 (P2-P5),
respectively.
• Internal Ports 3 and 4 (HCP3, HCP4) attach to External Ports 6 and 7 (P6, P7), respectively.
• All connectors are located on the back panel and assigned to the same Group.
• Connectors C1 and C2 are USB2 compatible and their color is not specified. Connectors C3 to C5 are
USB3 compatible and their color is specified.
• External Ports P1 - P5 present a USB2 data bus (i.e. a D+/D- signal pair). External Ports P6 and P7
present a SuperSpeed data bus (i.e. SSRx+/SSRx- and SSTx+/SSTx- signal pairs).
Motherboard
xHC
Root Hub
Integrated Hub
Integrated
IP1 IP2 IP3 IP4
Hub Ports
P1 P2 P3 P4 P5 P6 P7 External
Ports
Embedded
USB3 Hub
Motherboard
EP1 EP2
Hub Ports
Physical USB
C1 C2 C3 C4 C5 Motherboard
Connectors
USB Cables
455
eXtensible Host Controller Interface Revision 1.0
456
eXtensible Host Controller Interface Revision 1.0
457
eXtensible Host Controller Interface Revision 1.0
458
eXtensible Host Controller Interface Revision 1.0
} // Device( HCP3 )
// Root Hub port 4 ( HCP4 )
Device( HCP4 ) {
Name( _ADR, 0x00000004 )
// Must match the _UPC declaration for USB0.RHUB.HCP2.IHUB.IP4 as
459
eXtensible Host Controller Interface Revision 1.0
Note: USB 3.0 specific connectors are identified with a standardized blue color (Pantone 300C). In this
example Pantone 300C is mapped to the RGB value of 0(R), 114(G), 198(B) (0072C6h).
460
eXtensible Host Controller Interface Revision 1.0
State
Hierarchy - Contains other state machines
Initial
State - Initial state of state machine
461
eXtensible Host Controller Interface Revision 1.0
Table Labels
Protocol Overhead
The downstream link overhead in bytes. The components of overhead are described by the cell to
the right.
TD Transfer Size
TD Transfer Size in bytes.
Max Bandwidth
The maximum achievable bandwidth given the TD Transfer Size in KBytes/second.
% Microframe Bandwidth per TD
The percentage of microframe bandwidth consumed by a single TD.
Max TDs
The maximum number of TD Transfer Size TDs than may be scheduled per microframe.
Bytes Remaining
The remaining byte times in a microframe after transferring one TD.
Bytes/Microframe Useful Data
TD Transfer Size * Max TDs
462
eXtensible Host Controller Interface Revision 1.0
TD % Microframe Bytes/
Max Bandwidth Bytes
Transfer Bandwidth Max TDs Microframe
(KBytes/second) Remaining
Size per TD Useful Data
xHC implementations are free to determine how the individual bus transactions for specific bulk transfers
are moved over the bus within and across microframes. An endpoint could see all bus transactions for a
bulk transfer within the same microframe or spread across several microframes. An xHC, for various
implementation reasons, may not be able to provide the above maximum number of transactions per
(micro)frame.
Note: For a given TD Transfer Size, simultaneous bulk IN and OUT transfers would incur an additional
36 bytes of Protocol Overhead per OUT TD, i.e. 1 for the IN DP’s ACK TP (20B) and 2 Link
Commands for the IN DP (8B each).
463
eXtensible Host Controller Interface Revision 1.0
TD % Microframe Bytes/
Max Bandwidth Bytes
Transfer Bandwidth Max TDs Microframe
(KBytes/second) Remaining
Size per TD Useful Data
Note: For a given TD Transfer Size, simultaneous interrupt IN and OUT transfers would incur an
additional 36 bytes of Protocol Overhead on the downstream link per OUT TD, i.e. 1 for the IN
DP’s ACK TP (20B) and 2 Link Commands for the IN DP (8B each).
464
eXtensible Host Controller Interface Revision 1.0
TD % Microframe Bytes/
Max Bandwidth Bytes
Transfer Bandwidth per Max TDs Microframe
(KBytes/second) Remaining
Size TD Useful Data
Note: For a given TD Transfer Size, simultaneous isoch IN and OUT transfers would incur an additional
16 bytes of Protocol Overhead on the downstream link per OUT TD, i.e. 2 Link Commands for the
IN DP (8B each).
465
eXtensible Host Controller Interface Revision 1.0
Bit Description
8 Force Stopped Event (FSE). This flag indicates whether the host controller implementation
generates a Stopped Transfer Event when a Transfer Ring stops between TDs. A ‘1’ in this bit
indicates that Forced Stopped Events are supported. A ‘0’ in this bit indicates that Forced
Stopped Events are not supported. Refer to Section 4.6.9 for more information on the use of
this flag.
Bits Description
9 Secondary Bandwidth Domain Reporting (SBD). This flag indicates whether the host
controller implementation is capable of reporting Secondary Bandwidth Domain information. A
‘1’ in this bit indicates that Secondary Bandwidth Domain reporting is supported. A ‘0’ in this bit
indicates that Secondary Bandwidth Domain reporting is not supported. Refer to Section 4.16.2
for more information on the use of this flag.
466
eXtensible Host Controller Interface Revision 1.0
Bits Description
16 L1 Capability (L1C) - RO. Default = Implementation dependent. If this bit is set to ‘1’ the xHC
supports the USB2 Link Power Management L1 (Sleep) state and the associated USB2
protocol fields as defined in the PORTSC and USB2 PORTPMSC registers are valid,
specifically USB2 protocol functionality of the PLS and PLC fields in the PORTSC register, and
the fields of the USB2 PORTPMSC register.
Note that software is prohibited from using the PLS field initiate a transition to an L1 state or
using the USB2 PORTPMSC fields unless this bit is set to ‘1’.
467
eXtensible Host Controller Interface Revision 1.0
468