2019-05-27 14:55:01 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2009-04-14 20:18:14 +08:00
|
|
|
/*
|
2013-03-07 00:15:31 +08:00
|
|
|
* TI EDMA definitions
|
2009-04-14 20:18:14 +08:00
|
|
|
*
|
2013-03-07 00:15:31 +08:00
|
|
|
* Copyright (C) 2006-2013 Texas Instruments.
|
2009-04-14 20:18:14 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This EDMA3 programming framework exposes two basic kinds of resource:
|
|
|
|
*
|
|
|
|
* Channel Triggers transfers, usually from a hardware event but
|
|
|
|
* also manually or by "chaining" from DMA completions.
|
|
|
|
* Each channel is coupled to a Parameter RAM (PaRAM) slot.
|
|
|
|
*
|
|
|
|
* Slot Each PaRAM slot holds a DMA transfer descriptor (PaRAM
|
|
|
|
* "set"), source and destination addresses, a link to a
|
|
|
|
* next PaRAM slot (if any), options for the transfer, and
|
|
|
|
* instructions for updating those addresses. There are
|
|
|
|
* more than twice as many slots as event channels.
|
|
|
|
*
|
|
|
|
* Each PaRAM set describes a sequence of transfers, either for one large
|
|
|
|
* buffer or for several discontiguous smaller buffers. An EDMA transfer
|
|
|
|
* is driven only from a channel, which performs the transfers specified
|
|
|
|
* in its PaRAM slot until there are no more transfers. When that last
|
|
|
|
* transfer completes, the "link" field may be used to reload the channel's
|
|
|
|
* PaRAM slot with a new transfer descriptor.
|
|
|
|
*
|
|
|
|
* The EDMA Channel Controller (CC) maps requests from channels into physical
|
|
|
|
* Transfer Controller (TC) requests when the channel triggers (by hardware
|
|
|
|
* or software events, or by chaining). The two physical DMA channels provided
|
|
|
|
* by the TCs are thus shared by many logical channels.
|
|
|
|
*
|
|
|
|
* DaVinci hardware also has a "QDMA" mechanism which is not currently
|
|
|
|
* supported through this interface. (DSP firmware uses it though.)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EDMA_H_
|
|
|
|
#define EDMA_H_
|
|
|
|
|
|
|
|
enum dma_event_q {
|
|
|
|
EVENTQ_0 = 0,
|
|
|
|
EVENTQ_1 = 1,
|
2009-07-27 20:50:16 +08:00
|
|
|
EVENTQ_2 = 2,
|
|
|
|
EVENTQ_3 = 3,
|
2009-04-14 20:18:14 +08:00
|
|
|
EVENTQ_DEFAULT = -1
|
|
|
|
};
|
|
|
|
|
2009-05-21 19:41:35 +08:00
|
|
|
#define EDMA_CTLR_CHAN(ctlr, chan) (((ctlr) << 16) | (chan))
|
|
|
|
#define EDMA_CTLR(i) ((i) >> 16)
|
|
|
|
#define EDMA_CHAN_SLOT(i) ((i) & 0xffff)
|
|
|
|
|
2015-12-15 04:47:41 +08:00
|
|
|
#define EDMA_FILTER_PARAM(ctlr, chan) ((int[]) { EDMA_CTLR_CHAN(ctlr, chan) })
|
|
|
|
|
2010-06-29 14:05:13 +08:00
|
|
|
struct edma_rsv_info {
|
|
|
|
|
|
|
|
const s16 (*rsv_chans)[2];
|
|
|
|
const s16 (*rsv_slots)[2];
|
|
|
|
};
|
|
|
|
|
2015-12-15 04:47:41 +08:00
|
|
|
struct dma_slave_map;
|
|
|
|
|
2009-04-14 20:18:14 +08:00
|
|
|
/* platform_data for EDMA driver */
|
|
|
|
struct edma_soc_info {
|
2012-01-19 15:05:21 +08:00
|
|
|
/*
|
|
|
|
* Default queue is expected to be a low-priority queue.
|
|
|
|
* This way, long transfers on the default queue started
|
|
|
|
* by the codec engine will not cause audio defects.
|
|
|
|
*/
|
2009-07-27 21:57:07 +08:00
|
|
|
enum dma_event_q default_queue;
|
2009-04-14 20:18:14 +08:00
|
|
|
|
2010-06-29 14:05:13 +08:00
|
|
|
/* Resource reservation for other cores */
|
|
|
|
struct edma_rsv_info *rsv;
|
|
|
|
|
2015-10-16 15:18:10 +08:00
|
|
|
/* List of channels allocated for memcpy, terminated with -1 */
|
2015-12-09 16:18:10 +08:00
|
|
|
s32 *memcpy_channels;
|
2015-10-16 15:18:10 +08:00
|
|
|
|
2013-06-21 05:06:38 +08:00
|
|
|
s8 (*queue_priority_mapping)[2];
|
2013-06-21 05:06:39 +08:00
|
|
|
const s16 (*xbar_chans)[2];
|
2015-12-15 04:47:41 +08:00
|
|
|
|
|
|
|
const struct dma_slave_map *slave_map;
|
|
|
|
int slavecnt;
|
2009-04-14 20:18:14 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|