Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4355c7b
zephyr: Kconfig: add SOF shell commands menu
lrgirdwo May 4, 2026
1dc101d
zephyr/shell: add DSP status commands and fix heap_usage
lrgirdwo May 4, 2026
c638209
zephyr/shell: add module list command with manifest lookup
lrgirdwo May 4, 2026
6827be9
zephyr/shell: add IPC4 pipeline construction commands
lrgirdwo May 4, 2026
0d27928
zephyr/shell: add Intel ADSP MTL TLB debug commands
lrgirdwo May 4, 2026
f26edcc
zephyr/shell: add Xtensa hardware DTLB debug commands (PTL)
lrgirdwo May 4, 2026
790fdb8
zephyr/shell: add interactive llext module load command
lrgirdwo May 6, 2026
55c6b54
shell: add llext_list and llext_purge commands
lrgirdwo May 6, 2026
f057d39
shell: add core_on and core_off commands for secondary core power con…
lrgirdwo May 6, 2026
c68a8f4
shell: add support to qemu for shell
lrgirdwo Mar 4, 2026
27c2a36
vregion: add shell info dump for vpages and vregions
lrgirdwo May 7, 2026
0d62fdb
zephyr/shell: add vpage/vregion/pipeline/module info commands
lrgirdwo May 7, 2026
ea99133
ipc: add lightweight RX/TX statistics and shell ipc_stats/ipc_last co…
lrgirdwo May 7, 2026
bd63bf7
zephyr/shell: add buffer_list and buffer_info commands
lrgirdwo May 7, 2026
a985139
schedule: add scheduler_dump_tasks op and shell sched_tasks/sched_load
lrgirdwo May 7, 2026
eb0aa1f
shell: add log_status and mtrace_dump commands
lrgirdwo May 7, 2026
a8ba296
shell: add mailbox_hex and dbgwin_dump commands
lrgirdwo May 7, 2026
0e3f46a
shell: add perf_status command for SOF telemetry
lrgirdwo May 7, 2026
e84f80e
shell: add dai_list and dma_status commands
lrgirdwo May 7, 2026
f106c1e
shell: add kctl_list command
lrgirdwo May 7, 2026
c15d9d5
zephyr/shell: include module name in mod command output
lrgirdwo May 12, 2026
08cf307
ipc: fix stats path safety in zephyr IPC hooks
lrgirdwo May 12, 2026
714a448
zephyr/shell: document all missing shell commands in shell.md
lrgirdwo May 12, 2026
90d1f37
zephyr/shell: add hierarchical 'sof dai list' command
lrgirdwo May 13, 2026
6cdda77
zephyr/shell: add Zephyr version and build timestamp to sof version
lrgirdwo May 13, 2026
3148985
zephyr/shell: fix module_list and clock_status output
lrgirdwo May 13, 2026
2c85521
shell: add 'sof llext symbols' command
lrgirdwo May 15, 2026
eeda9a1
llext: split VMA accumulator for openmodule vs standalone ELFs
lrgirdwo May 19, 2026
315697c
mtl: enable all openmodule-capable components as llext =m
lrgirdwo May 19, 2026
6e0c754
shell: fix 'sof llext list' showing blank module names
lrgirdwo May 19, 2026
d540aa6
llext_manager: zero-initialize mod_manifest on library load
lrgirdwo May 19, 2026
a487502
scripts: install UUID.bin symlinks for openmodule library aliases
lrgirdwo May 19, 2026
96fd5e6
lib_manager,module_adapter: add debug traces for openmodule loading
lrgirdwo May 19, 2026
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
6 changes: 4 additions & 2 deletions app/configs/mtl/modules.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
CONFIG_DTS_CODEC=m
CONFIG_SAMPLE_SMART_AMP=m
CONFIG_COMP_STUBS=y
# All openmodules-capable components built as =m (openmodules llext)
# Standalone llexts (DTS, RTNR, IGO_NR, Google CTC/RTC, tester) remain separate
CONFIG_COMP_MIXIN_MIXOUT=m
CONFIG_COMP_FIR=m
CONFIG_COMP_IIR=m
Expand All @@ -11,9 +13,9 @@ CONFIG_COMP_SRC=m
CONFIG_COMP_ARIA=m
CONFIG_COMP_ASRC=m
CONFIG_COMP_MFCC=m
CONFIG_COMP_RTNR=m
CONFIG_COMP_RTNR=y
CONFIG_COMP_TDFB=m
CONFIG_COMP_IGO_NR=m
CONFIG_COMP_IGO_NR=y
CONFIG_COMP_VOLUME=m
CONFIG_COMP_DCBLOCK=m
CONFIG_COMP_CROSSOVER=m
Expand Down
3 changes: 3 additions & 0 deletions app/no_auth_llext_overlay.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Disable library authentication for testing on hardware without OTC key support
# This allows loading community-signed llext libraries without CSE authentication
CONFIG_LIBRARY_AUTH_SUPPORT=n
10 changes: 9 additions & 1 deletion app/shell_overlay.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CONFIG_SHELL=y
CONFIG_SHELL_HELP=y
CONFIG_SHELL_CMDS=y
CONFIG_SHELL_LOG_BACKEND=n
CONFIG_SHELL_LOG_BACKEND=y
CONFIG_SHELL_AUTOSTART=y

CONFIG_SHELL_BACKEND_ADSP_MEMORY_WINDOW=y
Expand All @@ -18,3 +18,11 @@ CONFIG_WINSTREAM_CONSOLE=y
# these must be disabled in order to use the console.
CONFIG_SOF_TELEMETRY_PERFORMANCE_MEASUREMENTS=n
CONFIG_SOF_TELEMETRY_IO_PERFORMANCE_MEASUREMENTS=n
CONFIG_SOF_SHELL_LLEXT_LOAD=y
CONFIG_SOF_SHELL_LLEXT_LIST=y
CONFIG_SOF_SHELL_LLEXT_PURGE=y
CONFIG_SOF_SHELL_CORE_POWER=y

# Disable REBOOT since qemu_xtensa does not implement sys_arch_reboot
CONFIG_REBOOT=n
CONFIG_SHELL_PRINTF_BUFF_SIZE=256
4 changes: 4 additions & 0 deletions app/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ void test_main(void)
sof_app_main();
#if CONFIG_SOF_BOOT_TEST && defined(QEMU_BOOT_TESTS)
sof_run_boot_tests();
#ifdef CONFIG_SHELL
k_sleep(K_FOREVER);
#else
qemu_xtensa_exit(0);
#endif
#endif
}
#else
int main(void)
Expand Down
20 changes: 20 additions & 0 deletions scripts/sof-qemu-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ def main():

crashed = check_for_crash(full_output)

shell_enabled = False
config_file = os.path.join(build_dir, "zephyr", ".config")
if not os.path.isfile(config_file):
config_file = os.path.join("zephyr", ".config")

if os.path.isfile(config_file):
with open(config_file, "r") as f:
for line in f:
if line.strip() == "CONFIG_SHELL=y":
shell_enabled = True
break

if crashed:
print("\n[sof-qemu-run] Detected crash signature in standard output!")
# Stop QEMU if it's still running
Expand All @@ -156,6 +168,14 @@ def main():
child.close(force=True)

run_sof_crash_decode(build_dir, full_output)
elif shell_enabled:
print("\n[sof-qemu-run] Shell is enabled. Entering interactive mode...")
if child.isalive():
try:
child.interact()
except Exception as e:
print(f"Error during interaction: {e}")
child.close(force=True)
else:
print("\n[sof-qemu-run] No crash detected. Interacting with QEMU Monitor to grab registers...")

Expand Down
23 changes: 20 additions & 3 deletions scripts/sof-qemu-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,25 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2026 Intel Corporation. All rights reserved.

# Define the build directory from the first argument (or default)
BUILD_DIR="${1:-build}"
# Parse arguments to determine the build directory
BUILD_DIR="build"

while [[ $# -gt 0 ]]; do
case "$1" in
--build-dir)
BUILD_DIR="$2"
shift 2
;;
-*)
echo "Unknown option $1"
exit 1
;;
*)
BUILD_DIR="$1"
shift
;;
esac
done

# Find and source the zephyr environment script, typically via the sof-venv wrapper
# or directly if running in a known zephyrproject layout.
Expand All @@ -24,5 +41,5 @@ source ${VENV_DIR}/bin/activate
cd "${BUILD_DIR}" || exit 1

# Finally run the python script which will now correctly inherit 'west' from the sourced environment.
python3 "${SCRIPT_DIR}/sof-qemu-run.py" --build-dir "${BUILD_DIR}"
python3 "${SCRIPT_DIR}/sof-qemu-run.py" --build-dir .

17 changes: 17 additions & 0 deletions scripts/xtensa-build-zephyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,23 @@ def install_lib(platform, sof_output_dir, abs_build_dir, platform_wconfig):
symlink_or_copy(lib_install_dir, lib_name,
lib_dir, alias_libname)

# Create UUID.bin symlinks in sof-ipc4-lib pointing to the grouped .ri
if key in lib_uuids:
for uuid in lib_uuids[key]:
symlink_or_copy(lib_install_dir, lib_name,
sof_lib_dir, uuid + '.bin')
for p_alias in platform_configs[platform].aliases:
alias_lib_dir = sof_output_dir / '..' / 'sof-ipc4-lib' / p_alias
if args.key_type_subdir != "none":
alias_lib_dir = alias_lib_dir / args.key_type_subdir
alias_lib_dir.mkdir(parents=True, exist_ok=True)
alias_libname = ''.join(['sof-', p_alias, '-', key, '.ri'])
alias_lib_install_dir = sof_output_dir / p_alias
if args.key_type_subdir != "none":
alias_lib_install_dir = alias_lib_install_dir / args.key_type_subdir
symlink_or_copy(alias_lib_install_dir, alias_libname,
alias_lib_dir, uuid + '.bin')

def install_platform(platform, sof_output_dir, platf_build_environ, platform_wconfig):

# Keep in sync with caller
Expand Down
4 changes: 4 additions & 0 deletions src/audio/module_adapter/module_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ struct comp_dev *module_adapter_new_ext(const struct comp_driver *drv,
#if CONFIG_IPC_MAJOR_4
dst->ext_data = &ext_data;
#endif
comp_cl_err(drv, "DBG adapter_new: extended_init=%d spec.size=%zu",
config->ipc_extended_init, spec.size);
ret = module_adapter_init_data(dev, dst, config, &spec);
if (ret) {
comp_err(dev, "%d: module init data failed",
Expand Down Expand Up @@ -304,6 +306,8 @@ struct comp_dev *module_adapter_new_ext(const struct comp_driver *drv,
#endif

/* Init processing module */
comp_cl_err(drv, "DBG adapter_new: calling module_init, interface->init=%p",
interface->init);
ret = module_init(mod);
if (ret) {
comp_err(dev, "%d: module initialization failed",
Expand Down
3 changes: 3 additions & 0 deletions src/audio/module_adapter/module_adapter_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ int module_adapter_init_data(struct comp_dev *dev,
assert(dev->drv->type == SOF_COMP_MODULE_ADAPTER);
cfg = (const struct ipc4_base_module_extended_cfg *)args->data;

comp_err(dev, "DBG init_data: cfgsz=%zu cfg=%p base_cfg_sz=%zu full_cfg_sz=%zu",
cfgsz, cfg, sizeof(cfg->base_cfg), sizeof(*cfg));

if (cfg == NULL)
return -EINVAL;
if (cfgsz < sizeof(cfg->base_cfg))
Expand Down
60 changes: 60 additions & 0 deletions src/include/sof/ipc/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,66 @@ struct ipc_cmd_hdr *mailbox_validate(void);
*/
void ipc_cmd(struct ipc_cmd_hdr *_hdr);

/**
* \brief Lightweight IPC counters and last-message snapshot for diagnostics.
*
* Populated by the platform RX/TX hooks. Safe to read from any context;
* fields are 32-bit and updated under @ref ipc::lock when written.
*/
struct ipc_stats {
uint32_t rx_count; /**< total IPC messages received */
uint32_t tx_count; /**< total IPC messages sent */
uint32_t tx_direct_count; /**< messages sent via the direct path */
uint32_t rx_errors; /**< RX path errors / unknown targets */
uint32_t tx_errors; /**< TX path send failures */

/* last RX */
uint32_t last_rx_pri;
uint32_t last_rx_ext;
uint64_t last_rx_time; /**< platform cycles */

/* last TX */
uint32_t last_tx_pri;
uint32_t last_tx_ext;
uint64_t last_tx_time;
};

/**
* \brief Record an inbound IPC for the stats snapshot.
*
* @param[in] pri Primary header word.
* @param[in] ext Extension header word.
*/
void ipc_stats_record_rx(uint32_t pri, uint32_t ext);

/**
* \brief Record an outbound IPC for the stats snapshot.
*
* @param[in] pri Primary header word.
* @param[in] ext Extension header word.
* @param[in] direct True if the message used the "direct" send path.
* @param[in] err Send result (negative on error).
*/
void ipc_stats_record_tx(uint32_t pri, uint32_t ext, bool direct, int err);

/**
* \brief Increment the RX error counter without updating the last-message
* snapshot. Used for unknown targets / dispatch failures.
*/
void ipc_stats_inc_rx_error(void);

/**
* \brief Read a copy of the current IPC statistics.
*
* @param[out] out Destination snapshot.
*/
void ipc_stats_get(struct ipc_stats *out);

/**
* \brief Reset all IPC statistics counters.
*/
void ipc_stats_reset(void);

/**
* \brief IPC message to be processed on other core.
* @param[in] core Core id for IPC to be processed on.
Expand Down
10 changes: 10 additions & 0 deletions src/include/sof/lib/vregion.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <stddef.h>

struct shell;

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -123,6 +125,13 @@ void vregion_info(struct vregion *vr);
*/
void vregion_mem_info(struct vregion *vr, size_t *size, uintptr_t *start);

/**
* @brief Dump all virtual regions info
*
* @param[in] sh Shell context to print to.
*/
void vregion_info_all(const struct shell *sh);

#else /* CONFIG_SOF_VREGIONS */

#include <rtos/alloc.h>
Expand Down Expand Up @@ -176,6 +185,7 @@ static inline void vregion_mem_info(struct vregion *vr, size_t *size, uintptr_t
if (size)
*size = 0;
}
static inline void vregion_info_all(const struct shell *sh) {}

#endif /* CONFIG_SOF_VREGIONS */

Expand Down
15 changes: 15 additions & 0 deletions src/include/sof/lib_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,19 @@ void lib_notif_msg_send(struct ipc_msg *msg);
*/
void lib_notif_msg_clean(bool leave_one_handle);

/*
* \brief Purge (free) a loadable library from IMR/DRAM storage
*
* param[in] lib_id - library slot id (1 .. LIB_MANAGER_MAX_LIBS-1)
*
* Removes the library binary from DRAM/IMR and releases the
* lib_manager_mod_ctx entry so that the slot can be reused by a
* future LOAD_LIBRARY call. Returns -EBUSY if any module file from
* the library is still mapped in SRAM (i.e., has active instances
* or is still linked as a dependency).
*
* Return: 0 on success, negative errno on error.
*/
int lib_manager_purge_library(uint32_t lib_id);

#endif /* __SOF_LIB_MANAGER_H__ */
15 changes: 15 additions & 0 deletions src/include/sof/schedule/schedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,21 @@ struct scheduler_ops {
* This operation is optional.
*/
int (*scheduler_restore)(void *data);

/**
* Iterate over all tasks owned by the scheduler and invoke @p cb on each.
* The scheduler is responsible for taking its own lock around the walk.
* @param data Private data of selected scheduler.
* @param cb Callback called once per task; must not block.
* @param ctx Opaque context passed to @p cb.
*
* This operation is optional and exists only for diagnostics
* (e.g. shell commands). Schedulers that do not implement it are
* silently skipped by enumeration tools.
*/
void (*scheduler_dump_tasks)(void *data,
void (*cb)(struct task *task, void *ctx),
void *ctx);
};

/** \brief Holds information about scheduler. */
Expand Down
Loading
Loading