Skip to content

Commit

Permalink
ASoC: SOF: IPC4: add fw_image_flags support
Browse files Browse the repository at this point in the history
Driver gets fw_image_flags fw manifest and adopts features based on
this flag.

Signed-off-by: Rander Wang <[email protected]>
  • Loading branch information
RanderWang committed Oct 30, 2023
1 parent 180286d commit 4438127
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/soc/sof/ipc4-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ static ssize_t sof_ipc4_fw_parse_ext_man(struct snd_sof_dev *sdev,
dev_dbg(sdev->dev, "Header length: %u, module count: %u\n",
fw_header->len, fw_header->num_module_entries);

if (SOF_IPC4_GET_IMAGE_TYPE(fw_header->fw_image_flags) == SOF_IPC4_BASEFW)
ipc4_data->fw_image_flags = fw_header->fw_image_flags;

fw_lib->modules = devm_kmalloc_array(sdev->dev, fw_header->num_module_entries,
sizeof(*fw_module), GFP_KERNEL);
if (!fw_lib->modules)
Expand Down
13 changes: 13 additions & 0 deletions sound/soc/sof/ipc4-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
#define SOF_IPC4_OUTBOX_WINDOW_IDX 1
#define SOF_IPC4_DEBUG_WINDOW_IDX 2

enum sof_ipc4_image_type {
SOF_IPC4_ROM,
SOF_IPC4_BASEFW,
SOF_IPC4_LIBRARY
};

#define SOF_IPC4_RESERVED BIT(0)
#define SOF_IPC4_IMAGE_TYPE GENMASK(2, 1) /* 0 - ROM, 1 - Base FW, 2 -library */
#define SOF_IPC4_GET_IMAGE_TYPE(x) (((x) & SOF_IPC4_IMAGE_TYPE) >> 1)
#define SOF_IPC4_RELOCATABLE_LIB BIT(3)
#define SOF_IPC4_D3_CONTEXT_LOST BIT(4)

enum sof_ipc4_mtrace_type {
SOF_IPC4_MTRACE_NOT_AVAILABLE = 0,
SOF_IPC4_MTRACE_INTEL_CAVS_1_5,
Expand Down Expand Up @@ -81,6 +93,7 @@ struct sof_ipc4_fw_data {
u32 mtrace_log_bytes;
int max_num_pipelines;
u32 max_libs_count;
u32 fw_image_flags;

int (*load_library)(struct snd_sof_dev *sdev,
struct sof_ipc4_fw_library *fw_lib, bool reload);
Expand Down

0 comments on commit 4438127

Please sign in to comment.