|
9 | 9 | #include <ipc4/pipeline.h> |
10 | 10 | #include <ipc4/logging.h> |
11 | 11 | #include <sof_versions.h> |
| 12 | +#include <sof/platform.h> |
| 13 | +#include <sof/lib_manager.h> |
12 | 14 | #include <sof/lib/cpu-clk-manager.h> |
13 | 15 | #include <sof/lib/cpu.h> |
14 | 16 | #include <rtos/init.h> |
@@ -431,6 +433,35 @@ static int basefw_power_state_info_get(uint32_t *data_offset, char *data) |
431 | 433 | return 0; |
432 | 434 | } |
433 | 435 |
|
| 436 | +static int basefw_modules_info_get(uint32_t *data_offset, char *data) |
| 437 | +{ |
| 438 | +#ifdef CONFIG_INTEL |
| 439 | + struct ipc4_modules_info *const module_info = (struct ipc4_modules_info *)data; |
| 440 | +#ifdef ZEPHYR_SOC_INTEL_ADSP_MEMORY_H_ |
| 441 | + struct sof_man_fw_desc *desc = (struct sof_man_fw_desc *)IMR_BOOT_LDR_MANIFEST_BASE; |
| 442 | + |
| 443 | + if (!desc) |
| 444 | + return -EINVAL; |
| 445 | +#else |
| 446 | + return -EINVAL; |
| 447 | +#endif |
| 448 | + module_info->modules_count = desc->header.num_module_entries; |
| 449 | + |
| 450 | + for (int idx = 0; idx < module_info->modules_count; ++idx) { |
| 451 | + struct sof_man_module *module_entry = |
| 452 | + (struct sof_man_module *)((char *)desc + SOF_MAN_MODULE_OFFSET(idx)); |
| 453 | + memcpy_s(&module_info->modules[idx], sizeof(module_info->modules[idx]), |
| 454 | + module_entry, sizeof(struct sof_man_module)); |
| 455 | + } |
| 456 | + |
| 457 | + *data_offset = sizeof(module_info->modules_count) + |
| 458 | + module_info->modules_count * sizeof(module_info->modules[0]); |
| 459 | + return 0; |
| 460 | +#else |
| 461 | + return -EINVAL; |
| 462 | +#endif |
| 463 | +} |
| 464 | + |
434 | 465 | static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv) |
435 | 466 | { |
436 | 467 | #if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) |
@@ -580,7 +611,9 @@ static int basefw_get_large_config(struct comp_dev *dev, |
580 | 611 | /* TODO: add more support */ |
581 | 612 | case IPC4_DSP_RESOURCE_STATE: |
582 | 613 | case IPC4_NOTIFICATION_MASK: |
| 614 | + break; |
583 | 615 | case IPC4_MODULES_INFO_GET: |
| 616 | + return basefw_modules_info_get(data_offset, data); |
584 | 617 | case IPC4_PIPELINE_LIST_INFO_GET: |
585 | 618 | case IPC4_PIPELINE_PROPS_GET: |
586 | 619 | case IPC4_GATEWAYS_INFO_GET: |
|
0 commit comments