Skip to content

Commit 68a51da

Browse files
committed
Audio: basefw: Implement ipc4 modules info get
Added support for ipc4 query no 9. This make it possible to get infromation about the current loaded modules. Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
1 parent b6aa921 commit 68a51da

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

src/audio/base_fw.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <ipc4/pipeline.h>
1010
#include <ipc4/logging.h>
1111
#include <sof_versions.h>
12+
#include <sof/platform.h>
13+
#include <sof/lib_manager.h>
1214
#include <sof/lib/cpu-clk-manager.h>
1315
#include <sof/lib/cpu.h>
1416
#include <rtos/init.h>
@@ -419,6 +421,27 @@ static int basefw_power_state_info_get(uint32_t *data_offset, char *data)
419421
return 0;
420422
}
421423

424+
static int basefw_modules_info_get(uint32_t * data_offset, char* data)
425+
{
426+
struct ipc4_modules_info *const module_info = (struct ipc4_modules_info *)data;
427+
428+
struct sof_man_fw_desc *desc = (struct sof_man_fw_desc *)IMR_BOOT_LDR_MANIFEST_BASE;
429+
if (!desc) {
430+
return -EINVAL;
431+
}
432+
433+
module_info->modules_count = desc->header.num_module_entries;
434+
435+
for(int idx = 0; idx < module_info->modules_count; ++idx){
436+
struct sof_man_module *module_entry =
437+
(struct sof_man_module *)((char *)desc + SOF_MAN_MODULE_OFFSET(idx));
438+
memcpy(&(module_info->modules[idx]), module_entry, sizeof(struct sof_man_module));
439+
}
440+
441+
*data_offset = sizeof(uint32_t) + module_info->modules_count * sizeof(struct sof_man_module);
442+
return 0;
443+
}
444+
422445
static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv)
423446
{
424447
#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE)
@@ -497,6 +520,7 @@ static int basefw_get_large_config(struct comp_dev *dev,
497520
case IPC4_DSP_RESOURCE_STATE:
498521
case IPC4_NOTIFICATION_MASK:
499522
case IPC4_MODULES_INFO_GET:
523+
return basefw_modules_info_get(data_offset, data);
500524
case IPC4_PIPELINE_LIST_INFO_GET:
501525
case IPC4_PIPELINE_PROPS_GET:
502526
case IPC4_SCHEDULERS_INFO_GET:

src/include/ipc/header.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ struct ipc_cmd_hdr;
329329
#define SOF_IPC_MESSAGE_ID(x) ((x) & 0xffff)
330330

331331
/** Maximum message size for mailbox Tx/Rx */
332-
#define SOF_IPC_MSG_MAX_SIZE 384
332+
#define SOF_IPC_MSG_MAX_SIZE 0x1000
333333

334334
/** @} */
335335

src/include/ipc4/base_fw.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,11 @@ enum ipc4_alh_version {
637637
IPC4_ALH_CAVS_1_8 = 0x10000,
638638
};
639639

640+
struct ipc4_modules_info{
641+
uint32_t modules_count;
642+
struct sof_man_module modules[1];
643+
} __attribute__((packed, aligned(4)));
644+
640645
struct ipc4_log_state_info {
641646
/*
642647
* Specifies how frequently FW sends Log Buffer Status

0 commit comments

Comments
 (0)