From a1120f0f9f8b508a79c979008e7a8e36bced7a5b Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 18 Apr 2024 14:47:01 +0300 Subject: [PATCH] audio: base_fw: move L1_EXIT control to platform specific code Move the Intel specific L1_EXIT control handling from base_fw.c to Intel specific platform code. Signed-off-by: Kai Vehmanen --- src/audio/base_fw.c | 41 --------------- src/platform/intel/ace/lib/base_fw_platform.c | 52 +++++++++++++++++++ 2 files changed, 52 insertions(+), 41 deletions(-) diff --git a/src/audio/base_fw.c b/src/audio/base_fw.c index 498246a93..9eb32f7a2 100644 --- a/src/audio/base_fw.c +++ b/src/audio/base_fw.c @@ -17,9 +17,6 @@ #include #include #include -#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) -#include -#endif #include #include #include @@ -475,42 +472,6 @@ static int basefw_libraries_info_get(uint32_t *data_offset, char *data) return 0; } -static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv) -{ -#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) - const uint32_t force = tlv->value[0]; - - if (force) { - tr_info(&basefw_comp_tr, "FW config set force dmi l0 state"); - intel_adsp_force_dmi_l0_state(); - } else { - tr_info(&basefw_comp_tr, "FW config set allow dmi l1 state"); - intel_adsp_allow_dmi_l1_state(); - } - - return 0; -#else - return IPC4_UNAVAILABLE; -#endif -} - -static int basefw_set_fw_config(bool first_block, - bool last_block, - uint32_t data_offset, - const char *data) -{ - const struct sof_tlv *tlv = (const struct sof_tlv *)data; - - switch (tlv->type) { - case IPC4_DMI_FORCE_L1_EXIT: - return fw_config_set_force_l1_exit(tlv); - default: - break; - } - tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it"); - return 0; -} - int schedulers_info_get(uint32_t *data_off_size, char *data, uint32_t core_id) @@ -676,8 +637,6 @@ static int basefw_set_large_config(struct comp_dev *dev, const char *data) { switch (param_id) { - case IPC4_FW_CONFIG: - return basefw_set_fw_config(first_block, last_block, data_offset, data); case IPC4_PERF_MEASUREMENTS_STATE: return set_perf_meas_state(data); case IPC4_SYSTEM_TIME: diff --git a/src/platform/intel/ace/lib/base_fw_platform.c b/src/platform/intel/ace/lib/base_fw_platform.c index 81ed85ef5..62beebcf0 100644 --- a/src/platform/intel/ace/lib/base_fw_platform.c +++ b/src/platform/intel/ace/lib/base_fw_platform.c @@ -4,11 +4,20 @@ // // Author: Kai Vehmanen +#include + #include #include #include + +#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) +#include +#endif + #include +LOG_MODULE_REGISTER(basefw_platform, CONFIG_SOF_LOG_LEVEL); + int platform_basefw_fw_config(uint32_t *data_offset, char *data) { struct sof_tlv *tuple = (struct sof_tlv *)data; @@ -68,6 +77,42 @@ int platform_basefw_get_large_config(struct comp_dev *dev, return -EINVAL; } +static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv) +{ +#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) + const uint32_t force = tlv->value[0]; + + if (force) { + tr_info(&basefw_comp_tr, "FW config set force dmi l0 state"); + intel_adsp_force_dmi_l0_state(); + } else { + tr_info(&basefw_comp_tr, "FW config set allow dmi l1 state"); + intel_adsp_allow_dmi_l1_state(); + } + + return 0; +#else + return IPC4_UNAVAILABLE; +#endif +} + +static int basefw_set_fw_config(bool first_block, + bool last_block, + uint32_t data_offset, + const char *data) +{ + const struct sof_tlv *tlv = (const struct sof_tlv *)data; + + switch (tlv->type) { + case IPC4_DMI_FORCE_L1_EXIT: + return fw_config_set_force_l1_exit(tlv); + default: + break; + } + tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it"); + return 0; +} + int platform_basefw_set_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, @@ -75,5 +120,12 @@ int platform_basefw_set_large_config(struct comp_dev *dev, uint32_t data_offset, const char *data) { + switch (param_id) { + case IPC4_FW_CONFIG: + return basefw_set_fw_config(first_block, last_block, data_offset, data); + default: + break; + } + return IPC4_UNKNOWN_MESSAGE_TYPE; }