-
Notifications
You must be signed in to change notification settings - Fork 349
IPC payload API abstraction (on top of unmerged PR10089) #10346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@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). |
17e0264 to
3ad9a6f
Compare
|
V2:
|
3ad9a6f to
6b285de
Compare
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
src/ipc/ipc-zephyr.c
Outdated
| /* prepare the message and copy to mailbox */ | ||
| struct ipc_cmd_hdr *hdr = ipc_prepare_to_send(msg); | ||
|
|
||
| if (msg->tx_size) |
There was a problem hiding this comment.
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) ?
There was a problem hiding this comment.
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.
|
V3:
|
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]>
b9e7a42 to
e764edc
Compare
|
V4:
|
|
Linking here, @tmleman has objections to the approach taken in this PR, see: #10089 (comment) |
Implementation of
#9697
... built on of @dcpleung 's #10089 .
This is not yet ready, but pushing these praparation patches for early review.