USB Host Controller Access to System Memory
14-90
Given all of the information in Table 14–35, the MPU performs the initializa-
tions described in Table 14–36.
Table 14–36. Some Data Structure Initializations for Address Conversion Example
Item initialized
Value
Type of Value
HcHCCA register
0x30F00700
Local bus virtual address
HcBulkHeadED register
0x30F00140
Local bus virtual address
HcControlHeadED register
0x30F00150
Local bus virtual address
TDQueueHeadPointer for first bulk ED
0x30F00D90
Local bus virtual address
TDQueueHeadPointer for first control ED
0x30F00DA0
Local bus virtual address
CBP for first TD of first bulk ED
0x32100007
Local bus virtual address
CBP for first TD of first control ED
0x32103423
Local bus virtual address
To properly initialize the EDs and TDs mentioned here, the MPU software must
allocate memory for the data structure and initialize the various fields. To initial-
ize the address pointers in the structure, it begins by getting the MPU virtual
address of the item that is pointed to by the data structure pointer. It converts
that value to the corresponding local bus virtual address and places that value
into the data structure pointer field.
For example, if the USB host controller driver must add a TD to the TD list in
the first bulk ED, it must locate the last TD on the TD list and update it with the
new TD information. It must then change the NextP pointer of the last TD to
point to the local bus virtual address of a newly allocated empty TD. To traverse
the TD list to find the last TD, the host controller driver perhaps starts by
traversing the ED list. It would start by reading the HcBulkHeadED register,
which returns a local bus virtual address. It converts this value to the corre-
sponding MPU virtual address and reads the ED. If the ED is for a different
function number or different endpoint number or direction, the driver reads the
NextED pointer, converts the value from a local bus virtual address to a MPU
virtual address, and checks this new ED for function number and endpoint
number. Once it finds an ED that matches in function number and endpoint
number (and perhaps endpoint direction), it begins traversing the TD list asso-
ciated with the ED.
To traverse the TD list, the driver begins by saving a copy of the TailP value
from the ED and by reading the HeadP value from the ED, which is a local bus
virtual address. The driver converts this to a MPU virtual address, and reads