From 2c46361cdf028618b8420519d0d68c274cde2f78 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Wed, 18 Oct 2023 13:15:27 +0800 Subject: [PATCH] ipc4: set fw_ready flag for host Like IPC3 path, set SOF_IPC_INFO_D3_PERSISTENT for fw_ready event to host if IMR_CONTEXT_SAVE is supported so that host can sync up with FW, .e.g. avoid library reload if IMR_CONTEXT_SAVE is supported. Currently CAVS platforms don't support IMR_CONTEXT_SAVE but ACE platforms support it. It doesn't affect windows driver since the extension part is not used by host driver. Signed-off-by: Rander Wang --- src/include/ipc4/header.h | 2 ++ src/ipc/ipc4/handler.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/include/ipc4/header.h b/src/include/ipc4/header.h index 5abef50342b0..ddd4e9ca2d2a 100644 --- a/src/include/ipc4/header.h +++ b/src/include/ipc4/header.h @@ -215,4 +215,6 @@ struct sof_ipc4_notify_module_data { uint8_t event_data[]; } __attribute((packed, aligned(4))); +#define SOF_IPC4_FW_CONTEXT_SAVE 1 + #endif diff --git a/src/ipc/ipc4/handler.c b/src/ipc/ipc4/handler.c index 209bddf65097..4d378ecbc03b 100644 --- a/src/ipc/ipc4/handler.c +++ b/src/ipc/ipc4/handler.c @@ -1326,6 +1326,9 @@ void ipc_boot_complete_msg(struct ipc_cmd_hdr *header, uint32_t data) { header->pri = SOF_IPC4_FW_READY; header->ext = 0; + + if (IS_ENABLED(CONFIG_ADSP_IMR_CONTEXT_SAVE)) + header->ext |= SOF_IPC4_FW_CONTEXT_SAVE; } #if defined(CONFIG_PM_DEVICE) && defined(CONFIG_INTEL_ADSP_IPC)