Skip to content

Commit b3b9abf

Browse files
fkwasowikv2019i
authored andcommitted
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>
1 parent fb06e4d commit b3b9abf

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

src/audio/base_fw.c

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#include <sof/lib/cpu.h>
1414
#include <rtos/init.h>
1515
#include <platform/lib/clk.h>
16+
#if defined(CONFIG_SOC_SERIES_INTEL_ACE)
17+
#include <intel_adsp_hda.h>
18+
#endif
1619

1720
#if CONFIG_ACE_V1X_ART_COUNTER || CONFIG_ACE_V1X_RTC_COUNTER
1821
#include <zephyr/device.h>
@@ -391,6 +394,42 @@ static int basefw_power_state_info_get(uint32_t *data_offset, char *data)
391394
return 0;
392395
}
393396

397+
static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv)
398+
{
399+
#if defined(CONFIG_SOC_SERIES_INTEL_ACE)
400+
const uint32_t force = tlv->value[0];
401+
402+
if (force) {
403+
tr_info(&basefw_comp_tr, "FW config set force dmi l0 state");
404+
intel_adsp_force_dmi_l0_state();
405+
} else {
406+
tr_info(&basefw_comp_tr, "FW config set allow dmi l1 state");
407+
intel_adsp_allow_dmi_l1_state();
408+
}
409+
410+
return 0;
411+
#else
412+
return IPC4_UNAVAILABLE;
413+
#endif
414+
}
415+
416+
static int basefw_set_fw_config(bool first_block,
417+
bool last_block,
418+
uint32_t data_offset,
419+
const char *data)
420+
{
421+
const struct sof_tlv *tlv = (const struct sof_tlv *)data;
422+
423+
switch (tlv->type) {
424+
case IPC4_DMI_FORCE_L1_EXIT:
425+
return fw_config_set_force_l1_exit(tlv);
426+
default:
427+
break;
428+
}
429+
tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it");
430+
return 0;
431+
}
432+
394433
static int basefw_get_large_config(struct comp_dev *dev,
395434
uint32_t param_id,
396435
bool first_block,
@@ -457,8 +496,7 @@ static int basefw_set_large_config(struct comp_dev *dev,
457496
{
458497
switch (param_id) {
459498
case IPC4_FW_CONFIG:
460-
tr_warn(&basefw_comp_tr, "returning success for Set FW_CONFIG without handling it");
461-
return 0;
499+
return basefw_set_fw_config(first_block, last_block, data_offset, data);
462500
case IPC4_SYSTEM_TIME:
463501
return basefw_set_system_time(param_id, first_block,
464502
last_block, data_offset, data);

0 commit comments

Comments
 (0)