USB Host Controller Access to System Memory
14-91
Universal Serial Bus Host
the TD. If the NextTD pointer is not the same as the saved copy of the TailP
value, the TD is the not last TD in the list, and the driver converts the NextTD
local bus virtual address to a MPU virtual address, fetches that TD, and
compares the NextTD pointer to the saved TailP value. This process continues
until the driver finds a TD with a NextTD value that matches the saved TD
value.
Once the last TD on the correct list has been found, the driver copies the new
TD information into the last TD, allocates memory for a new TD, converts the
address of the new TD to a local bus virtual address, and updates the NextTD
value in the last TD to point to the newly allocated TD. It also updates the TailP
value in the ED to the local bus virtual address of the newly allocated TD.
14.6.4 NULL Pointers
The OHCI Specification for USB uses NULL pointers to indicate the end of a
list. The OMAP USB host controller compares the ED and TD pointers against
the value 0x00000000 to determine if the pointer is a null pointer. Address
conversion routines must understand this usage and must not mistake
0x00000000, the null pointer, for local bus virtual address 0x30000000, which
may point to a valid location in physical system memory.
14.6.5 Endianism and USB Host Controller Access to System Memory
The OHCI Specification for USB defines a little-endian controller. Since the
OMAP5910 USB host controller is OHCI-compliant, it is defined for use in little-
endian systems. The OMAP5910 MPU core and subsystem are also little
endian.
14.6.5.1
Endianism and OHCI Endpoint and Transfer Descriptors
OHCI endpoint and transfer descriptors are implemented as shown in the
OHCI Specification for USB, with the bit positions in the endpoint and transfer
descriptor data structures representing bit positions on the physical 32-bit data
bus.
If using C structures for the EDs and TDs, be careful of data alignment of the
structures and the implications of the MPU’s little endianism. The OHCI Speci-
fication for USB requires that EDs and TDs be aligned at 32-bit boundaries in
system memory (local bus virtual address LS 4 bits must be 0). It may be useful
to validate that your data structures are being properly initialized in memory
by performing 32-bit reads to the initialized data structures and comparing the
32-bit read values to the intended values within the bit-fields. However,
because the USB host controller and the MPU core both use little endian
addressing, this should not arise any issues on the OMAP5910 device.