Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/zephyr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ jobs:
- zephyr_revision: mnfst
IPC_platforms: wcl imx95

# The default configuration targets Linux, also build the
# internal CI configuration (app/internal_ci_overlay.conf).
- zephyr_revision: mnfst
IPC_platforms: lnl ptl
config_overlay: internal_ci

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# Download a full clone to fix `git describe`, sof_version.h and
Expand Down Expand Up @@ -232,6 +238,7 @@ jobs:
--cmake-args=-DEXTRA_AFLAGS='-Werror -Wa,--fatal-warnings' \
--cmake-args=--warn-uninitialized \
--overlay=sof/app/configs/repro-build.conf \
${{ matrix.config_overlay && format('--overlay=sof/app/{0}_overlay.conf', matrix.config_overlay) || '' }} \
--no-tarball \
${{ matrix.build_opts }} ${{ matrix.IPC_platforms }}

Expand All @@ -252,7 +259,7 @@ jobs:
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: linux-build ${{ matrix.build_opts }} ${{ matrix.IPC_platforms }}
name: linux-build ${{ matrix.build_opts }} ${{ matrix.IPC_platforms }}${{ matrix.config_overlay && format(' {0}', matrix.config_overlay) || '' }}
if-no-files-found: error
path: |
build-sof-staging
Expand Down
5 changes: 4 additions & 1 deletion Kconfig.sof
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ config FAST_GET

config SOF_OS_LINUX_COMPAT_PRIORITY
bool "Prioritize backwards compatibility for old Linux kernels"
default y
help
Build option to maintain maximal backwards compatibility with old
versions of Linux SOF driver. When this is not set, firmware may
require newer version of host, and/or use features that are not
available in stable Linux kernel trees.
available in stable Linux kernel trees. This is enabled by default
as the default SOF build targets the Linux SOF driver, it is
disabled by app/internal_ci_overlay.conf.

rsource "Kconfig.xtos"

Expand Down
40 changes: 29 additions & 11 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,37 @@ cmake_minimum_required(VERSION 3.21.0)

# Board specific overlays (these must be before find_package(Zephyr))
# -------------------------------------------------------------------
#
# The default build targets the Linux SOF driver. Overlays added here
# are put before any user given overlays, so that the user overlays
# take precedence.

# Intel ACE3.x and newer (e.g. ptl, wcl, nvl): if "os_linux_overlay"
# used, also add "ll_userspace_overlay". The board target may be given
# in full in BOARD ("intel_adsp/ace30/ptl") or split into BOARD and
# BOARD_QUALIFIERS ("intel_adsp" + "ace30/ptl"), so match on both.
if(DEFINED EXTRA_CONF_FILE AND
"${BOARD}/${BOARD_QUALIFIERS}" MATCHES "^intel_adsp/ace[3-9][0-9]/")
string(FIND "${EXTRA_CONF_FILE}" "os_linux_overlay" _linux_overlay_idx)
string(FIND "${EXTRA_CONF_FILE}" "ll_userspace_overlay" _ll_overlay_idx)
if(_linux_overlay_idx GREATER_EQUAL 0 AND _ll_overlay_idx LESS 0)
list(APPEND EXTRA_CONF_FILE
"${CMAKE_CURRENT_SOURCE_DIR}/ll_userspace_overlay.conf")
# The board target may be given in full in BOARD ("intel_adsp/ace30/ptl")
# or split into BOARD and BOARD_QUALIFIERS ("intel_adsp" + "ace30/ptl"),
# so normalize the concatenation of the two.
string(REGEX REPLACE "/+" "/" _sof_board "${BOARD}/${BOARD_QUALIFIERS}")
string(REGEX REPLACE "/$" "" _sof_board "${_sof_board}")
string(REPLACE "/" "_" _sof_board_conf "${_sof_board}")

# Zephyr merges the overlays given in EXTRA_CONF_FILE and the deprecated
# OVERLAY_CONFIG, from both CMake variables and the environment, so look
# at all of them to find out which overlays are used.
set(_sof_conf_files "${EXTRA_CONF_FILE};$ENV{EXTRA_CONF_FILE};${OVERLAY_CONFIG};$ENV{OVERLAY_CONFIG}")

if("${_sof_conf_files}" MATCHES "internal_ci_overlay")
# Internal CI build: also add the board specific internal CI overlay,
# if there is one.
set(_sof_ci_overlay
"${CMAKE_CURRENT_SOURCE_DIR}/overlays/internal_ci/${_sof_board_conf}.conf")
if(EXISTS "${_sof_ci_overlay}")
list(PREPEND EXTRA_CONF_FILE "${_sof_ci_overlay}")
endif()
Comment on lines +24 to 31
elseif("${_sof_board}" MATCHES "^intel_adsp/ace[3-9][0-9]/" AND
NOT "${_sof_conf_files}" MATCHES "ll_userspace_overlay")
# Intel ACE3.x and newer (e.g. ptl, wcl, nvl): Linux builds use
# user-space LL.
list(PREPEND EXTRA_CONF_FILE
"${CMAKE_CURRENT_SOURCE_DIR}/ll_userspace_overlay.conf")
endif()

find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
Expand Down
2 changes: 1 addition & 1 deletion app/boards/intel_adsp_ace20_lnl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000

# Zephyr / power settings
CONFIG_ADSP_IDLE_CLOCK_GATING=y
CONFIG_ADSP_IMR_CONTEXT_SAVE=y
CONFIG_ADSP_IMR_CONTEXT_SAVE=n
CONFIG_PM_PREWAKEUP_CONV_MODE_CEIL=y
CONFIG_PM_DEVICE_RUNTIME_ASYNC=n

Expand Down
3 changes: 1 addition & 2 deletions app/boards/intel_adsp_ace30_ptl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ CONFIG_XTENSA_MMU_NUM_L2_TABLES=50
CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000

# Zephyr / power settings
CONFIG_ADSP_IMR_CONTEXT_SAVE=y
CONFIG_ADSP_IMR_CONTEXT_SAVE=n
CONFIG_PM_PREWAKEUP_CONV_MODE_CEIL=y
CONFIG_PM_DEVICE_RUNTIME_ASYNC=n

Expand All @@ -81,7 +81,6 @@ CONFIG_DYNAMIC_THREAD=y
CONFIG_DYNAMIC_THREAD_ALLOC=y
CONFIG_DYNAMIC_THREAD_PREFER_ALLOC=y
CONFIG_SOF_STACK_SIZE=8192
CONFIG_SOF_USERSPACE_PROXY=y
CONFIG_MAX_THREAD_BYTES=3

CONFIG_MAX_DOMAIN_PARTITIONS=32
2 changes: 1 addition & 1 deletion app/boards/intel_adsp_ace30_wcl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ CONFIG_MM_DRV_INTEL_VIRTUAL_REGION_COUNT=3
CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000

# Zephyr / power settings
CONFIG_ADSP_IMR_CONTEXT_SAVE=y
CONFIG_ADSP_IMR_CONTEXT_SAVE=n
CONFIG_PM_PREWAKEUP_CONV_MODE_CEIL=y
CONFIG_PM_DEVICE_RUNTIME_ASYNC=n

Expand Down
4 changes: 2 additions & 2 deletions app/boards/intel_adsp_ace40_nvl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ CONFIG_MM_DRV_INTEL_VIRTUAL_REGION_COUNT=3
CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000

# Zephyr / power settings
CONFIG_ADSP_IMR_CONTEXT_SAVE=y
CONFIG_ADSP_IMR_CONTEXT_SAVE=n
CONFIG_PM_PREWAKEUP_CONV_MODE_CEIL=y
CONFIG_SRAM_RETENTION_MODE=n
CONFIG_PM_DEVICE_RUNTIME_ASYNC=n
Expand All @@ -67,7 +67,7 @@ CONFIG_PM_DEVICE_RUNTIME_ASYNC=n
CONFIG_LOG_BACKEND_ADSP=n
CONFIG_WINSTREAM_CONSOLE=n
CONFIG_LOG_RUNTIME_FILTERING=y
CONFIG_LOG_RUNTIME_DEFAULT_LEVEL=1
CONFIG_LOG_RUNTIME_DEFAULT_LEVEL=3

# Zephyr / debug: temporary, until fixed
CONFIG_GDBSTUB=n
4 changes: 2 additions & 2 deletions app/boards/intel_adsp_ace40_nvls.conf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ CONFIG_MM_DRV_INTEL_VIRTUAL_REGION_COUNT=3
CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000

# Zephyr / power settings
CONFIG_ADSP_IMR_CONTEXT_SAVE=y
CONFIG_ADSP_IMR_CONTEXT_SAVE=n
CONFIG_PM_PREWAKEUP_CONV_MODE_CEIL=y
CONFIG_SRAM_RETENTION_MODE=n
CONFIG_PM_DEVICE_RUNTIME_ASYNC=n
Expand All @@ -68,7 +68,7 @@ CONFIG_PM_DEVICE_RUNTIME_ASYNC=n
CONFIG_LOG_BACKEND_ADSP=n
CONFIG_WINSTREAM_CONSOLE=n
CONFIG_LOG_RUNTIME_FILTERING=y
CONFIG_LOG_RUNTIME_DEFAULT_LEVEL=1
CONFIG_LOG_RUNTIME_DEFAULT_LEVEL=3

# Zephyr / debug: temporary, until fixed
CONFIG_GDBSTUB=n
19 changes: 19 additions & 0 deletions app/internal_ci_overlay.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Overlay definitions to build SOF firmware for internal CI
#
# The default SOF build (board config files) targets the Linux SOF
# driver. This overlay restores the configuration that was used
# for non-Linux builds before Linux became the default.
#
# When this overlay is used, app/CMakeLists.txt also:
# - does not include the Intel ACE3.x+ LL userspace overlay
# (ll_userspace_overlay.conf)
# - includes the board specific internal CI overlay from
# overlays/internal_ci/<board>.conf, if present
#

# Do not restrict firmware to features supported by stable
# Linux SOF driver versions. This also enables the additional
# virtual heap buffers (VIRTUAL_HEAP_EXTENDED) on platforms
# that support them.
CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY=n
6 changes: 3 additions & 3 deletions app/ll_userspace_overlay.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# This is overlay configuration file to enable user-space LL audio
# pipeline support.
#
# NOTE: this overlay is automatically included if an Intel ACE3.x
# or newer target (e.g. ptl, wcl, nvl) is built with generic
# "os_linux_overlay.conf"
# NOTE: this overlay is automatically included when an Intel ACE3.x
# or newer target (e.g. ptl, wcl, nvl) is built, unless the
# build uses "internal_ci_overlay.conf"

# Enable user-space LL support in SOF
# -----------------------------------
Expand Down
34 changes: 9 additions & 25 deletions app/os_linux_overlay.conf
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
#
# Overlay definitions to build SOF firmware for use
# with SOF driver in Linux kernel
# DEPRECATED: the default SOF build now targets the Linux SOF driver,
# so this overlay is no longer needed and is intentionally empty.
#
# It is kept so that existing build scripts that pass
# "-o app/os_linux_overlay.conf" keep working, and it will be removed
# in a future release.
#
# The previous non-Linux default configuration is available via
# app/internal_ci_overlay.conf.
#

# As a general rule, update of SOF firmware shall never
# break existing systems by depending on Linux kernel patches
# that have been upstreamed after commercial availability
# of a product.
CONFIG_SOF_OS_LINUX_COMPAT_PRIORITY=y

# SOF Linux driver does not require FW to retain its
# state, so context save can be disabled
CONFIG_ADSP_IMR_CONTEXT_SAVE=n
CONFIG_SOF_USERSPACE_PROXY=n

# Logging options

# Set default runtime log level to INFO (3).
# Note: This setting only has effect when CONFIG_LOG_RUNTIME_FILTERING is enabled.
# By default, the runtime level equals the compile-time level, but it is explicitly
# set here to INFO to ensure expected behavior if platform configurations set a
# lower default level (e.g., ERROR).
CONFIG_LOG_RUNTIME_DEFAULT_LEVEL=3

# Disable additional VMH buffers to use memory for virtual regions.
CONFIG_VIRTUAL_HEAP_EXTENDED=n
5 changes: 5 additions & 0 deletions app/overlays/internal_ci/intel_adsp_ace20_lnl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Board specific internal CI settings for lnl, automatically
# included after internal_ci_overlay.conf. See internal_ci_overlay.conf.

# Retain FW context in IMR over D3
CONFIG_ADSP_IMR_CONTEXT_SAVE=y
8 changes: 8 additions & 0 deletions app/overlays/internal_ci/intel_adsp_ace30_ptl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Board specific internal CI settings for ptl, automatically
# included after internal_ci_overlay.conf. See internal_ci_overlay.conf.

# Retain FW context in IMR over D3
CONFIG_ADSP_IMR_CONTEXT_SAVE=y

# Run userspace modules inside the userspace proxy
CONFIG_SOF_USERSPACE_PROXY=y
5 changes: 5 additions & 0 deletions app/overlays/internal_ci/intel_adsp_ace30_wcl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Board specific internal CI settings for wcl, automatically
# included after internal_ci_overlay.conf. See internal_ci_overlay.conf.

# Retain FW context in IMR over D3
CONFIG_ADSP_IMR_CONTEXT_SAVE=y
8 changes: 8 additions & 0 deletions app/overlays/internal_ci/intel_adsp_ace40_nvl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Board specific internal CI settings for nvl, automatically
# included after internal_ci_overlay.conf. See internal_ci_overlay.conf.

# Retain FW context in IMR over D3
CONFIG_ADSP_IMR_CONTEXT_SAVE=y

# Default runtime log level ERROR
CONFIG_LOG_RUNTIME_DEFAULT_LEVEL=1
8 changes: 8 additions & 0 deletions app/overlays/internal_ci/intel_adsp_ace40_nvls.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Board specific internal CI settings for nvls, automatically
# included after internal_ci_overlay.conf. See internal_ci_overlay.conf.

# Retain FW context in IMR over D3
CONFIG_ADSP_IMR_CONTEXT_SAVE=y

# Default runtime log level ERROR
CONFIG_LOG_RUNTIME_DEFAULT_LEVEL=1
14 changes: 7 additions & 7 deletions src/include/sof/userspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ easy to maintain.

## Why this exists

SOF supports several privilege configurations. On PTL (`intel_adsp_ace30_ptl`) the board
config enables `CONFIG_USERSPACE` and `CONFIG_SOF_USERSPACE_PROXY`, running individual audio
modules in isolated user threads via the proxy container. For Linux builds
(`os_linux_overlay.conf`), `app/CMakeLists.txt` automatically includes
`app/ll_userspace_overlay.conf` on Intel ACE3.x and newer targets (e.g. ptl, wcl, nvl), which
additionally enables `CONFIG_SOF_USERSPACE_LL` so the entire LL pipeline and the module-facing
IPC run in user threads. This is the standard Linux build configuration for these targets.
SOF supports several privilege configurations. The default build targets the Linux SOF
driver: on Intel ACE3.x and newer targets (e.g. ptl, wcl, nvl), `app/CMakeLists.txt`
automatically includes `app/ll_userspace_overlay.conf`, which enables `CONFIG_USERSPACE` and
`CONFIG_SOF_USERSPACE_LL` so the entire LL pipeline and the module-facing IPC run in user
threads. With `app/internal_ci_overlay.conf` the LL userspace overlay is not included and, on
PTL (`intel_adsp_ace30_ptl`), `CONFIG_SOF_USERSPACE_PROXY` is enabled instead, running
individual audio modules in isolated user threads via the proxy container.
The kernel keeps the OS/HAL, boot, drivers, and the syscall validators in both cases.

The privilege boundary is real, but nothing in the source *layout* signals which side a given
Expand Down
5 changes: 3 additions & 2 deletions zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,12 @@ config VIRTUAL_HEAP_EXTENDED
bool "Extend the Virtual Heap configuration with additional buffers"
depends on MM_DRV_INTEL_ADSP_MTL_TLB
depends on VIRTUAL_HEAP
default y
default y if !SOF_OS_LINUX_COMPAT_PRIORITY
help
Enable additional Virtual Heap buffers. Some configurations need this
while others need the memory for other purposes, e.g. for the virtual
page / virtual region storage.
page / virtual region storage. Linux builds do not need the
additional buffers.

config SOF_ZEPHYR_VIRTUAL_HEAP_REGION_SIZE
hex "Size in bytes of virtual memory region for virtual heap shared for all cores"
Expand Down
1 change: 1 addition & 0 deletions zephyr/test/userspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Building for Intel Panther Lake:
./scripts/xtensa-build-zephyr.py --cmake-args=-DCONFIG_SOF_BOOT_TEST_STANDALONE=y \
--cmake-args=-DCONFIG_SOF_USERSPACE_INTERFACE_DMA=y \
--cmake-args=-DCONFIG_SOF_USERSPACE_LL=y \
-o app/internal_ci_overlay.conf \
-o app/overlays/ptl/userspace_overlay.conf -o app/winconsole_overlay.conf ptl

Running test:
Expand Down
Loading