diff --git a/src/ipc/ipc3/handler.c b/src/ipc/ipc3/handler.c index 7d42b58d8ca2..6b869c95aecc 100644 --- a/src/ipc/ipc3/handler.c +++ b/src/ipc/ipc3/handler.c @@ -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. */ @@ -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); diff --git a/zephyr/wrapper.c b/zephyr/wrapper.c index c508b7c1ff61..8c7c466422d2 100644 --- a/zephyr/wrapper.c +++ b/zephyr/wrapper.c @@ -198,6 +198,20 @@ int task_main_start(struct sof *sof) return 0; } +static int boot_complete(void) +{ +#ifdef CONFIG_IMX93_A55 + /* in the case of i.MX93, SOF_IPC_FW_READY + * sequence will be initiated by the host + * so we shouldn't do anything here. + */ + return 0; +#else + /* let host know DSP boot is complete */ + return platform_boot_complete(0); +#endif /* CONFIG_IMX93_A55 */ +} + int start_complete(void) { #if defined(CONFIG_IMX) @@ -215,9 +229,7 @@ int start_complete(void) pm_policy_state_lock_get(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); pm_policy_state_lock_get(PM_STATE_SOFT_OFF, PM_ALL_SUBSTATES); #endif - - /* let host know DSP boot is complete */ - return platform_boot_complete(0); + return boot_complete(); } /*