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 />

indicates the last buffer of the frame. After the last buffer of the frame has been transmitted,<br />

the DMA writes back the final status information to the transmit descriptor 0 (TDES0) word<br />

of the descriptor that has the last segment set in transmit descriptor 0 (TDES0[29]). At this<br />

time, if Interrupt on Completion (TDES0[30]) is set, Transmit Interrupt (in ETH_DMASR<br />

register [0]) is set, the next descriptor is fetched, and the process repeats. Actual frame<br />

transmission begins after the Transmit FIFO has reached either a programmable transmit<br />

threshold (ETH_DMAOMR register[16:14]), or a full frame is contained in the FIFO. There is<br />

also an option for the Store and forward mode (ETH_DMAOMR register[21]). Descriptors<br />

are released (OWN bit TDES0[31] is cleared) when the DMA finishes transferring the frame.<br />

Transmit polling suspended<br />

Transmit polling can be suspended by either of the following conditions:<br />

● The DMA detects a descriptor owned by the CPU (TDES0[31]=0) and the Transmit<br />

buffer unavailable flag is set (ETH_DMASR register[2]). To resume, the driver must give<br />

descriptor ownership to the DMA and then issue a Poll Demand command.<br />

● A frame transmission is aborted when a transmit error due to underflow is detected.<br />

The appropriate Transmit Descriptor 0 (TDES0) bit is set. If the second condition<br />

occurs, both the Abnormal Interrupt Summary (in ETH_DMASR register [15]) and<br />

Transmit Underflow bits (in ETH_DMASR register[5]) are set, and the information is<br />

written to Transmit Descriptor 0, causing the suspension. If the DMA goes into Suspend<br />

state due to the first condition, then both the Normal Interrupt Summary (ETH_DMASR<br />

register [16]) and Transmit Buffer Unavailable (ETH_DMASR register[2]) bits are set. In<br />

both cases, the position in the transmit list is retained. The retained position is that of<br />

the descriptor following the last descriptor closed by the DMA. The driver must explicitly<br />

issue a Transmit Poll Demand command after rectifying the suspension cause.<br />

Normal Tx DMA descriptors<br />

The normal transmit descriptor structure consists of four 32-bit words as shown in<br />

Figure 349. The bit descriptions of TDES0, TDES1, TDES2 and TDES3 are given below.<br />

Note that enhanced descriptors must be used if time stamping is activated (ETH_PTPTSCR<br />

bit 0, TSE=1) or if IPv4 checksum offload is activated (ETH_MACCR bit 10, IPCO=1).<br />

Figure 349. Normal transmit descriptor<br />

TDES 0<br />

TDES 1<br />

TDES 2<br />

TDES 3<br />

31 0<br />

O<br />

W<br />

N<br />

Ctrl<br />

[30:26]<br />

Reserved<br />

[31:29]<br />

T<br />

T<br />

S<br />

E<br />

Res.<br />

24<br />

Ctrl<br />

[23:20]<br />

Buffer 2 byte count<br />

[28:16]<br />

Reserved<br />

[19:18]<br />

Reserved<br />

[15:13]<br />

Buffer 1 address [31:0] / Time stamp low [31:0]<br />

Status [16:0]<br />

Buffer 1 byte count<br />

[12:0]<br />

Buffer 2 address [31:0] or Next descriptor address [31:0] / Time stamp high [31:0]<br />

T<br />

T<br />

S<br />

S<br />

ai15642b<br />

Doc ID 018909 Rev 3 948/1416

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

Saved successfully!

Ooh no, something went wrong!