Functional Description
890
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Ethernet Controller
15.3.3.3 Buffer Size Calculations
The DMA does not update the size fields in the Transmit and Receive descriptors. The DMA updates only
the status fields (RDES and TDES) of the descriptors. The driver has to perform the size calculations. The
TX DMA transfers the exact number of bytes (indicated by buffer size fields of TDES1) to the MAC. If a
descriptor is marked as first (FS bit of TDES0 is set), then the DMA marks the first transfer from the buffer
as the start-of-frame (SOF). If a descriptor is marked as last (LS bit of TDES0), then the DMA marks the
last transfer from that data buffer as the end-of frame (EOF).
The RX DMA transfers data to a buffer until the buffer is full or the end-of frame is received from the
RX/TX Controller. If a descriptor is not marked as last (LS bit of RDES0), then the descriptor's
corresponding buffers are full and the amount of valid data in a buffer is accurately indicated by its buffer
size field minus the data buffer pointer offset when the FS bit of that descriptor is set. The offset is zero
when the data buffer pointer is aligned to the data bus width. If a descriptor is marked as last, then the
buffer may not be full (as indicated by the buffer size in RDES1). To compute the amount of valid data in
this final buffer, the driver must read the frame length (FL bits of RDES0) and subtract the sum of the
buffer sizes of the preceding buffers in this frame. The Receive DMA always transfers the start of next
frame with a new descriptor.
NOTE:
Even when the start address of a receive buffer is not aligned to the data width of 32-bit
system bus, the system should allocate a receive buffer of a size aligned to the system bus
width. For example, if the system allocates a 1024-byte (1KB) receive buffer starting from
address 0x1000, the software can program the buffer start address in the Receive descriptor
to have a 0x1002 offset. The Receive DMA writes the frame to this buffer with dummy data
in the first two locations (0x1000 and 0x1001). The actual frame is written from location
0x1002. Thus, the actual useful space in this buffer is 1022 bytes, even though the buffer
size is programmed as 1024 bytes, because of the start address offset.
15.3.3.4 DMA Arbiter
The arbiter inside the DMA module performs the arbitration between the Transmit and Receive channel
accesses. The DMA can be configured to arbitrate in a round-robin or fixed-priority configuration. When
the DA bit of the EMACDMABUSMOD register is clear, the DMA arbiter allocates the data bus in the ratio
set by the PR bit field of the EMACDMABUSMOD register when both the TX and RX DMA request access
at the same time. When the DA bit is set, the RX DMA always has priority over the TX DMA for data
access by default. However if the TXPR bit of the EMACDMABUSMOD register is also set, then the TX
DMA always gets priority over the RX DMA.
15.3.3.5 Enhanced and Alternate Descriptors
Enhanced Descriptors can contain up to eight words (32 bytes) and buffers of up to 8KB (useful for Jumbo
frames). Enhanced Descriptors support IEEE 1588-2008 Advanced Timestamp and IPC Full Checksum
(Type 2) Offload. These enhanced features are enabled with the TSEN bit of the EMACTIMSTCTRL
register and the IPC bit of the EMACCFG register, respectively.
When using Enhanced Descriptors, set the descriptor size to eight words with the Alternate Descriptor
Size (ATDS) bit in the Ethernet MAC DMA Bus Mode (EMACDMABUSMOD) register. If these enhanced
features are not enabled, the extended descriptors (DES4 to DES7) are not required. Therefore, the
software can use Alternate Descriptors with a default size of 16 bytes (4 words). For alternate descriptors,
the software should clear the Alternate Descriptor Size (ATDS) bit in the Ethernet MAC DMA Bus Mode
(EMACDMABUSMOD) register.
See
and
for more details on the descriptor structure.