Nxp Semiconductors UM10237 User Manual

Page of 792
UM10237_2
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 02 — 19 December 2008 
251 of 792
NXP Semiconductors
UM10237
Chapter 11: LPC24XX Ethernet
be written to the TxDescriptorNumber/RxDescriptorNumber registers using a -1 encoding 
i.e. the value in the registers is the number of descriptors minus one e.g. if the descriptor 
array has 4 descriptors the value of the number of descriptors register should be 3.
After setting up the descriptor arrays, frame buffers need to be allocated for the receive 
descriptors before enabling the receive datapath. The Packet field of the receive 
descriptors needs to be filled with the base address of the frame buffer of that descriptor. 
Amongst others the Control field in the receive descriptor needs to contain the size of the 
data buffer using -1 encoding.
The receive datapath has a configurable filtering function for discarding/ignoring specific 
Ethernet frames. The filtering function should also be configured during initialization.
After an assertion of the hardware reset, the soft reset bit in the MAC will be asserted. The 
soft reset condition must be removed before the Ethernet block can be enabled.
Enabling of the receive function is located in two places. The receive DMA manager 
needs to be enabled and the receive datapath of the MAC needs to be enabled. To 
prevent overflow in the receive DMA engine the receive DMA engine should be enabled 
by setting the RxEnable bit in the Command register before enabling the receive datapath 
in the MAC by setting the RECEIVE ENABLE bit in the MAC1 register.
The transmit DMA engine can be enabled at any time by setting the TxEnable bit in the 
Command register.
Before enabling the datapaths, several options can be programmed in the MAC, such as 
automatic flow control, transmit to receive loop-back for verification, full/half duplex 
modes, etc.
Base addresses of descriptor arrays and descriptor array sizes cannot be modified 
without a (soft) reset of the receive and transmit datapaths.
9.6 Transmit process
Overview
This section outlines the transmission process.
Device driver sets up descriptors and data
If the descriptor array is full the device driver should wait for the descriptor arrays to 
become not full before writing to a descriptor in the descriptor array. If the descriptor array 
is not full, the device driver should use the descriptor numbered TxProduceIndex of the 
array pointed to by TxDescriptor.
The Packet pointer in the descriptor is set to point to a data frame or frame fragment to be 
transmitted. The Size field in the Command field of the descriptor should be set to the 
number of bytes in the fragment buffer, -1 encoded. Additional control information can be 
indicated in the Control field in the descriptor (bits Interrupt, Last, CRC, Pad).
After writing the descriptor the descriptor needs to be handed over to the hardware by 
incrementing (and possibly wrapping) the TxProduceIndex register.
If the transmit datapath is disabled, the device driver should not forget to enable the 
transmit datapath by setting the TxEnable bit in the Command register.