diff --git a/src/audio/base_fw.c b/src/audio/base_fw.c index 3940672396bb..8bc43eca8241 100644 --- a/src/audio/base_fw.c +++ b/src/audio/base_fw.c @@ -146,21 +146,12 @@ static int basefw_hw_config(uint32_t *data_offset, char *data) value = SOF_DIV_ROUND_UP(EBB_BANKS_IN_SEGMENT * SRAM_BANK_SIZE, HOST_PAGE_SIZE); tlv_value_uint32_set(tuple, IPC4_TOTAL_PHYS_MEM_PAGES_HW_CFG, value); - tuple = tlv_next(tuple); - tlv_value_uint32_set(tuple, IPC4_HP_EBB_COUNT_HW_CFG, PLATFORM_HPSRAM_EBB_COUNT); - - tuple = tlv_next(tuple); - /* 2 DMIC dais */ - value = DAI_NUM_SSP_BASE + DAI_NUM_HDA_IN + DAI_NUM_HDA_OUT + - DAI_NUM_ALH_BI_DIR_LINKS + 2; - tlv_value_uint32_set(tuple, IPC4_GATEWAY_COUNT_HW_CFG, value); - - tuple = tlv_next(tuple); - tlv_value_uint32_set(tuple, IPC4_LP_EBB_COUNT_HW_CFG, PLATFORM_LPSRAM_EBB_COUNT); - tuple = tlv_next(tuple); *data_offset = (int)((char *)tuple - data); + /* add platform specific tuples */ + platform_basefw_hw_config(data_offset, (char *)tuple); + return 0; } diff --git a/src/include/sof/platform.h b/src/include/sof/platform.h index 80fdff077500..3d17baea53a8 100644 --- a/src/include/sof/platform.h +++ b/src/include/sof/platform.h @@ -52,6 +52,16 @@ int platform_init(struct sof *sof); */ int platform_context_save(struct sof *sof); +/** + * \brief Platform specific routine to add data tuples to HW_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_hw_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 765bc7580236..c384c410b9df 100644 --- a/src/platform/intel/ace/platform.c +++ b/src/platform/intel/ace/platform.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,10 @@ #include #include +#if defined(CONFIG_IPC_MAJOR_4) +#include +#endif + #include #include @@ -140,3 +145,26 @@ int platform_context_save(struct sof *sof) { return 0; } + +int platform_basefw_hw_config(uint32_t *data_offset, char *data) +{ + struct sof_tlv *tuple = (struct sof_tlv *)data; + uint32_t value; + + tuple = tlv_next(tuple); + tlv_value_uint32_set(tuple, IPC4_HP_EBB_COUNT_HW_CFG, PLATFORM_HPSRAM_EBB_COUNT); + + tuple = tlv_next(tuple); + /* 2 DMIC dais */ + value = DAI_NUM_SSP_BASE + DAI_NUM_HDA_IN + DAI_NUM_HDA_OUT + + DAI_NUM_ALH_BI_DIR_LINKS + 2; + tlv_value_uint32_set(tuple, IPC4_GATEWAY_COUNT_HW_CFG, value); + + tuple = tlv_next(tuple); + tlv_value_uint32_set(tuple, IPC4_LP_EBB_COUNT_HW_CFG, PLATFORM_LPSRAM_EBB_COUNT); + + 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 2f4602b4c222..bc94b905a1b7 100644 --- a/src/platform/intel/cavs/platform.c +++ b/src/platform/intel/cavs/platform.c @@ -33,11 +33,16 @@ #include #include #include +#include #include #include #include #include +#if defined(CONFIG_IPC_MAJOR_4) +#include +#endif + #include #include #include @@ -239,3 +244,26 @@ int platform_context_save(struct sof *sof) #endif return 0; } + +int platform_basefw_hw_config(uint32_t *data_offset, char *data) +{ + struct sof_tlv *tuple = (struct sof_tlv *)data; + uint32_t value; + + tuple = tlv_next(tuple); + tlv_value_uint32_set(tuple, IPC4_HP_EBB_COUNT_HW_CFG, PLATFORM_HPSRAM_EBB_COUNT); + + tuple = tlv_next(tuple); + /* 2 DMIC dais */ + value = DAI_NUM_SSP_BASE + DAI_NUM_HDA_IN + DAI_NUM_HDA_OUT + + DAI_NUM_ALH_BI_DIR_LINKS + 2; + tlv_value_uint32_set(tuple, IPC4_GATEWAY_COUNT_HW_CFG, value); + + tuple = tlv_next(tuple); + tlv_value_uint32_set(tuple, IPC4_LP_EBB_COUNT_HW_CFG, PLATFORM_LPSRAM_EBB_COUNT); + + tuple = tlv_next(tuple); + *data_offset = (int)((char *)tuple - data); + + return 0; +}