Skip to content

Conversation

@tmleman
Copy link
Contributor

@tmleman tmleman commented Dec 9, 2025

This patch reworks the SOF IPC platform integration to use the generic Zephyr ipc_service instead of the Intel audio DSP specific driver.

Before this change SOF was talking directly to the Intel ADSP IPC driver, which made the IPC path tightly coupled to that particular backend. All commands were sent and completed via intel_adsp_ipc_*() functions.

The code now sends and receives IPC commands through a Zephyr ipc_service endpoint registered on the Intel ADSP host IPC instance, using sof_ipc_receive_cb() as the receive handler. Incoming messages are processed as before using the existing compact IPC path to process commands.

Each IPC command is treated as a compact two-word ipc_cmd_hdr and a BUILD_ASSERT guarantees that the header size remains aligned with the transport format assumptions.

This change is part of ongoing work to better integrate SOF with Zephyr and will allow other vendors to more easily integrate their own IPC backends.

Copilot AI review requested due to automatic review settings December 9, 2025 15:02
@tmleman tmleman added the DNM Do Not Merge tag label Dec 9, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates SOF's platform IPC implementation from the Intel-specific ADSP IPC driver to the generic Zephyr ipc_service API, enabling better integration with Zephyr and easier vendor customization.

Key Changes:

  • Replaced direct intel_adsp_ipc_*() calls with ipc_service_*() API calls throughout the IPC path
  • Introduced sof_ipc_receive_cb() as the new IPC service endpoint callback handler
  • Added compile-time assertion to validate IPC header format assumptions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
west.yml Updates Zephyr dependency to a PR branch containing the required IPC service changes
src/ipc/ipc-zephyr.c Replaces Intel ADSP IPC driver calls with generic Zephyr IPC service API, registers endpoint, and updates message handling callbacks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

struct ipc_cmd_hdr *hdr = ipc_prepare_to_send(msg);

intel_adsp_ipc_send_message_emergency(INTEL_ADSP_IPC_HOST_DEV, hdr->pri, hdr->ext);
(void)ipc_service_send_critical(&sof_ipc_ept, hdr, sizeof(*hdr));
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return value of ipc_service_send_critical() is silently discarded with a void cast. If this function can fail, the caller has no way to detect or handle the failure. Consider logging an error or adding an assertion to catch failures in this critical path.

Suggested change
(void)ipc_service_send_critical(&sof_ipc_ept, hdr, sizeof(*hdr));
int ret = ipc_service_send_critical(&sof_ipc_ept, hdr, sizeof(*hdr));
if (ret != 0) {
tr_err(&ipc_tr, "ipc_service_send_critical() failed: %d", ret);
}

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should check/report this failure (since its likely time critical).

Comment on lines +314 to +315
ret = ipc_service_register_endpoint(INTEL_ADSP_IPC_HOST_DEV,
&sof_ipc_ept, &sof_ipc_ept_cfg);
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code still references INTEL_ADSP_IPC_HOST_DEV macro directly. While migrating to the generic ipc_service API, this hardcoded Intel-specific device reference limits portability. Consider abstracting this behind a platform-agnostic macro or devicetree reference to fully achieve the stated goal of allowing other vendors to integrate their own IPC backends.

Copilot uses AI. Check for mistakes.
@tmleman tmleman force-pushed the topic/upstream/pr/intel/ace/ipc_rework branch from d085bfa to a2b58ca Compare December 10, 2025 15:10
PR with changes in IPC backend.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This patch reworks the SOF IPC platform integration to use the generic
Zephyr ipc_service instead of the Intel audio DSP specific driver.

Before this change SOF was talking directly to the Intel ADSP IPC
driver, which made the IPC path tightly coupled to that particular
backend. All commands were sent and completed via intel_adsp_ipc_*()
functions.

The code now sends and receives IPC commands through a Zephyr
ipc_service endpoint registered on the Intel ADSP host IPC instance,
using sof_ipc_receive_cb() as the receive handler. Incoming messages are
processed as before using the existing compact IPC path to process
commands.

Each IPC command is treated as a compact two-word ipc_cmd_hdr and a
BUILD_ASSERT guarantees that the header size remains aligned with the
transport format assumptions.

This change is part of ongoing work to better integrate SOF with Zephyr
and will allow other vendors to more easily integrate their own IPC
backends.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
@lgirdwood
Copy link
Member

@tmleman Jenkins results are good atm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DNM Do Not Merge tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants