Commit Graph

70 Commits

Author SHA1 Message Date
Kai Vehmanen 985c5b5685 zephyr: split the heap into shared and non shared
To increase performance of audio application code, the SOF heap should
be mapped to cached address region on platforms with aliased
cached/uncached memory layout.

This splits the heap into two and maps the SOF_MEM_ZONE_BUFFER to
the cached heap and all rest to uncached heap.

The raw heap memory area is still mapped to uncached memory, even for
the cached heap. The allocated blocks are converted to cached addresses
and passed to SOF users of rmalloc() and rballoc_align(). To ensure
application buffers do not share cachelines with heap metadata chunks,
allocation sizes are rounded up to integer multiples of platform
cacheline size.

BugLink: https://github.com/thesofproject/sof/issues/4306
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-06-28 20:07:02 +01:00
Kai Vehmanen 798226afcf zephyr: fix key-phrase-buffer init in wrapper
The key-phrase-buffer (kpb) component can be included in
Zephyr-based builds, but the component is not initialized
properly in the builds.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-06 14:45:05 +01:00
Kai Vehmanen bc6888ecab zephyr: add sample-smart-amp component to the wrapper
Add the sample-smart-amp to the wrapper build if the component
is enabled in build config.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-06 14:45:05 +01:00
Guennadi Liakhovetski 3fefbf55f9 zephyr: notifier: per-core notifier support
Notifier data has to be per-core and its allocation is
performed in init_system_notify(), no need to also do it in
architecture code.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-05 11:03:35 +01:00
Guennadi Liakhovetski 084b851e33 zephyr: fix multicore booting and status management
sof_main() doesn't run on secondary cores. Instead we provide
a new function, that initialises a dummy thread, runs SOF
initialisation by calling secondary_core_init() and switches
over to the dummy thread.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-05 11:03:35 +01:00
Guennadi Liakhovetski 385586a5f6 zephyr: implement IDC using P4WQ
When running on Zephyr we use P4WQ to implement inter-core
messaging.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-05 11:03:35 +01:00
Guennadi Liakhovetski e111252a5f zephyr: move library platform code to platform.c
Move logging code and static data to platform/library and
declare a LOG module properly.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-04 16:10:49 +01:00
Guennadi Liakhovetski b617910feb zephyr: fix logging build breakage
The use of Zephyr LOG_*() API in SOF is breaking compilation.
Replace it with with the native trace logging until a proper
fix is available.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-04-27 12:11:41 +01:00
Guennadi Liakhovetski 975fa04088 zephyr: allow building with dynamic interrupts disabled
SOF registers IRQ handlers dynamically, therefore disabling
support for dynamic interrupts for SOF builds doesn't make
much sense. However, this can be used to at least increase
compile-time testing coverage and potentially enable
applications, not using dynamic interrupt registration.

BugLink: https://github.com/thesofproject/sof/issues/4044
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-04-22 14:04:45 +01:00
Guennadi Liakhovetski 372d3873bd zephyr: make sure non-atomic 64-bit timer is consistent
The Zephyr timer implementation reads high and low 32 bits
in a non-atomic way. Add a loop to make sure the read is
consistent.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-02-03 16:35:10 +00:00
Guennadi Liakhovetski 9ac38d8828 zephyr: fix regression: add platform_timer_get_atomic()
Recently added platform_timer_get_atomic() has to be
implemented for Zephyr too.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-02-03 16:35:10 +00:00
Guennadi Liakhovetski b580a787da zephyr: update for unsupported arch builds
Add some files from src/platform/library/ to generic arch
builds with Zephyr.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:11:42 +00:00
Guennadi Liakhovetski 1d39806f4e zephyr: extend the wrapper for generic architecture support
When building SOF with Zephyr for unsupported architectures
the following additional adjustments to the wrapper are required:
1. define HEAP_RUNTIME_SIZE
2. implement stubs for interrupt handlich code
3. remove arch_timer_get_system() as it's provided by a header
4. hardcode "return 0;" for platform_timer_get()
5. disable sys_module_init() which anyway isn't yet functional
   under Zephyr
6. add dummy platform_init() and platform_boot_complete()
7. add log_const_sof

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski a91219eb79 zephyr: remove infinite recursion on Broadwell
Broadwell support with Zephyr had only been dry-coded, it has never
been tested, and it contains an infinite recursion bug: functions
platform_timer_get() and arch_timer_get_system() call each other
infinitely. Break the recursion formally, until a proper fix is
available.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-18 11:37:37 +00:00
Andy Ross 2664fc30fb zephyr/wrapper: Disable check for CONFIG_SYS_HEAP_ALIGNED_ALLOC
This kconfig variable no longer exists in upstream Zephyr (the feature
it used to control is now zero-overhead and always enabled).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-11-16 11:23:50 +00:00
Guennadi Liakhovetski b672923809 zephyr: adjust for new location of audio component samples
Audio component samples have been moved to a new location, fix Zephyr
builds to account for it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-23 10:16:55 +01:00
Guennadi Liakhovetski 9a02ffdeb7 zephyr: fix compiler warnings due to recent Zephyr changes
Fix two compiler warnings, introduced by recent Zephyr changes.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-23 10:16:55 +01:00
Guennadi Liakhovetski 94ed4ca325 zephyr: remote the platform_timer_set() wrapper
platform_timer_set() isn't called from Zephyr any more, remote it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-01 22:06:40 +01:00
Liam Girdwood 4b2edf8eed zephyr: wrapper: complete zephyr support for working audio
This patch finalises the wrapper to allow LL scheduling of
timer domain audio, EDF sccheduling of IPC, trace re-direction
and kconfig build support.

There are still many items that are WIP and have been marked with
TODO: comments.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-08-14 15:07:34 +01:00
Liam Girdwood 207c6fdbee zephyr: add wrappers to bridge between Zephyr and SOF APIs.
Add a wrapper to convert SOF API calls to Zephyr equivalents. This allows
development to continue in parallel with xtos/HAL and Zephyr RTOSes until
parity is reached.

The initlial Zephyr APIs to be used are HAL, boot, IRQs, scheduling and
memory. The wrapper reflects this and will probably grow until feature
parity is reached when it can be deleted (as Zephyr APIs can be used
directly).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-21 20:34:34 +01:00