Skip to content

Conversation

@kv2019i
Copy link
Collaborator

@kv2019i kv2019i commented Oct 31, 2025

Implementation of
#9697
... built on of @dcpleung 's #10089 .

This is not yet ready, but pushing these praparation patches for early review.

@kv2019i
Copy link
Collaborator Author

kv2019i commented Oct 31, 2025

@lgirdwood I noticed I'm undoing's some of your early 2021 work to add IPC4. Let me know if this is going to wrong direction.

@thesofproject/nxp FYI, potentially of interest. The goal is to make ipc-zephyr.c usable for all platforms (and for both IPC3/4).

@kv2019i kv2019i force-pushed the 202511-ipc-payload-interface branch from 17e0264 to 3ad9a6f Compare October 31, 2025 16:34
@kv2019i
Copy link
Collaborator Author

kv2019i commented Oct 31, 2025

V2:

  • drop the west.yml from the PR10089 series (Zephyr is now up-to-date in SOF so this is no more needed) -> allows to get test results

@kv2019i kv2019i force-pushed the 202511-ipc-payload-interface branch from 3ad9a6f to 6b285de Compare October 31, 2025 16:38
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

LGTM.

/* prepare the message and copy to mailbox */
struct ipc_cmd_hdr *hdr = ipc_prepare_to_send(msg);

if (msg->tx_size)
Copy link
Member

Choose a reason for hiding this comment

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

Should mailbox_dspbox_write() check this instead (meaning we only check in one place) ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lgirdwood Ack. If no blockers, I'll proceed to move the dspbox writes to the IPC driver in Zephyr, so that use of mailbox is abstracted in SOF side (SOF ipc-zephyr.c just uses the driver interface and has no direct use of mailbox.h). The "if (msg->tx_size)" check can be then done in the IPC backend driver in Zephyr.

@kv2019i
Copy link
Collaborator Author

kv2019i commented Nov 4, 2025

V3:

@kv2019i kv2019i changed the title IPC payload API abstraction (on top of unmergd PR10089) IPC payload API abstraction (on top of unmerged PR10089) Nov 4, 2025
dcpleung and others added 6 commits November 4, 2025 18:55
This reworks the Zephyr IPC interface to utilize the generic
IPC service and backend. So we no longer have to maintain
a SoC specific IPC driver.

Signed-off-by: Daniel Leung <[email protected]>
Preparation to abstract use of mailboxes in code that handles
IPC responses. Remove direct access to mailbox.h HOSTBOX
definition, and instead use a function to get access to the payload.
This allows to have the mailbox access code in one place and
e.g. ensure the cache invalidation is done correctly.

In a later step, this code will be moved to Zephyr IPC driver.
This will allow to use SOF with generic IPC drivers (no need to
map to mailbox.h).

Signed-off-by: Kai Vehmanen <[email protected]>
In commit 7ba1a08 ("ipc4: add support for ipc4 boot message and
data"), ipc_prepare_to_send() function was added to prepare the IPC
client code to handle multiple IPC versions. This function has however
not been used in all IPC client code in SOF, and when Intel IPC3 support
was removed, only remaining usage is in ipc-zephyr.c.

As usage is limited, change the semantics of ipc_prepare_to_send()
to only modify the header fields (e.g. for IPC4 set the extension
field), but remove the code to write payload to mailbox. Instead
move this code to ipc-zephyr.c. This will allow to move the payload
handling later to Zephyr drivers, and out from common codec.

Signed-off-by: Kai Vehmanen <[email protected]>
Move responsibility to write and read the IPC message payload
to the Zephyr IPC driver.

This change allows to use SOF IPC client code with multiple hardware
backends and there's no assumption payload transport is a memory mapped
payload buffer is exposed via mailbox.h.

This depends on Zephyr commit TBD ("foo bar") that adds message
payload to the interface.

Signed-off-by: Kai Vehmanen <[email protected]>
@kv2019i kv2019i force-pushed the 202511-ipc-payload-interface branch from b9e7a42 to e764edc Compare November 4, 2025 16:56
@kv2019i
Copy link
Collaborator Author

kv2019i commented Nov 4, 2025

V4:

  • rebased so CI tests can be run (avoids the west.yml conflict)

@kv2019i
Copy link
Collaborator Author

kv2019i commented Nov 5, 2025

Linking here, @tmleman has objections to the approach taken in this PR, see: #10089 (comment)

@softwarecki softwarecki self-requested a review November 12, 2025 15:27
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