Nxp Semiconductors UM10237 用户手册

下载
页码 792
UM10237_2
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 02 — 19 December 2008 
215 of 792
NXP Semiconductors
UM10237
Chapter 11: LPC24XX Ethernet
Descriptors, which are stored in memory, contain information about fragments of incoming 
or outgoing Ethernet frames. A fragment may be an entire frame or a much smaller 
amount of data. Each descriptor contains a pointer to a memory buffer that holds data 
associated with a fragment, the size of the fragment buffer, and details of how the 
fragment will be transmitted or received.
Descriptors are stored in arrays in memory, which are located by pointer registers in the 
Ethernet block. Other registers determine the size of the arrays, point to the next 
descriptor in each array that will be used by the DMA engine, and point to the next 
descriptor in each array that will be used by the Ethernet device driver.
5.4 Overview of DMA operation
The DMA engine makes use of a Receive descriptor array and a Transmit descriptor array 
in memory. All or part of an Ethernet frame may be contained in a memory buffer 
associated with a descriptor. When transmitting, the transmit DMA engine uses as many 
descriptors as needed (one or more) to obtain (gather) all of the parts of a frame, and 
sends them out in sequence. When receiving, the receive DMA engine also uses as many 
descriptors as needed (one or more) to find places to store (scatter) all of the data in the 
received frame.
The base address registers for the descriptor array, registers indicating the number of 
descriptor array entries, and descriptor array input/output pointers are contained in the 
Ethernet block. The descriptor entries and all transmit and receive packet data are stored 
in memory which is not a part of the Ethernet block. The descriptor entries tell where 
related frame data is stored in memory, certain aspects of how the data is handled, and 
the result status of each Ethernet transaction.
Hardware in the DMA engine controls how data incoming from the Ethernet MAC is saved 
to memory, causes fragment related status to be saved, and advances the hardware 
receive pointer for incoming data. Driver software must handle the disposition of received 
data, changing of descriptor data addresses (to avoid unnecessary data movement), and 
advancing the software receive pointer. The two pointers create a circular queue in the 
descriptor array and allow both the DMA hardware and the driver software to know which 
descriptors (if any) are available for their use, including whether the descriptor array is 
empty or full.
Similarly, driver software must set up pointers to data that will be transmitted by the 
Ethernet MAC, giving instructions for each fragment of data, and advancing the software 
transmit pointer for outgoing data. Hardware in the DMA engine reads this information and 
sends the data to the Ethernet MAC interface when possible, updating the status and 
advancing the hardware transmit pointer.
5.5 Ethernet Packet
 illustrates the different fields in an Ethernet packet.