Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230202132954.26773-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Rander Wang and committed by
Mark Brown
4700bfb2 2740dcce

+5
+1
sound/soc/sof/ipc4-priv.h
··· 14 14 #include "sof-priv.h" 15 15 16 16 /* The DSP window indices are fixed */ 17 + #define SOF_IPC4_INBOX_WINDOW_IDX 0 17 18 #define SOF_IPC4_OUTBOX_WINDOW_IDX 1 18 19 #define SOF_IPC4_DEBUG_WINDOW_IDX 2 19 20
+3
sound/soc/sof/ipc4.c
··· 13 13 #include <sound/sof/ipc4/header.h> 14 14 #include "sof-priv.h" 15 15 #include "sof-audio.h" 16 + #include "ipc4-fw-reg.h" 16 17 #include "ipc4-priv.h" 17 18 #include "ops.h" 18 19 ··· 543 542 outbox_offset = snd_sof_dsp_get_window_offset(sdev, SOF_IPC4_OUTBOX_WINDOW_IDX); 544 543 outbox_size = SOF_IPC4_MSG_MAX_SIZE; 545 544 545 + sdev->fw_info_box.offset = snd_sof_dsp_get_window_offset(sdev, SOF_IPC4_INBOX_WINDOW_IDX); 546 + sdev->fw_info_box.size = sizeof(struct sof_ipc4_fw_registers); 546 547 sdev->dsp_box.offset = inbox_offset; 547 548 sdev->dsp_box.size = inbox_size; 548 549 sdev->host_box.offset = outbox_offset;
+1
sound/soc/sof/sof-priv.h
··· 548 548 549 549 /* IPC */ 550 550 struct snd_sof_ipc *ipc; 551 + struct snd_sof_mailbox fw_info_box; /* FW shared memory */ 551 552 struct snd_sof_mailbox dsp_box; /* DSP initiated IPC */ 552 553 struct snd_sof_mailbox host_box; /* Host initiated IPC */ 553 554 struct snd_sof_mailbox stream_box; /* Stream position update */