Skip to content

Commit

Permalink
audio: base_fw: do not use platform interface for vendor extensions
Browse files Browse the repository at this point in the history
In commit 14c4e86 ("audio: base_fw: add platform layer to IPC4
hw_config data"), the platform specific code was moved to platform
layer.

This commit implements a lighter weight abstraction for the moved
code. Instead of using the platform layer, the Intel specific vendor
code is added directly in base_fw_intel.c and guarded by a Kconfig.
All other IPC4 build targets will use an empty implementation.

This avoids the need to add a platform definition for all IPC4 targets.
The common implementation in base_fw.c is sufficient to cover all
mandatory functionality required e.g. by the upstream SOF Linux driver's
IPC4 implementation.

The interfaces are renamed to refer to "vendor" instead of "platform",
to avoid any confusion with the platform layer with the new
implementation.

Signed-off-by: Kai Vehmanen <[email protected]>
  • Loading branch information
kv2019i authored and lgirdwood committed May 8, 2024
1 parent 0ea0d62 commit b10ec85
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 109 deletions.
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace15_mtpm.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CONFIG_METEORLAKE=y
CONFIG_IPC_MAJOR_4=y
CONFIG_IPC4_BASE_FW_INTEL=y

CONFIG_COMP_SRC=y
CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y
Expand Down
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace20_lnl.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CONFIG_LUNARLAKE=y
CONFIG_IPC_MAJOR_4=y
CONFIG_IPC4_BASE_FW_INTEL=y

CONFIG_COMP_SRC=y
CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y
Expand Down
1 change: 1 addition & 0 deletions app/boards/intel_adsp_cavs25.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=y
CONFIG_TRACE=n

CONFIG_IPC_MAJOR_4=y
CONFIG_IPC4_BASE_FW_INTEL=y
CONFIG_RIMAGE_SIGNING_SCHEMA="tgl-cavs"
CONFIG_PCM_CONVERTER_FORMAT_S16LE=y
CONFIG_PCM_CONVERTER_FORMAT_S24LE=y
Expand Down
1 change: 1 addition & 0 deletions app/boards/intel_adsp_cavs25_tgph.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=y
CONFIG_TRACE=n

CONFIG_IPC_MAJOR_4=y
CONFIG_IPC4_BASE_FW_INTEL=y
CONFIG_RIMAGE_SIGNING_SCHEMA="tgl-cavs"
CONFIG_PCM_CONVERTER_FORMAT_S16LE=y
CONFIG_PCM_CONVERTER_FORMAT_S24LE=y
Expand Down
8 changes: 8 additions & 0 deletions src/audio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ config COMP_BASEFW_IPC4
help
Select for BASEFW component

config IPC4_BASE_FW_INTEL
bool "BASEFW component Intel vendor extensions"
depends on COMP_BASEFW_IPC4
help
Enable Intel vendor extensions for base firmware module.
This implements a set of additional IPC4 properties that
extend the base spec.

rsource "copier/Kconfig"

config HOST_DMA_RELOAD_DELAY_ENABLE
Expand Down
16 changes: 8 additions & 8 deletions src/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <sof/ut.h>
#include <sof/tlv.h>
#include <ipc4/base_fw.h>
#include <ipc4/base_fw_platform.h>
#include <ipc4/base_fw_vendor.h>
#include <ipc4/pipeline.h>
#include <ipc4/logging.h>
#include <ipc/topology.h>
Expand Down Expand Up @@ -121,7 +121,7 @@ static int basefw_config(uint32_t *data_offset, char *data)
tuple = tlv_next(tuple);

/* add platform specific tuples */
platform_basefw_fw_config(&plat_data_offset, (char *)tuple);
basefw_vendor_fw_config(&plat_data_offset, (char *)tuple);

*data_offset = (int)((char *)tuple - data) + plat_data_offset;

Expand Down Expand Up @@ -152,7 +152,7 @@ static int basefw_hw_config(uint32_t *data_offset, char *data)
tuple = tlv_next(tuple);

/* add platform specific tuples */
platform_basefw_hw_config(&plat_data_offset, (char *)tuple);
basefw_vendor_hw_config(&plat_data_offset, (char *)tuple);

*data_offset = (int)((char *)tuple - data) + plat_data_offset;

Expand Down Expand Up @@ -298,7 +298,7 @@ static int basefw_libraries_info_get(uint32_t *data_offset, char *data)

for (int lib_id = 0; lib_id < LIB_MANAGER_MAX_LIBS; ++lib_id) {
if (lib_id == 0) {
desc = platform_base_fw_get_manifest();
desc = basefw_vendor_get_manifest();
} else {
#if CONFIG_LIBRARY_MANAGER
desc = (struct sof_man_fw_desc *)lib_manager_get_library_manifest(lib_id);
Expand Down Expand Up @@ -336,7 +336,7 @@ static int basefw_libraries_info_get(uint32_t *data_offset, char *data)

static int basefw_modules_info_get(uint32_t *data_offset, char *data)
{
return platform_basefw_modules_info_get(data_offset, data);
return basefw_vendor_modules_info_get(data_offset, data);
}

int schedulers_info_get(uint32_t *data_off_size,
Expand Down Expand Up @@ -479,7 +479,7 @@ static int basefw_get_large_config(struct comp_dev *dev,
break;
}

return platform_basefw_get_large_config(dev, param_id, first_block, last_block,
return basefw_vendor_get_large_config(dev, param_id, first_block, last_block,
data_offset, data);
};

Expand Down Expand Up @@ -507,8 +507,8 @@ static int basefw_set_large_config(struct comp_dev *dev,
break;
}

return platform_basefw_set_large_config(dev, param_id, first_block, last_block,
data_offset, data);
return basefw_vendor_set_large_config(dev, param_id, first_block, last_block,
data_offset, data);
};

static const struct comp_driver comp_basefw = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ struct ipc4_modules_info {
struct sof_man_module modules[0];
} __packed __aligned(4);

LOG_MODULE_REGISTER(basefw_platform, CONFIG_SOF_LOG_LEVEL);
LOG_MODULE_REGISTER(basefw_intel, CONFIG_SOF_LOG_LEVEL);

int platform_basefw_fw_config(uint32_t *data_offset, char *data)
int basefw_vendor_fw_config(uint32_t *data_offset, char *data)
{
struct sof_tlv *tuple = (struct sof_tlv *)data;

Expand All @@ -47,7 +47,7 @@ int platform_basefw_fw_config(uint32_t *data_offset, char *data)
return 0;
}

int platform_basefw_hw_config(uint32_t *data_offset, char *data)
int basefw_vendor_hw_config(uint32_t *data_offset, char *data)
{
struct sof_tlv *tuple = (struct sof_tlv *)data;
uint32_t value;
Expand All @@ -69,7 +69,7 @@ int platform_basefw_hw_config(uint32_t *data_offset, char *data)
return 0;
}

struct sof_man_fw_desc *platform_base_fw_get_manifest(void)
struct sof_man_fw_desc *basefw_vendor_get_manifest(void)
{
struct sof_man_fw_desc *desc;

Expand All @@ -78,10 +78,10 @@ struct sof_man_fw_desc *platform_base_fw_get_manifest(void)
return desc;
}

int platform_basefw_modules_info_get(uint32_t *data_offset, char *data)
int basefw_vendor_modules_info_get(uint32_t *data_offset, char *data)
{
struct ipc4_modules_info *const module_info = (struct ipc4_modules_info *)data;
struct sof_man_fw_desc *desc = platform_base_fw_get_manifest();
struct sof_man_fw_desc *desc = basefw_vendor_get_manifest();

if (!desc)
return -EINVAL;
Expand Down Expand Up @@ -228,12 +228,12 @@ static uint32_t basefw_get_ext_system_time(uint32_t *data_offset, char *data)
return IPC4_UNAVAILABLE;
}

int platform_basefw_get_large_config(struct comp_dev *dev,
uint32_t param_id,
bool first_block,
bool last_block,
uint32_t *data_offset,
char *data)
int basefw_vendor_get_large_config(struct comp_dev *dev,
uint32_t param_id,
bool first_block,
bool last_block,
uint32_t *data_offset,
char *data)
{
/* We can use extended param id for both extended and standard param id */
union ipc4_extended_param_id extended_param_id;
Expand Down Expand Up @@ -298,12 +298,12 @@ static int basefw_set_fw_config(bool first_block,
return 0;
}

int platform_basefw_set_large_config(struct comp_dev *dev,
uint32_t param_id,
bool first_block,
bool last_block,
uint32_t data_offset,
const char *data)
int basefw_vendor_set_large_config(struct comp_dev *dev,
uint32_t param_id,
bool first_block,
bool last_block,
uint32_t data_offset,
const char *data)
{
switch (param_id) {
case IPC4_FW_CONFIG:
Expand Down
80 changes: 0 additions & 80 deletions src/include/ipc4/base_fw_platform.h

This file was deleted.

Loading

0 comments on commit b10ec85

Please sign in to comment.