Unverified Commit c27032b4 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: SOF: query FW config to reload library

Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>:

We should query FW config if context save is supported, and no need
to reload FW if hda->booted_from_imr and ipc4_data->fw_context_save
are true.
parents e7a4a2fd 3a0e7bb8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -423,6 +423,12 @@ enum sof_ipc4_fw_config_params {
	SOF_IPC4_FW_CFG_RESERVED,
	SOF_IPC4_FW_CFG_POWER_GATING_POLICY,
	SOF_IPC4_FW_CFG_ASSERT_MODE,
	SOF_IPC4_FW_RESERVED1,
	SOF_IPC4_FW_RESERVED2,
	SOF_IPC4_FW_RESERVED3,
	SOF_IPC4_FW_RESERVED4,
	SOF_IPC4_FW_RESERVED5,
	SOF_IPC4_FW_CONTEXT_SAVE
};

struct sof_ipc4_fw_version {
+3 −2
Original line number Diff line number Diff line
@@ -519,14 +519,15 @@ int hda_dsp_ipc4_load_library(struct snd_sof_dev *sdev,
			      struct sof_ipc4_fw_library *fw_lib, bool reload)
{
	struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
	struct sof_ipc4_fw_data *ipc4_data = sdev->private;
	struct hdac_ext_stream *hext_stream;
	struct firmware stripped_firmware;
	struct sof_ipc4_msg msg = {};
	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 is enabled and fw context is saved for D3 state, skip the loading */
	if (reload && hda->booted_from_imr && ipc4_data->fw_context_save)
		return 0;

	/* the fw_lib has been verified during loading, we can trust the validity here */
+2 −0
Original line number Diff line number Diff line
@@ -133,6 +133,8 @@ int sof_lnl_ops_init(struct snd_sof_dev *sdev)

	ipc4_data->mtrace_type = SOF_IPC4_MTRACE_INTEL_CAVS_2;

	ipc4_data->fw_context_save = true;

	/* External library loading support */
	ipc4_data->load_library = hda_dsp_ipc4_load_library;

+2 −0
Original line number Diff line number Diff line
@@ -718,6 +718,8 @@ int sof_mtl_ops_init(struct snd_sof_dev *sdev)

	ipc4_data->mtrace_type = SOF_IPC4_MTRACE_INTEL_CAVS_2;

	ipc4_data->fw_context_save = true;

	/* External library loading support */
	ipc4_data->load_library = hda_dsp_ipc4_load_library;

+2 −0
Original line number Diff line number Diff line
@@ -91,6 +91,8 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev)

		ipc4_data->mtrace_type = SOF_IPC4_MTRACE_INTEL_CAVS_2;

		ipc4_data->fw_context_save = true;

		/* External library loading support */
		ipc4_data->load_library = hda_dsp_ipc4_load_library;

Loading