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 <adrian.bonislawski@intel.com>
Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
  • Loading branch information
kfrydryx authored and abonislawski committed Apr 14, 2024
1 parent 6bc04cd commit 102d70a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <rtos/interrupt.h>
#include <sof/init.h>
#include <sof/lib/cpu.h>
#include <sof/lib/cpu-clk-manager.h>
#include <sof/lib/memory.h>
#include <sof/lib/mm_heap.h>
#include <sof/lib/notifier.h>
Expand Down Expand Up @@ -203,6 +204,11 @@ int secondary_core_init(struct sof *sof)
if (err < 0)
return err;
#endif
#if CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL
err = core_kcps_adjust(cpu_get_id(), SECONDARY_CORE_BASE_CPS_USAGE);
if (err < 0)
return err;
#endif

trace_point(TRACE_BOOT_PLATFORM);

Expand Down
8 changes: 5 additions & 3 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 @@ -89,10 +90,11 @@ 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
*/
#if CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL
ret = core_kcps_adjust(cpu_get_id(), PRIMARY_CORE_BASE_CPS_USAGE);
#else
ret = core_kcps_adjust(cpu_get_id(), CLK_MAX_CPU_HZ / 1000);
#endif
if (ret < 0)
return ret;

Expand Down
3 changes: 3 additions & 0 deletions src/platform/meteorlake/include/platform/lib/clk.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@

#define NUM_SSP_FREQ 3

#define PRIMARY_CORE_BASE_CPS_USAGE 20000
#define SECONDARY_CORE_BASE_CPS_USAGE 10000

#endif /* __PLATFORM_LIB_CLK_H__ */

#else
Expand Down

0 comments on commit 102d70a

Please sign in to comment.