Commit Graph

20 Commits

Author SHA1 Message Date
Rander Wang 5ac79eae01 mutex: add mutex support in XTOS
It uses spin lock to support mutex.

Suggested-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Suggested-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-12-19 13:26:19 +02: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
Adrian Warecki 6f488686b9 dma: Use dma_get_attribute from Zephyr
Use Zephyrs dma_get_attribute when using Zephyr native drivers.

After switching to dma_get_attribute from Zephyr,
local copy of get_attribute function for dw and alh
in ace platform is no longer necessary.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-11-28 16:55:55 +02:00
Adrian Warecki 4321546db0 dma: cavs: ace: Move period count to dma_plat_data
Since zephyr does not support reading the period count
attribute from dma, this value has been moved to
dma_plat_data.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-11-28 16:55:55 +02:00
Adrian Warecki 7f04a2aaf5 dma: Rename dma_get_attribute to dma_get_attribute_legacy
This commit prepares for the introduction of the
dma_get_attribute function in Zephyr.
The dma_get_attribute function was renamed to
dma_get_attribute_legacy. Fixed all existing calls to it.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-11-28 16:55:55 +02:00
MARUTHI MACHANI 4c39ce3433 platform:amd:support for tdm configuration
support for tdm configuration for amd platforms

Signed-off-by: MARUTHI MACHANI <maruthi.machani@amd.com>
2022-11-23 20:28:09 +00:00
Baofeng Tian 5261853027 Performance: remove perf avg macro and reduce print profiling logs
PERFORMANCE_COUNTERS_RUN_AVERAGE is not an independent macro,
it depend on: PERFORMANCE_COUNTERS, so it is duplicated,
remove this macro and use one macro to control this module,
also reduced unnecessary profiling log print.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2022-11-01 10:45:00 +00: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
Baofeng Tian 177b61457f performance: perf cnt bugfix for profiling
Current hw cycle is based on 38400000, and perf cnt module did not consider
the clock wrap case, i.e the later cycle maybe small than the previous one.
so add code to handle this situation.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2022-10-18 13:41:37 +03:00
Baofeng Tian 33ea9ea5ab profiling task: modify task profiling with performance counter macro
This patch is used to make sure profiling code only can be run
with performance profiling build, and unify all performance profiling
with same format and usage.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2022-10-14 12:08:03 +03: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
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
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