E-4
DINK32 PowerPC ISA Debugger User’s Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
MPC8240 DMA Memory Controller
int_steer controls interrupt steering, use defined constants as follows:
DMA_INT_STEER_LOCAL to steer to local processor
DMA_INT_STEER_PCI to steer to PCI bus through INTA_
type is the type of transfer, use defined constants as follows:
DMA_M2M local memory to local memory (note, this is currently the only one
tested)
DMA_M2P local memory to PCI
DMA_P2M PCI to local memory
DMA_P2P PCI to PCI
source is the source address of the data to transfer
dest is the destination address, the target of the transfer
len is the length in bytes of the data
channel is the DMA channel to use for the transfer, use defined constants as follows:
DMA_CHN_0 Kahlua has two channels, zero and one
DMA_CHN_1
snoop controls processor snooping of the DMA channel buffer, use defined
constants a follows:
DMA_SNOOP_DISABLE
DMA_SNOOP_ENABLE
Return: DMA_Status return value is either DMA_SUCCESS or DMA_ERROR.
Description:
Initiate the DMA transfer.
This function does not implement any validation of the transfer. It does check the status of
the DMA channel to determine if it is OK to initiate a transfer, but the application must
handle verification and error conditions via the interrupt mechanisms.
E.1.4
API Example Usage
The ROM monitor program DINK32 currently uses the DMA API to initiate a direct data
transfer in local memory only. The DINK32 program runs interactively to allow the user to
transfer a block of data in local memory. DINK32 obtains information from the user as
follows: interrupt steering, transfer type, source address of the data, destination (target)
address, length of the data to transfer, DMA channel, and snoop control.
Note that the initialization call to configure the DMA interface is made once: the first time
the user requests a DMA transfer operation. Each transmit or receive operation is initiated
by a single call to a DMA API function. The DINK32 program is an interactive application,
so it gives the DMA library access to its own print output function. DINK32 does not
currently implement any handling of interrupts for error handling or completion of transfer
verification.
F
n
.