Commit a4cfdebd authored by Ranjani Sridharan's avatar Ranjani Sridharan Committed by Mark Brown

ASoC: SOF: Intel: HDA: Set up sof_ipc4_fw_data for IPC4

Allocate the sof_ipc4_fw_data struct for IPC4 and set the fw header offset
for the platforms which will be used by the core when loading the firmware
image.

The core expects that the "private" field in struct snd_sof_dev (which is
unused today with IPC3) is used to save this data.
Signed-off-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220511171648.1622993-6-ranjani.sridharan@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent c62ff366
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
* Hardware interface for audio DSP on Apollolake and GeminiLake * Hardware interface for audio DSP on Apollolake and GeminiLake
*/ */
#include <sound/sof/ext_manifest4.h>
#include "../ipc4-priv.h"
#include "../sof-priv.h" #include "../sof-priv.h"
#include "hda.h" #include "hda.h"
#include "../sof-audio.h" #include "../sof-audio.h"
...@@ -46,6 +48,16 @@ int sof_apl_ops_init(struct snd_sof_dev *sdev) ...@@ -46,6 +48,16 @@ int sof_apl_ops_init(struct snd_sof_dev *sdev)
} }
if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) { if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) {
struct sof_ipc4_fw_data *ipc4_data;
sdev->private = devm_kzalloc(sdev->dev, sizeof(*ipc4_data), GFP_KERNEL);
if (!sdev->private)
return -ENOMEM;
ipc4_data = sdev->private;
ipc4_data->manifest_fw_hdr_offset = SOF_MAN4_FW_HDR_OFFSET;
/* doorbell */
sof_apl_ops.irq_thread = hda_dsp_ipc4_irq_thread; sof_apl_ops.irq_thread = hda_dsp_ipc4_irq_thread;
/* ipc */ /* ipc */
......
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
* Hardware interface for audio DSP on Cannonlake. * Hardware interface for audio DSP on Cannonlake.
*/ */
#include <sound/sof/ext_manifest4.h>
#include <sound/sof/ipc4/header.h> #include <sound/sof/ipc4/header.h>
#include "../ipc4-priv.h"
#include "../ops.h" #include "../ops.h"
#include "hda.h" #include "hda.h"
#include "hda-ipc.h" #include "hda-ipc.h"
...@@ -344,6 +346,16 @@ int sof_cnl_ops_init(struct snd_sof_dev *sdev) ...@@ -344,6 +346,16 @@ int sof_cnl_ops_init(struct snd_sof_dev *sdev)
} }
if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) { if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) {
struct sof_ipc4_fw_data *ipc4_data;
sdev->private = devm_kzalloc(sdev->dev, sizeof(*ipc4_data), GFP_KERNEL);
if (!sdev->private)
return -ENOMEM;
ipc4_data = sdev->private;
ipc4_data->manifest_fw_hdr_offset = SOF_MAN4_FW_HDR_OFFSET;
/* doorbell */
sof_cnl_ops.irq_thread = cnl_ipc4_irq_thread; sof_cnl_ops.irq_thread = cnl_ipc4_irq_thread;
/* ipc */ /* ipc */
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* Hardware interface for audio DSP on Tigerlake. * Hardware interface for audio DSP on Tigerlake.
*/ */
#include <sound/sof/ext_manifest4.h>
#include "../ipc4-priv.h"
#include "../ops.h" #include "../ops.h"
#include "hda.h" #include "hda.h"
#include "hda-ipc.h" #include "hda-ipc.h"
...@@ -79,6 +81,15 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev) ...@@ -79,6 +81,15 @@ int sof_tgl_ops_init(struct snd_sof_dev *sdev)
} }
if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) { if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) {
struct sof_ipc4_fw_data *ipc4_data;
sdev->private = devm_kzalloc(sdev->dev, sizeof(*ipc4_data), GFP_KERNEL);
if (!sdev->private)
return -ENOMEM;
ipc4_data = sdev->private;
ipc4_data->manifest_fw_hdr_offset = SOF_MAN4_FW_HDR_OFFSET;
/* doorbell */ /* doorbell */
sof_tgl_ops.irq_thread = cnl_ipc4_irq_thread; sof_tgl_ops.irq_thread = cnl_ipc4_irq_thread;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment