09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

● TDES7: Transmit descriptor Word7<br />

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0<br />

29.6.8 Rx DMA configuration<br />

TTSH<br />

rw<br />

Bits 31:0 TTSH: Transmit frame time stamp high<br />

This field is updated by DMA with the 32 most significant bits of the time stamp captured for<br />

the corresponding transmit frame. This field has the time stamp only if the Last segment control<br />

bit (LS) in the descriptor is set.<br />

The Receive DMA engine’s reception sequence is illustrated in Figure 351 and described<br />

below:<br />

1. The CPU sets up Receive descriptors (RDES0-RDES3) and sets the OWN bit<br />

(RDES0[31]).<br />

2. Once the SR (ETH_DMAOMR register[1]) bit is set, the DMA enters the Run state.<br />

While in the Run state, the DMA polls the receive descriptor list, attempting to acquire<br />

free descriptors. If the fetched descriptor is not free (is owned by the CPU), the DMA<br />

enters the Suspend state and jumps to Step 9.<br />

3. The DMA decodes the receive data buffer address from the acquired descriptors.<br />

4. Incoming frames are processed and placed in the acquired descriptor’s data buffers.<br />

5. When the buffer is full or the frame transfer is complete, the Receive engine fetches the<br />

next descriptor.<br />

6. If the current frame transfer is complete, the DMA proceeds to step 7. If the DMA does<br />

not own the next fetched descriptor and the frame transfer is not complete (EOF is not<br />

yet transferred), the DMA sets the Descriptor error bit in RDES0 (unless flushing is<br />

disabled). The DMA closes the current descriptor (clears the OWN bit) and marks it as<br />

intermediate by clearing the Last segment (LS) bit in the RDES1 value (marks it as last<br />

descriptor if flushing is not disabled), then proceeds to step 8. If the DMA owns the next<br />

descriptor but the current frame transfer is not complete, the DMA closes the current<br />

descriptor as intermediate and returns to step 4.<br />

7. If IEEE 1588 time stamping is enabled, the DMA writes the time stamp (if available) to<br />

the current descriptor’s RDES2 and RDES3. It then takes the received frame’s status<br />

and writes the status word to the current descriptor’s RDES0, with the OWN bit cleared<br />

and the Last segment bit set.<br />

8. The Receive engine checks the latest descriptor’s OWN bit. If the CPU owns the<br />

descriptor (OWN bit is at 0) the Receive buffer unavailable bit (in ETH_DMASR<br />

register[7]) is set and the DMA Receive engine enters the Suspended state (step 9). If<br />

the DMA owns the descriptor, the engine returns to step 4 and awaits the next frame.<br />

9. Before the Receive engine enters the Suspend state, partial frames are flushed from<br />

the Receive FIFO (you can control flushing using bit 24 in the ETH_DMAOMR register).<br />

10. The Receive DMA exits the Suspend state when a Receive Poll demand is given or the<br />

start of next frame is available from the Receive FIFO. The engine proceeds to step 2<br />

and re-fetches the next descriptor.<br />

The DMA does not acknowledge accepting the status until it has completed the time stamp<br />

write-back and is ready to perform status write-back to the descriptor. If software has<br />

enabled time stamping through CSR, when a valid time stamp value is not available for the<br />

Doc ID 018909 Rev 3 954/1416

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

Saved successfully!

Ooh no, something went wrong!