base_fw: add DMI_FORCE_L1_EXIT FW config

Add new parameter for SW to force DMI L1 exit on IPC request.

Signed-off-by: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com>
This commit is contained in:
Fabiola Kwasowiec 2023-12-01 16:57:18 +01:00 committed by Kai Vehmanen
parent fb06e4d4cd
commit b3b9abffe7
1 changed files with 40 additions and 2 deletions

View File

@ -13,6 +13,9 @@
#include <sof/lib/cpu.h> #include <sof/lib/cpu.h>
#include <rtos/init.h> #include <rtos/init.h>
#include <platform/lib/clk.h> #include <platform/lib/clk.h>
#if defined(CONFIG_SOC_SERIES_INTEL_ACE)
#include <intel_adsp_hda.h>
#endif
#if CONFIG_ACE_V1X_ART_COUNTER || CONFIG_ACE_V1X_RTC_COUNTER #if CONFIG_ACE_V1X_ART_COUNTER || CONFIG_ACE_V1X_RTC_COUNTER
#include <zephyr/device.h> #include <zephyr/device.h>
@ -391,6 +394,42 @@ static int basefw_power_state_info_get(uint32_t *data_offset, char *data)
return 0; return 0;
} }
static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv)
{
#if defined(CONFIG_SOC_SERIES_INTEL_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;
}
static int basefw_get_large_config(struct comp_dev *dev, static int basefw_get_large_config(struct comp_dev *dev,
uint32_t param_id, uint32_t param_id,
bool first_block, bool first_block,
@ -457,8 +496,7 @@ static int basefw_set_large_config(struct comp_dev *dev,
{ {
switch (param_id) { switch (param_id) {
case IPC4_FW_CONFIG: case IPC4_FW_CONFIG:
tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it"); return basefw_set_fw_config(first_block, last_block, data_offset, data);
return 0;
case IPC4_SYSTEM_TIME: case IPC4_SYSTEM_TIME:
return basefw_set_system_time(param_id, first_block, return basefw_set_system_time(param_id, first_block,
last_block, data_offset, data); last_block, data_offset, data);