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

always accessed in the maximum possible burst size (limited by PBL) for the 16 bytes to be<br />

read.<br />

The Transmit DMA initiates a data transfer only when there is sufficient space in the<br />

Transmit FIFO to accommodate the configured burst or the number of bytes until the end of<br />

frame (when it is less than the configured burst length). The DMA indicates the start address<br />

and the number of transfers required to the AHB Master Interface. When the AHB Interface<br />

is configured for fixed-length burst, then it transfers data using the best combination of<br />

INCR4, INCR8, INCR16 and SINGLE transactions. Otherwise (no fixed-length burst), it<br />

transfers data using INCR (undefined length) and SINGLE transactions.<br />

The Receive DMA initiates a data transfer only when sufficient data for the configured burst<br />

is available in Receive FIFO or when the end of frame (when it is less than the configured<br />

burst length) is detected in the Receive FIFO. The DMA indicates the start address and the<br />

number of transfers required to the AHB master interface. When the AHB interface is<br />

configured for fixed-length burst, then it transfers data using the best combination of INCR4,<br />

INCR8, INCR16 and SINGLE transactions. If the end of frame is reached before the fixedburst<br />

ends on the AHB interface, then dummy transfers are performed in order to complete<br />

the fixed-length burst. Otherwise (FB bit in ETH_DMABMR is reset), it transfers data using<br />

INCR (undefined length) and SINGLE transactions.<br />

When the AHB interface is configured for address-aligned beats, both DMA engines ensure<br />

that the first burst transfer the AHB initiates is less than or equal to the size of the configured<br />

PBL. Thus, all subsequent beats start at an address that is aligned to the configured PBL.<br />

The DMA can only align the address for beats up to size 16 (for PBL > 16), because the<br />

AHB interface does not support more than INCR16.<br />

29.6.3 Host data buffer alignment<br />

The transmit and receive data buffers do not have any restrictions on start address<br />

alignment. In our system with 32-bit memory, the start address for the buffers can be aligned<br />

to any of the four bytes. However, the DMA always initiates transfers with address aligned to<br />

the bus width with dummy data for the byte lanes not required. This typically happens during<br />

the transfer of the beginning or end of an Ethernet frame.<br />

● Example of buffer read:<br />

If the Transmit buffer address is 0x0000 0FF2, and 15 bytes need to be transferred,<br />

then the DMA will read five full words from address 0x0000 0FF0, but when transferring<br />

data to the Transmit FIFO, the extra bytes (the first two bytes) will be dropped or<br />

ignored. Similarly, the last 3 bytes of the last transfer will also be ignored. The DMA<br />

always ensures it transfers a full 32-bit data items to the Transmit FIFO, unless it is the<br />

end of frame.<br />

● Example of buffer write:<br />

If the Receive buffer address is 0x0000 0FF2, and 16 bytes of a received frame need to<br />

be transferred, then the DMA will write five full 32-bit data items from address<br />

0x0000 0FF0. But the first 2 bytes of the first transfer and the last 2 bytes of the third<br />

transfer will have dummy data.<br />

29.6.4 Buffer size calculations<br />

The DMA does not update the size fields in the transmit and receive descriptors. The DMA<br />

updates only the status fields (xDES0) of the descriptors. The driver has to calculate the<br />

sizes. The transmit DMA transfers the exact number of bytes (indicated by buffer size field in<br />

TDES1) towards the MAC core. If a descriptor is marked as first (FS bit in TDES0 is set),<br />

Doc ID 018909 Rev 3 942/1416

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

Saved successfully!

Ooh no, something went wrong!