Altera recommends the following method of building and updating the descriptor
list:
1. Build the descriptor list and terminate the list with a non-hardware owned
descriptor (OWNED_BY_HW = 0). The list can be arbitrarily long.
2. Set the interrupt IE_CHAIN_COMPLETED.
3. Write the address of the first descriptor in the first list to the
next_descriptor_pointer register and set the RUN bit to 1 to initiate transfers.
4. While the core is processing the first list, build a second list of descriptors.
5. When the SD-DMA controller core finishes processing the first list, an interrupt is
generated. Update the next_descriptor_pointer register with the address of
the first descriptor in the second list. Clear the RUN bit and the status register. Set
the RUN bit back to 1 to resume transfers.
6. If there are new descriptors to add, always add them to the list which the core is
not processing. For example, if the core is processing the first list, add new
descriptors to the second list and so forth.
This method ensures that the descriptors are not updated when the core is processing
them. Because the method requires a response to the interrupt, a high-latency
interrupt may cause a problem in systems where stalling data movement is not
possible.
阅读(2078) | 评论(0) | 转发(0) |