User Manual
BCM1250/BCM1125/BCM1125H
10/21/02
B r o a d c o m C o r p o r a t i o n
Document
1250_1125-UM100CB-R
Section 7: DMA Page
151
R
INGS
AND
C
HAINS
Each DMA engine works from a set of descriptors. These may be organized either as a ring or a chain.
Figure 26: DMA Descriptor Ring
. Each descriptor can point to two buffers and the next descriptor to use
is in memory just after the current descriptor. The number of descriptors in the ring is configured when the ring
is established. The DMA engine will detect when it has reached the last descriptor (at the highest memory
location) by checking the ring size, its successor is the descriptor at the lowest memory location, which is
pointed to by the descriptor base register in the configuration block. The ring size can be from 1 to 65536
descriptors. The DMA controller keeps track of its current position in the ring (initially the base). Software
passes ownership of descriptors (and the associated pair of buffers) to the controller by incrementing the count
of the number of descriptors owned by the controller. Writing to the count register adds the value written to the
current count. The software may write the register at any time, the hardware prevents the potential conflict of
the software incrementing as the controller decrements. There is no overflow protection on the count, so
software should take care not to let the count pass 65535 descriptors owned by the DMA controller. When the
controller has finished with a descriptor it will return ownership by decrementing the count. If the descriptor
interrupt bit is set an interrupt will be raised when ownership of the descriptor is returned.
Owned by
DMA Engine
Current
Count
Ring
Size
Ring Base
Buffer A
Buffer B
Size B
Size A
Descriptor 0
Descriptor 1
...
...
.
.
Descriptor ring_size-1