Skip to content
Merged
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
129 changes: 129 additions & 0 deletions app/boards/native_sim.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2026 Intel Corporation. All rights reserved.
*
* Virtual DAI instances for the native_sim build.
*
* native_sim has no audio hardware. Without any registered DAI device
* dai_get_device() never matches and every DAI gateway request is rejected
* before the generic SOF DAI code runs, which hides those paths from the IPC
* fuzzer. These nodes describe the virtual links handled by
* src/kernel/platform/posix/dai_virtual.c (enabled with CONFIG_DAI_POSIX).
*
* The indices below mirror a plausible Intel platform so that a host request
* carrying a realistic gateway node id finds a device.
*/

/ {
posix_dai_ssp0: posix-dai-ssp0 {
compatible = "zephyr,posix-dai";
dai-type = "ssp";
dai-index = <0>;
status = "okay";
};

posix_dai_ssp1: posix-dai-ssp1 {
compatible = "zephyr,posix-dai";
dai-type = "ssp";
dai-index = <1>;
status = "okay";
};

posix_dai_ssp2: posix-dai-ssp2 {
compatible = "zephyr,posix-dai";
dai-type = "ssp";
dai-index = <2>;
status = "okay";
};

posix_dai_ssp3: posix-dai-ssp3 {
compatible = "zephyr,posix-dai";
dai-type = "ssp";
dai-index = <3>;
status = "okay";
};

posix_dai_dmic0: posix-dai-dmic0 {
compatible = "zephyr,posix-dai";
dai-type = "dmic";
dai-index = <0>;
status = "okay";
};

posix_dai_dmic1: posix-dai-dmic1 {
compatible = "zephyr,posix-dai";
dai-type = "dmic";
dai-index = <1>;
status = "okay";
};

posix_dai_hda0: posix-dai-hda0 {
compatible = "zephyr,posix-dai";
dai-type = "hda";
dai-index = <0>;
status = "okay";
};

posix_dai_hda1: posix-dai-hda1 {
compatible = "zephyr,posix-dai";
dai-type = "hda";
dai-index = <1>;
status = "okay";
};

posix_dai_hda2: posix-dai-hda2 {
compatible = "zephyr,posix-dai";
dai-type = "hda";
dai-index = <2>;
status = "okay";
};

posix_dai_hda3: posix-dai-hda3 {
compatible = "zephyr,posix-dai";
dai-type = "hda";
dai-index = <3>;
status = "okay";
};

posix_dai_alh0: posix-dai-alh0 {
compatible = "zephyr,posix-dai";
dai-type = "alh";
dai-index = <0>;
status = "okay";
};

posix_dai_alh1: posix-dai-alh1 {
compatible = "zephyr,posix-dai";
dai-type = "alh";
dai-index = <1>;
status = "okay";
};

posix_dai_alh2: posix-dai-alh2 {
compatible = "zephyr,posix-dai";
dai-type = "alh";
dai-index = <2>;
status = "okay";
};

posix_dai_alh3: posix-dai-alh3 {
compatible = "zephyr,posix-dai";
dai-type = "alh";
dai-index = <3>;
status = "okay";
};

posix_dai_uaol0: posix-dai-uaol0 {
compatible = "zephyr,posix-dai";
dai-type = "uaol";
dai-index = <0>;
status = "okay";
};

posix_dai_uaol1: posix-dai-uaol1 {
compatible = "zephyr,posix-dai";
dai-type = "uaol";
dai-index = <1>;
status = "okay";
};
};
4 changes: 4 additions & 0 deletions app/configs/fuzz_features.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ CONFIG_DMA=y

CONFIG_DAI=y

# Virtual (configuration-only) DAI devices. Without a registered DAI device
# native_sim rejects every DAI gateway before the generic SOF DAI code runs.
CONFIG_DAI_POSIX=y

CONFIG_PM_DEVICE=y
CONFIG_POWER_DOMAIN=y

Expand Down
45 changes: 45 additions & 0 deletions app/dts/bindings/dai/zephyr,posix-dai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright(c) 2026 Intel Corporation. All rights reserved.

description: |
Virtual DAI instance used by the SOF native_sim (POSIX) build.

native_sim has no audio hardware, so this node describes a DAI that only
exists to make the generic SOF DAI construction, configuration and property
paths reachable (most importantly for the IPC fuzzer). It is handled by
src/kernel/platform/posix/dai_virtual.c and moves no audio data.

compatible: "zephyr,posix-dai"

include: base.yaml

properties:
dai-type:
type: string
required: true
enum:
- "ssp"
- "dmic"
- "hda"
- "alh"
- "uaol"
description: |
DAI type this instance reports through dai_config_get(). It selects the
Zephyr type (DAI_INTEL_SSP, DAI_INTEL_DMIC, DAI_INTEL_HDA,
DAI_INTEL_ALH or DAI_INTEL_UAOL) that SOF matches a gateway request
against.

dai-index:
type: int
required: true
description: |
DAI index this instance answers to. SOF derives it from the IPC gateway
node id, so only configured indices can be instantiated.

fifo-depth:
type: int
default: 32
description: |
FIFO depth reported through dai_get_properties(). Some DAI types use it
as the DMA burst size.
3 changes: 3 additions & 0 deletions src/kernel/lib/dai-kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ const struct device *zephyr_dev[] = {
#if DT_HAS_COMPAT_STATUS_OKAY(mediatek_afe)
DT_FOREACH_STATUS_OKAY(mediatek_afe, GET_DEVICE_LIST)
#endif
#if CONFIG_DAI_POSIX
DT_FOREACH_STATUS_OKAY(zephyr_posix_dai, GET_DEVICE_LIST)
#endif
};

const struct device **dai_get_device_list(size_t *count)
Expand Down
12 changes: 12 additions & 0 deletions src/kernel/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ config ZEPHYR_POSIX_FUZZ_TICKS
following a unit-test style case, so the default is short to
prevent interaction with regular timer workloads.

config DAI_POSIX
bool "Virtual DAI devices for the native_sim build"
depends on DAI && ZEPHYR_NATIVE_DRIVERS
help
Register the devicetree-described virtual DAI instances handled by
src/kernel/platform/posix/dai_virtual.c. native_sim has no audio hardware,
so without them dai_get_device() never matches and every DAI gateway
request is rejected before the generic SOF DAI construction,
configuration and property code runs. The virtual DAIs make those
paths reachable for the fuzzer. They are configuration-only: no
blob is parsed and no audio data is moved.

endif # ZEPHYR_POSIX && ARCH_POSIX_LIBFUZZER

config IMX8
Expand Down
Loading
Loading