Skip to content

Phase 2 (part 2): move src/idc to src/kernel/idc - #11398

Draft
lgirdwood wants to merge 4 commits into
thesofproject:mainfrom
lgirdwood:kernel-user/phase2b
Draft

lgirdwood wants to merge 4 commits into
thesofproject:mainfrom
lgirdwood:kernel-user/phase2b

Conversation

@lgirdwood

@lgirdwood lgirdwood commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Phase 2 of #11306 (kernel / user-space partition), second part: move the inter-core communication code to src/kernel/idc. Stacked on #11394: its two commits come first and will drop out when it is merged.

Patches

  • src/idc → src/kernel/idc: a pure move. The code is now built into the sof_kernel library added in Phase 2 (part 1): add src/kernel and a sof_kernel library, move src/init #11394.
    • Kconfig: a new src/kernel/Kconfig sources the Kconfig files of the moved directories. src/Kconfig sources it in place of idc/Kconfig, and the option values are unchanged.
    • README: the relative link is fixed.
    • Host builds: only Zephyr builds the IDC code, so they are not affected.
  • Docs: AGENTS.md, the user-space README and the audio README list the kernel-only directories by name. They now list src/kernel, note the sof_kernel library, and keep the directories that have not moved yet. This also covers src/init, which Phase 2 (part 1): add src/kernel and a sof_kernel library, move src/init #11394 moved but did not update here.

Functional change

None. The objects are unchanged, and every build's .config has the same option values before and after. As in #11394, the only effect is on link order: in every firmware image the symbols (name, type and size) and the SYS_INIT() order are identical, and only alignment padding in some sections changes. Two more link-order effects:

Testing

  • Per commit:
    • Builds: every commit was built on tgl, tgl-h, mtl, lnl, ptl, wcl, nvl, imx8, imx8x, imx8m, imx8m_cm7, imx8ulp, imx95 and qemu_xtensa, and in the extra CI configurations:
      • native_sim IPC3/IPC4 stub builds;
      • imx93 64-bit;
      • PTL with each userspace overlay;
      • PTL with CONFIG_SOF_USERSPACE_PROXY=n;
      • PTL and MTL with os_linux_overlay.conf;llext_relocatable.conf.
    • Objects and LLEXT modules: same non-debug section sizes as the previous commit.
    • Firmware images: compared for symbols, SYS_INIT() order and section sizes.
    • Cadence xt-clang (RI-2022.10): MTL, PTL and NVL compile.
    • Host: the host library and cmocka build and pass.
  • At the tip:
    • all cmocka configurations, the testbench and the tools pass;
    • the platforms that already fail on main (acp_6_0, acp_7_0, acp_7_x, mt8186, mt8188, mt8195, mt8196, mt8365) have unchanged error sets.
  • Hardware: TGL (UP Xtreme i11) with sof-hda-generic-cavs25-2ch.tplg boots, plays 5 s on the HDA analog PCM, and plays again after runtime suspend, with no DSP errors.

All of the above was run on 78b23ad (current main) with #11394 applied.

🤖 Generated with Claude Code

lrgirdwo and others added 4 commits November 3, 2026 12:59
Phase 2 of the kernel / user-space partition (thesofproject#11306) moves the code
that only runs in kernel mode to src/kernel. The firmware init code is
the first: it brings up the SOF context and runs from SYS_INIT() in
supervisor mode.

Move it to src/kernel/init and add src/kernel/CMakeLists.txt, which
the Zephyr build now adds instead of src/init. Update the paths in the
README and in a ztest comment. Only Zephyr builds src/init, so the
host builds are not affected. No functional change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add a sof_kernel Zephyr library for the code in src/kernel, so that
kernel-only code is built separately from modules_sof and can later be
given include directories of its own.

The library is created in zephyr/CMakeLists.txt, next to modules_sof,
so that it gets the same directory-level compile definitions, and it
links the same SOF interface library. It is created first so that
modules_sof stays the current Zephyr library there.
src/kernel/CMakeLists.txt makes sof_kernel the current library for its
own directory tree, so the CMake files of the directories moved there
need no change. The trace relative paths are set for it as well.

Like all Zephyr libraries it is linked as a whole archive, so the
SYS_INIT() entries it holds are kept and their order is unchanged.
The generated code is unchanged; only the link order, and with it the
alignment padding in some sections, changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The inter-core communication code only runs in kernel mode. Move it to
src/kernel/idc, where it is built into the sof_kernel library.

Add src/kernel/Kconfig for the Kconfig files of the moved directories
and source it from src/Kconfig in place of idc/Kconfig. The option
values are unchanged. Fix the relative link in the README. Only Zephyr
builds the IDC code, so the host builds are not affected.
No functional change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
AGENTS.md, the user-space README and the audio README list the
kernel-only directories by name and still name src/init and src/idc,
which are now under src/kernel. List src/kernel, note that it is built
into the sof_kernel library, and keep the directories that have not
moved there yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants