Linux Kernel
3.7.1
|
Go to the source code of this file.
Data Structures | |
struct | edmacc_param |
struct | edma_rsv_info |
struct | edma_soc_info |
Enumerations | |
enum | address_mode { INCR = 0, FIFO = 1 } |
enum | fifo_width { W8BIT = 0, W16BIT = 1, W32BIT = 2, W64BIT = 3, W128BIT = 4, W256BIT = 5 } |
enum | dma_event_q { EVENTQ_0 = 0, EVENTQ_1 = 1, EVENTQ_2 = 2, EVENTQ_3 = 3, EVENTQ_DEFAULT = -1 } |
enum | sync_dimension { ASYNC = 0, ABSYNC = 1 } |
#define EDMA_CHANNEL_ANY -1 /* for edma_alloc_channel() */ |
#define EDMA_SLOT_ANY -1 /* for edma_alloc_slot() */ |
enum address_mode |
enum dma_event_q |
enum fifo_width |
enum sync_dimension |
int edma_alloc_channel | ( | int | channel, |
void(*)(unsigned channel, u16 ch_status, void *data) | callback, | ||
void * | data, | ||
enum dma_event_q | eventq_no | ||
) |
edma_alloc_channel - allocate DMA channel and paired parameter RAM : specific channel to allocate; negative for "any unmapped channel" : optional; to be issued on DMA completion or errors : passed to callback : an EVENTQ_* constant, used to choose which Transfer Controller (TC) executes requests using this channel. Use EVENTQ_DEFAULT unless you really need a high priority queue.
This allocates a DMA channel and its associated parameter RAM slot. The parameter RAM is initialized to hold a dummy transfer.
Normal use is to pass a specific channel number as , to make use of hardware events mapped to that channel. When the channel will be used only for software triggering or event chaining, channels not mapped to hardware events (or mapped to unused events) are preferable.
DMA transfers start from a channel using edma_start(), or by chaining. When the transfer described in that channel's parameter RAM slot completes, that slot's data may be reloaded through a link.
DMA errors are only reported to the associated with the channel driving that transfer, but transfer completion callbacks can be sent to another channel under control of the TCC field in the option word of the transfer's parameter RAM set. Drivers must not use DMA transfer completion callbacks for channels they did not allocate. (The same applies to TCC codes used in transfer chaining.)
edma_alloc_cont_slots- alloc contiguous parameter RAM slots The API will return the starting point of a set of contiguous parameter RAM slots that have been requested
: can only be EDMA_CONT_PARAMS_ANY or EDMA_CONT_PARAMS_FIXED_EXACT or EDMA_CONT_PARAMS_FIXED_NOT_EXACT : number of contiguous Paramter RAM slots - the start value of Parameter RAM slot that should be passed if id is EDMA_CONT_PARAMS_FIXED_EXACT or EDMA_CONT_PARAMS_FIXED_NOT_EXACT
If id is EDMA_CONT_PARAMS_ANY then the API starts looking for a set of contiguous Parameter RAM slots from parameter RAM 64 in the case of DaVinci SOCs and 32 in the case of DA8xx SOCs.
If id is EDMA_CONT_PARAMS_FIXED_EXACT then the API starts looking for a set of contiguous parameter RAM slots from the "slot" that is passed as an argument to the API.
If id is EDMA_CONT_PARAMS_FIXED_NOT_EXACT then the API initially tries starts looking for a set of contiguous parameter RAMs from the "slot" that is passed as an argument to the API. On failure the API will try to find a set of contiguous Parameter RAM slots from the remaining Parameter RAM slots
edma_alloc_slot - allocate DMA parameter RAM : specific slot to allocate; negative for "any unused slot"
This allocates a parameter RAM slot, initializing it to hold a dummy transfer. Slots allocated using this routine have not been mapped to a hardware DMA channel, and will normally be used by linking to them from a slot associated with a DMA channel.
Normal use is to pass EDMA_SLOT_ANY as the , but specific slots may be allocated on behalf of DSP firmware.
void edma_free_channel | ( | unsigned | channel | ) |
edma_free_channel - deallocate DMA channel : dma channel returned from edma_alloc_channel()
This deallocates the DMA channel and associated parameter RAM slot allocated by edma_alloc_channel().
Callers are responsible for ensuring the channel is inactive, and will not be reactivated by linking, chaining, or software calls to edma_start().
edma_free_cont_slots - deallocate DMA parameter RAM slots : first parameter RAM of a set of parameter RAM slots to be freed : the number of contiguous parameter RAM slots to be freed
This deallocates the parameter RAM slots allocated by edma_alloc_cont_slots. Callers/applications need to keep track of sets of contiguous parameter RAM slots that have been allocated using the edma_alloc_cont_slots API. Callers are responsible for ensuring the slots are inactive, and will not be activated.
void edma_free_slot | ( | unsigned | slot | ) |
edma_free_slot - deallocate DMA parameter RAM : parameter RAM slot returned from edma_alloc_slot()
This deallocates the parameter RAM slot allocated by edma_alloc_slot(). Callers are responsible for ensuring the slot is inactive, and will not be activated.
void edma_get_position | ( | unsigned | slot, |
dma_addr_t * | src, | ||
dma_addr_t * | dst | ||
) |
edma_get_position - returns the current transfer points : parameter RAM slot being examined : pointer to source port position : pointer to destination port position
Returns current source and destination addresses for a particular parameter RAM slot. Its channel should not be active when this is called.
void edma_link | ( | unsigned | from, |
unsigned | to | ||
) |
void edma_pause | ( | unsigned | channel | ) |
edma_pause - pause dma on a channel : on which edma_start() has been called
This temporarily disables EDMA hardware events on the specified channel, preventing them from triggering new transfers on its behalf
void edma_read_slot | ( | unsigned | slot, |
struct edmacc_param * | param | ||
) |
void edma_resume | ( | unsigned | channel | ) |
edma_resume - resumes dma on a paused channel : on which edma_pause() has been called
This re-enables EDMA hardware events on the specified channel.
void edma_set_dest | ( | unsigned | slot, |
dma_addr_t | dest_port, | ||
enum address_mode | mode, | ||
enum fifo_width | width | ||
) |
edma_set_dest - set initial DMA destination address in parameter RAM slot : parameter RAM slot being configured : physical address of destination (memory, controller FIFO, etc) : INCR, except in very rare cases : ignored unless is FIFO, else specifies the width to use when addressing the fifo (e.g. W8BIT, W32BIT)
Note that the destination address is modified during the DMA transfer according to edma_set_dest_index().
edma_set_dest_index - configure DMA destination address indexing : parameter RAM slot being configured : byte offset between destination arrays in a frame : byte offset between destination frames in a block
Offsets are specified to support either contiguous or discontiguous memory transfers, or repeated access to a hardware register, as needed. When accessing hardware registers, both offsets are normally zero.
void edma_set_src | ( | unsigned | slot, |
dma_addr_t | src_port, | ||
enum address_mode | mode, | ||
enum fifo_width | width | ||
) |
edma_set_src - set initial DMA source address in parameter RAM slot : parameter RAM slot being configured : physical address of source (memory, controller FIFO, etc) : INCR, except in very rare cases : ignored unless is FIFO, else specifies the width to use when addressing the fifo (e.g. W8BIT, W32BIT)
Note that the source address is modified during the DMA transfer according to edma_set_src_index().
edma_set_src_index - configure DMA source address indexing : parameter RAM slot being configured : byte offset between source arrays in a frame : byte offset between source frames in a block
Offsets are specified to support either contiguous or discontiguous memory transfers, or repeated access to a hardware register, as needed. When accessing hardware registers, both offsets are normally zero.
void edma_set_transfer_params | ( | unsigned | slot, |
u16 | acnt, | ||
u16 | bcnt, | ||
u16 | ccnt, | ||
u16 | bcnt_rld, | ||
enum sync_dimension | sync_mode | ||
) |
edma_set_transfer_params - configure DMA transfer parameters : parameter RAM slot being configured : how many bytes per array (at least one) : how many arrays per frame (at least one) : how many frames per block (at least one) : used only for A-Synchronized transfers; this specifies the value to reload into bcnt when it decrements to zero : ASYNC or ABSYNC
See the EDMA3 documentation to understand how to configure and link transfers using the fields in PaRAM slots. If you are not doing it all at once with edma_write_slot(), you will use this routine plus two calls each for source and destination, setting the initial address and saying how to index that address.
An example of an A-Synchronized transfer is a serial link using a single word shift register. In that case, would be equal to that word size; the serial controller issues a DMA synchronization event to transfer each word, and memory access by the DMA transfer controller will be word-at-a-time.
An example of an AB-Synchronized transfer is a device using a FIFO. In that case, equals the FIFO width and equals its depth. The controller with the FIFO issues DMA synchronization events when the FIFO threshold is reached, and the DMA transfer controller will transfer one frame to (or from) the FIFO. It will probably use efficient burst modes to access memory.
int edma_start | ( | unsigned | channel | ) |
edma_start - start dma on a channel : channel being activated
Channels with event associations will be triggered by their hardware events, and channels without such associations will be triggered by software. (At this writing there is no interface for using software triggers except with channels that don't support hardware triggers.)
Returns zero on success, else negative errno.
void edma_stop | ( | unsigned | channel | ) |
void edma_unlink | ( | unsigned | from | ) |
void edma_write_slot | ( | unsigned | slot, |
const struct edmacc_param * | param | ||
) |
edma_write_slot - write parameter RAM data for slot : number of parameter RAM slot being modified
data to be written into parameter RAM slot |
Use this to assign all parameters of a transfer at once. This allows more efficient setup of transfers than issuing multiple calls to set up those parameters in small pieces, and provides complete control over all transfer options.