Commit Graph

394 Commits

Author SHA1 Message Date
Marcin Szkudlinski 62e358231e kconfig: add DP_SCHEDULER kconfig def
some platforms don't use Zephyr, therefore they can't
use DP scheduler. Add a config option

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-03-14 14:00:28 +00:00
Marc Herbert 11441d8540 zephyr/docker-run.sh: hardcode zephyr-build img to Zephyr SDK 0.15.2
Windows has always been hardcoded to 0.15.2 in .github Actions.

Fixes the compare-linux-windows check that just started to fail in daily
build https://github.com/thesofproject/sof/actions/runs/4400264770

The ":latest" zephyr-build image was just upgraded to the Zephyr SDK
0.16.0-rc1
https://hub.docker.com/layers/zephyrprojectrtos/zephyr-build/latest/images/sha256-91ef9e556aa2a6b5ee5397536e6c441b87fbaef82b9dfc0d12287c39d884d0af?context=explore

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-13 21:59:42 +00:00
Andrula Song 802cffad0d Audio: Dcblock: Add HiFi4 implementation of dcblock
Add HiFi4 implementation of dcblock processing functions.
Compared with generic C version, the 16 bit format can save
about 54.8% cycles, and 53.1% for 24 bit format and 49.1%
for 32 bit.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-03-10 11:37:45 +02:00
Przemyslaw Blaszkowski 4d3bd81c02 aria: add generic processing functions
Add non-HIFI processing functions for non-Xtensa configurations.

Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
2023-03-09 13:54:32 +00:00
Guennadi Liakhovetski b637889efb platform: remove support for cAVS 2.0 platforms
Remove all support for cAVS 2.0 platformsm including Ice Lake and
Jasper Lake, they aren't supported any more.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-07 14:02:18 +02:00
Guennadi Liakhovetski 5cbbde7986 clock: replace per-clock locks with a global one
select_cpu_clock() on cAVS currently takes all the clock locks while
adjusting them. And that function is called from clock_set_freq()
which also takes one of those locks, which leads to a recursive
spin-lock. To fix that remove per-clock spin-locks and use a global
clock lock instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-07 13:37:56 +02:00
Guennadi Liakhovetski 5a090a68cb schedule: remove schedule_task_complete()
schedule_task_complete() is never used, remove it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-06 12:14:14 +00:00
Piotr Makaruk 1f710923dd ipc4: add file for notifications initializations
Add separate file for notifications initializations. All generic
initializations could be stored in one place. Add initialization for
generic xrun notification message which can be sent by gateway.

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
2023-03-03 15:53:36 +00:00
Guennadi Liakhovetski dc9ba281d7 platform: remove support for cAVS 1.8 platforms
Remove all support for cAVS 1.8 platformsm including Cannon Lake,
Comet Lake, Whiskey Lake and Coffee Lake, they aren't supported
any more.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-02 23:02:37 +00:00
Rander Wang 8d5e3a8b52 ipc4: enable google AEC building for zephyr
Enable dummy AEC building support but still need to
enable google AEC in overlay file for chrome.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-03-02 14:51:04 -08:00
Guennadi Liakhovetski 0f0acaae94 platform: remove support for cAVS 1.5 platforms
Remove all support for cAVS 1.5 platformsm including Apollo Lake,
Sky Lake, Kaby Lake, Broxton and Gemini Lake, they aren't supported
any more.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-02 11:28:23 +00:00
Laurentiu Mihalcea 039ccee564 zephyr: Introduce Zephyr version of sof/lib/io.h
The purpose of this commit is to get rid of the dependency
on xtos/include/sof/lib/io.h when building SOF for Zephyr.
Apart from that, this commit solves or gets us closer to
solving the following issues:
	1) Compiling SOF for arm64 architecture results
	in warnings such as the following:

	"warning: cast to pointer from integer
	of different size [-Wint-to-pointer-cast]"

	2) Enabling CONFIG_SOF_ZEPHYR_STRICT_HEADERS will
	result in a compilation error. One of the causes
	for this is the fact that sof/lib/io.h doesn't
	exist.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-03-01 16:03:40 +00:00
Guennadi Liakhovetski 1b934e9d6c IDC: set IDC task priority equal to that of the IPC task
One of the functions of the IDC thread is to execute IPCs on
secondary cores, those have to be executed with the same priority as
when they're run on the primary core, i.e. with the priority of the
IPC thread. Set IDC thread priority equal to the IPC thread.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-01 15:30:05 +00:00
Andrey Borisovich 33d95bc723 Set SOF C++ language standard to C++17 for Zephyr builds
Recent changes to Zephyr header files written in C++
use templates and features provided by the C++14 standard.
Meteorlake board that is built with Zephyr has some C++ code
that uses those headers.
We upgrade straight to C++17 since it is newest standard currently
supported by xt-clang toolchain.
This change does not affect any other boards since the do not
have any C++ code as the time of writing.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-02-28 14:59:41 +00: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 cb72ee08a5 sof: lib: Remove unused #include from cpu.h
All arch/ files should be only used by XTOS. Since the
include statement from cpu.h is not used at all we can safely
remove it. With this, we can make the split between Zephyr
and XTOS more clean.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-02-24 14:28:49 +02: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
Laurentiu Mihalcea 0a5c049ac0 Switch to using rtos/task.h instead of sof/schedule/task.h
The purpose of this commit is to separate XTOS-specific code
from the Zephyr-specific code found in sof/schedule/task.h.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-02-24 14:28:49 +02:00
Jaska Uimonen 1e21a5d2fc zephyr: lib: move cpu.c from lib-zephyr
Move zephyr cpu.c from "unnecessary" lib-zephyr to lib/zephyr.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-02-23 22:17:07 +00:00
Laurentiu Mihalcea 2115a7bfea Switch to using rtos/sof.h instead of sof/sof.h
The purpose of this commit is to separate the XTOS-specifc
code from the Zephyr-specifc code found in sof/sof.h.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-02-22 13:15:06 +00:00
Andrula Song 6b91a55328 Audio: Fix the peak volume calculation error in volume component
Fix the peak volume calculation error in volume component, calculate
the maximum absolute value of input as peak volume as close source
firmware did.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-02-21 15:51:33 +00:00
Laurentiu Mihalcea b91e253f65 include: sof: debug: Split panic.h into Zephyr and XTOS-specific headers
The purpose of this commit is to separate Zephyr-specific definitions
from XTOS-specific definitions. Based on the build, <rtos/panic.h>
will contain the required definitions.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-02-21 15:34:47 +00:00
Guennadi Liakhovetski 17fbf7de22 platform: remove support for Sue Creek
Remove all support for Sue Creek platforms, it isn't supported any
more.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-20 15:46:16 +00:00
ShriramShastry e6baebd54b Math: library: Add an exponential function
The 32-bit exponential library function has an accuracy
of 1e-4 and a unit in last place error of 4.5878 for
inputs from -5 to +5 (Q4.28) and outputs from 0.0067379470
to 148.4131591026 (Q9.23).

Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
2023-02-20 11:17:37 +00:00
Guennadi Liakhovetski d80635054f platform: remove support for Broadwell and Haswell
Remove all support for Broadwell and Haswell platforms, they
aren't supported any more.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-16 16:19:36 +00:00
Guennadi Liakhovetski 89f7aa0abd platform: remove support for Baytrail and Cherrytrail
Remove all support for Baytrail and Cherrytrail platforms, they
aren't supported on the "main" branch any more. To build SOF for them
use the "table-v2.2" branch.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-08 13:36:04 +00:00
Serhiy Katsyuba e6e441ced5 ipc4: add IPC4 gateway
Adds IPC4 gateway. IPC4 gateway transfers audio between host
and DSP without DMA: via memory window (audio payload) and IPC4
messages (commands).

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-02-07 16:27:20 +00:00
Adrian Warecki d33af9ffbd platform: ace: watchdog: Add ll watchdog support
This commit adds watchdog support in zephyrs ll domain for ace platform.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-02-01 12:43:29 +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
Guennadi Liakhovetski 3c46100163 mixer: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register mixer, mixin and mixout 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 4ff094088e volume: convert to Zephyr native initialisation
Use SOF_MODULE_INIT() to register volume 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 6d48dc5ca4 zephyr: add a macro for module initialisation
This macro integrates SOF modules into Zephyr initialisation
framework. SOF module initialisation functions use
DECLARE_MODULE_ADAPTER() or DECLARE_MODULE() to register with the SOF
native initialisation scheme, now the same initialisation functions
can be used with the new SOF_MODULE_INIT() macro to integrate them
into the Zephyr initialisation flow.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Guennadi Liakhovetski dfaa45c95e zephyr: move primary_core_init() to POST_KERNEL
Zephyr has an elaborate subsystem initialisation framework. Use it
for primary_core_init() instead of calling it from main(). This
prepares for a migration of module initialisation to that framework
too.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-26 16:54:57 +02:00
Marc Herbert 35dda2ae27 .github/zephyr: compare Windows and Linux builds
The End.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-01-23 19:28:51 +02:00
Ranjani Sridharan 1abfb3448f up_down_mixer: Convert module to use the module interface
Use the module_adapter interface instead of comp_drv ops

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-01-23 18:50:49 +02:00
Piotr Makaruk d92f07ad30 hda: chain management and logic implementation
Hardware HDA chain require manager for controlling multiple streams tasks.
Enable support with LL task and DMA mandatory logic.

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
2023-01-19 15:37:32 +01:00
Jakub Dabek 99093bac4e memory: Add virtual memory regions gathering and structs
Add virtual memory regions info gathering from zephyr and introduce
structs agregating this information.
Add proper defines for memory management.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2023-01-17 16:10:44 +02:00
Krzysztof Frydryk 6b647412bf lib: Add mcps budget manager for cpu clock control
Initial implementation of MCPS budget manager.
FW can request/free MCPS usage on enabling certain FW elements. Caution
should be taken when processing on different cores, as kcps_budget_data
is uncache only. The manager will change clock source to match requested
MCPS consumption. Budget manager may interfere with manually setting
clock values!

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2023-01-09 15:12:13 +00:00
Guennadi Liakhovetski 12a553814b memcpy_s: fix the name of the last parameter
The last parameter of memcpy_s() isn't the size of the source buffer,
it's the actual number of bytes that should be copied.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-01-09 14:35:39 +00:00
Ranjani Sridharan fba35b13f4 mixin: Convert the component to use the module interface
Replace the comp_drv ops for the mixin component to use the
module_adapter interface. The trigger and get_attribute ops are replaced
with the module_adapter ops which do the exact same thing. The base_cfg
field from struct mixin_data is removed as it is replaced with the
base_cfg in struct module_config and all users have been updated.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-01-06 16:58:47 +00:00
Ranjani Sridharan bf7aa04890 mixout: Convert component to use the module adapter
Convert the mixout module to use the module adapter. The
bind/unbind/get_attribute ops in the mixout module have been moved to the
module_adapter ops and is functionally the same as with the comp_drv
ops.

The struct mixout_data struct has been simplified to contain 2 fields as
the source info table has been moved to struct processing_module and
rename the consumed_yet_not_produced_frames field in struct mixout_data
to pending_frames.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-20 16:44:26 +00:00
Guennadi Liakhovetski fcd6e9541d alloc: fix argument for cache alias conversion
z_soc_uncached_ptr() takes a cached alias as argument.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Marc Herbert e6f72dee82 zephyr/docker-build.sh: upgrade CMake to 3.21 or above
CMake 3.21 changed the order object files are passed the linker. This
breaks build reproducibility.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 15:19:44 -08:00
Marc Herbert 424da2cd9d zephyr/docker: pass http[s]_proxy variables to the container
Support downloads from within the container.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 15:19:44 -08:00
Ranjani Sridharan 41a16145fc mixer: convert the mixer comp to use the module interface
Convert the mixer component and the mock tests to use the module
interface

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-15 20:44:20 +02:00
Andy Ross 3ae99d937a zephyr/wrapper: Handle OOM correctly in rzalloc()
Fuzzing caught this function failing to handle a heap failure and crashing.

Signed-off-by: Andy Ross <andyross@google.com>
2022-12-07 17:25:39 +00:00
Andy Ross c50eddce1f platform: Add Zephyr native_posix-based emulation environment
This extends the ideas in CONFIG_LIBRARY=y to implement SOF as an
application for the Zephyr native_posix architecture.  These are host
x86 or x86_64 binaries that include a full OS build, which can be used
(via mocked drivers) for testing against host validation environments
like ASAN/MSAN.

The mechanism uses the existing "host" architecture used by
CONFIG_LIBRARY, but adds a new platform layer named "posix", populated
entirely with stubs.

No driver integration is provided in this patch.  The resulting
executable builds correctly, but has no devices and won't do anything.

Signed-off-by: Andy Ross <andyross@google.com>
2022-12-07 17:25:39 +00:00
Andy Ross 054230481f zephyr: Not all builds are xtensa
Don't need the arch-specific cache header if we're building for native_posix

Signed-off-by: Andy Ross <andyross@google.com>
2022-12-07 17:25:39 +00:00
Andy Ross 001bb8f331 zephyr/wrapper.c: Misc portability/correctness cleanups
This file needs the clk.h APIs, so include the header.  Don't include
the Xtensa cache.h, as it's unused (and not supposed to be, zephyr.c
is portable code).  Use the proper interrupt en/disable APIs instead
of the SOC-level calls they wrap.

Signed-off-by: Andy Ross <andyross@google.com>
2022-12-07 17:25:39 +00:00
Andy Ross b4025e5d49 zephyr: Add missing kernel.h include
The timer.h header references k_cycle_get_64(), which is defined in
kernel.h.  Was previously hidden by a transitive include somewhere.

Signed-off-by: Andy Ross <andyross@google.com>
2022-12-07 17:25:39 +00:00
Gongjun Song af5d5545fe src: convert the SRC component to use the module interface
Adopt module interface for src component.

IPC3 has compatibility issues, it continues to use comp_driver.
Convert to module adapter only for IPC4.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
2022-12-07 13:57:10 +00:00
Marcin Szkudlinski b033740402 mtl: add support L3 (IMR) heap
L3 memory should support have support
for allocating/freeing memory
A heap support in L3 is introduced by
this commit

Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-11-30 13:43:10 +00:00
Marcin Szkudlinski bb9e2cc147 move HPSRAM heap size def to zephyr adsp_memory.h
The heap size def should not be in alloc.c
This is a platform specific setting
Also (unused by now) macros regarding IMR bootloader
have been removed - moved to Zephyr

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-11-30 13:43:10 +00:00
Marcin Szkudlinski 51c2bc1eb6 IMRheap preparation - cleanup in alloc.c
A quick cleanum in alloc.c
 - code style
 - code not relevant to CAVS/ACE

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-11-30 13:43:10 +00:00
Marc Herbert 5311f61037 zephyr/cmake: fix target_compile_options() comments. No code change
Add reference to -fno-inline-functions issue
https://github.com/thesofproject/sof/issues/5212

Add examples of compilation failures without gnu99.

Fixes commit e430629a1e ("xt-clang: Do not use -std=gnu99 for C++")
that separated the comment from its code.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-11-30 11:50:28 +00:00
Andrula Song 7f36f83333 Audio: Mixin_mixout: Optimize the mixin processing functions
Use audio_stream_samples_without_wrap_sx to replace the complicated
boundary detection for every sample and separate the mix functions to
normal mode and remap mode.

Normal mode (the default mode) can save at least 55.5% cycles for C
version and at least 76.7% for HiFi3 version.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-11-25 11:58:18 +00:00
Jaroslaw Stelter e430629a1e xt-clang: Do not use -std=gnu99 for C++
Option -std=gnu99 applied to C++ files trigerrs warning for xcc
compiler however throws error for xt-clang.
This patch limits usage of this flag to C, ASM code only.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-11-22 16:03:31 +00:00
Marc Herbert 082cc8fbd1 zephyr/docker-build.sh: give PATH precedence to a local sparse
Adjust PATH to give precedence to any local sparse. New precedence:

1. zephyr-workspace
2. /opt/sparse/bin
3. Anything else in default PATH

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-11-22 09:19:45 +00:00
Marc Herbert 7d9de28ef1 zephyr/docker-run.sh: show zephyr-build OS with lsb_release -a
Logging what the container is made of will help diagnose binary
incompatibilities or other problems.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-11-22 09:19:45 +00:00
Marcin Szkudlinski 315962c4d7 zephyr: move memory allocation code 1:1 from wrapper.c to alloc.c
to have more order in the code - move memory code from a huge
common wrapper.c to specific lib/alloc.c
Note there is NO changes in the code, code is as it was before

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2022-11-21 17:09:52 +00:00
Baofeng Tian 79a51819fc Heap profiling: fix regression for heap profiling print with ipc3 case
In zephyr ipc3 case, the first heap allocation come too early
and zephyr logging even is not initialized, it cause sof boot failure.

Limit heap status collection for zephyr+ipc4 only.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2022-11-21 13:20:35 +00:00
Baofeng Tian 371d35108a Memory: add support for memory heap profiling
Heap memory profiling is based on runtime zephyr API.
It will print out each memory allocation with allocated bytes
and free bytes, display as below:
zephyr: heap allocatd: 22c0 free: 152a90 max allocated: 1000

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2022-11-16 13:38:08 +00:00
Daniel Baluta 25493e5d44 zephyr: Add zephyr lib.c standalone file
We need this in order to export symbols to external libraries.

E.g Cadence library needs __vec_memset / __vec_memcpy.

Previous commit d9aed376d5 ("zephyr: rtos: Add __vec_memcpy /
__vec_memset") is not enough in the case of external libs.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-11-11 15:57:50 +02:00
Daniel Baluta d9aed376d5 zephyr: rtos: Add __vec_memcpy / __vec_memset
libc used by Zephyr does not provide implementation for
__vec_memcpy / __vec_memset so add them here.

Fixes c90055f2f5 ("header: rtos: use rtos specific version of string.h")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-11-10 18:28:27 +02:00
Tomasz Leman 71fd3b34ea zephyr: power: preventing lower power states
D3 (PM_STATE_SOFT_OFF) state can be only entered after IPC request from
host. That why this prevent should be permanent.

D0i3 (PM_STATE_RUNTIME_IDLE) can be entered if host allows it and under
special conditions. State is prevented by default. Host will remove this
prevent with dedicated IPC message.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-11-04 20:48:41 +02:00
Laurentiu Mihalcea 1daedbf646 Introduce Zephyr DMA domain as experimental feature
This series of changes allows developers to enable DMA
domain on Zephyr. Currently, this feature is marked as
experimental because it still requires a lot of testing
and bug fixes.

In the case of i.MX, these changes still allow the usage
of dma_multi_chan_domain in conjunction with ll_schedule
if so desired. This is done because the feature is still
experimental and once it becomes more stable the appropriate
changes will be done in order to make DMA domain the
default option.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2022-11-02 12:34:34 +00:00
Andrula Song 87bd3d628b Math: IIR: add Direct-1 format implementation of IIR
Add C and hifi3 version Direct-1 implementation for IIR,
and rename the structure of sof_eq_iir_header_df2t to
sof_eq_iir_header for both two format sharing. Compared
with the original Direct-2 transport format,Direct-1 has
better performance on low frequency since lower quantization
noise while asking the same memory. The C version cost the
same cycles and hifi version can save about 9.8% cycles than
Direct-2 transport format.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-10-28 12:33:56 +01:00
Tomasz Leman e973f5245e zephyr: cpu: moving outside of the wrapper
Moving core management code out of the wrapper for solutions builded
with zephyr.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-10-26 13:27:25 +01:00
Adrian Warecki ac33ac128b ace: dma: Add dma configuration
Added code containing configuration of the dma channels.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-10-18 16:10:37 +03:00
Adrian Warecki c47a0bf6ff ace: clock: Update clock definitions
Added code with clock definitions

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-10-18 16:10:37 +03:00
Daniel Baluta de739dd89c zephyr: Fix cycle counting on i.MX
On i.MX8 k_cycle_get_64 always returns 0 so use sof_cycle_get_64
instead.

There is no better solution to support 64bit cycle counting for i.MX
and will have to stick with this implementation.

Fixes: c3c94fc515 ("header: rtos: use rtos specific version of wait.h")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-10-18 08:57:39 +03:00
Jaska Uimonen 251ee59b2e ipc: rename ace ipc zephyr stubb as ipc-zephyr.c
Rename ace ipc zephyr stubb as ipc-zephyr.c as it is a generic interface
towards zephyr cavs/ace ipc drivers. Change existing zephyr ace/mtl
makefile reference to it and start using it in cavs/tgl ipc4 zephyr
native drivers builds. Tgl ipc3 builds will still use sof cavs ipc
driver.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-10-17 17:01:09 +03:00
Marc Herbert 36b3ff4025 zephyr/docker-run.sh: log all '*zephyr*' images and align columns
`docker images` has no globbing option so just use `grep zephyr`

This fixes two different issues:
- Fixes tabulation images with names of a different length
- Displays any internal local cache some users may have

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:29:05 +01:00
Marc Herbert 77bb169887 .github: de-hardcode zephyr SDK version in sparse build
Also add references documenting sparse's REAL_CC pain.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:29:05 +01:00
Marc Herbert 027be98371 zephyr/docker: move exec_as_sof_uid() to new sudo-cwd.sh
Besides making things more obvious, the important functional change is
that the user switch is now performed for _every_ invoked, command, not
just for the build command.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:29:05 +01:00
Rander Wang 72300fe090 eq_fir: use module interface
Adopt module interface for eq_fir component.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-10-03 13:26:31 +01:00
Guennadi Liakhovetski 1d6fae0f65 zephyr: edf-schedule: (cosmetic) make two variables static
EDF work queue related variables can be static.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-03 12:23:39 +03:00
Marc Herbert 2d2f5f6982 zephyr/docker-*.sh: pass REAL_CC through for sparse support
Other minor fixes

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-09-26 12:33:56 +01:00
Adrian Warecki 784bce763c mtl: Added meteorlake platform to the build system
Added new mtl platform to xtensa-build-zephyr.py.
Added ace directories to cmake files.
Added ACE to kconfig.
Add Meteorlake platform to be built with Zephyr under
CONFIG_ACE_VERSION_1_5 flag.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-09-21 15:15:26 +02:00
Rafal Redzimski e7120ce2a1 platform: ace: define a dedicated heap section
Define a dedicated .heap section in case of zephyr build.
Such explicit section is required to allow for unmapping
of unused physical pages which can be later used for
loadable library/modules support.

Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
2022-09-21 15:15:26 +02:00
Adrian Warecki d5967d1913 platform: mtl: Add meteorlake plaftom
Added base files of meteorlake plaftom:
  Board configuration
  CPU, clock and memory configuration
  Platform bootstrap code
  IPC driver wrapper for Zephyr IPC API for ACE1.5 platforms.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-09-21 15:15:26 +02:00
Anas Nashif ddc104c66d zephyr: both BDW and BYT are not supported in zephyr
Both Broadwell and Baytrail are not supported in zephyr and those
Kconfigs are not defined anywhere, neither in SOF nor in zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-09-16 15:32:25 +01:00
Kai Vehmanen 38d92effc4 ipc4: use delayed work queue for IPC resends
Continue changes in commit c194125b83 ("zephyr: add
notifier_register(ipc_send_queued_msg) in task_main_start()") and
implement the delayed IPC msg sending in Zephyr work queue.

The old implementation did not cover cases where IPC needed to be resent
when no active LL scheduler tasks were active.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-09-12 16:50:29 +01:00
Liam Girdwood 27a3d7c2af header: rtos: use rtos specific version of cache.h
Code can now include <rtos/cache.h> which can wrap onto rtos cache
APIs. Will wrap onto Zephyr generic cache API when ready.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-09-12 11:44:27 +01:00
Liam Girdwood e8733b4f4c header: rtos: use rtos specific version of clk.h
Code can now include <rtos/clk.h>. API is not yet wrapped to Zephyr.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-09-12 11:44:27 +01:00
Liam Girdwood 4843516ab8 header: rtos: use rtos specific version of alloc.h
Code can now include <rtos/alloc.h> and uses thinly wrapped Zephyr
native for most uses. Wrapping can be removed over time.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-09-12 11:44:27 +01:00
Liam Girdwood e7d1b7bbf9 header: rtos: use rtos specific version of interrupt.h
Code can now include <rtos/interrupt.h> and uses native Zephyr IRQ API
for most uses. Some wrapping still exists which can be removed over
time. IMX is missing IRQ driver in Zephyr so falls back to xtos IRQ
driver.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-09-12 11:44:27 +01:00
Liam Girdwood e42f4a6e63 header: rtos: use rtos specific version of timer.h
Code can now include <rtos/timer.h> and uses native Zephyr timer API
for most uses. Some wrapping still exists which can be removed over
time.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-09-12 11:44:27 +01:00
Adrian Bonislawski dac5759fe6 probes: add IPC4 support
Add IPC4 support for extraction & injection probes
IPC4 header changes, checksum calculation
moved checksum from header to the end of data packet

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-09-07 21:54:47 +01:00
Jaroslaw Stelter de889c554b library_manager: module_adapter: Enable build of library manager and IADK modules
Add the library manager and IADK modules to build.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-09-07 18:05:11 +01:00
Jaroslaw Stelter a363e882ea zephyr: rtos: Allow memory operations to be called from cpp code
The memcpy_s() function is called from CPP code in IADK modules.
Declare it as extern "C" when header included in CPP code.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-09-07 18:05:11 +01:00
Daniel Baluta 0488ffee32 zephyr: Fix DRC module compilation
Add DRC files to Zephyr compilation to avoid failures like this:

sof/src/audio/drc/drc_generic.c:188: undefined reference to
`drc_lin2db_fixed'

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-09-06 21:40:06 +01:00
Liam Girdwood c3c94fc515 header: rtos: use rtos specific version of wait.h
Code can now include <rtos/wait.h> and uses native Zephyr 64
cycle API instead of SOF version.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-09-06 15:37:21 +01:00
Marc Herbert 42dd33fb06 zephyr/docker-run.sh: add comments about image versions
Explain how to use this script with a different image version.

Docker image versions and tags tend to confuse new users.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-09-02 18:28:30 +01:00
Marc Herbert 4bf26d09c1 zephyr/docker-run.sh: add missing '-i' option
This makes it possible to run interactive commands like:

  ./sof/zephyr/docker-run.sh /bin/bash

Fixes commit 02c1269144 ("Add new, convenience zephyr/docker-run.sh
script")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-09-02 18:28:30 +01:00
Marc Herbert 02c1269144 Add new, convenience zephyr/docker-run.sh script
This makes it much easier to run commands in the
ghcr.io/zephyrproject-rtos/zephyr-build container.

Loosely based on scripts/docker-run.sh.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-09-01 16:26:02 +01:00
Liam Girdwood c90055f2f5 header: rtos: use rtos specific version of string.h
No runtime semantic change. Use C library when RTOS uses
C library otherwise use own C library calls.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-31 12:01:07 +01:00
Liam Girdwood 09c52810a7 header: rtos: use rtos specific version of bit.h
No runtime functional change. Code can now include <rtos/bit.h>

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-31 12:01:07 +01:00
Liam Girdwood ce0879a432 header: rtos: use rtos specific version of atomic.h
No runtime functional change. Code can now include <rtos/atomic.h>

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-31 12:01:07 +01:00
Liam Girdwood 1629a1f72c header: rtos: decouple headers into rtos specific directories.
No functional runtime change, but changes to rtos partitioning and the
layout of headers .

This patch creates RTOS specifc header paths and updates spinlock.h
and kernel.h to show the new usage. Other headers will incrementally follow.
It reuses the current zephyr topleve directory and creates a new
toplevel xtos directory for xtos specific files.

Due to the mixing of RTOS, driver and library headers at the top level include
directory it was necessary to create rtos specific header directories i.e.

src/include/rtos-xtos
src/include/rtos-zephyr

These RTOS include directories will eventually contain RTOS specific headers
whilst common logic and structures will be placed in non RTOS directories.

This will also mean

"#include <sof/spinlock.h>"

will become

"#include <rtos/spinlock.h>"

and will allow easier visualisation of where and why RTOS headers are being used.
This will help to eliminate cross usage of headers between RTOSes.

Subsequqnt patches will move more headers and rtos specific wrppaer
source files into rtos specific locations.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-31 12:01:07 +01:00
Kai Vehmanen 8a8845e5ff ipc4: implement mtrace logging support
Handle IPC4_ENABLE_LOGS basefw message. If firmware is built with
Zephyr and CONFIG_LOG_BACKEND_ADSP_MTRACE is defined, initialize
the mtrace logging backend.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-31 10:33:46 +01:00
Kai Vehmanen 4abda50153 zephyr: edf_schedule: add support for repeating EDF tasks
Extend the EDF scheduler adaptation to Zephyr to allow repeating
tasks. This allows SOF code to use the per core threads used by
EDF for more usages.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-31 10:33:46 +01:00
Rander Wang 141efbd7b0 ipc4: convert selector to use the new module interface
Now both ipc4 and ipc3 path will switch to module interface
with this patch.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-08-24 13:28:02 +01:00
Andrula Song 100144a1d0 Audio: Mixer: Add hifi version processing functions for mixer
Add hifi3 & hifi4 version implementation of mixer processing functions.
The hifi version functions can save at least 47% cycles than C version.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-08-24 12:00:30 +01:00
Kai Vehmanen c3d1228fb0 probe: add backend for logging via probes
Implement a Zephyr logging backend which routes the logs via SOF
probes interface.

Tested with Linux SOF driver, crecord and sof/tools/probes for decoding.

The patch modifies the probes IPC3 interface, adding a new probe purpose
field (PROBE_PURPOSE_LOGGING, 0x3) to specify probe extraction for
logging. A field for system trace (as is also reserved (PROBE_PURPOSE_TRACING).

Example usage in Linux:

 term1# crecord -c3 -d0 -b8192 -f4 -FS32_LE -R48000 -C4 /tmp/extract.dat
 term2# echo 0,3,0 > /sys/kernel/debug/sof/probe_points
 term1# <terminate crecord>
 term1# sof-probes -p /tmp/extract.dat
 term1# cat buffer_0.bin

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-16 15:36:42 +01:00
Marc Herbert 125d372b19 docker-build.sh: don't switch versions when already initialized
Restore ability to use (and test!) zephyr/docker-build.sh locally
without overwriting work in progress.

Fixes commit b371373f7d ("scripts: docker-build.sh updated with
changes from xtensa-build-zephyr.py")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-04 09:46:22 +01:00
Guennadi Liakhovetski e135633636 zephyr: update for recent Zephyr include path changes
Zephyr removed support for header inclusion without the zephyr/ path.
Update SOF with correct paths.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 20:59:53 +01:00
Andrey Borisovich b371373f7d scripts: docker-build.sh updated with changes from xtensa-build-zephyr.py
Removed old flags from python script call and replaced with
new one. Added one more working directory to zephyr-build container
now SOF is placed in /workdir/sof and west workspace in /workdir .

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-08-03 11:43:22 +01:00
Daniel Baluta 1c018d517f timer: Introduce sof_cycle_get_64
With Zephyr, SOF uses k_cycle_get_64() API in order to
count clock cycles.

Not all platforms have a 64bit counter (e.g i.MX dsp integration
only has xtensa timer which is limited to 32 bits).

So, instead of using k_cycle_get_64 introduce new API sof_cycle_get_64
which keeps the existing behavior for platforms which define
CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER, otherwise use k_uptime_ticks().

See comments from @andyross at
https://github.com/zephyrproject-rtos/zephyr/pull/48318

Suggested-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-08-01 11:09:39 +01:00
Krzysztof Frydryk a6e936359c src: enable hifi4 optimized src build with zephyr
Add src_hifi4.c to sources when building with zephyr.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-07-27 23:08:16 +01:00
Ranjani Sridharan 4af7082ad0 Revert "eq_iir: Use the new module interface"
This reverts commit 9d9ba739b3.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-07-19 15:33:29 -05:00
Ranjani Sridharan 9d9ba739b3 eq_iir: Use the new module interface
Use the module interface instead of the comp drv interface for the
EQ IIR component.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-07-18 16:56:40 +01:00
Anas Nashif a0c9907dbd zephyr: module: point to where the app is
This allows building SOF from zephyr for CI and testing purposes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-18 14:22:01 +01:00
Anas Nashif 33112b74e8 zephyr: use zephyr prefix for includes
Zephyr includes are now under a zephyr namespace, so use this.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-18 14:22:01 +01:00
Andrula Song 12d660b088 Audio: copier: add hifi version implementation of apply_attenuation
add hifi version implementation of apply_attenuation, using xtensa
instructions can save about 74% cycles than the original one.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-07-15 08:55:11 +01:00
Serhiy Katsyuba 9d2857fe37 mixin/mixout all topologies support
Adds possibility to connect single mixin to multiple
mixouts. This allows for all possible mixin/mixout
topologies.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-07-13 09:47:09 +01:00
Guennadi Liakhovetski 162dafc288 zephyr: add third-party components
Add multiple third-party and optional audio processing components to
the Zephyr cmake and initialisation lists.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-07-01 11:11:23 +01:00
Jaska Uimonen 015ec63c4d zephyr: add glue code to use zephyr dai drivers
This patch adds a mechanism to load and use dai driver from zephyr
instead of xtos driver.

Patch includes following changes:
- dai-zephyr.c calls directly zephyr driver methods
- include/lib/dai.h is divided into dai-legacy.h and dai-zephyr.h
- use zephyr dais by configuring CONFIG_ZEPHYR_NATIVE_DRIVERS=y

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-06-16 20:15:59 +01:00