![Texas Instruments AM1808 Technical Reference Manual Download Page 1660](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_10945581660.webp)
Architecture
1660
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Universal Serial Bus 2.0 (USB) Controller
34.2.8.7 Zero Length Packets
A special case is the handling of null packets with the CPPI 4.1 compliant DMA controller. Upon receiving
a zero length USB packet, the XFER DMA will send a data block to the DMA controller with byte count of
zero and the zero byte packet bit of INFO Word 2 set. The DMA controller will then perform normal End of
Packet termination of the packet, without transferring data.
If a zero-length USB packet is received, the XDMA will send the CDMA a data block with a byte count of 0
and this bit set. The CDMA will then perform normal EOP termination of the packet without transferring
data. For transmit, if a packet has this bit set, the XDMA will ignore the CPPI packet size and send a zero-
length packet to the USB controller.
34.2.8.8 CPPI DMA Scheduler
The CPPI DMA scheduler is responsible for controlling the rate and order between the different Tx and Rx
threads that are provided in the CPPI DMA controller. The scheduler table RAM exists within the
scheduler.
34.2.8.8.1 CPPI DMA Scheduler Initialization
Before the scheduler can be used, the host is required to initialize and enable the block. This initialization
is performed as follows:
1. The Host initializes entries within an internal memory array in the scheduler. This array contains up to
256 entries (4 entries per table word
n
) and each entry consists of a DMA channel number and a bit
indicating if this is a Tx or Rx opportunity. These entries represent both the order and frequency that
various Tx and Rx channels will be processed. A table size of 256 entries allows channel bandwidth to
be allocated with a maximum precision of 1/256th of the total DMA bandwidth. The more entries that
are present for a given channel, the bigger the slice of the bandwidth that channel will be given. Larger
tables can be accommodated to allow for more precision. This array can only be written by the Host, it
cannot be read.
2. If the application does not need to use the entire 256 entries, firmware can initialize the portion of the
256 entries and indicate the size of the entries used by writing onto an internal register in the scheduler
which sets the actual size of the array (it can be less than 256 entries).
3. The host writes an internal register bit to enable the scheduler. The scheduler is not required to be
disabled in order to change the scheduler array contents.
34.2.8.8.2 Example of Scheduler Programming
Consider a three endpoints use on a system with the following configurations: EP1-Tx, EP2-Rx, and EP2-
Tx. Two assumptions are considered:
Case 1:
Assume that you would like to service each enabled endpoints (EP1-Tx, EP2-Rx, and EP2-Tx)
with equal priority.
The scheduler handles the rate at which an endpoint is serviced by the number of credits programmed
(entries) for that particular endpoint within the scheduler Table Words. The scheduler has up to 256
credits that it can grant and for this example the number of entries/credits could be anywhere from 3 to
256. However, the optimum and direct programming for this scenario would be programming only the first
three entries of the scheduler via scheduler Table WORD[0]. Since this case expects the Scheduler to use
only the first three entries, you communicate that by programming DMA_SCHED_CTRL.LAST_ENTRY
with 2 (that is, 3 - 1). The Enabled Endpoint numbers and the data transfer direction is then communicated
by programming the first three entries of WORD[0] (ENTRY0_CHANNEL = 1: ENTRY0_RXTX = 0;
ENTRY1_CHANNEL = 2: ENTRY1_RXTX = 1;ENTRY2_CHANNEL = 2: ENTRY2_RXTX = 0). With this
programming, the Scheduler will only service the first three entries in a round-robin fashion, checking each
credited endpoint for transfer one after the other, and servicing the endpoint that has data to transfer.