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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>