From f918c12384cfe57d5be68fe1faa6272d30256ddb Mon Sep 17 00:00:00 2001 From: Laurentiu Mihalcea Date: Fri, 24 Nov 2023 13:19:53 +0200 Subject: [PATCH] imx93_a55: cleanup: Remove unnecessary lib files With the transition to the native Zephyr drivers, the imx93_a55/lib/dai.c and imx93_a55/lib/dma.c files become unnecessary. As such, remove them in an attempt to clean up the src/platform/imx93_a55/ hierarchy. Signed-off-by: Laurentiu Mihalcea --- src/platform/imx93_a55/lib/dai.c | 60 -------------------------------- src/platform/imx93_a55/lib/dma.c | 58 ------------------------------ 2 files changed, 118 deletions(-) delete mode 100644 src/platform/imx93_a55/lib/dai.c delete mode 100644 src/platform/imx93_a55/lib/dma.c diff --git a/src/platform/imx93_a55/lib/dai.c b/src/platform/imx93_a55/lib/dai.c deleted file mode 100644 index 5f1cb3f7e534..000000000000 --- a/src/platform/imx93_a55/lib/dai.c +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* - * Copyright 2023 NXP - */ - -#include -#include -#include -#include - -static struct dai sai[] = { - { - .index = 3, /* SOF uses SAI3 */ - .plat_data = { - .base = SAI3_BASE, - .fifo[SOF_IPC_STREAM_PLAYBACK] = { - .offset = SAI3_BASE + REG_SAI_TDR0, - .depth = 128, /* number of 32-bit words */ - .watermark = 64, /* needs to be half the depth */ - .handshake = EDMA_HANDSHAKE(EDMA2_SAI3_CHAN_TX_IRQ, - EDMA2_SAI3_CHAN_TX, - EDMA2_SAI3_TX_MUX), - }, - .fifo[SOF_IPC_STREAM_CAPTURE] = { - .offset = SAI3_BASE + REG_SAI_RDR0, - .depth = 128, - .watermark = 64, - .handshake = EDMA_HANDSHAKE(EDMA2_SAI3_CHAN_RX_IRQ, - EDMA2_SAI3_CHAN_RX, - EDMA2_SAI3_RX_MUX), - }, - }, - .drv = &sai_driver, - }, -}; - -static const struct dai_type_info dti[] = { - { - .type = SOF_DAI_IMX_SAI, - .dai_array = sai, - .num_dais = ARRAY_SIZE(sai), - }, -}; - -static const struct dai_info lib_dai = { - .dai_type_array = dti, - .num_dai_types = ARRAY_SIZE(dti) -}; - -int dai_init(struct sof *sof) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(sai); i++) - k_spinlock_init(&dti[0].dai_array[i].lock); - - sof->dai_info = &lib_dai; - - return 0; -} diff --git a/src/platform/imx93_a55/lib/dma.c b/src/platform/imx93_a55/lib/dma.c deleted file mode 100644 index 280748711647..000000000000 --- a/src/platform/imx93_a55/lib/dma.c +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* - * Copyright 2023 NXP - */ - -#include -#include -#include - -extern struct dma_ops dummy_dma_ops; -extern struct dma_ops edma_ops; - -static const int edma2_ints[EDMA2_CHAN_MAX] = { - [EDMA2_SAI3_CHAN_RX] = EDMA2_SAI3_CHAN_RX_IRQ, - [EDMA2_SAI3_CHAN_TX] = EDMA2_SAI3_CHAN_TX_IRQ, -}; - -static struct dma dma[PLATFORM_NUM_DMACS] = { - { - .plat_data = { - .id = DMA_ID_EDMA2, - .dir = DMA_DIR_MEM_TO_DEV | DMA_DIR_DEV_TO_MEM, - .devs = DMA_DEV_SAI, - .base = EDMA2_BASE, - .chan_size = EDMA2_CHAN_SIZE, - .channels = EDMA2_CHAN_MAX, - .drv_plat_data = edma2_ints, - }, - .ops = &edma_ops, - }, - { - .plat_data = { - .id = DMA_ID_HOST, - .dir = DMA_DIR_HMEM_TO_LMEM | DMA_DIR_LMEM_TO_HMEM, - .devs = DMA_DEV_HOST, - .channels = 16 - }, - .ops = &dummy_dma_ops, - }, -}; - -static const struct dma_info lib_dma = { - .dma_array = dma, - .num_dmas = ARRAY_SIZE(dma) -}; - -int dmac_init(struct sof *sof) -{ - int i; - - /* early lock initialization for ref counting */ - for (i = 0; i < ARRAY_SIZE(dma); i++) - k_spinlock_init(&dma[i].lock); - - sof->dma_info = &lib_dma; - - return 0; -}