Intel
®
81341 and 81342 I/O Processors
December 2007
Developer’s Manual
Order Number: 315037-002US
511
Application DMA Unit—Intel
®
81341 and 81342
5.11
Programming the Application DMA
The software for initiating a transfer using the Application DMA falls into the following
categories:
An example for each category is shown in the following sections as pseudo code flow.
5.11.1
Application DMA Initialization
The ADMA is designed to have independent control of the interrupts, enables, and
control. The initialization consists of virtually no overhead as shown in
.
5.11.2
Start Transfer
The ADMA control register provides independent control each time the ADMA is
configured. This provides the greatest flexibility to the applications programmer. The
example shown in
describes the pseudo code for initiating an XOR operation
with the ADMA for four sources.
• ADMA initialization
• Start Transfer
• Suspend ADMA
Figure 72. Pseudo Code: Application DMA Initialization
ACCR = 0x0000 0000 ; Disable the Application DMA
Call setup_adma
Figure 73. Pseudo Code: XOR Transfer Operation
; Set up descriptor in Intel XScale
®
microarchitecture local memory at address d
d.nda = 0
/* No chaining */
d.SAR0 = 0x0 A000 0400/* Source address of Data Block 1 */
d.SAR1 = 0x0 A000 0800/* Source address of Data Block 2 */
d.SAR2 = 0x0 A000 0C00/* Source address of Data Block 3 */
d.SAR3 = 0x0 A000 1000/* Source address of Data Block 4 */
d.DADR = 0x0 B000 0100/* Destination address of XOR-ed data */
d.ABCR = 1024
/* Byte Count of 1024 */
d.ADCR = 0x0000 001F/* XOR operation on 4 Source Blocks */
/* Store the result & interrupt processor */
; Check for Inactive ADMA & no pending interrupts
if (ACSR != 0) exit/* If ADMA is not ready, exit */
; Start Operation
ANDAR = &d
; Set up descriptor address
ACCR = 0x00000001
; Set ADMA Enable bit