Commit Graph

145 Commits

Author SHA1 Message Date
Curtis Malainey 4bec102d0c zephyr: delete dead defines
The usages have been deleted, delete the defines now too.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-09-26 17:28:15 +01:00
Laurentiu Mihalcea 33fe3179a0 zephyr: wrapper: remove dead smex code
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>
2024-09-20 13:59:36 +03:00
Andy Ross 17f46a71ee uuid: Use new UUID registry pervasively
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>
2024-07-05 14:32:56 +01:00
Andy Ross a3c1b75808 uuid: Rename DECLARE_SOF(_RT)?_UUID() -> SOF_DEFINE_UUID()
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>
2024-07-05 14:32:56 +01:00
Guennadi Liakhovetski 1673b1097e 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 <guennadi.liakhovetski@linux.intel.com>
2024-06-12 11:07:35 +01:00
Laurentiu Mihalcea 65b8a32f27 nxp: imx8ulp: switch to native Zephyr drivers and timer domain
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>
2024-04-25 14:12:41 +03:00
Laurentiu Mihalcea 9737e124bc nxp: imx8/imx8x: switch to native Zephyr drivers and timer domain
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>
2024-04-23 12:20:31 +01:00
Marc Herbert 884305b837 zephyr/wrapper.c: dereference NULL in POSIX for better k_panic() trace
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>
2024-02-28 15:39:56 +00:00
Laurentiu Mihalcea 3de7b96566 cleanup: remove direct inclusion of drivers/interrupt.h
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>
2024-01-29 14:53:26 +00:00
Flavio Ceolin 07455c572e zephyr: s/MP_NUM_CPUS/MP_MAX_NUM_CPUS/
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>
2023-07-25 15:27:05 +01:00
Rander Wang 2c757064b1 zephyr: wrapper: halt the system in fatal error handler
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>
2023-06-06 17:39:58 +03:00
Kai Vehmanen 9ea2f05ac7 ipc4 : send panic on Zephyr OS panic
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>
2023-05-23 13:29:33 +03:00
Paul Olaru 1ae0d1a4ec drivers: imx: interrupt: Use Zephyr wrapper definitions
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>
2023-05-15 11:44:28 +03:00
Laurentiu Mihalcea bcbb85a29e zephyr: wrapper: Conditionally call platform_boot_complete()
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>
2023-05-02 12:19:11 +03:00
Laurentiu Mihalcea f7d9e76f95 Remove unused <soc.h> header inclusions
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>
2023-04-24 11:40:53 +03:00
Krzysztof Frydryk 10e1172ea5 ams: Add initial AMS implementation
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>
2023-02-28 09:10:29 +01:00
Laurentiu Mihalcea 7ed1159e48 Switch to using rtos/idc.h instead of sof/drivers/idc.h
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>
2023-02-24 14:28:49 +02:00
Guennadi Liakhovetski 6b9c3caac8 zephyr: remove unused module initialisation
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>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 6b3050918a probe: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register probe with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski a6d6ed7632 waves: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register waves with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski e7a21904ac dts: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register dts with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski cfeb248275 google-hotword: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register google-hotword with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 8bb6321c6e tdfb: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register tdfb with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski d34fe6f1d4 up-down-mixer: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register up-down-mixer with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 12f647b753 rtnr: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register rtnr with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 388098abeb igo-nr: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register igo-nr with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski bc7eca2bd0 google-rtc: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register google-rtc with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 65dd48af21 multiband-drc: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register multiband-drc with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski ff81eda5d6 drc: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register drc with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 1f48e003d0 crossover: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register crossover with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski ba73c38320 aria: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register aria with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski e9d078b69f passthrough: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register passthrough with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 453d741f8a cadence: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register cadence with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski c3b453278b copier: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register copier with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski a07e69076c basefw: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register basefw with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski b03a15c89a mux: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register mux with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 798e7acaf3 dcblock: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register dcblock with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 781a2f14a9 asrc: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register asrc with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 1c0598071e smart-amp: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register smart-amp with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski e34183b0ab kpb: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register kpb with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 16bf62c2cc host: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register host with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 602205f40a keyword: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register keyword with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 386822403d eq-iir: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register eq-iir with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski f35132fed6 eq-fir: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register eq-fir with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski d1d3cfdeaf tone: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register tone with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 644a11b251 switch: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register switch with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski 674aed94c2 selector: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register selector with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski dba274da89 chain-dma: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register chain-dma with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski ad3e2e4ab1 src: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register src with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski efa132a9c8 dai: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register dai with the Zephyr
initialisation framework.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00