From 89574aed3f8a99c67ab3103d7c3f393ba810a4e8 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 9 Oct 2024 14:04:52 +0300 Subject: [PATCH 1/3] ipc: only build dma-copy.c if CONFIG_TRACE selected The dma_copy_new() implemented in dma-copy.c is only used by dma-trace.c, so if CONFIG_TRACE=n, the file can be omitted in builds. Signed-off-by: Kai Vehmanen --- src/ipc/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ipc/CMakeLists.txt b/src/ipc/CMakeLists.txt index bcae454871b4..1f70f1050154 100644 --- a/src/ipc/CMakeLists.txt +++ b/src/ipc/CMakeLists.txt @@ -15,9 +15,8 @@ add_local_sources(sof is_zephyr(it_is) if(it_is) ### Zephyr ### -zephyr_library_sources( - dma-copy.c -) +# dma-copy only used for dma-trace +zephyr_library_sources_ifdef(CONFIG_TRACE dma-copy.c) if (CONFIG_SOC_SERIES_INTEL_CAVS_V25 OR CONFIG_SOC_SERIES_INTEL_ADSP_ACE) zephyr_library_sources( From 36949c8924f52e8084c04b938b0169978b45c2ba Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 9 Oct 2024 15:48:12 +0300 Subject: [PATCH 2/3] platform: imx8ulp: conditionally include dma-trace.h If the platform is build with native Zephyr drivers, dma-trace.h cannot be used as it relies on legacy XTOS DMA driver interface. Make include of dma-trace.h conditional. Signed-off-by: Kai Vehmanen --- src/platform/imx8ulp/platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platform/imx8ulp/platform.c b/src/platform/imx8ulp/platform.c index bf8dacd6ea02..a00889694f1a 100644 --- a/src/platform/imx8ulp/platform.c +++ b/src/platform/imx8ulp/platform.c @@ -25,7 +25,9 @@ #include #include #include +#if CONFIG_TRACE #include +#endif #include #include #include From 1c043d8c88fd16bcc5ae11ac9e959f21c5eb7540 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 9 Oct 2024 15:49:44 +0300 Subject: [PATCH 3/3] ipc: ipc3: conditionally include dma-trace.h If the SOF is built with native Zephyr drivers, dma-trace.h cannot be used as it relies on legacy XTOS DMA driver interface. Make include of dma-trace.h conditional. Signed-off-by: Kai Vehmanen --- src/ipc/ipc3/handler.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ipc/ipc3/handler.c b/src/ipc/ipc3/handler.c index 4349c9606253..1a4ca43d70fe 100644 --- a/src/ipc/ipc3/handler.c +++ b/src/ipc/ipc3/handler.c @@ -34,7 +34,9 @@ #include #include #include +#if CONFIG_TRACE #include +#endif #include #include #include