Functional Description
transfer size (in bytes) of the transfer for the USB Module (USB0 or USB1) prior to posting a transfer
transaction. If the transfer size is an integer multiple of USB MaxPktSize then no additional zero-byte
packet is sent when using Generic RNDIS transfer. However, if the a short packet has been sent prior to
programmed size count, the transfer would end in a similar fashion an RDIS transfer would behave. For
example, it the USB MaxPktSize (Tx/RxMaxP) is programmed with a value of 64, the Generic RNDIS EP
Size register for that endpoint must be programmed with a value that is an integer multiple of 64 (for
example, 64, 128, 192, 256, etc.) for it behave differently than RNDIS transfer. In other words, when using
Generic RNDIS mode and the DMA is tasked to transfer data transfer size that is less or equal the size
value programmed within the USB0/1 GENERIC RNDIS EPn Size register.
This means that Generic RNDIS mode will perform data transfer in the same manner as RNDIS mode,
closing the CPPI packet if a USB packet with a size less than the USB MaxPktSize size value is received.
Otherwise, the packet will be closed when the value in the Generic RNDIS EP Size register is reached.
Using USB0/1 GENERIC RNDIS EPn Size register, a packet of up to 64K bytes (65536 bytes) can be
transferred. This is to allow the host software to program the USB module to transfer data that is an exact
multiple of the USB MaxPktSize (Tx/RxMaxP programmed value) without having to send an additional
short packet to terminate.
NOTE: As in RNDIS mode, the USB max packet size (Tx/RxMaxp programmed value) of any Generic
RNDIS mode enabled endpoints must be a multiple of 64 bytes. Generic RNDIS acceleration should not
be enabled for endpoints where the max packet size is not a multiple of 64 bytes. Only transparent mode
should be used for such endpoints.
16.3.9.8.3.1 Generic RNDIS DMA Transfer Setup
Disable the use of RNDIS at the global level, this is achieved by clearing RNDIS bit field
(CTRLR0/1[RNDIS]=0), since global configuration over-rides endpoint configuration.
Configure the field that correspond to the USB module endpoint using the corresponding USB0/1 TX(RX)
Mode Register, i.e., TXMODE0/1[TXn_MODE] = 11b and RXMODE0/1[RXn_MODE] = 11b.
16.3.9.8.4 Linux CDC DMA Transfer
Linux CDC DMA transfer mode acts in the same manner as RNDIS packets, except for the case where
the last data matches the max USB packet size requiring additional zero-byte packet transfer in RNDIS
mode and this is not the case for Linux CDC. If the last data packet of a transfer is a short packet where
the data size is greater than zero and less the USB MaxPktSize, then the behavior of the Linux CDC DMA
transfer type is identical with the RNDIS DMA transfer type. The only exception is when the short packet
length terminating the transfer is a Null Packet. In this case, instead of transferring the Null Packet, it will
transfer a data packet of size 1 byte with the data value of 00h.
In transmit operation, if an endpoint is configured or CDC Linux mode, upon receiving a Null Packet from
the CPPI DMA, the XFER DMA will then generate a packet containing 1 byte of data, whose value is 00h,
indicating the end of the transfer. During receive operation, the XFER DMA will recognize the one byte
zero packet as a termination of the data transfer, and sends a block of data with the EOP indicator set and
a byte count of one to the CPPI DMA controller. The CPPI DMA realizing the end of the transfer
termination will not update/increase the packet size count of the Host Packet Descriptor.
16.3.9.8.4.1 Linux CDC DMA Transfer Setup
Disable the use of RNDIS at the global level, this is achieved by clearing RNDIS bit field
(CTRLR0/1[RNDIS]=0), since global configuration over-rides endpoint configuration.
Configure the field that correspond to the USB module endpoint using the corresponding USB0/1 TX(RX)
Mode Register, i.e., TXMODE0/1[TXn_MODE] = 10b and RXMODE0/1[RXn_MODE] = 10b.
16.3.9.9 USB Data Flow Using DMA
The necessary steps required to perform a USB data transfer using the CPPI 4.1 DMA is expressed using
an example for both transmit and receive cases. Assume USB0 is ready to perform a USB data transfer of
size 608 bytes (see
).
1750
Universal Serial Bus (USB)
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated