diff --git a/include/sound/sof/info.h b/include/sound/sof/info.h index 75193850ead0c2..af3442d115b58f 100644 --- a/include/sound/sof/info.h +++ b/include/sound/sof/info.h @@ -26,6 +26,7 @@ #define SOF_IPC_INFO_LOCKSV BIT(2) #define SOF_IPC_INFO_GDB BIT(3) #define SOF_IPC_INFO_D3_PERSISTENT BIT(4) +#define SOF_IPC_INFO_CONTEXT_SAVE BIT(5) /* extended data types that can be appended onto end of sof_ipc_fw_ready */ enum sof_ipc_ext_data { diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c index 9d50652cc3f45e..7411c8ec2be8b7 100644 --- a/sound/soc/sof/intel/hda-loader.c +++ b/sound/soc/sof/intel/hda-loader.c @@ -525,8 +525,8 @@ int hda_dsp_ipc4_load_library(struct snd_sof_dev *sdev, struct snd_dma_buffer dmab; int ret, ret1; - /* IMR booting will restore the libraries as well, skip the loading */ - if (reload && hda->booted_from_imr) + /* if IMR booting and D3 context save are supported, skip the loading */ + if (reload && hda->booted_from_imr && sdev->fw_ready.flags & SOF_IPC_INFO_CONTEXT_SAVE) return 0; /* the fw_lib has been verified during loading, we can trust the validity here */ diff --git a/sound/soc/sof/ipc4.c b/sound/soc/sof/ipc4.c index 8441f4ae406568..d740c90944c7e8 100644 --- a/sound/soc/sof/ipc4.c +++ b/sound/soc/sof/ipc4.c @@ -574,6 +574,8 @@ EXPORT_SYMBOL(sof_ipc4_find_debug_slot_offset_by_type); static int ipc4_fw_ready(struct snd_sof_dev *sdev, struct sof_ipc4_msg *ipc4_msg) { int inbox_offset, inbox_size, outbox_offset, outbox_size; + struct sof_ipc_fw_ready *fw_ready = &sdev->fw_ready; + int ret; /* no need to re-check version/ABI for subsequent boots */ if (!sdev->first_boot) @@ -599,6 +601,13 @@ static int ipc4_fw_ready(struct snd_sof_dev *sdev, struct sof_ipc4_msg *ipc4_msg sdev->debug_box.offset = snd_sof_dsp_get_window_offset(sdev, SOF_IPC4_DEBUG_WINDOW_IDX); + ret = snd_sof_dsp_block_read(sdev, SOF_FW_BLK_TYPE_SRAM, inbox_offset, fw_ready, + sizeof(*fw_ready)); + if (ret) { + dev_err(sdev->dev, "Unable to read fw_ready, read from TYPE_SRAM failed\n"); + return ret; + } + sof_ipc4_create_exception_debugfs_node(sdev); dev_dbg(sdev->dev, "mailbox upstream 0x%x - size 0x%x\n",