diff --git a/src/audio/base_fw.c b/src/audio/base_fw.c index e0d8800f7bb1..b0b6a448de6f 100644 --- a/src/audio/base_fw.c +++ b/src/audio/base_fw.c @@ -43,6 +43,7 @@ static int basefw_config(uint32_t *data_offset, char *data) uint16_t version[4] = {SOF_MAJOR, SOF_MINOR, SOF_MICRO, SOF_BUILD}; struct sof_tlv *tuple = (struct sof_tlv *)data; struct ipc4_scheduler_config sche_cfg; + uint32_t plat_data_offset = 0; uint32_t log_bytes_size = 0; tlv_value_set(tuple, IPC4_FW_VERSION_FW_CFG, sizeof(version), version); @@ -58,15 +59,6 @@ static int basefw_config(uint32_t *data_offset, char *data) IPC4_SLOW_CLOCK_FREQ_HZ_FW_CFG, clock_get_freq(CPU_LOWEST_FREQ_IDX)); - tuple = tlv_next(tuple); - tlv_value_uint32_set(tuple, IPC4_SLOW_CLOCK_FREQ_HZ_FW_CFG, IPC4_ALH_CAVS_1_8); - - tuple = tlv_next(tuple); - tlv_value_uint32_set(tuple, IPC4_UAOL_SUPPORT, 0); - - tuple = tlv_next(tuple); - tlv_value_uint32_set(tuple, IPC4_ALH_SUPPORT_LEVEL_FW_CFG, IPC4_ALH_CAVS_1_8); - tuple = tlv_next(tuple); tlv_value_uint32_set(tuple, IPC4_DL_MAILBOX_BYTES_FW_CFG, MAILBOX_HOSTBOX_SIZE); @@ -121,7 +113,11 @@ static int basefw_config(uint32_t *data_offset, char *data) IS_ENABLED(CONFIG_ADSP_IMR_CONTEXT_SAVE)); tuple = tlv_next(tuple); - *data_offset = (int)((char *)tuple - data); + + /* add platform specific tuples */ + platform_basefw_fw_config(&plat_data_offset, (char *)tuple); + + *data_offset = (int)((char *)tuple - data) + plat_data_offset; return 0; } diff --git a/src/include/sof/platform.h b/src/include/sof/platform.h index 644275e171c2..fb6803f110e2 100644 --- a/src/include/sof/platform.h +++ b/src/include/sof/platform.h @@ -61,6 +61,15 @@ int platform_context_save(struct sof *sof); */ int platform_basefw_hw_config(uint32_t *data_offset, char *data); +/** + * \brief Platform specific routine to add data tuples to FW_CONFIG + * structure sent to host via IPC. + * \param[out] data_offset data offset after tuples added + * \parma[in] data pointer where to add new entries + * \return 0 if successful, error code otherwise. + */ +int platform_basefw_fw_config(uint32_t *data_offset, char *data); + /** @}*/ #endif diff --git a/src/platform/intel/ace/platform.c b/src/platform/intel/ace/platform.c index e3ecd8669bd6..be4595efeb73 100644 --- a/src/platform/intel/ace/platform.c +++ b/src/platform/intel/ace/platform.c @@ -165,3 +165,22 @@ int platform_basefw_hw_config(uint32_t *data_offset, char *data) return 0; } + +int platform_basefw_fw_config(uint32_t *data_offset, char *data) +{ + struct sof_tlv *tuple = (struct sof_tlv *)data; + uint32_t value; + + tlv_value_uint32_set(tuple, IPC4_SLOW_CLOCK_FREQ_HZ_FW_CFG, IPC4_ALH_CAVS_1_8); + + tuple = tlv_next(tuple); + tlv_value_uint32_set(tuple, IPC4_UAOL_SUPPORT, 0); + + tuple = tlv_next(tuple); + tlv_value_uint32_set(tuple, IPC4_ALH_SUPPORT_LEVEL_FW_CFG, IPC4_ALH_CAVS_1_8); + + tuple = tlv_next(tuple); + *data_offset = (int)((char *)tuple - data); + + return 0; +} diff --git a/src/platform/intel/cavs/platform.c b/src/platform/intel/cavs/platform.c index ca440061cb74..ffbb269b4807 100644 --- a/src/platform/intel/cavs/platform.c +++ b/src/platform/intel/cavs/platform.c @@ -264,3 +264,21 @@ int platform_basefw_hw_config(uint32_t *data_offset, char *data) return 0; } + +int platform_basefw_fw_config(uint32_t *data_offset, char *data) +{ + struct sof_tlv *tuple = (struct sof_tlv *)data; + + tlv_value_uint32_set(tuple, IPC4_SLOW_CLOCK_FREQ_HZ_FW_CFG, IPC4_ALH_CAVS_1_8); + + tuple = tlv_next(tuple); + tlv_value_uint32_set(tuple, IPC4_UAOL_SUPPORT, 0); + + tuple = tlv_next(tuple); + tlv_value_uint32_set(tuple, IPC4_ALH_SUPPORT_LEVEL_FW_CFG, IPC4_ALH_CAVS_1_8); + + tuple = tlv_next(tuple); + *data_offset = (int)((char *)tuple - data); + + return 0; +} diff --git a/src/platform/posix/posix.c b/src/platform/posix/posix.c index df5732786b3d..410d53a9df2f 100644 --- a/src/platform/posix/posix.c +++ b/src/platform/posix/posix.c @@ -95,3 +95,10 @@ int platform_basefw_hw_config(uint32_t *data_offset, char *data) return 0; } + +int platform_basefw_fw_config(uint32_t *data_offset, char *data) +{ + *data_offset = 0; + + return 0; +}