From 4887b777a6028475ac6aad8c21c78f29ed603e65 Mon Sep 17 00:00:00 2001 From: Laurentiu Mihalcea Date: Fri, 24 Nov 2023 11:06:48 +0200 Subject: [PATCH] lib: dma: Add entries for i.MX93's EDMA and HOST DMAs Since the EDMA and HOST DMA nodes have been introduced to the i.MX93 overlay, add entries in the dma array which will create a struct dma for each of these DMACs. Signed-off-by: Laurentiu Mihalcea --- zephyr/lib/dma.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/zephyr/lib/dma.c b/zephyr/lib/dma.c index 5bb5b9641..ec2ac28a2 100644 --- a/zephyr/lib/dma.c +++ b/zephyr/lib/dma.c @@ -107,6 +107,29 @@ SHARED_DATA struct dma dma[] = { .z_dev = DEVICE_DT_GET(DT_NODELABEL(hda_link_out)), }, #endif +#ifdef CONFIG_SOC_SERIES_MIMX9_A55 +{ + .plat_data = { + .dir = DMA_DIR_MEM_TO_DEV | DMA_DIR_DEV_TO_MEM, + .devs = DMA_DEV_SAI, + /* TODO: might be worth using `dma-channels` here + * (needs to become a mandatory property) + */ + .channels = 64, + .period_count = 2, + }, + .z_dev = DEVICE_DT_GET(DT_NODELABEL(edma4)), +}, +{ + .plat_data = { + .dir = DMA_DIR_HMEM_TO_LMEM | DMA_DIR_LMEM_TO_HMEM, + .devs = DMA_DEV_HOST, + .channels = DT_PROP(DT_NODELABEL(host_dma), dma_channels), + .period_count = 2, + }, + .z_dev = DEVICE_DT_GET(DT_NODELABEL(host_dma)), +}, +#endif /* CONFIG_SOC_SERIES_MIMX9_A55 */ }; const struct dma_info lib_dma = {