25.7.4 Linked List
This module provides linked-list operation which allows a DMA channel to perform more than one block transfer without the CPU intervening in-between block transfers. A linked-list is data structure that resides in system memory which consists of descriptors linked together by address pointers contained within the descriptor. Each descriptor can completely define a block transfer. Linked List Block Descriptor describes the contents of a descriptor. The DMA is capable of loading the descriptor, configuring the channel based on the descriptor, performing a block transfer and then loading the next descriptor in the linked-list autonomously.
To enable link list mode, software first programs the CHNXTk.NXT register field with a pointer to the first descriptor in the linked-list, then sets the CHCTRLAk.LLEN bit to 1 which enables linked list operation. The DMA will then request access to the read port and perform a descriptor load.
The DMA always loads the first and second words of the descriptor. The first word contains the next pointer in the linked list chain. This word is loaded into CHNXTk.NXT. The second word contains the BDCFG.RUNSTDBY, BDCFG.SWFRC, BDCFG.LLEN, BDCFB.ENABLE, and controls to optionally load the rest of the descriptor content. The DMA will load all optional parts of the descriptor and configure the channel SFR registers before setting CHCTRLAk.LLEN = BDCFG.LLEN, CHCTRLAk.ENABLE = BDCFG.ENABLE, and CHCTRLAk.SWFRC = BDCFG.SWFRC.
If CHCTRLAk.ENABLE=1 after the descriptor is loaded, the DMA will perform a block transfer as described in Block Transfer. If both CHCTRLAk.ENABLE=1 and CHCTRLAk.SWFRC=1, the DMA issues a start trigger to the channel as soon as the descriptor is loaded and the first cell transfer starts. On completion of the block transfer, the DMA clears CHCTRLAk.ENABLE.
At this point the DMA channel is ready to load the next descriptor. If CHCTRLAk.LLEN=1, the channel requests access to the DMAR port to load the next descriptor at the location specified by the CHNXTk.NXT register.
The link list traversal continues until a descriptor sets CHCTRLAk.LLEN=0, or if CHCTRLAk.LLEN=1 and CHNXTk.NXT was loaded with 0xFFFF_FFFF (NULL pointer) from the descriptor BDNXT.NXT location. If CHNXTk.NXT is set to the NULL pointer, the DMA will clear CHCTRLAK.LLEN, set the CHINTFk.LL flag and end the link-list operation.