Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
USB System Architecture (USB 2.0).pdf
Скачиваний:
172
Добавлен:
03.05.2015
Размер:
7.03 Mб
Скачать

Appendix C:

Universal Host

Controller

Overview

The Universal Host Controller (UHC) and the Universal Host Controller Driver (UHCD) are responsible for scheduling and executing IRPs forwarded from the USB driver. The UHC also integrates the root hub function that is compliant with the USB hub definition. The root hub integrated into the UHC has two USB ports. The following sections describe the mechanism used by the UHC to schedule and generate transactions via the USB.

The UHC is integrated into the Intel PIIX3 PCI ISA Expansion Bus Bridge and later chips. It is implemented as a PCI master and is capable of performing transactions to and from memory to fetch and update data structures built by the UHCD.

Universal Host Controller Transaction Scheduling

The sequence of transactions scheduled and performed during each 1ms frame is illustrated in Figure C-1. Note that the periodic transfers are scheduled first (isochronous and interrupt), followed by the control and bulk transfers. The periodic transfers can take up to 90% of the bus bandwidth and control transfers are guaranteed at least 10% of the bandwidth.

The UHCD schedules transactions by building a series of transfer descriptors that are linked to form the collection of transactions that are to be performed during a given frame. This is known as the frame list and is located in system memory.

465

USB System Architecture

Figure C-1: Universal Host Controller Transfer Scheduling

 

 

1.0 ms

SOF

Isochronous Data

Interrupt Data Control Data Bulk Data Time

Universal Host Controller Frame List Access

Figure C-2 illustrates the mechanism used by the UHC to access the frame list from memory. The components involved are:

Start of Frame (SOF) Counter — This counter decrements with each 12MHz clock cycle. When the counter expires, the frame counter is incremented and the next frame begins. This clock is also the source of USB bit timing for transmissions initiated by the root hub.

The SOF Modify Register — This register can be used to adjust the number of bit times contained in each frame. This changes the interval at which frames are started. The modify register supports the master client feature that allows a single client driver to adjust SOF timing to permit the USB frame rate to synchronize to its isochronous transfer rate. The default value results in 1ms frame generation.

Frame Counter — The frame counter increments at each frame time to select the next sequential entry in the frame list. Each entry contains a pointer to the first transfer descriptor.

Frame Number Register — The UHCD programs the start frame number into this register to define the initial entry point within the frame list. This value is loaded into the frame counter and is incremented by the SOF Counter.

Frame List Base Address Register — The UHCD identifies the base address of the 4KB frame list.

The frame list is an array of up to 1024 entries corresponding to a particular frame. Each entry contains a pointer to a linked list of data structures that contain the information needed by the host controller to build a transaction that will be forwarded to the root hub for transmission over the USB. The UHC reads and interprets each transfer descriptor and generates the transaction described for each descriptor.

466

Appendix C: Universal Host Controller

Figure C-2: Frame List Access

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SOF Modify

 

 

 

 

 

 

 

 

 

 

 

 

Register

 

 

 

 

 

 

 

 

 

12 MHz

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SOF Counter

 

 

Frame Number

 

 

 

 

 

 

 

 

 

 

Register

 

 

Pointer

cntl

1023

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Pointer

cntl

 

 

 

 

 

 

 

 

11 bits

 

 

 

 

 

 

 

 

 

 

1 msec

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Frame Counter

 

 

Pointer

cntl

 

 

 

 

 

 

 

 

Frame List

Pointer

cntl

Frame

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Pointer

cntl

 

 

 

 

 

 

 

10 bits

 

Index A11:A2

List

 

 

 

 

 

 

 

 

Pointer

cntl

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Pointer

cntl

 

 

 

 

 

 

 

 

Frame List Base

 

 

Pointer

cntl

 

 

 

 

 

 

 

 

Address Register

 

 

Pointer

cntl

 

 

 

 

 

 

 

 

 

 

Base Address

Pointer

cntl

 

 

 

 

 

 

 

 

20 bits

 

A31:A12

 

Pointer

cntl

0

 

 

 

 

Host Controller

 

 

 

 

 

 

 

 

 

 

 

System Memory

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UHC Transfer Scheduling Mechanism

Figure C-3 illustrates the frame list and the linked list of transfer descriptors that define the transactions to be performed by the UHC. This illustration presumes that many different devices are attached to the USB and that all transfer types are being used by these devices. The order in which the transfer descriptors are linked determines the order that each transaction will be transmitted over the USB. Note that the frame list entry points to transfer descriptors defined for isochronous transfer endpoints. The non-isochronous transfers are queued to permit retries in the event of a failed transaction, whereas isochronous transactions cannot be retried.

Each queue head (QH) and associated transfer descriptor (TD) list is associated with a given transfer type. The first queue is allocated for interrupt transfers, followed by the control transfer queue and finally bulk transfer queues. When all scheduled transactions have completed, the host controller can reclaim the

467

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]