725
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
descriptor), and the buffer address will be stored in RDES2 and TDES2, RDES3 and TDES3. When using the buffer
address pointed to by the current descriptor, the descriptor pointer will point to the next descriptor. When the chain
structure is used, the descriptor pointer points to the second buffer; when the ring structure is used, the next address
pointed to by the descriptor pointer is calculated as follows:
Next descriptor address = Current descriptor a 16 + ETH_DMABUSMOD.DSL [4:0]×4
If current descriptor is the last descriptor in descriptor list, TDES1.TER or RDES1.RER must be set under the ring
structure to identify the current descriptor as the last descriptor in the list, and next descriptor will point to the first
descriptor in descriptor list. Under chain structure, can also point to the first address in the descriptor list by setting
the value of TDES3 or RDES3. Once DMA detects the end of the frame it will jump to the buffer for next frame.
Figure 25-8 Two structures of descriptor
Data buffer address alignment
The alignment types supported by Ethernet DMA controller include byte alignment, halfword alignment, and word
alignment. So the application can configure the transmit data buffer address and receive data buffer address to any
address. However, when DMA initiates a transfer, the address is always accessed in a word-aligned manner. The read
buffer and write buffer accesses are also different:
Read buffer: If the address of transmit buffer is 0x2000 01A2, and need to transfer 15 bytes. After starting the
read operation, DMA will actually read 20 bytes from addresses 0x2000 01A0, 0x2000 01A4, 0x2000 01A8,
0x2000 01AC and 0x2000 01B0, and then discard the first 2 bytes (0x2000 01A0 and 0x2000 01A1) and the
last 3 bytes (0x2000 01B1, 0x2000 01B2 and 0x2000 01B3).
Write buffer: If the address of receive buffer is 0x2000 0AB2, and need to transfer 16 bytes. After starting the
write operation, DMA will actually write five 32-bit data from address 0x2000 0AB0 to 0x2000 0AC0. But the
first 2 bytes (0x2000 0AB0 and 0x2000 0AB1) and the last 2 bytes (0x2000 0AC2 and 0x2000 0AC3) are filled
with null data instead.
Note: DMA controller will not write any data beyond the defined buffer address.
Descriptors 0
Descriptors 1
Descriptors 2
Descriptor N
(last)
Buffer1
Buffer1
Buffer1
Buffer1
Chain structure
Ring structure
Descriptors 0
Descriptors 1
Descriptors 2
Descriptor N
(last)
Buffer1
Buffer1
Buffer1
Buffer1
Buffer2
Buffer2
Buffer2
Buffer2