From f53b41d6b263f95dcbf270d5200b046ed19b781c Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 5 Jun 2024 11:48:10 +0200 Subject: [PATCH 1/3] west: update to Zephyr "main", fixing disabled LLEXT builds Fixes, needed for a recent Zephyr head plus a PR to fix CONFIG_LLEXT=n builds. Signed-off-by: Guennadi Liakhovetski --- west.yml | 2 +- zephyr/lib/cpu.c | 2 +- zephyr/wrapper.c | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/west.yml b/west.yml index 9a9f877027b0..8bebf78c3e6c 100644 --- a/west.yml +++ b/west.yml @@ -43,7 +43,7 @@ manifest: - name: zephyr repo-path: zephyr - revision: 53ddff639562ef68dc0a6f62b82f7505c75ebdce + revision: 0a3f2f0397a86425cc7d12fa3a0c0ab8020d80e1 remote: zephyrproject # Import some projects listed in zephyr/west.yml@revision diff --git a/zephyr/lib/cpu.c b/zephyr/lib/cpu.c index e65c85729c13..6055c8deeee6 100644 --- a/zephyr/lib/cpu.c +++ b/zephyr/lib/cpu.c @@ -156,7 +156,7 @@ void cpu_disable_core(int id) return; /* Broadcasting interrupts to other cores. */ - arch_sched_ipi(); + arch_sched_broadcast_ipi(); uint64_t timeout = k_cycle_get_64() + k_ms_to_cyc_ceil64(CONFIG_SECONDARY_CORE_DISABLING_TIMEOUT); diff --git a/zephyr/wrapper.c b/zephyr/wrapper.c index 89c130c6a12d..a83de383026b 100644 --- a/zephyr/wrapper.c +++ b/zephyr/wrapper.c @@ -331,8 +331,10 @@ int poll_for_register_delay(uint32_t reg, uint32_t mask, */ volatile int *_sof_fatal_null = NULL; +struct arch_esf; + void k_sys_fatal_error_handler(unsigned int reason, - const z_arch_esf_t *esf) + const struct arch_esf *esf) { ARG_UNUSED(esf); From 074dd67a5253d452b418b59ba5032e33833550c0 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 6 Jun 2024 15:20:10 +0200 Subject: [PATCH 2/3] llext: don't build if CONFIG_LLEXT=n Not all configurations need LLEXT, don't include LLEXT support in such cases. Signed-off-by: Guennadi Liakhovetski --- src/include/sof/llext_manager.h | 6 ++++++ src/library_manager/lib_manager.c | 2 ++ zephyr/CMakeLists.txt | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/include/sof/llext_manager.h b/src/include/sof/llext_manager.h index d75dae4b4804..55ca48d31755 100644 --- a/src/include/sof/llext_manager.h +++ b/src/include/sof/llext_manager.h @@ -11,10 +11,16 @@ struct comp_driver; struct comp_ipc_config; +#if CONFIG_LLEXT uintptr_t llext_manager_allocate_module(struct processing_module *proc, const struct comp_ipc_config *ipc_config, const void *ipc_specific_config); int llext_manager_free_module(const uint32_t component_id); +#else +#define llext_manager_allocate_module(proc, ipc_config, ipc_specific_config) 0 +#define llext_manager_free_module(component_id) 0 +#define llext_unload(ext) 0 +#endif #endif diff --git a/src/library_manager/lib_manager.c b/src/library_manager/lib_manager.c index 9c4f071d0baa..e7007517cff6 100644 --- a/src/library_manager/lib_manager.c +++ b/src/library_manager/lib_manager.c @@ -29,7 +29,9 @@ #include #include +#if CONFIG_LLEXT #include +#endif #if CONFIG_LIBRARY_AUTH_SUPPORT #include diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index ac7f011e22e6..9684012476c0 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -648,7 +648,7 @@ zephyr_library_sources_ifdef(CONFIG_LIBRARY_MANAGER ${SOF_SRC_PATH}/library_manager/lib_notification.c ) -if (CONFIG_MM_DRV) +if (CONFIG_MM_DRV AND CONFIG_LLEXT) zephyr_library_sources_ifdef(CONFIG_LIBRARY_MANAGER ${SOF_SRC_PATH}/library_manager/llext_manager.c ) From 5c74c70aaeee1080b018ac6e185eb8e55ccbd178 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 6 Jun 2024 15:22:23 +0200 Subject: [PATCH 3/3] llext: only enable on ACE platforms cAVS platforms don't use LLEXT because memory mapping isn't supported on them. Select LLEXT per platform, so far only for ACE 1.5 and 2.0. Signed-off-by: Guennadi Liakhovetski --- app/boards/intel_adsp_ace15_mtpm.conf | 4 ++++ app/boards/intel_adsp_ace20_lnl.conf | 4 ++++ app/prj.conf | 4 ---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/boards/intel_adsp_ace15_mtpm.conf b/app/boards/intel_adsp_ace15_mtpm.conf index c594f806c4b4..8fd7888ad442 100644 --- a/app/boards/intel_adsp_ace15_mtpm.conf +++ b/app/boards/intel_adsp_ace15_mtpm.conf @@ -82,6 +82,10 @@ CONFIG_LL_WATCHDOG=y CONFIG_MEMORY_WIN_2_SIZE=12288 +CONFIG_LLEXT=y +CONFIG_LLEXT_STORAGE_WRITABLE=y +CONFIG_MODULES=y + # Temporary disabled options CONFIG_TRACE=n CONFIG_COMP_KPB=y diff --git a/app/boards/intel_adsp_ace20_lnl.conf b/app/boards/intel_adsp_ace20_lnl.conf index 81bb35b47fca..42dea6d096ee 100644 --- a/app/boards/intel_adsp_ace20_lnl.conf +++ b/app/boards/intel_adsp_ace20_lnl.conf @@ -77,6 +77,10 @@ CONFIG_PROBE_DMA_MAX=2 CONFIG_MEMORY_WIN_2_SIZE=12288 +CONFIG_LLEXT=y +CONFIG_LLEXT_STORAGE_WRITABLE=y +CONFIG_MODULES=y + # Temporary disabled options CONFIG_TRACE=n diff --git a/app/prj.conf b/app/prj.conf index 5a681ac5b74b..cd182e5be16c 100644 --- a/app/prj.conf +++ b/app/prj.conf @@ -53,7 +53,3 @@ CONFIG_SCHED_CPU_MASK_PIN_ONLY=y CONFIG_SYS_CLOCK_TICKS_PER_SEC=15000 CONFIG_DAI=y CONFIG_HEAP_MEM_POOL_SIZE=2048 - -CONFIG_LLEXT=y -CONFIG_LLEXT_STORAGE_WRITABLE=y -CONFIG_MODULES=y