Skip to content

Clean up the XTOS leftovers - #11516

Open
lgirdwood wants to merge 5 commits into
thesofproject:mainfrom
lgirdwood:kernel-user/xtos-cleanup
Open

lgirdwood wants to merge 5 commits into
thesofproject:mainfrom
lgirdwood:kernel-user/xtos-cleanup

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Clean up the XTOS leftovers. The XTOS firmware build has been removed: Zephyr is the only supported RTOS, and the other non-Zephyr builds are the host builds (the host library, testbench and unit tests). Follow-up to the review of #11513, which removes the last XTOS scheduler.

Patches

  1. arch: host: remove two dead files.
    • arch/sof.h errors unless the XTOS rtos/sof.h included it, and nothing includes it.
    • lib/ams.c is not built, and it includes xtos-structs.h, which no longer exists.
  2. platform, arch: host: the i.MX and AMD platform IDC headers accept being included from the XTOS or the Zephyr rtos/idc.h. Only the Zephyr check is left. The #error messages of the IDC and task headers name the headers that include them now (Zephyr's, or the host ones).
  3. posix: rename the two __XTOS_* include guards to __POSIX_*, like the other posix headers, and make the messages that reject Zephyr builds say these are host headers.
  4. zephyr: remove PLATFORM_HEADERS, which is set to "posix" or "xtos" but never read.
  5. tree-wide: update the comments and docs that still describe XTOS as a current build: CMake comments, the UUID, cache stub, DMA, trace and IPC worker comments, the ZEPHYR_NATIVE_DRIVERS help, zephyr/README, ARCHITECTURE.md, the src/include README and set_xtensa_params.sh.
    • Also corrects the legacy interrupt API comments. They said it was for i.MX ("no IRQ driver in Zephyr"), but only the AMD platforms without native drivers use it; i.MX uses the Zephyr interrupt API.

Not in this part

  • The XTOS LL scheduler: removed by Kernel/user partition, Phase 5 part 4: remove the clock change notification and the XTOS LL scheduler #11513.
  • Kconfig.xtos, the legacy interrupt API (_xtos_* calls) and dai-legacy.h: used by the platforms that still use the legacy drivers (AMD and MediaTek), so they go with those drivers.
  • The AMD idma.h: a vendor header.
  • Kept on purpose: comments that only say where something came from, such as the deprecated XTOS heap header and memory flag, the old XTOS build script, and the source checksum note in version.cmake (changing that code would change the source hash). Also the error message for the removed XTOS build.

Functional change

None.

Testing

  • Per commit, compared with main:
    • Builds: tgl, tgl-h, mtl, lnl, ptl, wcl, nvl, imx8, imx8x, imx8m, imx8m_cm7, imx8ulp, imx95 and qemu_xtensa, and 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;
      • PTL and TGL with app/debug_stream_overlay.conf, and PTL with that overlay and user-space LL.
    • Comparisons: objects, LLEXT modules and firmware images (sections, symbols, SYS_INIT() order), and the per-function disassembly. No object changes at any commit. The only image difference is sof_init() on imx8m_cm7, imx93 and imx95, which embeds the git hash.
    • Signing: rimage runs for every Intel platform, and the generated configs are unchanged.
    • Cadence xt-clang (RI-2022.10): MTL, PTL and NVL compile.
    • ZTest: the unit tests pass, run as in CI (22 of 22 configurations).
    • Host: the host library and the cmocka unit tests build and pass.
    • Documentation: builds as in CI, with no warnings.
  • At the tip:
    • the testbench and the tools pass;
    • the host library and the cmocka unit tests pass for all nine defconfigs and the library config;
    • the include checker passes with --strict, for the builds (same 16 baseline sources) and for the sources;
    • 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.

All of the above was run on d9b1a78 (current main).

🤖 Generated with Claude Code

lrgirdwo and others added 5 commits November 21, 2026 18:26
Both are left from the XTOS firmware build, which has been removed:
- arch/sof.h can only be included from the XTOS rtos/sof.h (it errors
  unless __XTOS_RTOS_SOF_H__ is defined), which no longer exists, and
  nothing includes it;
- lib/ams.c is not built (arch/host/lib only builds notifier.c), and it
  includes xtos-structs.h, which no longer exists.

No functional change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The platform IDC headers of i.MX and AMD accept being included from the
XTOS rtos/idc.h (__XTOS_RTOS_IDC_H__) or the Zephyr one. The XTOS
firmware build has been removed, so only the Zephyr check is left.

Several #error messages still name the XTOS headers. The library
platform and host arch headers are included from the host (posix)
rtos/idc.h and rtos/task.h, so name those, and fix the "Zepyhr" typo in
the i.MX8 header.

No functional change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The posix headers are the RTOS headers of the host builds (the host
library, testbench and unit tests), and the XTOS firmware build that
also used some of them has been removed. Most of them have __POSIX_*
include guards already; rename the two __XTOS_* ones, and make the
messages that reject Zephyr builds say these are host headers.

No functional change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
zephyr/CMakeLists.txt sets PLATFORM_HEADERS to "posix" or "xtos", but
nothing reads it. Remove it.

No functional change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The XTOS firmware build has been removed: Zephyr is the only supported
RTOS, and the other non-Zephyr builds are the host builds (the host
library, testbench and unit tests). Update the comments and docs that
still describe XTOS as a current build:
- CMake comments about files shared with XTOS: they are shared with the
  host builds;
- the UUID, cache stub, DMA, trace and IPC worker comments;
- the ZEPHYR_NATIVE_DRIVERS help, zephyr/README, ARCHITECTURE.md and the
  src/include README;
- set_xtensa_params.sh, which only the testbench build uses.

The comments on the legacy interrupt API said it was for i.MX, which has
"no IRQ driver in Zephyr". It is only used by the AMD platforms without
native drivers; i.MX uses the Zephyr interrupt API. Correct them.

Comments that only say where something came from (the deprecated XTOS
heap header and memory flag, the old XTOS build script) are kept.

No functional change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@intel-sofci

Copy link
Copy Markdown

PR 11516: test results

Run date: 2026-11-21 20:42 UTC

Tested commit: e7b069aac9ec27e80f00c5567066ad38c9682ba9

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

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.

3 participants