Skip to content

Commit

Permalink
ipc: ipc3: Add support for SOF_IPC_FW_READY sequence initiated by host
Browse files Browse the repository at this point in the history
In the case of i.MX93 Linux will send an IPC_FW_READY
message to SOF and will expect to receive the following information
in the hostbox:
	1) reply structure
	2) sof_ipc_fw_ready structure
	3) sof_ipc_fw_ready structure

This flow is required because the FW (due to Jailhouse's design)
will be up before the platform driver from Linux so the
SOF_IPC_FW_READY sequence can't be initiated by SOF.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
  • Loading branch information
LaurentiuM1234 authored and dbaluta committed May 2, 2023
1 parent bcbb85a commit de9b8be
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/ipc/ipc3/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,35 @@ void ipc_boot_complete_msg(struct ipc_cmd_hdr *header, uint32_t data)
header->dat[1] = data;
}

static int ipc_fw_ready(void)
{
#ifdef CONFIG_IMX93_A55
/* VERY IMPORTANT:
* * due to how the FW is started, i.MX93 has the
* following flow (please note that the host driver
* is blacklisted and inserted later on):
*
* 1) Linux kernel boots and user space becomes
* available.
* 2) FW is started (through Jailhouse) => SOF is running
* 4) Host driver module is inserted.
* 5) Host platform driver sends SOF_IPC_FW_READY and
* expects SOF to send the SOF_IPC_FW_READY
* message, the window regions and the reply
* header in the following order:
* 1) reply structure
* 2) sof_ipc_fw_ready structure
* 3) windows structure
* (all of the above information is written
* contiguously in the hostbox)
*/
return platform_boot_complete(0);
#else
/* any other platform should not receive SOF_IPC_FW_READY from host */
return -EINVAL;
#endif /* CONFIG_IMX93_A55 */
}

/*
* Global IPC Operations.
*/
Expand Down Expand Up @@ -1663,6 +1692,9 @@ void ipc_cmd(struct ipc_cmd_hdr *_hdr)
case SOF_IPC_GLB_DEBUG:
ret = ipc_glb_debug_message(hdr->cmd);
break;
case SOF_IPC_FW_READY:
ret = ipc_fw_ready();
break;
#if CONFIG_DEBUG
case SOF_IPC_GLB_TEST:
ret = ipc_glb_test_message(hdr->cmd);
Expand Down

0 comments on commit de9b8be

Please sign in to comment.