USB Data Flow - USB Data Flow - AM026

Versal AI Edge Series Gen 2 and Prime Series Gen 2 Technical Reference Manual (AM026)

Document ID
AM026
Release Date
2025-12-23
Revision
1.3 English
To operate the USB controller in various modes, a set of data structures are defined by the xHCI specification. The application software gives information to the xHCI driver that takes care of the programming and interaction with the data structures. The data structures are used to communicate control, status, and data between the xHCI stack (software) and USB 3.2 controller.
Table 1. Basic Data Structures
Data Structure Alignment (Bytes)
Context Data Structures  
Device context 64
Device context data structure contains slot context and endpoint contexts (up to 32). An array of device contexts is prepared and maintained by the xHCI embedded block and software. This array contains a maximum of 256 device contexts. The first entry (slot ID = 0) in the device context base address array is utilized by the xHCI scratchpad mechanism.  
Slot context 32
The endpoint context data structure defines information that applies to a specific endpoint  
Stream context 16
This data structure defines information that applies to a specific stream associated with an endpoint.  
Input context 64
The input context data structure specifies the endpoints and the operations to be performed on those endpoints by the address device, configure endpoint, and evaluate context commands.  
Input control context 64
The input control context data structure defines which device context data structures are affected by a command and the operations to be performed on those contexts.  
Port bandwidth context 32
The port bandwidth context data structure is used to provide system software with the percentage of periodic bandwidth available on each root hub port, at the speed indicated by the device speed field of the get port bandwidth command. Software allocates the context data structure and the xHCI updates the context data structure during the execution of a get port bandwidth command.  
Ring Data Structures  
Transfer ring segments 16
A transfer request block (TRB) ring is an array of TRB structures, that are used by the xHCI as a circular queue to communicate with the host. Transfer rings provide data transport to and from USB devices. There is a 1:1 mapping between transfer rings and USB pipes. They are defined by an endpoint context data structure contained in a device context, or the stream context array pointed to by the endpoint context.  
Command ring segments 64
The command ring provides system software the ability to issue commands to enumerate USB devices, configure the xHCI to support those devices, and coordinate virtualization features. The command ring is managed by the command ring control register that resides in the operational registers.  
Event ring segments 64
The event ring provides the xHCI with a means of reporting to system software: data transfer and command completion status, root hub port status changes, and other xHCI related events. An event ring is defined by the event ring segment table base address, segment table size, and dequeue pointer registers which reside in the run time registers.  
Event ring segment table 64
This is a table of event ring segments  
Scratchpad buffers Page
A scratchpad buffer is a PAGESIZE block of system memory located on a PAGESIZE boundary. Each of these buffers allocated from system memory for storing internal state  

Data Structure Network

Below are a set of figures and tables to illustrate the Data Structure Network.

Figure 1. Data Structure
Figure 2. Device Context DS
Figure 3. Slot Context DS
Figure 4. Endpoint Context DS
Figure 5. Transfer TRB
Figure 6. Event TRB 1
Figure 7. Event TRB 2
Figure 8. Command TRB 1
Figure 9. Command TRB 2
Figure 10. Command TRB 3
Figure 11. Command TRB 4
Figure 12. Other TRB