Host Mode Initialization

Zynq UltraScale+ Device Technical Reference Manual (UG1085)

Document ID
UG1085
Release Date
2023-12-21
Revision
2.4 English

After the system boots, the following steps are executed in the system software.

1.The host controller is enumerated, assigned a base address for the xHCI register space.

2.The system software sets the frame length adjustment (FLADJ) register to a system-specific value.

3.Initialize the system I/O memory maps.

4.Wait until the controller not ready (CNR) flag in the USBSTS is 0 before writing any xHCI operational or run time registers.

5.Program the maximum device slots enabled (MaxSlotsEn) field in the configuration register to enable the device slots that system software is going to use.

6.Program the device context base address array pointer (DCBAAP) register with a 64-bit address pointing to where the device context base address array is located.

7.Define the command ring dequeue pointer by programming the command ring control register with a 64-bit address pointing to the starting address of the first TRB of the command ring.

8.Initialize interrupts

9.Initialize each active interrupter by with the following steps.

a.Defining the event ring.

-Allocate and initialize the event ring segment(s)

-Allocate the event ring segment table (ERST). Initialize the 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 with the number of segments described by the event ring segment table.

-Program the interrupter event ring dequeue pointer (ERDP) register 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 with a 64-bit address pointer to where the event ring segment table is located.

Note:   Writing the ERSTBA enables the event ring.

b.Define the interrupts.

-Enable system bus interrupt generation by writing a 1 to the interrupter enable (INTE) flag of the USBCMD register.

-Enable the interrupter by writing a 1 to the interrupt enable (IE) field of the management register.

-Write the USBCMD to turn the host controller ON by setting the run/stop (R/S) bit to 1. This operation allows the xHCI to begin accepting doorbell references.

c.The host controller is now up and running.

10.The root hub ports begin reporting device connects. System software can begin enumerating 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 start of files (SOFs) occurring on the port.