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

USB System Architecture

remaining bus bandwidth by performing additional control and bulk transfers.

Bus Bandwidth Reclamation

Bus bandwidth reclamation can be implemented such that when all scheduled transactions have completed, the UHC can use the remaining frame time to perform additional transactions. This requires that the last QH in the list points back to the beginning of the control and bulk queues. Each QH also has a termination bit that, when set, terminates the transfer sequence, and no reclamation occurs.

The UHC tracks frame timing to monitor the amount of frame time left for scheduling additional transactions. A sample point (called PreSOF point) permits the UHC to determine if there is sufficient time to start the next transaction before the end of packet. The PreSOF point can be selected for 32or 64-byte packets under software control. If the packet cannot complete in the remaining time, it is not performed.

Transfer Descriptors

This section defines the contents of the transfer descriptors and the queue heads. Figure C-4 illustrates the contents of a transfer descriptor. In general, transfer descriptors contain the information needed by the UHC to generate a transaction and report status, including:

Transfer Type (isochronous and other)

Type of Token Packet (IN, OUT, SETUP)

Direction of Transfer

Size of Data Packet

Data Toggle Bit

Memory Buffer Location

Completion Status

The transfer descriptor consists of four double words (DW0 - DW3). Each DW within the transfer descriptor is defined in tables Table C-1 - Table C-4.

468

Appendix C: Universal Host Controller

Figure C-3: Transfer Mechanism and Execution Order

 

 

 

 

 

 

 

 

 

 

1023

Pointer

Q

T

 

 

 

 

 

 

 

Pointer

Q

T

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Pointer

Q

T

 

 

Isochronous

 

 

Pointer

Q

T

 

 

 

 

 

 

 

 

 

Transactions

 

 

Pointer

Q

T

 

 

 

 

 

 

 

 

 

 

 

Pointer

Q

T

 

 

 

 

 

TD

 

 

TD

 

TD

 

 

Pointer

Q

T

 

 

 

 

 

 

 

 

 

 

 

Pointer

Q

T

 

 

 

 

 

TD

 

 

TD

 

TD

 

 

Pointer

Q

T

 

 

 

 

 

 

 

 

 

 

 

Pointer

Q

T

 

 

 

 

 

 

 

 

 

 

 

TD

 

TD

 

TD

0

Pointer

Q

T

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Q=Transfer Descriptor or Queue Head T=Terminate

Interrupt

Control and Bulk

Transactions

Transactions

}

 

 

Link

Link

Link

 

 

 

 

 

 

 

Pointer Pointer Pointer

 

 

 

 

 

 

 

 

 

 

QH

 

QH

 

QH

 

 

QH

 

 

 

 

Element

Element

Element

Element

 

Link

 

Link

 

Link

 

Link

Pointer

Pointer

Pointer

Pointer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TD

 

 

TD

 

 

TD

 

 

TD

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TD

 

 

TD

 

 

TD

 

 

TD

 

 

 

 

 

 

 

 

 

 

TD

 

 

 

 

TD

 

 

 

TD

 

 

 

 

TD

TD TD

TD

469

USB System Architecture

Figure C-4: Transfer Descriptor Format

Generic Transfer Descriptor (TD)

31

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4

3

2

1

0

 

 

 

 

 

 

 

 

 

Link Pointer

 

 

 

 

 

0

VF

Q

T

DW 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

31 30 29 28 27 26 25 24 23

16

15

11 10

 

 

 

 

 

0

 

Res

SPD

C_ERR

LS

ISO

IOC

 

 

Status

 

Reserved

 

 

Actual Length

 

 

 

DW 1

 

 

 

 

 

 

 

 

 

 

31

 

 

 

 

 

 

21 20 19 18

15

14

 

8

7

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Maximum Length

 

R

D

EndPoint

Device Address

Packet ID

 

DW 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

31

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Memory Buffer ointerP

 

 

 

 

 

 

DW 3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table C-1: Definition of Fields (DW0)

 

 

 

Bit

Field Name

Description

 

 

 

 

 

 

0

T

Terminate — Link pointer is valid (0) or not valid (1).

 

 

 

1

Q

QH (Queue head) or TD (Transfer Descriptor) select — Informs

 

 

UHC that link points to QH (1) or TD (0).

 

 

 

2

VF

Vertical First — Specifies a depth first (1) or breadth first (0)

 

 

method of processing TDs.

 

 

 

31:4

Link

Points to another TD or QH (address bits 31:4).

 

Pointer

 

 

 

 

470

Appendix C: Universal Host Controller

 

 

Table C-2: Definition of DW1

 

 

 

Bit(s)

Field Name

Description

 

 

 

 

 

 

10:0

Actual Length

Actual length of the transfer that is written by the

 

 

UHC after the transaction has completed.

 

 

 

23:16

Status

Status information posted by the UHC, indicating

 

 

completion status, including:

 

 

• Active — set by software to enable execu-

 

 

tion of a transaction by UHC. Cleared by

 

 

UHC to indicate that descriptor should

 

 

not be executed when encountered in

 

 

schedule again.

 

 

• Stalled — set by UHC to indicate an end-

 

 

point stall has been encountered.

 

 

• Data Buffer Error — set by UHC to indi-

 

 

cate that it has encountered a data buffer

 

 

overflow or underflow.

 

 

• Babble Detected — UHC has detected a

 

 

babble condition when executing this TD.

 

 

UHC also sets a stalled bit since this indi-

 

 

cates a serious failure.

 

 

• NAK Received — set by UHC when NAK

 

 

is returned by target.

 

 

• CRC/Timeout Error — set by UHC if a

 

 

bus time-out or CRC error has been

 

 

detected.

 

 

 

24

IOC

Interrupt on Complete — UHC should generate an

 

 

interrupt at the end of frame in which this TD com-

 

 

pleted.

 

 

 

25

ISO

Isochronous Select — this TD is isochronous (1).

 

 

 

26

LS

Low Speed Device — Preamble packet must be used.

 

 

 

28:27

C_ERR

Error Counter — two bit field used to indicate number

 

 

of error that have occurred when executing this

 

 

descriptor. UHC decrements count when each error is

 

 

detected. (not decremented for babble or stall).

 

 

 

471

USB System Architecture

 

 

Table C-2: Definition of DW1

 

 

 

Bit(s)

Field Name

Description

 

 

 

 

 

 

29

SPD

Short Packet Detected — this bit enables the detection

 

 

of short packets resulting from queued transactions

 

 

that access the target (IN transactions).

 

 

 

 

 

Table C-3: Definition of DW2

 

 

 

Bit(s)

Field Name

Description

 

 

 

 

 

 

7:0

Packet ID

Specifies which type of token packet to use: IN, OUT,

 

 

or SETUP.

 

 

 

14:8

Device

Address of device being accessed by this TD.

 

Address

 

 

 

 

18:15

EndPoint

Endpoint of device being accessed by this TD.

 

 

 

19

Data Toggle

Determines which data packet the UHC should send

 

 

or expect. (always 0 for isochronous transfers).

 

 

 

31:21

Maximum

Specifies the maximum number of data bytes allowed

 

Length

for this transfer. Maximum value is 1280 (4FFh) which

 

 

is the longest packet that is guaranteed to fit into a sin-

 

 

gle frame (does not include PID or CRC).

 

 

 

 

 

Table C-4: Definition of DW3

 

 

 

Bit(s)

Field Name

Description

 

 

 

 

 

 

31:0

Memory

Points to the beginning of the memory buffer to be

 

Buffer Pointer

used during this transaction. The buffer must be at

 

 

least as long as the value of the maximum length field

 

 

in DW2.

 

 

 

472

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