Skip to content

Commit 3ad9a6f

Browse files
committed
ipc: move IPC payload write to SOF Zephyr IPC client code
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]>
1 parent 08938ba commit 3ad9a6f

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/ipc/ipc-zephyr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,9 @@ int ipc_platform_send_msg(const struct ipc_msg *msg)
328328
/* prepare the message and copy to mailbox */
329329
struct ipc_cmd_hdr *hdr = ipc_prepare_to_send(msg);
330330

331+
if (msg->tx_size)
332+
mailbox_dspbox_write(0, (uint32_t *)msg->tx_data, msg->tx_size);
333+
331334
return ipc_send_message(hdr->pri, hdr->ext);
332335
}
333336

src/ipc/ipc3/handler.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,8 +1500,6 @@ struct ipc_cmd_hdr *ipc_prepare_to_send(const struct ipc_msg *msg)
15001500
hdr[0] = msg->header;
15011501
hdr[1] = 0;
15021502

1503-
mailbox_dspbox_write(0, msg->tx_data, msg->tx_size);
1504-
15051503
return ipc_to_hdr(hdr);
15061504
}
15071505

src/ipc/ipc4/handler.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,9 +1592,6 @@ struct ipc_cmd_hdr *ipc_prepare_to_send(const struct ipc_msg *msg)
15921592
msg_data.msg_out.pri = msg->header;
15931593
msg_data.msg_out.ext = msg->extension;
15941594

1595-
if (msg->tx_size)
1596-
mailbox_dspbox_write(0, (uint32_t *)msg->tx_data, msg->tx_size);
1597-
15981595
return &msg_data.msg_out;
15991596
}
16001597

0 commit comments

Comments
 (0)