Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ee8217a
arch: move src/arch to src/kernel/arch
lrgirdwo Nov 7, 2026
7e6bf42
platform: move src/platform to src/kernel/platform
lrgirdwo Nov 7, 2026
d377fa7
zephyr: build all of src/kernel into sof_kernel
lrgirdwo Nov 7, 2026
6416a3d
logging: move the SOF probe log backend options to src/kernel/logging
lrgirdwo Nov 7, 2026
91d93ed
trace: print host build traces without CONFIG_TRACE
lrgirdwo Nov 7, 2026
4104527
trace: remove the SOF DMA trace
lrgirdwo Nov 7, 2026
99a6202
docs: kernel-only code is now all in src/kernel
lrgirdwo Nov 7, 2026
d2af124
ipc: split the kernel part of ipc-common.c into src/kernel/ipc
lrgirdwo Nov 7, 2026
74bf7bd
ipc4: split the kernel part of handler-user.c into src/kernel/ipc/ipc4
lrgirdwo Nov 7, 2026
ed5de8c
ipc4: split the kernel part of helper.c into src/kernel/ipc/ipc4
lrgirdwo Nov 7, 2026
83761fe
schedule: split the kernel part of zephyr_domain.c into src/kernel/sc…
lrgirdwo Nov 8, 2026
f04bb22
schedule: split the kernel part of zephyr_ll.c into src/kernel/schedule
lrgirdwo Nov 8, 2026
c1e66b9
schedule: move the DP scheduler private header to src/include
lrgirdwo Nov 8, 2026
3b03c51
schedule: split the kernel part of zephyr_dp_schedule.c into src/kern…
lrgirdwo Nov 8, 2026
de1f89c
schedule: split the kernel part of zephyr_dp_schedule_thread.c into s…
lrgirdwo Nov 8, 2026
b1ca6ca
schedule: split the kernel part of zephyr_dp_schedule_application.c i…
lrgirdwo Nov 8, 2026
2d1547b
schedule: move the TWB scheduler to src/kernel/schedule
lrgirdwo Nov 8, 2026
24dad1c
schedule: split the scheduler registration out of schedule.c
lrgirdwo Nov 8, 2026
477d8ee
docs: schedule: describe the kernel parts of the schedulers
lrgirdwo Nov 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 5 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ memory-partition markers and Kconfig hierarchy are documented in
[`src/include/sof/userspace/README.md`](src/include/sof/userspace/README.md). When adding or
moving code, follow it:

* **Place code in the right tier.** OS/HAL/boot/inter-core → a kernel-only directory
(`kernel/`, which is built into the `sof_kernel` library, and the directories not yet
moved there: `arch/`, `platform/`, `trace/`); audio
application logic → `audio/`; reusable pure code → a shared-library directory (`lib/`,
`math/`, `module/`) kept free of privileged operations. Each top-level directory's
`README.md` states its tier in a "Runs in:" banner — keep it accurate.
* **Place code in the right tier.** OS/HAL/boot/inter-core → the kernel-only directory
(`kernel/`, which is built into the `sof_kernel` library); audio application logic →
`audio/`; reusable pure code → a shared-library directory (`lib/`, `math/`, `module/`) kept
free of privileged operations. Each top-level directory's `README.md` states its tier in a
"Runs in:" banner — keep it accurate.
* **Cross the boundary only via a syscall.** Add a `__syscall` declaration, put the `z_vrfy_`
validator in the boundary tier (preferably `zephyr/syscall/<subsystem>.c`), validate every
user-supplied argument, and add the call to
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,6 @@ endif()

if(BUILD_UNIT_TESTS)
enable_testing()
add_subdirectory(src/arch/${ARCH})
add_subdirectory(src/kernel/arch/${ARCH})
add_subdirectory(test)
endif()
6 changes: 3 additions & 3 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ src/audio/module_adapter/* @ranj063 @jxstelter
src/audio/google/* @thesofproject/google

# platforms
src/platform/imx8/** @dbaluta
src/platform/amd/** @bhiregoudar @sunilkumardommati
src/platform/mtk/** @yaochunhung @kuanhsuncheng
src/kernel/platform/imx8/** @dbaluta
src/kernel/platform/amd/** @bhiregoudar @sunilkumardommati
src/kernel/platform/mtk/** @yaochunhung @kuanhsuncheng

# drivers
src/drivers/intel/dmic.c @singalsu
Expand Down
2 changes: 1 addition & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ target_sources(app PRIVATE
)

zephyr_library_include_directories(app PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../src/arch/xtensa/include
${CMAKE_CURRENT_SOURCE_DIR}/../src/kernel/arch/xtensa/include
${CMAKE_CURRENT_SOURCE_DIR}/../src/include
)
1 change: 0 additions & 1 deletion app/boards/acp_7_0_adsp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ CONFIG_DMA_AMD_ACP_TDM=y
CONFIG_DAI_AMD_TDM=y
CONFIG_AMS=n
CONFIG_WRAP_ACTUAL_POSITION=y
CONFIG_TRACE=n
CONFIG_COMP_VOLUME=y
CONFIG_COMP_SRC=n
CONFIG_COMP_FIR=n
Expand Down
1 change: 0 additions & 1 deletion app/boards/acp_7_x_adsp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ CONFIG_DAI_AMD_SDW=y
CONFIG_DAI_AMD_TDM=y
CONFIG_AMS=n
CONFIG_WRAP_ACTUAL_POSITION=y
CONFIG_TRACE=n
CONFIG_COMP_VOLUME=y
CONFIG_COMP_SRC=n
CONFIG_COMP_FIR=n
Expand Down
1 change: 0 additions & 1 deletion app/boards/imx8mp_evk_mimx8ml8_adsp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ CONFIG_KPB_FORCE_COPY_TYPE_NORMAL=n
CONFIG_DMA=y
CONFIG_DMA_NXP_SDMA=y
CONFIG_DAI_NXP_MICFIL=y
CONFIG_TRACE=n
CONFIG_SHARED_INTERRUPTS=y
CONFIG_ZEPHYR_NATIVE_DRIVERS=y
CONFIG_SAI_HAS_MCLK_CONFIG_OPTION=y
Expand Down
1 change: 0 additions & 1 deletion app/boards/intel_adsp_ace40_nvl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ CONFIG_LIBRARY_BUILD_LIB=y
CONFIG_LIBRARY_DEFAULT_MODULAR=y

# SOF / logging
CONFIG_TRACE=n
CONFIG_SOF_LOG_LEVEL_INF=y

# Zephyr / OS features
Expand Down
1 change: 0 additions & 1 deletion app/boards/intel_adsp_ace40_nvls.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ CONFIG_LIBRARY_BUILD_LIB=y
CONFIG_LIBRARY_DEFAULT_MODULAR=y

# SOF / logging
CONFIG_TRACE=n
CONFIG_SOF_LOG_LEVEL_INF=y

# Zephyr / OS features
Expand Down
1 change: 0 additions & 1 deletion app/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ CONFIG_HAVE_AGENT=n
CONFIG_MINIMAL_LIBC=y

CONFIG_ZEPHYR_LOG=y
CONFIG_TRACE=n
CONFIG_LOG=y
CONFIG_LOG_PRINTK=y
# Log processing is offloaded to a low-priority thread.
Expand Down
1 change: 0 additions & 1 deletion doc/sof.doxygen.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ PREDEFINED = "__attribute__(x)= " \
"CONFIG_FORMAT_S16LE=1" \
"CONFIG_FORMAT_S32LE=1" \
"CONFIG_FORMAT_S24LE=1" \
"CONFIG_TRACE=1" \
"CONFIG_IPC4=1" \
"CONFIG_IPC3=1" \
"CONFIG_IPC_MAJOR_4=1" \
Expand Down
6 changes: 0 additions & 6 deletions posix/include/rtos/sof.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ struct clock_info;
struct comp_driver_list;
struct dai_info;
struct dma_info;
struct dma_trace_data;
struct ipc;
struct ll_schedule_domain;
struct mm;
Expand All @@ -27,7 +26,6 @@ struct notify_data;
struct pm_runtime_data;
struct sa;
struct timer;
struct trace;
struct pipeline_posn;
struct probe_pdata;

Expand All @@ -49,11 +47,7 @@ struct sof {
/* system agent */
struct sa *sa;

/* DMA for Trace*/
struct dma_trace_data *dmat;

/* generic trace structure */
struct trace *trace;

/* platform clock information */
struct clock_info *clocks;
Expand Down
2 changes: 1 addition & 1 deletion scripts/cmake/defconfigs.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause

# Looks for defconfig files in arch directories where kconfig.cmake looks too.
set(DEFCONFIGS_DIRECTORY "${PROJECT_SOURCE_DIR}/src/arch/${ARCH}/configs")
set(DEFCONFIGS_DIRECTORY "${PROJECT_SOURCE_DIR}/src/kernel/arch/${ARCH}/configs")
file(GLOB DEFCONFIG_PATHS "${DEFCONFIGS_DIRECTORY}/*_defconfig")

# Adds dependency on defconfigs directory
Expand Down
6 changes: 3 additions & 3 deletions scripts/cmake/kconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ if(NOT INIT_CONFIG_found)
set(INIT_CONFIG "initial.config" CACHE STRING "Initial .config file")

# - ".' is the top source directory.
# - "src/arch/host/configs" holds the library (testbench) configurations
# - "src/kernel/arch/host/configs" holds the library (testbench) configurations
# and is also used by defconfigs.cmake.
# - "test/cmocka/configs" holds the unit test configurations.
# - First found wins.
# - If two directories ever use the same defconfig name then a full
# path must be used, e.g.: -DINIT_CONFIG=test/cmocka/configs/collision_defconfig

set(init_config_search_list "." "src/arch/host/configs" "test/cmocka/configs")
set(init_config_search_list "." "src/kernel/arch/host/configs" "test/cmocka/configs")

find_file(INIT_CONFIG_found
NAMES ${INIT_CONFIG}
Expand All @@ -46,7 +46,7 @@ message(FATAL_ERROR
"Initial configuration missing, no ${INIT_CONFIG} found. "
"Provide a ${PROJECT_SOURCE_DIR}/initial.config file or specify some "
"other -DINIT_CONFIG=location relative to '${PROJECT_SOURCE_DIR}/' or "
"'${PROJECT_SOURCE_DIR}/src/arch/*/configs/'"
"'${PROJECT_SOURCE_DIR}/src/kernel/arch/*/configs/'"
)
endif()

Expand Down
3 changes: 1 addition & 2 deletions scripts/kernel_user_partition.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ src/include/sof/drivers/*
src/include/sof/platform.h
src/include/sof/llext_manager.h
src/include/sof/ipc/driver.h
src/include/sof/trace/dma-trace.h
src/include/sof/lib/agent.h
src/include/sof/lib/cpu-clk-manager.h
src/include/sof/lib/mailbox.h
src/include/sof/lib/perf_cnt.h
src/include/sof/lib/watchdog.h
src/platform/*
src/kernel/platform/*
zephyr/include/rtos/clk.h
zephyr/include/rtos/idc.h
zephyr/include/rtos/interrupt.h
Expand Down
2 changes: 1 addition & 1 deletion scripts/rebuild-testbench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ For temporary, interactive Kconfiguration use:

$BUILD_BACKEND -C $TESTBENCH_DIR/$BUILD_DIR_NAME/sof_ep/build/ menuconfig

Permanent configuration is "src/arch/host/configs/library_defconfig".
Permanent configuration is "src/kernel/arch/host/configs/library_defconfig".

For instant, incremental build:

Expand Down
5 changes: 0 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause

add_subdirectory(platform)
add_subdirectory(arch)
add_subdirectory(ipc)
add_subdirectory(audio)
add_subdirectory(lib)
Expand All @@ -14,6 +12,3 @@ endif()

add_subdirectory(kernel)

if (CONFIG_TRACE)
add_subdirectory(trace)
endif()
6 changes: 2 additions & 4 deletions src/Kconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# SPDX-License-Identifier: BSD-3-Clause

rsource "arch/Kconfig"
rsource "kernel/arch/Kconfig"

rsource "platform/Kconfig"
rsource "kernel/platform/Kconfig"

rsource "audio/Kconfig"

rsource "trace/Kconfig"

rsource "samples/Kconfig"

rsource "schedule/Kconfig"
Expand Down
8 changes: 0 additions & 8 deletions src/audio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,6 @@ config PCM_REMAPPING_CONVERTERS
Enable conversion functions that perform both format conversion
and channel remapping simultaneously.

config TRACE_CHANNEL
int "TRACE DMA Channel configuration"
default 0
help
This option is used for custom configuration of trace dma channel other
than zero dma channel.Define macro DMA_TRACE_CHANNEL in platform to
configure the required channel number.

config WRAP_ACTUAL_POSITION
bool "Buffer wrapping"
help
Expand Down
2 changes: 1 addition & 1 deletion src/audio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ modules in user context.

When adding a component here, keep it inside the application tier: allocate through the module
allocation syscalls (`mod_*`), mark any globals shared with the kernel using the partition
markers, and never call kernel-only subsystems (`kernel/drivers/`, `platform/`, `kernel/idc/`)
markers, and never call kernel-only subsystems (`kernel/drivers/`, `kernel/platform/`, `kernel/idc/`)
directly.
39 changes: 0 additions & 39 deletions src/audio/module_adapter/module/waves/waves.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,31 +432,6 @@ static int waves_effect_revision(struct processing_module *mod)
return -EINVAL;
}

#if CONFIG_TRACEV
if (revision_len) {
const uint32_t *ptr = (uint32_t *)revision;
uint32_t len = revision_len / sizeof(uint32_t);
uint32_t idx = 0;

/* get requests from codec_adapter are not supported
* printing strings is not supported
* so dumping revision string to trace log as ascii values
* if simply write a for loop here then depending on trace filtering settings
* some parts of revision might not be printed - this is highly unwanted
*/
dump_hex(ptr, idx, len);
dump_hex(ptr, idx, len);
dump_hex(ptr, idx, len);
dump_hex(ptr, idx, len);
dump_hex(ptr, idx, len);
dump_hex(ptr, idx, len);
dump_hex(ptr, idx, len);
dump_hex(ptr, idx, len);
dump_hex(ptr, idx, len);
dump_hex(ptr, idx, len);
}
#endif

comp_info(dev, "done");
return 0;
}
Expand Down Expand Up @@ -528,20 +503,6 @@ static int waves_effect_message(struct processing_module *mod, void *data, uint3
}
}

#if CONFIG_TRACEV
/* at time of writing codec adapter does not support getting something from codec
* so response is stored to internal structure and dumped into trace messages
*/
if (response_size) {
uint32_t idx;
uint32_t len = response_size / sizeof(uint32_t);
const uint32_t *ptr = (uint32_t *)waves_codec->response;

for (idx = 0; idx < len; )
dump_hex(ptr, idx, len);
}
#endif

return 0;
}

Expand Down
4 changes: 0 additions & 4 deletions src/debug/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ void panic_dump(uint32_t p, struct sof_ipc_panic_info *panic_info,
dump_panicinfo(ext_offset, panic_info);
ext_offset += sizeof(struct sof_ipc_panic_info);

#if CONFIG_TRACE
trace_flush_dma_to_mbox();
#endif

/* Dump stack frames and override panic code 'p' if ext_offset is
* off stack_limit. Find stack_ptr.
*/
Expand Down
70 changes: 70 additions & 0 deletions src/include/ipc4/handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
#ifndef __SOF_IPC4_HANDLER_H__
#define __SOF_IPC4_HANDLER_H__

struct comp_dev;
struct comp_driver;
struct ipc4_message_request;
struct ipc4_pipeline_set_state;

/**
* \brief Processes an IPC4 userspace module message.
Expand Down Expand Up @@ -69,6 +72,73 @@ int ipc4_user_process_glb_message(struct ipc4_message_request *ipc4, struct ipc_
*/
int ipc4_set_pipeline_state(struct ipc4_message_request *ipc4);

/**
* \brief Get the first pipeline ID of a SET_PIPELINE_STATE message.
* \ingroup ipc4_envelope_api
* @param[in] ipc4 IPC4 message request structure.
* @param[in] state Copy of the SET_PIPELINE_STATE message header.
* @param[out] ppl_id Receives the pipeline ID array of a multi-pipeline
* message, NULL otherwise (may be NULL).
* @param[out] ppl_count Receives the number of pipelines (may be NULL).
* @return The first pipeline ID, or a negative error code.
*/
int ipc4_pipeline_id_get(struct ipc4_message_request *ipc4,
struct ipc4_pipeline_set_state *state,
const uint32_t **ppl_id, unsigned int *ppl_count);

/**
* \brief Copy the kcontrol payload header of a LARGE_CONFIG_GET from the hostbox.
* \ingroup ipc4_envelope_api
* @param[in] dev Target component, NULL for the base firmware.
* @param[in] param_id Large config parameter ID.
* @param[out] data_out Reply data buffer.
* @param[in] data_size Size of the payload in the hostbox.
*/
void ipc4_prepare_for_kcontrol_get(struct comp_dev *dev, uint8_t param_id,
char *data_out, uint32_t data_size);

/**
* \brief Process a vendor config LARGE_CONFIG_GET.
* \ingroup ipc4_envelope_api
* @param[in] dev Target component, NULL for the base firmware.
* @param[in] drv Component driver.
* @param[in] init_block True for the first block.
* @param[in] final_block True for the last block.
* @param[in,out] data_off_size Payload size in, reply data size out.
* @param[out] data_out Reply data buffer.
* @param[in] data_in Request payload.
* @return IPC4 status code (IPC4_SUCCESS on success).
*/
int ipc4_get_vendor_config_module_instance(struct comp_dev *dev,
const struct comp_driver *drv,
bool init_block,
bool final_block,
uint32_t *data_off_size,
char *data_out,
const char *data_in);

/**
* \brief Process a vendor config LARGE_CONFIG_SET.
* \ingroup ipc4_envelope_api
* @param[in] dev Target component, NULL for the base firmware.
* @param[in] drv Component driver.
* @param[in] module_id Module ID, for error messages.
* @param[in] instance_id Instance ID, for error messages.
* @param[in] init_block True for the first block.
* @param[in] final_block True for the last block.
* @param[in] data_off_size Payload size.
* @param[in] data Request payload.
* @return IPC4 status code (IPC4_SUCCESS on success).
*/
int ipc4_set_vendor_config_module_instance(struct comp_dev *dev,
const struct comp_driver *drv,
uint32_t module_id,
uint32_t instance_id,
bool init_block,
bool final_block,
uint32_t data_off_size,
const char *data);

/**
* \brief Complete an IPC compound message transaction and signal waiting threads.
* \ingroup ipc4_envelope_api
Expand Down
Loading
Loading