imx8m: add support for SDMA2 and SAI1

Add SDMA2 and SAI1 related info.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
This commit is contained in:
Viorel Suman 2021-04-13 18:18:51 +03:00 committed by Liam Girdwood
parent c80270e7e4
commit b8ec30a01b
5 changed files with 39 additions and 2 deletions

View File

@ -10,7 +10,7 @@
#ifndef __PLATFORM_LIB_DMA_H__
#define __PLATFORM_LIB_DMA_H__
#define PLATFORM_NUM_DMACS 2
#define PLATFORM_NUM_DMACS 3
/* max number of supported DMA channels */
#define PLATFORM_MAX_DMA_CHAN 32

View File

@ -41,6 +41,9 @@
#define SDMA3_BASE 0x30e00000
#define SDMA3_SIZE 0x10000
#define SAI_1_BASE 0x30c10000
#define SAI_1_SIZE 0x00010000
#define SAI_3_BASE 0x30c30000
#define SAI_3_SIZE 0x00010000

View File

@ -14,6 +14,24 @@
#include <ipc/stream.h>
static SHARED_DATA struct dai sai[] = {
{
.index = 1,
.plat_data = {
.base = SAI_1_BASE,
.fifo[SOF_IPC_STREAM_PLAYBACK] = {
.offset = SAI_1_BASE + REG_SAI_TDR0,
.depth = 128, /* in 4 bytes words */
/* Handshake is SDMA hardware event */
.handshake = 1,
},
.fifo[SOF_IPC_STREAM_CAPTURE] = {
.offset = SAI_1_BASE + REG_SAI_RDR0,
.depth = 128, /* in 4 bytes words */
.handshake = 0,
},
},
.drv = &sai_driver,
},
{
.index = 3,
.plat_data = {

View File

@ -24,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,
},
{
.plat_data = {
.id = DMA_ID_SDMA3,

View File

@ -173,7 +173,8 @@ int platform_init(struct sof *sof)
/* Init SDMA platform domain */
sof->platform_dma_domain =
dma_multi_chan_domain_init(&sof->dma_info->dma_array[1],
1, PLATFORM_DEFAULT_CLOCK, true);
PLATFORM_NUM_DMACS - 1,
PLATFORM_DEFAULT_CLOCK, true);
/* i.MX platform DMA domain will be full synchronous, no time dependent */
sof->platform_dma_domain->full_sync = true;