Skip to content

Commit

Permalink
platform: register proper basefw CPS consumption on boot
Browse files Browse the repository at this point in the history
On init, register consumption of 10MCPS for base fw
if CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL enabled

Signed-off-by: Adrian Bonislawski <[email protected]>
Signed-off-by: Krzysztof Frydryk <[email protected]>

+Squashed commit:
38b4cb1 platform: mtl: lowest clock as default
Signed-off-by: Tomasz Leman <[email protected]>
  • Loading branch information
kfrydryx authored and abonislawski committed Aug 26, 2023
1 parent b120d37 commit 1a27eaf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/platform/intel/ace/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <sof/lib/cpu-clk-manager.h>
#include <sof/lib/mm_heap.h>
#include <sof/lib/watchdog.h>
#include <sof/lib/cpu-clk-manager.h>
#include <sof/schedule/edf_schedule.h>
#include <sof/schedule/dp_schedule.h>
#include <sof/schedule/ll_schedule.h>
Expand Down Expand Up @@ -80,6 +81,13 @@ static struct pm_notifier pm_state_notifier = {
.state_exit = cpu_notify_state_exit,
};

#if CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL
/* Value to be determined experimentaly */
#define BASE_CPS_USAGE 10000
#else
#define BASE_CPS_USAGE (CLK_MAX_CPU_HZ / 1000)
#endif

/* Runs on the primary core only */
int platform_init(struct sof *sof)
{
Expand All @@ -89,10 +97,7 @@ int platform_init(struct sof *sof)
platform_clock_init(sof);
kcps_budget_init();

/* Set DSP clock to MAX using KCPS API. Value should be lowered when KCPS API
* for modules is implemented
*/
ret = core_kcps_adjust(cpu_get_id(), CLK_MAX_CPU_HZ / 1000);
ret = core_kcps_adjust(cpu_get_id(), BASE_CPS_USAGE);
if (ret < 0)
return ret;

Expand Down
2 changes: 1 addition & 1 deletion src/platform/meteorlake/include/platform/lib/clk.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#define CPU_LOWEST_FREQ_IDX CPU_WOVCRO_FREQ_IDX

#define CPU_DEFAULT_IDX CPU_HPRO_FREQ_IDX
#define CPU_DEFAULT_IDX CPU_LOWEST_FREQ_IDX

#define SSP_DEFAULT_IDX 1

Expand Down

0 comments on commit 1a27eaf

Please sign in to comment.