diff --git a/app/Kconfig b/app/Kconfig new file mode 100644 index 000000000000..1ea5b4d46f61 --- /dev/null +++ b/app/Kconfig @@ -0,0 +1,8 @@ +config SCHED_CPU_MASK_PIN_ONLY + default y if SMP + +config SMP_BOOT_DELAY + default y if SMP + +source "Kconfig.zephyr" + diff --git a/app/boards/acp_6_0_adsp.conf b/app/boards/acp_6_0_adsp.conf index d56937f651c9..2e4332e31dcd 100644 --- a/app/boards/acp_6_0_adsp.conf +++ b/app/boards/acp_6_0_adsp.conf @@ -5,7 +5,6 @@ CONFIG_DCACHE_LINE_SIZE=128 CONFIG_DYNAMIC_INTERRUPTS=y CONFIG_SHARED_INTERRUPTS=n CONFIG_ZEPHYR_LOG=n -CONFIG_TRACE=n CONFIG_DMA=y CONFIG_ZEPHYR_NATIVE_DRIVERS=n CONFIG_AMS=n diff --git a/app/boards/imx8qm_mek_mimx8qm6_adsp.conf b/app/boards/imx8qm_mek_mimx8qm6_adsp.conf index 6e741fa7a270..6c8eb26b6e9a 100644 --- a/app/boards/imx8qm_mek_mimx8qm6_adsp.conf +++ b/app/boards/imx8qm_mek_mimx8qm6_adsp.conf @@ -2,8 +2,6 @@ CONFIG_IMX8=y CONFIG_HAVE_AGENT=n CONFIG_FORMAT_CONVERT_HIFI3=n CONFIG_KPB_FORCE_COPY_TYPE_NORMAL=n -CONFIG_ZEPHYR_LOG=y -CONFIG_TRACE=n CONFIG_DMA=y CONFIG_DMA_NXP_EDMA_ENABLE_HALFMAJOR_IRQ=y CONFIG_SHARED_INTERRUPTS=y diff --git a/app/boards/imx8qxp_mek_mimx8qx6_adsp.conf b/app/boards/imx8qxp_mek_mimx8qx6_adsp.conf index d3e3c3c8be79..e6b3ce395c39 100644 --- a/app/boards/imx8qxp_mek_mimx8qx6_adsp.conf +++ b/app/boards/imx8qxp_mek_mimx8qx6_adsp.conf @@ -2,8 +2,6 @@ CONFIG_IMX8X=y CONFIG_HAVE_AGENT=n CONFIG_FORMAT_CONVERT_HIFI3=n CONFIG_KPB_FORCE_COPY_TYPE_NORMAL=n -CONFIG_ZEPHYR_LOG=y -CONFIG_TRACE=n CONFIG_DMA=y CONFIG_DMA_NXP_EDMA_ENABLE_HALFMAJOR_IRQ=y CONFIG_SHARED_INTERRUPTS=y diff --git a/app/boards/imx8ulp_evk_mimx8ud7_adsp.conf b/app/boards/imx8ulp_evk_mimx8ud7_adsp.conf index fdd6e7364c11..5df4c87d3c18 100644 --- a/app/boards/imx8ulp_evk_mimx8ud7_adsp.conf +++ b/app/boards/imx8ulp_evk_mimx8ud7_adsp.conf @@ -3,8 +3,6 @@ CONFIG_HAVE_AGENT=n CONFIG_FORMAT_CONVERT_HIFI3=n CONFIG_KPB_FORCE_COPY_TYPE_NORMAL=n -CONFIG_ZEPHYR_LOG=y -CONFIG_TRACE=n CONFIG_DMA=y CONFIG_DMA_NXP_EDMA_ENABLE_HALFMAJOR_IRQ=y diff --git a/app/boards/imx93_evk_mimx9352_a55.conf b/app/boards/imx93_evk_mimx9352_a55.conf index 4f3d12d5a2f8..7c0667da66b9 100644 --- a/app/boards/imx93_evk_mimx9352_a55.conf +++ b/app/boards/imx93_evk_mimx9352_a55.conf @@ -13,7 +13,6 @@ CONFIG_DCACHE_LINE_SIZE_DETECT=n CONFIG_DCACHE_LINE_SIZE=64 CONFIG_IMX93_A55=y -CONFIG_TRACE=n # DAI-related configurations CONFIG_SAI_HAS_MCLK_CONFIG_OPTION=y diff --git a/app/boards/imx95_evk_mimx9596_m7_ddr.conf b/app/boards/imx95_evk_mimx9596_m7_ddr.conf index 21aed31934af..aec33d7c7e91 100644 --- a/app/boards/imx95_evk_mimx9596_m7_ddr.conf +++ b/app/boards/imx95_evk_mimx9596_m7_ddr.conf @@ -1,5 +1,4 @@ CONFIG_DYNAMIC_INTERRUPTS=y -CONFIG_TRACE=n CONFIG_ZEPHYR_NATIVE_DRIVERS=y CONFIG_IMX95=y diff --git a/app/boards/intel_adsp_ace15_mtpm.conf b/app/boards/intel_adsp_ace15_mtpm.conf index 3908ca5d30d3..5341d14e4ddd 100644 --- a/app/boards/intel_adsp_ace15_mtpm.conf +++ b/app/boards/intel_adsp_ace15_mtpm.conf @@ -55,8 +55,6 @@ CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000 # SOF / logging CONFIG_SOF_LOG_LEVEL_INF=y -CONFIG_TRACE=n -CONFIG_ZEPHYR_LOG=y # Zephyr / OS features CONFIG_DEBUG_COREDUMP=y diff --git a/app/boards/intel_adsp_ace20_lnl.conf b/app/boards/intel_adsp_ace20_lnl.conf index 7130665f78d0..022a3a9a40b6 100644 --- a/app/boards/intel_adsp_ace20_lnl.conf +++ b/app/boards/intel_adsp_ace20_lnl.conf @@ -43,8 +43,6 @@ CONFIG_LIBRARY_MANAGER=y # SOF / logging CONFIG_SOF_LOG_LEVEL_INF=y -CONFIG_TRACE=n -CONFIG_ZEPHYR_LOG=y # Zephyr / OS features CONFIG_COUNTER=y diff --git a/app/boards/intel_adsp_ace30_ptl.conf b/app/boards/intel_adsp_ace30_ptl.conf index 0be2f1802a54..d7c1979b63a4 100644 --- a/app/boards/intel_adsp_ace30_ptl.conf +++ b/app/boards/intel_adsp_ace30_ptl.conf @@ -38,9 +38,7 @@ CONFIG_INTEL_MODULES=y CONFIG_LIBRARY_MANAGER=y # SOF / logging -CONFIG_TRACE=n CONFIG_SOF_LOG_LEVEL_INF=y -CONFIG_ZEPHYR_LOG=y # Zephyr / OS features CONFIG_COUNTER=y diff --git a/app/boards/intel_adsp_ace30_ptl_sim.conf b/app/boards/intel_adsp_ace30_ptl_sim.conf index be8d2b52c59e..eb72fb6598cc 100644 --- a/app/boards/intel_adsp_ace30_ptl_sim.conf +++ b/app/boards/intel_adsp_ace30_ptl_sim.conf @@ -55,7 +55,6 @@ CONFIG_INTEL_ADSP_IPC=y # Temporary disabled options -CONFIG_TRACE=n CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=n CONFIG_PM_DEVICE_POWER_DOMAIN=n diff --git a/app/boards/intel_adsp_cavs25.conf b/app/boards/intel_adsp_cavs25.conf index 1117c66437e4..72104567491a 100644 --- a/app/boards/intel_adsp_cavs25.conf +++ b/app/boards/intel_adsp_cavs25.conf @@ -35,9 +35,7 @@ CONFIG_INTEL_MODULES=y CONFIG_LIBRARY_MANAGER=n # SOF / logging -CONFIG_TRACE=n CONFIG_SOF_LOG_LEVEL_INF=y -CONFIG_ZEPHYR_LOG=y # Zephyr / OS features CONFIG_DEBUG_COREDUMP=y diff --git a/app/boards/intel_adsp_cavs25_tgph.conf b/app/boards/intel_adsp_cavs25_tgph.conf index 83dea362fb06..b29a7ba18970 100644 --- a/app/boards/intel_adsp_cavs25_tgph.conf +++ b/app/boards/intel_adsp_cavs25_tgph.conf @@ -34,9 +34,7 @@ CONFIG_INTEL_MODULES=y CONFIG_LIBRARY_MANAGER=n # SOF / logging -CONFIG_TRACE=n CONFIG_SOF_LOG_LEVEL_INF=y -CONFIG_ZEPHYR_LOG=y # Zephyr / OS features CONFIG_DEBUG_COREDUMP=y diff --git a/app/boards/native_sim_libfuzzer.conf b/app/boards/native_sim_libfuzzer.conf index 631130f99fc3..ece1e35845c9 100644 --- a/app/boards/native_sim_libfuzzer.conf +++ b/app/boards/native_sim_libfuzzer.conf @@ -8,9 +8,4 @@ CONFIG_SYS_HEAP_BIG_ONLY=y CONFIG_ZEPHYR_NATIVE_DRIVERS=y CONFIG_ARCH_POSIX_LIBFUZZER=y CONFIG_ZEPHYR_POSIX_FUZZ_TICKS=100 - -# Override incompatible options found in sof/app/prj.conf -# to silence build time warnings -# (strange why these are in app/prj.conf but not our problem here) -CONFIG_SMP_BOOT_DELAY=n -CONFIG_SCHED_CPU_MASK_PIN_ONLY=n +CONFIG_ZEPHYR_LOG=n diff --git a/app/prj.conf b/app/prj.conf index cd182e5be16c..e072f1df2fd2 100644 --- a/app/prj.conf +++ b/app/prj.conf @@ -15,6 +15,8 @@ CONFIG_HAVE_AGENT=n # We need more time to test and evaluate. CONFIG_MINIMAL_LIBC=y +CONFIG_ZEPHYR_LOG=y +CONFIG_TRACE=n CONFIG_LOG=y CONFIG_LOG_PRINTK=y # Log processing is offloaded to a low-priority thread. @@ -41,12 +43,6 @@ CONFIG_COMPILER_OPT="-fstrict-overflow" CONFIG_SCHED_DEADLINE=y CONFIG_SCHED_CPU_MASK=y -CONFIG_SMP_BOOT_DELAY=y - -# SOF code assumes system work queue and other system -# wide threads are pinned to a single core. -# CPU_MASK_PIN_ONLY must be set for all SOF builds. -CONFIG_SCHED_CPU_MASK_PIN_ONLY=y # Fix the sys ticks value until following bugs are solved: # - https://github.com/zephyrproject-rtos/zephyr/issues/46378 diff --git a/posix/include/sof/lib/dma.h b/posix/include/sof/lib/dma.h index 43214cc14ae5..ffae21574916 100644 --- a/posix/include/sof/lib/dma.h +++ b/posix/include/sof/lib/dma.h @@ -97,6 +97,9 @@ enum dma_cb_status { DMA_CB_STATUS_END, }; +#define SOF_DMA_CB_STATUS_RELOAD DMA_CB_STATUS_RELOAD +#define SOF_DMA_CB_STATUS_END DMA_CB_STATUS_END + /* DMA interrupt commands */ enum dma_irq_cmd { DMA_IRQ_STATUS_GET = 0, diff --git a/src/audio/dai-legacy.c b/src/audio/dai-legacy.c index 5065c3f21ca1..b212bb9ebdac 100644 --- a/src/audio/dai-legacy.c +++ b/src/audio/dai-legacy.c @@ -99,7 +99,7 @@ static void dai_dma_cb(void *arg, enum notify_id type, void *data) comp_dbg(dev, "dai_dma_cb()"); - next->status = DMA_CB_STATUS_RELOAD; + next->status = SOF_DMA_CB_STATUS_RELOAD; /* stop dma copy for pause/stop/xrun */ if (dev->state != COMP_STATE_ACTIVE || dd->xrun) { @@ -107,7 +107,7 @@ static void dai_dma_cb(void *arg, enum notify_id type, void *data) dai_trigger(dd->dai, COMP_TRIGGER_STOP, dev->direction); /* tell DMA not to reload */ - next->status = DMA_CB_STATUS_END; + next->status = SOF_DMA_CB_STATUS_END; } /* is our pipeline handling an XRUN ? */ diff --git a/src/drivers/mediatek/afe/afe-dai.c b/src/drivers/mediatek/afe/afe-dai.c index ee6b9cff0d8e..a0b3450515a9 100644 --- a/src/drivers/mediatek/afe/afe-dai.c +++ b/src/drivers/mediatek/afe/afe-dai.c @@ -100,7 +100,7 @@ const struct dai_driver afe_dai_driver = { .type = SOF_DAI_MEDIATEK_AFE, .uid = SOF_UUID(afe_dai_uuid), .tctx = &afe_dai_tr, - .dma_dev = DMA_DEV_AFE_MEMIF, + .dma_dev = SOF_DMA_DEV_AFE_MEMIF, .ops = { .trigger = afe_dai_drv_trigger, .set_config = afe_dai_drv_set_config, diff --git a/src/drivers/mediatek/afe/afe-drv.c b/src/drivers/mediatek/afe/afe-drv.c index 5681638344a6..b9cf29eaa654 100644 --- a/src/drivers/mediatek/afe/afe-drv.c +++ b/src/drivers/mediatek/afe/afe-drv.c @@ -380,7 +380,7 @@ int afe_probe(struct mtk_base_afe *afe) afe->irqs_size = platform->irqs_size; afe->irqs = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(struct mtk_base_afe_irq) * afe->irqs_size); - if (!afe->irqs) + if (!afe->irqs && afe->irqs_size) goto err_alloc_dais; for (i = 0; i < afe->irqs_size; i++) diff --git a/src/drivers/mediatek/afe/afe-memif.c b/src/drivers/mediatek/afe/afe-memif.c index 3a9abf73f016..5fdba9b17fd9 100644 --- a/src/drivers/mediatek/afe/afe-memif.c +++ b/src/drivers/mediatek/afe/afe-memif.c @@ -213,7 +213,7 @@ static int memif_status(struct dma_chan_data *channel, struct dma_chan_status *s if (!hw_ptr) { status->r_pos = 0; status->w_pos = 0; - status->timestamp = timer_get_system(timer_get()); + status->timestamp = sof_cycle_get_64(); return -EINVAL; } hw_ptr -= memif->dma_base; @@ -224,7 +224,7 @@ static int memif_status(struct dma_chan_data *channel, struct dma_chan_status *s status->r_pos = memif->rptr + memif->dma_base; status->w_pos = memif->wptr + memif->dma_base; - status->timestamp = timer_get_system(timer_get()); + status->timestamp = sof_cycle_get_64(); return 0; } @@ -370,6 +370,7 @@ static int memif_probe(struct dma *dma) dma->chan[channel].dma = dma; /* TODO need divide to UL and DL for different index */ dma->chan[channel].index = channel; + dma->chan[channel].status = COMP_STATE_INIT; memif = rzalloc(SOF_MEM_ZONE_SYS_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(struct afe_memif_dma)); diff --git a/src/init/init.c b/src/init/init.c index 530e82a537de..9ff13c5d8b12 100644 --- a/src/init/init.c +++ b/src/init/init.c @@ -287,7 +287,7 @@ static int primary_core_init(int argc, char *argv[], struct sof *sof) interrupt_init(sof); #endif /* __ZEPHYR__ */ -#ifdef CONFIG_ZEPHYR_LOG +#if defined(CONFIG_ZEPHYR_LOG) && !defined(CONFIG_LOG_MODE_MINIMAL) log_set_timestamp_func(default_get_timestamp, sys_clock_hw_cycles_per_sec()); #endif diff --git a/src/ipc/ipc3/handler.c b/src/ipc/ipc3/handler.c index 1a4ca43d70fe..12f2ba3a34a4 100644 --- a/src/ipc/ipc3/handler.c +++ b/src/ipc/ipc3/handler.c @@ -967,9 +967,11 @@ static int ipc_glb_trace_message(uint32_t header) #else static int ipc_glb_trace_message(uint32_t header) { - /* traces are disabled - CONFIG_TRACE is not set */ - - return -EINVAL; + /* Return success, as the protocol provides no way to inform + * the kernel that we don't support dtrace. It will just see + * no output. + */ + return 0; } #endif diff --git a/src/math/Kconfig b/src/math/Kconfig index 08e4f9a554f0..ccd7520f20a7 100644 --- a/src/math/Kconfig +++ b/src/math/Kconfig @@ -128,9 +128,7 @@ endmenu # this choice covers math iir, math fir, tdfb, and eqfir, eqiir. choice "FILTER_SIMD_LEVEL_SELECT" prompt "choose which SIMD level used for IIR/FIR/TDFB module" - depends on COMP_FIR - depends on COMP_IIR - depends on COMP_TDFB + depends on COMP_FIR || COMP_IIR || COMP_TDFB default FILTER_HIFI_MAX config FILTER_HIFI_MAX diff --git a/xtos/include/sof/lib/dma.h b/xtos/include/sof/lib/dma.h index 95e408124f0c..7cfd6cecdc2b 100644 --- a/xtos/include/sof/lib/dma.h +++ b/xtos/include/sof/lib/dma.h @@ -87,6 +87,7 @@ struct comp_buffer; #define SOF_DMA_DEV_SAI DMA_DEV_SAI #define SOF_DMA_DEV_ESAI DMA_DEV_ESAI #define SOF_DMA_DEV_MICFIL DMA_DEV_MICFIL +#define SOF_DMA_DEV_AFE_MEMIF DMA_DEV_AFE_MEMIF /* DMA access privilege flag */ #define DMA_ACCESS_EXCLUSIVE 1 @@ -106,6 +107,9 @@ enum dma_cb_status { DMA_CB_STATUS_END, }; +#define SOF_DMA_CB_STATUS_RELOAD DMA_CB_STATUS_RELOAD +#define SOF_DMA_CB_STATUS_END DMA_CB_STATUS_END + /* DMA interrupt commands */ enum dma_irq_cmd { DMA_IRQ_STATUS_GET = 0, diff --git a/zephyr/include/rtos/interrupt.h b/zephyr/include/rtos/interrupt.h index 3dfa7ccec7db..d0e3dd772b7c 100644 --- a/zephyr/include/rtos/interrupt.h +++ b/zephyr/include/rtos/interrupt.h @@ -30,6 +30,7 @@ static inline int interrupt_register(uint32_t irq, void(*handler)(void *arg), vo return arch_irq_connect_dynamic(irq, 0, (void (*)(const void *))handler, arg, 0); #else + LOG_MODULE_DECLARE(zephyr, CONFIG_SOF_LOG_LEVEL); tr_err(&zephyr_tr, "Cannot register handler for IRQ %u: dynamic IRQs are disabled", irq); return -EOPNOTSUPP; @@ -48,17 +49,15 @@ static inline void interrupt_unregister(uint32_t irq, const void *arg) static inline int interrupt_get_irq(unsigned int irq, const char *cascade) { -#if defined(CONFIG_LIBRARY) || defined(CONFIG_ACE) || defined(CONFIG_CAVS) || \ - defined(CONFIG_ZEPHYR_POSIX) || (defined(CONFIG_IMX) && !defined(CONFIG_IMX8M)) || \ - defined(CONFIG_AMD) - return irq; -#else +#ifdef CONFIG_IMX8M if (cascade == irq_name_level2) return SOC_AGGREGATE_IRQ(irq, IRQ_NUM_EXT_LEVEL2); if (cascade == irq_name_level5) return SOC_AGGREGATE_IRQ(irq, IRQ_NUM_EXT_LEVEL5); return SOC_AGGREGATE_IRQ(0, irq); +#else + return irq; #endif }