Configuration Download - Motorola DragonBall MC9328MX1 Reference Manual

Integrated portable system processor
Table of Contents

Advertisement

At power-up, the USB module contains no configuration information—such as, how many endpoints are
available or how to locate the descriptors. Device initialization consists of downloading this information to
the appropriate memories and to configure the datapath to match the intended application. The following
steps are involved in the initialization process:
1. Perform a hard reset or a software reset (by setting the RST bit in USB Enable
Register-USB_ENAB).
2. Wait for the device to be properly reset (after writing to RST bit, wait for it to clear) before
accessing the device registers.
3. Wait for the CFG bit in the USB_DDAR register to assert before attempting to
communicate with the UDC. Setting the RST bit forces the ENAB bit to set automatically.
4. Download configuration data (ENDPTBUFs, see Table 28-25 on page 28-36) to the
device's USB Descriptor RAM/Endpoint Buffer Data Register-USB_DDAT).
5. Program the USB Interrupt Mask Register (USB_MASK) to enable interrupts not
associated with a particular endpoint.
6. Program each Endpoint n Status/Control Register (USB_EPn_STAT) and Endpoint n
Interrupt Mask Register (USB_EPn_MASK) to support the intended data transfer modes.
7. Program endpoint type, direction, and maximum packet size in the USB_EPn_STAT
register for each endpoint.
8. Program the FIFO control registers. For each enabled endpoint, program frame mode,
granularity, alarm level, and so on (USB_EPn_FCTRL and USB_EPn_FALRM).
Normally, all endpoints should be programmed with FRAME mode enabled. To ensure
proper operation of the DMA request lines for frame mode endpoints, program the alarm
level to a value equal to or a multiple of the packet size of the endpoint.
9. Enable the USB for processing (set the USB_ENA bit in the USB Control Register,
USB_CTRL).
Initialization of the USB module is a time critical process. The USB host
waits about 100ms after power-on or a connection event to begin
enumerating devices on the bus. This device must have all of the
configuration information available when the host requests it.
After the device is enumerated, the USB host selects a specific configuration and set of interfaces on the
device. Software on the device must beware of USB configuration changes to maintain proper
communication with the USB host. The software retains sole responsibility for always knowing the current
configuration and alternate interface. The CFG_CHG interrupt in the USB_INTR register reports changes
in device configuration and alternate interface settings to the software. The software is required to respond
to the CFG_CHG interrupt. To prevent the state of the device from becoming out of sync with respect to
the host, the device halts further traffic on the USB while this interrupt is pending.

28.5.1 Configuration Download

The configuration download process initializes 6 endpoint buffers (ENDPTBUF-see Table 28-25 on
page 28-36) within the UDC module to define its personality on the USB. The first ENDPTBUF is
reserved for the default pipe (Control Endpoint) and must contain the value 0x0000080000.
The endpoint buffers are 40-bit data strings per physical endpoint (pipe) that are loaded directly into the
UDC module. They associate "logical" endpoint numbers in the USB software stack with hardware within
the UDC. Specifically, they attach each endpoint to a USB configuration, interface, and alternate setting,
and they specify transfer type, packet size, data direction, and hardware FIFO numbers.
MOTOROLA
NOTE:
USB Device Port
Device Initialization
28-35

Advertisement

Table of Contents
loading

Table of Contents