platform: register proper basefw CPS consumption on boot

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>
This commit is contained in:
Krzysztof Frydryk 2023-02-24 16:46:41 +01:00 committed by Liam Girdwood
parent db921487c5
commit 5f90a88dcb
3 changed files with 14 additions and 3 deletions

View File

@ -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>
@ -216,6 +217,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);

View File

@ -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>
@ -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;

View File

@ -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