Commit Graph

308 Commits

Author SHA1 Message Date
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
Anas Nashif 54c4b88d57 zephyr: use system cache API
Use zephyr cache APIs instead of xtensa specific ones.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-04-28 10:37:55 +03:00
Marcin Szkudlinski 85b4cdd6c5 kconfig: limit DP scheduler to ACE
DP scheduler is intended to work on MTL and
future platforms only - has not been tested on
any legacy.

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-04-25 13:23:28 +03:00
Laurentiu Mihalcea 2b30188f1b zephyr: CMakeLists.txt: Add support for building SOF for i.MX93
This commit introduces support in the CMakeLists.txt of Zephyr for
building SOF for i.MX93 platform.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-25 13:04:58 +03:00
Gerard Marull-Paretas ca68ba68f2 zephyr: update SYS_INIT calls
Update Zephyr head, and use the new call signature:
int (*init_fn)(void);

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-04-24 19:13:47 +03:00
Marc Herbert ed7c57ba32 zephyr/CMakeLists.txt: remove '..' in include paths
CMake seems to behave differently on Linux and Windows: it generates
different `-I` command line parameters. This results in spurious
`__FILE__` mismatches and non-reproducible builds when using
CONFIG_ASSERT, see example in #7428.

On Windows, '..' seem resolved more often which also seems to convert
forward slashes to backslashes.

They are also less readable and wasting a bit of space. Remove them
using cmake_path(SET ...)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-24 12:04:26 +03:00
Laurentiu Mihalcea f6d84391dc zephyr: include: rtos: interrupt.h: Make interrupt_get_irq work for ARM64 platforms
ARM64's GIC doesn't utilize cascaded interrupts so interrupt_get_irq
will have to return the given INTID.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-24 11:47:07 +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
Laurentiu Mihalcea db3c469ee7 zephyr: include: sof: Add Zephyr version of compiler_info.h
This is required by ARM64 platforms as they don't have
an arch/compiler_info.h so the compilation would fail.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-24 10:23:58 +03:00
Laurentiu Mihalcea 6aa71dd6f2 zephyr: lib: alloc.c: Add heap for ARM64 platforms
This commit places the heap inside the .bss section for
all ARM64 platforms.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-20 12:59:24 +03:00
Daniel Baluta 3f3c1e5084 zephyr: Make CONFIG_DMA_DOMAIN no longer experimental
DMA domain with Zephyr works fine for i.MX platforms. So, remove
"experimental" from description and enable it by default for i.MX
platforms.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-04-05 12:31:46 +01:00
Jaska Uimonen e9cfb64f0d zephyr: cavs: use zephyr pm, clk and dma glue
Start using zephyr pm_runtime, clk and dma glue code in cavs25 native
drivers build. Move the files from ace/lib into zephyr/lib.

Also update west.yaml to related zephyr commit as power related
files have been moved to zephyr side.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-03-27 12:37:26 +03:00
Andrula Song abd81a1383 Audio: Dcblock: Add HiFi3 implementation of dcblock
Add HiFi3 implementation of dcblock processing functions.
Compared with generic C version, the 16 bit format can save
about 48.1% cycles, and 48.4% for 24 bit format and 52.6%
for 32 bit.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-03-21 22:17:01 +00:00
Marcin Szkudlinski 3ee1d78738 scheduling: add Data Processing scheduler type
The DP scheduler is a scheduler based on Zephyr preemptible
threads. It will start each SOF task as a separate Zephyr
thread.
At current implementation the scheduler can trigger each
task/thread periodically or on demand.
TODO: more sophisticated scheduling decisions, with deadline
and task budgets calculations.

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-03-14 14:00:28 +00:00
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