Information
Universal Serial Bus Interface
MPC8308 PowerQUICC II Pro Processor Reference Manual, Rev. 1
Freescale Semiconductor 13-139
13.8.3.5 Control Endpoint Operation Model
This section discusses the control endpoint operation model.
13.8.3.5.1 Setup Phase
All requests to a control endpoint begin with a setup phase followed by an optional data phase and a
required status phase. The USB_DR will always accept the setup phase unless the setup lockout is
engaged.
The setup lockout will engage so that future setup packets are ignored. Lockout of setup packets ensures
that while software is reading the setup packet stored in the queue head, that data is not written as it is being
read potentially causing an invalid setup packet.
The setup lockout mechanism can be disabled and a tripwire type semaphore will ensure that the setup
packet payload is extracted from the queue head without being corrupted be an incoming setup packet.
This is the preferred behavior because ignoring repeated setup packets due to long software interrupt
latency would be a compliance issue.
Setup Packet Handling
• Disable Setup Lockout by writing ‘1’ to Setup Lockout Mode (SLOM) in USBMODE (once at
initialization). Setup lockout is not necessary when using the tripwire as described below.
NOTE
Leaving the Setup Lockout Mode as ‘0’ will result in a potential compliance
issue.
• After receiving an interrupt and inspecting ENDPTSETUPSTAT to determine that a setup packet
was received on a particular pipe:
— Write ‘1’ to clear corresponding bit ENDPTSETUPSTAT.
— Write ‘1’ to Setup Tripwire (SUTW) in USBCMD register.
— Duplicate contents of dQH.SetupBuffer into local software byte array.
— Read Setup TripWire (SUTW) in USBCMD register. (if set—continue; if cleared—goto 2)
— Write ‘0’ to clear Setup Tripwire (SUTW) in USBCMD register.
— Process setup packet using local software byte array copy and execute status/handshake phases.
NOTE
After receiving a new setup packet the status and/or handshake phases may
still be pending from a previous control sequence. These should be flushed
and de-allocated before linking a new status and/or handshake dTD for the
most recent setup packet.
13.8.3.5.2 Data Phase
Following the setup phase, the DCD must create a device transfer descriptor for the data phase and prime
the transfer.