1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2017 Intel Corporation. All rights reserved.
4  *
5  * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
6  *         Keyon Jie <yang.jie@linux.intel.com>
7  *         Rander Wang <rander.wang@intel.com>
8  */
9 
10 #ifdef __SOF_LIB_DMA_H__
11 
12 #ifndef __PLATFORM_LIB_DMA_H__
13 #define __PLATFORM_LIB_DMA_H__
14 
15 /* number of supported DMACs */
16 #define PLATFORM_NUM_DMACS	3
17 
18 /* max number of supported DMA channels */
19 #define PLATFORM_MAX_DMA_CHAN	8
20 
21 /* available DMACs */
22 #define DMA_GP_LP_DMAC0		0
23 #define DMA_GP_LP_DMAC1		1
24 #define DMA_GP_LP_DMAC2		2
25 
26 /* mappings - TODO improve API to get type */
27 #define DMA_ID_DMAC0	DMA_GP_LP_DMAC0
28 #define DMA_ID_DMAC1	DMA_GP_LP_DMAC1
29 #define DMA_ID_DMAC2	DMA_GP_LP_DMAC1
30 
31 /* handshakes */
32 #define DMA_HANDSHAKE_DMIC_CH0	0
33 #define DMA_HANDSHAKE_DMIC_CH1	1
34 #define DMA_HANDSHAKE_SSP0_RX	2
35 #define DMA_HANDSHAKE_SSP0_TX	3
36 #define DMA_HANDSHAKE_SSP1_RX	4
37 #define DMA_HANDSHAKE_SSP1_TX	5
38 #define DMA_HANDSHAKE_SSP2_RX	6
39 #define DMA_HANDSHAKE_SSP2_TX	7
40 #define DMA_HANDSHAKE_SSP3_RX	8
41 #define DMA_HANDSHAKE_SSP3_TX	9
42 #define DMA_HANDSHAKE_SSI_TX	26
43 #define DMA_HANDSHAKE_SSI_RX	27
44 
45 #define dma_chan_irq(dma, chan) dma_irq(dma)
46 #define dma_chan_irq_name(dma, chan) dma_irq_name(dma)
47 
48 #endif /* __PLATFORM_LIB_DMA_H__ */
49 
50 #else
51 
52 #error "This file shouldn't be included from outside of sof/lib/dma.h"
53 
54 #endif /* __SOF_LIB_DMA_H__ */
55