From c941b0a9f115a5057c10f7baccadb3cc35373c52 Mon Sep 17 00:00:00 2001 From: Paul Olaru Date: Mon, 23 Mar 2020 10:24:08 +0200 Subject: [PATCH] platform: imx8m: Add SDMA definition This commit adds the definition of the SDMA controller we use for SOF, namely SDMA2 (the other instances of SDMA are used for non-audio-related DMA in the system). This DMAC can serve the SAI. A way to account for channel 0 being used internally needs to be added. Signed-off-by: Paul Olaru --- src/platform/imx8m/lib/dma.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/platform/imx8m/lib/dma.c b/src/platform/imx8m/lib/dma.c index 7d8e3d61e..af0736a88 100644 --- a/src/platform/imx8m/lib/dma.c +++ b/src/platform/imx8m/lib/dma.c @@ -12,6 +12,7 @@ #include extern struct dma_ops dummy_dma_ops; +extern struct dma_ops sdma_ops; SHARED_DATA struct dma dma[PLATFORM_NUM_DMACS] = { { @@ -23,6 +24,21 @@ SHARED_DATA struct dma dma[PLATFORM_NUM_DMACS] = { }, .ops = &dummy_dma_ops, }, +{ + .plat_data = { + .id = DMA_ID_SDMA2, + /* Note: support is available for MEM_TO_MEM but not + * enabled as it is unneeded + */ + .dir = DMA_DIR_MEM_TO_DEV | DMA_DIR_DEV_TO_MEM, + .devs = DMA_DEV_SAI, + .base = SDMA2_BASE, + .channels = 32, + .irq = SDMA2_IRQ, + .irq_name = SDMA2_IRQ_NAME, + }, + .ops = &sdma_ops, +}, }; const struct dma_info lib_dma = {