CHT has 3 DMACs compared to the 2 DMACs on BYT
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/platform/baytrail/dma.c | 51 +++++++++++++++++++++- src/platform/baytrail/include/platform/dma.h | 6 +++ src/platform/baytrail/include/platform/interrupt.h | 2 + 3 files changed, 58 insertions(+), 1 deletion(-)
diff --git a/src/platform/baytrail/dma.c b/src/platform/baytrail/dma.c index 62baadb..6cb1fda 100644 --- a/src/platform/baytrail/dma.c +++ b/src/platform/baytrail/dma.c @@ -106,6 +106,43 @@ static struct dw_drv_plat_data dmac1 = { }, };
+#if defined CONFIG_CHERRYTRAIL +static struct dw_drv_plat_data dmac2 = { + .chan[0] = { + .class = 7, + .weight = 0, + }, + .chan[1] = { + .class = 7, + .weight = 0, + }, + .chan[2] = { + .class = 7, + .weight = 0, + }, + .chan[3] = { + .class = 7, + .weight = 0, + }, + .chan[4] = { + .class = 7, + .weight = 0, + }, + .chan[5] = { + .class = 7, + .weight = 0, + }, + .chan[6] = { + .class = 7, + .weight = 0, + }, + .chan[7] = { + .class = 7, + .weight = 0, + }, +}; +#endif + static struct dma dma[] = { { .plat_data = { @@ -124,7 +161,19 @@ static struct dma dma[] = { .drv_plat_data = &dmac1, }, .ops = &dw_dma_ops, -},}; +}, +#if defined CONFIG_CHERRYTRAIL +{ + .plat_data = { + .id = DMA_ID_DMAC2, + .base = DMA2_BASE, + .irq = IRQ_NUM_EXT_DMAC2, + .drv_plat_data = &dmac2, + }, + .ops = &dw_dma_ops, +}, +#endif +};
struct dma *dma_get(int dmac_id) { diff --git a/src/platform/baytrail/include/platform/dma.h b/src/platform/baytrail/include/platform/dma.h index e880eac..8a1a806 100644 --- a/src/platform/baytrail/include/platform/dma.h +++ b/src/platform/baytrail/include/platform/dma.h @@ -43,5 +43,11 @@ #define DMA_HANDSHAKE_SSP1_TX 3 #define DMA_HANDSHAKE_SSP2_RX 4 #define DMA_HANDSHAKE_SSP2_TX 5 +#define DMA_HANDSHAKE_SSP3_RX 6 +#define DMA_HANDSHAKE_SSP3_TX 7 +#define DMA_HANDSHAKE_SSP4_RX 8 +#define DMA_HANDSHAKE_SSP4_TX 9 +#define DMA_HANDSHAKE_SSP5_RX 10 +#define DMA_HANDSHAKE_SSP6_TX 11
#endif diff --git a/src/platform/baytrail/include/platform/interrupt.h b/src/platform/baytrail/include/platform/interrupt.h index 3d96ba5..8c97122 100644 --- a/src/platform/baytrail/include/platform/interrupt.h +++ b/src/platform/baytrail/include/platform/interrupt.h @@ -53,6 +53,7 @@ #define IRQ_NUM_EXT_SSP0 16 /* Level 5 */ #define IRQ_NUM_EXT_SSP1 17 /* Level 5 */ #define IRQ_NUM_EXT_SSP2 18 /* Level 5 */ +#define IRQ_NUM_EXT_DMAC2 19 /* Level 5 */ #define IRQ_NUM_NMI 20 /* Level 7 */
/* IRQ Masks */ @@ -74,5 +75,6 @@ #define IRQ_MASK_EXT_SSP0 (1 << IRQ_NUM_EXT_SSP0) #define IRQ_MASK_EXT_SSP1 (1 << IRQ_NUM_EXT_SSP1) #define IRQ_MASK_EXT_SSP2 (1 << IRQ_NUM_EXT_SSP2) +#define IRQ_MASK_EXT_DMAC2 (1 << IRQ_NUM_EXT_DMAC2)
#endif