In order to avoid first level interrupt handling from
wrapper.c second level interrupt handling go through interrupt.c
define macros to rename the duplicated functions
Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
As of commit 0868b1f71e ("zephyr: Remove legacy logging artifacts")
smex is no longer included in Zephyr builds. As such, there's no need to
include a ".static_log_entries" ELF section in the Zephyr ELFs.
This was originally added via commit ca6e3c3bff ("zephyr: add
smex_placeholder()").
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Strip out all the literall UUID management from existing C code (the
API itself still works for any out-of-tree or test code users) and
exclusively use the new, much simpler, SOF_DEFINE_REG_UUID() macro
which sources IDs from the registry by name.
Signed-off-by: Andy Ross <andyross@google.com>
Complete the unification of the diverged UUID APIs with a big rename.
Call it "DEFINE" instead of "DECLARE" since this is in fact a C struct
definition and not just a declaration of a type or extern symbol.
Signed-off-by: Andy Ross <andyross@google.com>
Fixes, needed for a recent Zephyr head plus a PR to fix
CONFIG_LLEXT=n builds.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Switch to Zephyr native drivers and timer domain. This
includes:
1) Switching all imx8ulp topologies to timer domain.
2) Disabling Zephyr DMA domain
3) Various interrupt-related fixes via Kconfig-related
ifdef logic.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This commit includes all necessary changes for switching
to timer domain and Zephyr native drivers on imx8 and imx8x.
This consists of:
1) Switching all imx8 topologies to timer domain.
2) Disabling Zephyr DMA domain
3) Various interrupt-related fixes via Kconfig-related
ifdef logic.
This commit includes all necessary changes for switching
to native Zephyr drivers on imx8/imx8x.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
As discussed in the alternative approach
https://github.com/zephyrproject-rtos/zephyr/pull/68494/, k_panic() in
POSIX mode has various shortcomings that do not provide a useful
trace. Useless pointers to signal handlers or other cleanup routines are
printed instead. Leverage our already existing
k_sys_fatal_error_handler() and dereference a NULL pointer there when in
POSIX mode. This "fails fast" and provides a complete and relevant stack
trace in CI when fuzzing or when using some other static
analyzer. Example of how fuzzing failure #8832 would have looked like in
CI results thanks to this commit:
```
./build-fuzz/zephyr/zephyr.exe: Running 1 inputs 1 time(s) each.
Running: ./rballoc_align_fuzz_crash
*** Booting Zephyr OS build zephyr-v3.5.0-3971-ge07de4e0a167 ***
[00:00:00.000,000] <inf> main: SOF on native_posix
[00:00:00.000,000] <inf> main: SOF initialized
@ WEST_TOPDIR/sof/zephyr/lib/alloc.c:391
[00:00:00.000,000] <err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic
[00:00:00.000,000] <err> os: Current thread: 0x891f8a0 (unknown)
[00:00:00.000,000] <err> zephyr: Halting emulation
AddressSanitizer:DEADLYSIGNAL
=================================================================
==1784402==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000
==1784402==The signal is caused by a WRITE memory access.
==1784402==Hint: address points to the zero page.
#0 0x829a77d in k_sys_fatal_error_handler zephyr/wrapper.c:352:19
#1 0x829b8c0 in rballoc_align zephyr/lib/alloc.c:391:3
#2 0x8281438 in buffer_alloc src/audio/buffer.c:58:16
#3 0x826a60a in buffer_new src/ipc/ipc-helper.c:48:11
#4 0x8262107 in ipc_buffer_new src/ipc/ipc3/helper.c:459:11
#5 0x825944d in ipc_glb_tplg_buffer_new src/ipc/ipc3/handler.c:1305:8
#6 0x8257036 in ipc_cmd src/ipc/ipc3/handler.c:1651:9
#7 0x8272e59 in ipc_platform_do_cmd src/platform/posix/ipc.c:162:2
#8 0x826a2ac in ipc_do_cmd src/ipc/ipc-common.c:328:9
#9 0x829b0ab in task_run zephyr/include/rtos/task.h:94:9
#10 0x829abd8 in edf_work_handler zephyr/edf_schedule.c:32:16
#11 0x83560f7 in work_queue_main zephyr/kernel/work.c:688:3
#12 0x82244c2 in z_thread_entry zephyr/lib/os/thread_entry.c:48:2
```
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zephyr and XTOS' rtos/interrupt.h already include
drivers/interrupt.h so there's no need to include it again
in files which make use of one of the two rtos/interrupt.h
headers. As such, this commit removes all drivers/interrupt.h
inclusions from said files.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Zephyr uses MP_MAX_NUM_CPUS internally to represent the
number of cores available and consequently to allocate
resources. It is even expected, and checked through assert,
that these two symbols have the same value. Use different
value can lead to an undesired behavior, so lets use
MP_MAX_NUM_CPUS.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Follow the k_sys_fatal_error_handler implementation in fatal.c in
zephyr framework. Without this halt, our k_sys_fatal_error_handler
will be called copules time and result to many useless IPC messages
to host.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Send panic notification message to host when panic happens. The panic
detail is built by Zephyr framework and included in debug memory window.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Co-developed-by: Rander Wang <rander.wang@intel.com>
For the functions platform_interrupt_clear and platform_interrupt_set,
the existing definitions based on arch_interrupt_* do not compile with
the xt-clang 2023 toolchain for imx. Use the Zephyr wrapper
implementations for those for now.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Due to the fact that on i.MX93 the host will initialize the
SOF_IPC_FW_READY sequence there's no need to call
platform_boot_complete() at the end of start_complete(). This
will be handled in the IPC3 handler.
This commit makes sure that aforementioned scenario won't
happen for i.MX93 while keeping the flow constant for the
other platforms.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This commit removes all occurrences of the soc.h header file
since this is not used. This also fixes build problem on i.MX93
caused by the fact that i.MX93 doesn't have a soc.h.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add Asynchronous Messaging Service. This can be used to communicate between
modules.
Asynchronous Messages are one-way messages from one producer to one or
multiple registered consumers. Messages between modules on different
cores are sent through IDC. All inter-core communication must be proxied
by the main core.
Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
The purpose of this commit is to separate the XTOS-specifc
code from the Zephyr-specifc code found in sof/drivers/idc.h.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
All SOF modules are now initialised using native Zephyr APIs, no need
any more in a dedicated ELF section. TODO: remove from linker scripts
once this is merged.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register probe with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register waves with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register dts with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register google-hotword with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register tdfb with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register up-down-mixer with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register rtnr with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register igo-nr with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register google-rtc with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register multiband-drc with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register drc with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register crossover with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register aria with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register passthrough with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register cadence with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register copier with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register basefw with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register mux with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register dcblock with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register asrc with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register smart-amp with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register kpb with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register host with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register keyword with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register eq-iir with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register eq-fir with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register tone with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register switch with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register selector with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register chain-dma with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use SOF_MODULE_INIT() to register src with the Zephyr
initialisation framework.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>