09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>RM0090</strong> Ethernet (ETH): media access control (MAC) with DMA controller<br />

been transferred. Upon completion of the EOF frame transfer, the status word is popped out<br />

and sent to the DMA controller.<br />

In Rx FIFO Store-and-forward mode (configured by the RSF bit in the ETH_DMAOMR<br />

register), a frame is read out only after being written completely into the Receive FIFO. In<br />

this mode, all error frames are dropped (if the core is configured to do so) such that only<br />

valid frames are read out and forwarded to the application. In Cut-through mode, some error<br />

frames are not dropped, because the error status is received at the end of the frame, by<br />

which time the start of that frame has already been read out of the FIFO.<br />

A receive operation is initiated when the MAC detects an SFD on the MII. The core strips the<br />

preamble and SFD before proceeding to process the frame. The header fields are checked<br />

for the filtering and the FCS field used to verify the CRC for the frame. The frame is dropped<br />

in the core if it fails the address filter.<br />

Receive protocol<br />

The received frame preamble and SFD are stripped. Once the SFD has been detected, the<br />

MAC starts sending the Ethernet frame data to the receive FIFO, beginning with the first<br />

byte following the SFD (destination address). If IEEE 1588 time stamping is enabled, a<br />

snapshot of the system time is taken when any frame's SFD is detected on the MII. Unless<br />

the MAC filters out and drops the frame, this time stamp is passed on to the application.<br />

If the received frame length/type field is less than 0x600 and if the MAC is programmed for<br />

the auto CRC/pad stripping option, the MAC sends the data of the frame to RxFIFO up to<br />

the count specified in the length/type field, then starts dropping bytes (including the FCS<br />

field). If the Length/Type field is greater than or equal to 0x600, the MAC sends all received<br />

Ethernet frame data to Rx FIFO, regardless of the value on the programmed auto-CRC strip<br />

option. The MAC watchdog timer is enabled by default, that is, frames above 2048 bytes (DA<br />

+ SA + LT + Data + pad + FCS) are cut off. This feature can be disabled by programming the<br />

watchdog disable (WD) bit in the MAC configuration register. However, even if the watchdog<br />

timer is disabled, frames greater than 16 KB in size are cut off and a watchdog timeout<br />

status is given.<br />

Receive CRC: automatic CRC and pad stripping<br />

The MAC checks for any CRC error in the receiving frame. It calculates the 32-bit CRC for<br />

the received frame that includes the Destination address field through the FCS field. The<br />

encoding is defined by the following polynomial.<br />

Gx ( ) x 32<br />

x 26<br />

x 23<br />

x 22<br />

x 16<br />

x 12<br />

x 11<br />

x 10<br />

x 8<br />

x 7<br />

x 5<br />

x 4<br />

x 2<br />

=<br />

+ + + + + + + + + + + + + x + 1<br />

Regardless of the auto-pad/CRC strip, the MAC receives the entire frame to compute the<br />

CRC check for the received frame.<br />

Receive checksum offload<br />

Both IPv4 and IPv6 frames in the received Ethernet frames are detected and processed for<br />

data integrity. You can enable the receive checksum offload by setting the IPCO bit in the<br />

ETH_MACCR register. The MAC receiver identifies IPv4 or IPv6 frames by checking for<br />

value 0x0800 or 0x86DD, respectively, in the received Ethernet frame Type field. This<br />

identification applies to VLAN-tagged frames as well. The receive checksum offload<br />

calculates IPv4 header checksums and checks that they match the received IPv4 header<br />

checksums. The IP Header Error bit is set for any mismatch between the indicated payload<br />

Doc ID 018909 Rev 3 922/1416

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!