From 7ba1a08862d6edc8143683bb6c1adf5caffebd3b Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 10 Jun 2021 20:48:47 +0100 Subject: [PATCH] ipc4: add support for ipc4 boot message and data Add support to send IPC4 boot message and boot data by providing a new API to get this data from ABI specific code. Signed-off-by: Liam Girdwood --- src/ipc/ipc3/handler.c | 5 +++++ src/platform/intel/cavs/platform.c | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/ipc/ipc3/handler.c b/src/ipc/ipc3/handler.c index 234fe6339..a53685bd9 100644 --- a/src/ipc/ipc3/handler.c +++ b/src/ipc/ipc3/handler.c @@ -1473,6 +1473,11 @@ ipc_cmd_hdr *ipc_prepare_to_send(struct ipc_msg *msg) return ipc_to_hdr(hdr); } +void ipc_boot_complete_msg(ipc_cmd_hdr *header, uint32_t *data) +{ + *header = SOF_IPC_FW_READY; +} + /* * Global IPC Operations. */ diff --git a/src/platform/intel/cavs/platform.c b/src/platform/intel/cavs/platform.c index 5a69af0e0..6bcb45eea 100644 --- a/src/platform/intel/cavs/platform.c +++ b/src/platform/intel/cavs/platform.c @@ -296,6 +296,9 @@ int platform_boot_complete(uint32_t boot_message) int platform_boot_complete(uint32_t boot_message) { + ipc_cmd_hdr header; + uint32_t data; + #if CONFIG_TIGERLAKE && !CONFIG_CAVS_LPRO_ONLY /* TGL specific HW recommended flow */ pm_runtime_get(PM_RUNTIME_DSP, PWRD_BY_HPRO | (CONFIG_CORE_COUNT - 1)); @@ -303,13 +306,17 @@ int platform_boot_complete(uint32_t boot_message) mailbox_dspbox_write(0, &ready, sizeof(ready)); + /* get any IPC specific boot message and optional data */ + data = SRAM_WINDOW_HOST_OFFSET(0) >> 12; + ipc_boot_complete_msg(&header, &data); + /* tell host we are ready */ #if CAVS_VERSION == CAVS_VERSION_1_5 - ipc_write(IPC_DIPCIE, SRAM_WINDOW_HOST_OFFSET(0) >> 12); - ipc_write(IPC_DIPCI, IPC_DIPCI_BUSY | SOF_IPC_FW_READY); + ipc_write(IPC_DIPCIE, data); + ipc_write(IPC_DIPCI, IPC_DIPCI_BUSY | header); #else - ipc_write(IPC_DIPCIDD, SRAM_WINDOW_HOST_OFFSET(0) >> 12); - ipc_write(IPC_DIPCIDR, IPC_DIPCIDR_BUSY | SOF_IPC_FW_READY); + ipc_write(IPC_DIPCIDD, data); + ipc_write(IPC_DIPCIDR, IPC_DIPCIDR_BUSY | header); #endif return 0; }