From b075b271530c2b95329319a7395b7a36c4ac3f7c Mon Sep 17 00:00:00 2001 From: Laurentiu Mihalcea Date: Fri, 22 Mar 2024 15:05:30 +0200 Subject: [PATCH 1/3] west.yml: bump up Zephyr revision Bump up Zephyr revision to fetch a Zephyr version that contains the following patch: 1) 64ba1b221091c343f7cca79a7970981eb1ff3a35 ("dts: nxp: imx93: add nodes for SAI3 and EDMA4") This is required for the transition to Zephyr native drivers on i.MX93. Signed-off-by: Laurentiu Mihalcea --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index f19359f4fe5a..d9985c6afaab 100644 --- a/west.yml +++ b/west.yml @@ -43,7 +43,7 @@ manifest: - name: zephyr repo-path: zephyr - revision: 8858a024c0151e3b4cd35262bed935248211d6b1 + revision: 66b475a3aa4d73f4ddd5be5a7a1e0f3c7028e539 remote: zephyrproject # Import some projects listed in zephyr/west.yml@revision From 43b0d6cc5e9ad26a9164b2b86d3a558d5f4386a6 Mon Sep 17 00:00:00 2001 From: Laurentiu Mihalcea Date: Thu, 23 Nov 2023 15:21:28 +0200 Subject: [PATCH 2/3] boards: mimx93_evk_a55: Enable SAI, EDMA and HOST DMA drivers This commit introduces the necessary changes to the overlay and configuration files required for enabling the Zephyr native SAI, EDMA and HOST DMA drivers on i.MX93. Signed-off-by: Laurentiu Mihalcea --- app/boards/imx93_evk_mimx9352_a55.conf | 12 +++++++++ app/boards/imx93_evk_mimx9352_a55.overlay | 30 ++++++++++++++--------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/app/boards/imx93_evk_mimx9352_a55.conf b/app/boards/imx93_evk_mimx9352_a55.conf index a3c9ce153f62..03c54e3e353c 100644 --- a/app/boards/imx93_evk_mimx9352_a55.conf +++ b/app/boards/imx93_evk_mimx9352_a55.conf @@ -14,3 +14,15 @@ CONFIG_DCACHE_LINE_SIZE=64 CONFIG_IMX93_A55=y CONFIG_TRACE=n + +# DAI-related configurations +CONFIG_SAI_HAS_MCLK_CONFIG_OPTION=y +CONFIG_SAI_IMX93_ERRATA_051421=y + +# DMA-related configurations +CONFIG_DMA=y +CONFIG_DMA_NXP_EDMA_ENABLE_HALFMAJOR_IRQ=y + +# needed because EDMA uses same interrupt for multiple +# channels. +CONFIG_SHARED_INTERRUPTS=y diff --git a/app/boards/imx93_evk_mimx9352_a55.overlay b/app/boards/imx93_evk_mimx9352_a55.overlay index df46ffd8b080..64cdfc32ec8e 100644 --- a/app/boards/imx93_evk_mimx9352_a55.overlay +++ b/app/boards/imx93_evk_mimx9352_a55.overlay @@ -24,18 +24,6 @@ reg = <0x42430000 DT_SIZE_K(64)>; }; - sai3: memory@42660000 { - reg = <0x42660000 DT_SIZE_K(64)>; - }; - - edma2_ch0: memory@42010000 { - reg = <0x42010000 DT_SIZE_K(32)>; - }; - - edma2_ch1: memory@42018000 { - reg = <0x42018000 DT_SIZE_K(32)>; - }; - outbox: memory@ce100000 { reg = <0xce100000 DT_SIZE_K(4)>; }; @@ -58,4 +46,22 @@ host_ram: memory@80000000 { reg = <0x80000000 DT_SIZE_M(1024)>; }; + + host_dma: dma { + compatible = "nxp,sof-host-dma"; + dma-channels = <32>; + #dma-cells = <0>; + }; +}; + +&sai3 { + tx-fifo-watermark = <2>; + rx-fifo-watermark = <96>; + fifo-depth = <96>; + rx-sync-mode = <1>; + status = "okay"; +}; + +&edma4 { + status = "okay"; }; From af389741317b426ed2374b7d392c0bd0ee0a224b Mon Sep 17 00:00:00 2001 From: Laurentiu Mihalcea Date: Fri, 24 Nov 2023 11:39:31 +0200 Subject: [PATCH 3/3] nxp: imx93: Switch to native Zephyr drivers and timer domain Starting with this commit, i.MX93 now uses the timer domain in conjunction with the Zephyr native drivers. Signed-off-by: Laurentiu Mihalcea --- app/boards/imx93_evk_mimx9352_a55.conf | 2 ++ src/platform/Kconfig | 1 - src/platform/imx93_a55/platform.c | 6 ------ tools/topology/topology1/sof-imx93-wm8962.m4 | 4 ++-- zephyr/CMakeLists.txt | 6 +----- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/app/boards/imx93_evk_mimx9352_a55.conf b/app/boards/imx93_evk_mimx9352_a55.conf index 03c54e3e353c..4f3d12d5a2f8 100644 --- a/app/boards/imx93_evk_mimx9352_a55.conf +++ b/app/boards/imx93_evk_mimx9352_a55.conf @@ -26,3 +26,5 @@ CONFIG_DMA_NXP_EDMA_ENABLE_HALFMAJOR_IRQ=y # needed because EDMA uses same interrupt for multiple # channels. CONFIG_SHARED_INTERRUPTS=y + +CONFIG_ZEPHYR_NATIVE_DRIVERS=y diff --git a/src/platform/Kconfig b/src/platform/Kconfig index e70364c9052d..66dce8ea6f85 100644 --- a/src/platform/Kconfig +++ b/src/platform/Kconfig @@ -128,7 +128,6 @@ config IMX93_A55 select BUILD_OUTPUT_BIN select ZEPHYR_LOG select HOST_PTABLE - select DMA_DOMAIN help Select if your target platform is imx93-compatible. diff --git a/src/platform/imx93_a55/platform.c b/src/platform/imx93_a55/platform.c index b442d5381361..ed5a7f6956fc 100644 --- a/src/platform/imx93_a55/platform.c +++ b/src/platform/imx93_a55/platform.c @@ -118,12 +118,6 @@ int platform_init(struct sof *sof) if (ret < 0) return -ENODEV; - /* Initialize DMA domain */ - sof->platform_dma_domain = zephyr_dma_domain_init(&sof->dma_info->dma_array[0], - 1, - PLATFORM_DEFAULT_CLOCK); - zephyr_ll_scheduler_init(sof->platform_dma_domain); - /* Initialize IPC */ ipc_init(sof); diff --git a/tools/topology/topology1/sof-imx93-wm8962.m4 b/tools/topology/topology1/sof-imx93-wm8962.m4 index 836d6fb77be6..f9ffe7f38e0a 100644 --- a/tools/topology/topology1/sof-imx93-wm8962.m4 +++ b/tools/topology/topology1/sof-imx93-wm8962.m4 @@ -58,14 +58,14 @@ dnl period, priority, core, time_domain) DAI_ADD(sof/pipe-dai-playback.m4, 1, SAI, 3, sai3-wm8962, PIPELINE_SOURCE_1, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) # capture DAI is SAI1 using 2 periods # Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, 2, SAI, 3, sai3-wm8962, PIPELINE_SINK_2, 2, s32le, - 1000, 0, 0) + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) # PCM Low Latency, id 0 diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 12e4b2ec3731..db468c258b21 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -323,16 +323,12 @@ if (CONFIG_SOC_MIMX9352_A55) zephyr_library_sources( ${SOF_PLATFORM_PATH}/imx93_a55/platform.c ${SOF_PLATFORM_PATH}/imx93_a55/lib/clk.c - ${SOF_PLATFORM_PATH}/imx93_a55/lib/dma.c - ${SOF_PLATFORM_PATH}/imx93_a55/lib/dai.c + lib/dma.c ) # Drivers zephyr_library_sources( - ${SOF_DRIVERS_PATH}/generic/dummy-dma.c ${SOF_DRIVERS_PATH}/imx/ipc.c - ${SOF_DRIVERS_PATH}/imx/edma.c - ${SOF_DRIVERS_PATH}/imx/sai.c ) zephyr_library_sources(