Skip to content

Commit d1f9de9

Browse files
committed
cmake/zephyr: decentralize src/schedule/
Adding all source files in a single, giant zephyr/CMakeLists.txt is inconvenient and does not scale. Link: #8260 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 47f3f44 commit d1f9de9

File tree

2 files changed

+48
-56
lines changed

2 files changed

+48
-56
lines changed

src/schedule/CMakeLists.txt

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,59 @@
11
# SPDX-License-Identifier: BSD-3-Clause
22

3-
if(CONFIG_SCHEDULE_DMA_MULTI_CHANNEL)
4-
add_local_sources(sof dma_multi_chan_domain.c)
3+
set(base_files
4+
schedule.c
5+
)
6+
7+
if(CONFIG_SCHEDULE_DMA_MULTI_CHANNEL AND NOT(CONFIG_DMA_DOMAIN))
8+
list(APPEND base_files dma_multi_chan_domain.c)
9+
endif()
10+
11+
if(CONFIG_SCHEDULE_DMA_SINGLE_CHANNEL AND NOT(CONFIG_DMA_DOMAIN))
12+
list(APPEND base_files dma_single_chan_domain.c)
513
endif()
614

7-
if(CONFIG_SCHEDULE_DMA_SINGLE_CHANNEL)
8-
add_local_sources(sof dma_single_chan_domain.c)
15+
is_zephyr(it_is)
16+
if(it_is) ### Zephyr ###
17+
18+
zephyr_library_sources(
19+
${base_files}
20+
zephyr_domain.c
21+
)
22+
23+
if (CONFIG_SOC_ACP_6_0)
24+
# Zephyr DMA domain should only be used with zephyr_ll
25+
if (CONFIG_DMA_DOMAIN)
26+
zephyr_library_sources(
27+
zephyr_ll.c
28+
zephyr_dma_domain.c
29+
)
30+
else()
31+
zephyr_library_sources(
32+
ll_schedule.c
33+
)
34+
endif()
35+
else()
36+
zephyr_library_sources(
37+
zephyr_ll.c
38+
)
939
endif()
1040

41+
zephyr_library_sources_ifdef(CONFIG_ZEPHYR_DP_SCHEDULER
42+
${SOF_SRC_PATH}/schedule/zephyr_dp_schedule.c
43+
)
44+
45+
zephyr_library_sources_ifdef(CONFIG_ZEPHYR_TWB_SCHEDULER
46+
${SOF_SRC_PATH}/schedule/zephyr_twb_schedule.c
47+
)
48+
49+
else() ### Not Zephyr ###
50+
1151
add_local_sources(sof
52+
${base_files}
1253
edf_schedule.c
1354
ll_schedule.c
14-
schedule.c
1555
task.c
1656
timer_domain.c
1757
)
58+
59+
endif()

zephyr/CMakeLists.txt

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ add_subdirectory(../src/init/ init_unused_install/)
203203
add_subdirectory(../src/ipc/ ipc_unused_install/)
204204
add_subdirectory(../src/debug/telemetry/ telemetry_unused_install/)
205205
add_subdirectory(../src/debug/debug_stream/ debug_stream_unused_install/)
206+
add_subdirectory(../src/schedule/ schedule_unused_install/)
206207

207208
if(CONFIG_COMP_TESTER STREQUAL "m")
208209
add_subdirectory(${SOF_DEBUG_PATH}/tester/llext
@@ -235,11 +236,6 @@ if (CONFIG_SOC_SERIES_INTEL_CAVS_V25)
235236
lib/dma.c
236237
)
237238

238-
# SOF core infrastructure - runs on top of Zephyr
239-
zephyr_library_sources(
240-
${SOF_SRC_PATH}/schedule/zephyr_ll.c
241-
)
242-
243239
set(PLATFORM "tigerlake")
244240
zephyr_include_directories(${SOF_PLATFORM_PATH}/intel/cavs/include)
245241
endif()
@@ -271,14 +267,6 @@ if (CONFIG_SOC_SERIES_INTEL_ADSP_ACE)
271267
${SOF_SRC_PATH}/schedule/zephyr_ll.c
272268
)
273269

274-
zephyr_library_sources_ifdef(CONFIG_ZEPHYR_DP_SCHEDULER
275-
${SOF_SRC_PATH}/schedule/zephyr_dp_schedule.c
276-
)
277-
278-
zephyr_library_sources_ifdef(CONFIG_ZEPHYR_TWB_SCHEDULER
279-
${SOF_SRC_PATH}/schedule/zephyr_twb_schedule.c
280-
)
281-
282270
# Sources for virtual heap management
283271
zephyr_library_sources(
284272
lib/regions_mm.c
@@ -321,8 +309,6 @@ if (CONFIG_SOC_MIMX8QM6_ADSP OR CONFIG_SOC_MIMX8QX6_ADSP)
321309
lib/dma.c
322310
)
323311

324-
zephyr_library_sources(${SOF_SRC_PATH}/schedule/zephyr_ll.c)
325-
326312
set(PLATFORM "imx8")
327313
endif()
328314

@@ -342,8 +328,6 @@ if (CONFIG_SOC_MIMX8ML8_ADSP)
342328
lib/dma.c
343329
)
344330

345-
zephyr_library_sources(${SOF_SRC_PATH}/schedule/zephyr_ll.c)
346-
347331
set(PLATFORM "imx8m")
348332
endif()
349333

@@ -363,8 +347,6 @@ if (CONFIG_SOC_MIMX8UD7_ADSP)
363347
lib/dma.c
364348
)
365349

366-
zephyr_library_sources(${SOF_SRC_PATH}/schedule/zephyr_ll.c)
367-
368350
set(PLATFORM "imx8ulp")
369351
endif()
370352

@@ -381,10 +363,6 @@ if (CONFIG_SOC_MIMX9352_A55)
381363
${SOF_DRIVERS_PATH}/imx/ipc.c
382364
)
383365

384-
zephyr_library_sources(
385-
${SOF_SRC_PATH}/schedule/zephyr_ll.c
386-
)
387-
388366
set(PLATFORM "imx93_a55")
389367
endif()
390368

@@ -400,10 +378,6 @@ if (CONFIG_SOC_MIMX9596_M7)
400378
${SOF_DRIVERS_PATH}/imx/ipc.c
401379
)
402380

403-
zephyr_library_sources(
404-
${SOF_SRC_PATH}/schedule/zephyr_ll.c
405-
)
406-
407381
# SOF-specific linker script additions
408382
zephyr_linker_sources(DATA_SECTIONS ${sof_top_dir}/src/platform/imx95/linker/data-sections.ld)
409383

@@ -444,17 +418,6 @@ if (CONFIG_SOC_ACP_6_0)
444418
${SOF_SRC_PATH}/drivers/interrupt.c
445419
)
446420

447-
# Zephyr DMA domain should only be used with zephyr_ll
448-
if (CONFIG_DMA_DOMAIN)
449-
zephyr_library_sources(
450-
${SOF_SRC_PATH}/schedule/zephyr_ll.c
451-
)
452-
else()
453-
zephyr_library_sources(
454-
${SOF_SRC_PATH}/schedule/ll_schedule.c
455-
)
456-
endif()
457-
458421
zephyr_include_directories(${SOF_PLATFORM_PATH}/amd/rembrandt/include)
459422
zephyr_include_directories(${SOF_PLATFORM_PATH}/amd/common/include)
460423
zephyr_include_directories(${SOF_PLATFORM_PATH}/amd/rembrandt/include/arch)
@@ -468,7 +431,6 @@ if (CONFIG_SOC_FAMILY_MTK)
468431
zephyr_library_sources(
469432
${SOF_PLATFORM_PATH}/mtk/platform.c
470433
${SOF_PLATFORM_PATH}/mtk/dai.c
471-
${SOF_SRC_PATH}/schedule/zephyr_ll.c
472434
${SOF_DRIVERS_PATH}/generic/dummy-dma.c
473435
${SOF_SRC_PATH}/drivers/mediatek/afe/afe-memif.c
474436
${SOF_SRC_PATH}/drivers/mediatek/afe/afe-dai.c
@@ -478,7 +440,6 @@ endif()
478440

479441
# Building for native_posix-based whole-OS host emulator
480442
zephyr_library_sources_ifdef(CONFIG_ZEPHYR_POSIX
481-
${SOF_SRC_PATH}/schedule/zephyr_ll.c
482443
${SOF_PLATFORM_PATH}/posix/dma.c
483444
${SOF_PLATFORM_PATH}/posix/dai.c
484445
${SOF_PLATFORM_PATH}/posix/ipc.c
@@ -530,8 +491,6 @@ zephyr_library_sources(
530491

531492
# SOF core infrastructure - runs on top of Zephyr
532493
${SOF_SRC_PATH}/arch/xtensa/drivers/cache_attr.c
533-
${SOF_SRC_PATH}/schedule/zephyr_domain.c
534-
${SOF_SRC_PATH}/schedule/schedule.c
535494

536495
${SOF_SRC_PATH}/idc/zephyr_idc.c
537496

@@ -612,15 +571,6 @@ add_subdirectory(../src/module module_unused_install/)
612571
if(CONFIG_PIPELINE_2_0)
613572
zephyr_library_sources(${SOF_AUDIO_PATH}/buffers/ring_buffer.c)
614573
endif()
615-
if(CONFIG_SCHEDULE_DMA_SINGLE_CHANNEL AND NOT(CONFIG_DMA_DOMAIN))
616-
zephyr_library_sources(${SOF_SRC_PATH}/schedule/dma_single_chan_domain.c)
617-
endif()
618-
if(CONFIG_SCHEDULE_DMA_MULTI_CHANNEL AND NOT(CONFIG_DMA_DOMAIN))
619-
zephyr_library_sources(${SOF_SRC_PATH}/schedule/dma_multi_chan_domain.c)
620-
endif()
621-
if (CONFIG_DMA_DOMAIN)
622-
zephyr_library_sources(${SOF_SRC_PATH}/schedule/zephyr_dma_domain.c)
623-
endif()
624574

625575
if(CONFIG_COMP_BLOB)
626576
zephyr_library_sources(

0 commit comments

Comments
 (0)