Sa11x0 usb device driver, Name, Sa11x0 usb hardware – Comtrol eCos User Manual
Page 791: Endpoint data structures, Caution

SA11X0 USB Device Driver
Name
SA11X0 USB Support
— Device driver for the on-chip SA11X0 USB device
SA11X0 USB Hardware
The Intel StrongARM SA11x0 family of processors is supplied with an on-chip USB slave device, the UDC (USB
Device Controller). This supports three endpoints. Endpoint 0 can only be used for control messages. Endpoint 1
can only be used for bulk transfers from host to peripheral. Endpoint 2 can only be used for bulk transfers from
peripheral to host. Isochronous and interrupt transfers are not supported.
Caution
Different revisions of the SA11x0 silicon have had various problems with the USB support.
The device driver has been tested primarily against stepping B4 of the SA1110 processor,
and may not function as expected with other revisions. Application developers should obtain
the manufacturer’s current errata sheets and specification updates. The B4 stepping still has
a number of problems, but the device driver can work around these. However there is a
penalty in terms of extra code, extra cpu cycles, and increased dispatch latency because
extra processing is needed at DSR level. Interrupt latency should not be affected.
There is one specific problem inherent in the UDC design of which application developers
should be aware: the hardware cannot fully implement the USB standard for bulk transfers. A
bulk transfer typically consists of some number of full-size 64-byte packets and is terminated
by a packet less than the full size. If the amount of data transferred is an exact multiple of 64
bytes then this requires a terminating packet of 0 bytes of data (plus header and checksum).
The SA11x0 USB hardware does not allow a 0-byte packet to be transmitted, so the device
driver is forced to substitute a 1-byte packet and the host receives more data than expected.
Protocol support is needed so that the appropriate host-side device driver can allow buffer
space for the extra byte, detect when it gets sent, and discard it. Consequently certain stan-
dard USB class protocols cannot be implemented using the SA11x0, and therefore custom
host-side device drivers will generally have to be provided, rather than re-using existing ones
that understand the standard protocol.
Endpoint Data Structures
The SA11x0 USB device driver can provide up to three data structures corresponding to the three endpoints:
a usbs_control_endpoint structure
usbs_sa11x0_ep0
; a usbs_rx_endpoint
usbs_sa11x0_ep1
; and a
usbs_tx_endpoint
usbs_sa11x0_ep2
. The header file
cyg/io/usb/usbs_sa11x0.h
provides declarations for
these.
Not all applications will require support for all the endpoints. For example, if the intended use of the UDC only
involves peripheral to host transfers then
usbs_sa11x0_ep1
is redundant. The device driver provides configuration
options to control the presence of each endpoint:
1. Endpoint 0 is controlled by
CYGFUN_DEVS_USB_SA11X0_EP0
. This defaults to enabled if there are any higher-
level packages that require USB hardware or if the global preference
CYGGLO_IO_USB_SLAVE_APPLICATION
687