1 /* SPDX-License-Identifier: GPL-2.0-or-later */
5 * Copyright (C) 2006-2013 Texas Instruments.
9 * This EDMA3 programming framework exposes two basic kinds of resource:
11 * Channel Triggers transfers, usually from a hardware event but
12 * also manually or by "chaining" from DMA completions.
13 * Each channel is coupled to a Parameter RAM (PaRAM) slot.
15 * Slot Each PaRAM slot holds a DMA transfer descriptor (PaRAM
16 * "set"), source and destination addresses, a link to a
17 * next PaRAM slot (if any), options for the transfer, and
18 * instructions for updating those addresses. There are
19 * more than twice as many slots as event channels.
21 * Each PaRAM set describes a sequence of transfers, either for one large
22 * buffer or for several discontiguous smaller buffers. An EDMA transfer
23 * is driven only from a channel, which performs the transfers specified
24 * in its PaRAM slot until there are no more transfers. When that last
25 * transfer completes, the "link" field may be used to reload the channel's
26 * PaRAM slot with a new transfer descriptor.
28 * The EDMA Channel Controller (CC) maps requests from channels into physical
29 * Transfer Controller (TC) requests when the channel triggers (by hardware
30 * or software events, or by chaining). The two physical DMA channels provided
31 * by the TCs are thus shared by many logical channels.
33 * DaVinci hardware also has a "QDMA" mechanism which is not currently
34 * supported through this interface. (DSP firmware uses it though.)
48 #define EDMA_CTLR_CHAN(ctlr, chan) (((ctlr) << 16) | (chan))
49 #define EDMA_CTLR(i) ((i) >> 16)
50 #define EDMA_CHAN_SLOT(i) ((i) & 0xffff)
52 #define EDMA_FILTER_PARAM(ctlr, chan) ((int[]) { EDMA_CTLR_CHAN(ctlr, chan) })
54 struct edma_rsv_info {
56 const s16 (*rsv_chans)[2];
57 const s16 (*rsv_slots)[2];
62 /* platform_data for EDMA driver */
63 struct edma_soc_info {
65 * Default queue is expected to be a low-priority queue.
66 * This way, long transfers on the default queue started
67 * by the codec engine will not cause audio defects.
69 enum dma_event_q default_queue;
71 /* Resource reservation for other cores */
72 struct edma_rsv_info *rsv;
74 /* List of channels allocated for memcpy, terminated with -1 */
77 s8 (*queue_priority_mapping)[2];
78 const s16 (*xbar_chans)[2];
80 const struct dma_slave_map *slave_map;