sof/zephyr
Kai Vehmanen 5ced8a4f62 zephyr: lib/cpu.h: remove dependency to platform layer
Remove dependency to platform cpu.h layer for Zephyr targets. The lib/cpu.h
is now common to all SOF targets when building for Zephyr.

Add a note to PLATFORM_PRIMARY_CORE_ID documentation that "primary core"
is a SOF/application convention and not visible in Zephyr OS interfaces.

Core 0 is the boot core in Zephyr, so use this definition as
PLATFORM_PRIMARY_CORE_ID for all SOF targets. This was already the case
in all platform definitions, so no functional change.

In SOF, the primary/secondary distinction is primarily used
in IPC code, together with Zephyr CONFIG_SMP_BOOT_DELAY=y.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-11-13 15:44:32 +02:00
..
include zephyr: lib/cpu.h: remove dependency to platform layer 2024-11-13 15:44:32 +02:00
lib zephyr: alloc : add heap memory allocation for .heap_mem section. 2024-10-18 14:53:04 +01:00
scripts xtensa-build-zephyr.py: add new rimage_west_configuration() 2023-05-26 10:47:51 +03:00
test vmh_tests: Add set of parametrized tests and test suit 2024-03-05 11:11:20 +01:00
CMakeLists.txt Audio: Volume: Add HiFi5 implementation. 2024-10-31 10:34:13 +02:00
FindZephyr-sdk.cmake .github: de-hardcode zephyr SDK version in sparse build 2022-10-10 11:29:05 +01:00
Kconfig zephyr: move to strict headers builds for all targets 2024-10-30 17:34:31 +00:00
README zephyr: replace obsolete README section with link to sof-docs 2022-02-07 10:43:28 +00:00
boot_test.c boot_test: change call of boot tests 2024-03-05 11:11:20 +01:00
docker-build.sh zephyr/docker-build.sh: explain why we autodetect with FindZephyr-sdk 2024-02-19 14:20:07 +00:00
docker-run.sh workflows: Upgrade docker container to v0.26.6 2023-12-14 11:34:12 +02:00
edf_schedule.c zephyr: edf-schedule: fix CONTAINER_OF type 2023-08-31 22:14:37 +03:00
lib.c zephyr: Add zephyr lib.c standalone file 2022-11-11 15:57:50 +02:00
module.yml zephyr: module: point to where the app is 2022-07-18 14:22:01 +01:00
schedule.c header: rtos: use rtos specific version of alloc.h 2022-09-12 11:44:27 +01:00
sof_shell.c zephyr: shell: add initial SOF custom commands 2024-07-04 15:05:13 +01:00
uuid-snippet.ld uuid: Use Zephyr ITERABLE sections for the UUID table 2024-07-05 14:32:56 +01:00
wrapper.c zephyr: amd: the lack of native Zephyr driver support for acp_6_0 platform. 2024-10-18 14:53:04 +01:00

README

SOF with Zephyr RTOS
====================

SOF currently uses the Cadence Xtos/HAL and it's own kernel functions as
its RTOS. SOF is moving to use Zephyr as it's RTOS in parallel to current
releases using xtos.

The initial "alpha" of SOF on Zephyr will use the Zephyr RTOS for boot, IRQs,
scheduling and memory allocation. Subsequent release will use more Zephyr
functionality as code is moved from SOF to Zephyr (i.e. EDF scheduler updates
copied from SOF to Zephyr).

Building SOF on Zephyr
======================

Section promoted to
https://thesofproject.github.io/latest/getting_started/build-guide/build-with-zephyr.html

Testing on Qemu
===============

Get the SOF qemu sof-v4.2 branch here.

git@github.com:thesofproject/qemu.git

Configure as

./configure' '--prefix=.' '--target-list=xtensa-softmmu,x86_64-softmmu' \
             '--enable-gtk' '--enable-sdl' '--enable-spice' \
             '--audio-drv-list=alsa' '--enable-libusb' \
             '--enable-usb-redir' '--enable-coroutine-pool' \
             '--disable-opengl' '--enable-fdt'

 Then run make.

FW can be tested as follows using the qemu helper script.

 ./xtensa-host.sh apl \
     -r ../../sof/sof/build_apl_gcc/src/arch/xtensa/rom-apl.bin \
     -k ../../zephyrproject/zephyr/build/zephyr/zephyr.ri

Where -r and -k are used to specify the ROM and kernel files.

The ROMS can be built from the SOF repo by running

./scripts/xtensa-build-all.sh  -r -a

Using console
-------------

Using logging and simulator backend with processing printk (LOG_PRINTK)
can bring console in qemu.

 - Enable xtensa simulator logging backend (LOG_BACKEND_XTENSA_SIM).
 - Enable printk processing(LOG_PRINTK)
 - Add "-semihosting" to qemu command line. Make sure it goes through scripts to real qemu.