Commit 4700bfb2 authored by Rander Wang's avatar Rander Wang Committed by Mark Brown

ASoC: SOF: add fw_info_box support

FW can share some information with host driver, .e.g fw status, pipeline
status and volume status. On ipc4 platform it is located in memory
windows 0 with size of struct sof_ipc4_fw_reg.

With this patch, ipc4 driver can find fw information in fw_info_box
Signed-off-by: default avatarRander Wang <rander.wang@intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230202132954.26773-3-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2740dcce
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "sof-priv.h" #include "sof-priv.h"
/* The DSP window indices are fixed */ /* The DSP window indices are fixed */
#define SOF_IPC4_INBOX_WINDOW_IDX 0
#define SOF_IPC4_OUTBOX_WINDOW_IDX 1 #define SOF_IPC4_OUTBOX_WINDOW_IDX 1
#define SOF_IPC4_DEBUG_WINDOW_IDX 2 #define SOF_IPC4_DEBUG_WINDOW_IDX 2
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <sound/sof/ipc4/header.h> #include <sound/sof/ipc4/header.h>
#include "sof-priv.h" #include "sof-priv.h"
#include "sof-audio.h" #include "sof-audio.h"
#include "ipc4-fw-reg.h"
#include "ipc4-priv.h" #include "ipc4-priv.h"
#include "ops.h" #include "ops.h"
...@@ -542,6 +543,8 @@ static int ipc4_fw_ready(struct snd_sof_dev *sdev, struct sof_ipc4_msg *ipc4_msg ...@@ -542,6 +543,8 @@ static int ipc4_fw_ready(struct snd_sof_dev *sdev, struct sof_ipc4_msg *ipc4_msg
outbox_offset = snd_sof_dsp_get_window_offset(sdev, SOF_IPC4_OUTBOX_WINDOW_IDX); outbox_offset = snd_sof_dsp_get_window_offset(sdev, SOF_IPC4_OUTBOX_WINDOW_IDX);
outbox_size = SOF_IPC4_MSG_MAX_SIZE; outbox_size = SOF_IPC4_MSG_MAX_SIZE;
sdev->fw_info_box.offset = snd_sof_dsp_get_window_offset(sdev, SOF_IPC4_INBOX_WINDOW_IDX);
sdev->fw_info_box.size = sizeof(struct sof_ipc4_fw_registers);
sdev->dsp_box.offset = inbox_offset; sdev->dsp_box.offset = inbox_offset;
sdev->dsp_box.size = inbox_size; sdev->dsp_box.size = inbox_size;
sdev->host_box.offset = outbox_offset; sdev->host_box.offset = outbox_offset;
......
...@@ -548,6 +548,7 @@ struct snd_sof_dev { ...@@ -548,6 +548,7 @@ struct snd_sof_dev {
/* IPC */ /* IPC */
struct snd_sof_ipc *ipc; struct snd_sof_ipc *ipc;
struct snd_sof_mailbox fw_info_box; /* FW shared memory */
struct snd_sof_mailbox dsp_box; /* DSP initiated IPC */ struct snd_sof_mailbox dsp_box; /* DSP initiated IPC */
struct snd_sof_mailbox host_box; /* Host initiated IPC */ struct snd_sof_mailbox host_box; /* Host initiated IPC */
struct snd_sof_mailbox stream_box; /* Stream position update */ struct snd_sof_mailbox stream_box; /* Stream position update */
......
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