arm64: unify counter and cpufreq-based frequency invariance
The frequency scale factor will always be a normalized ratio between
the current performance and maximum performance.
Given that the maximum performance is known from boot-time, it can be
cached in a per-cpu variable. This is already done for counter-based
frequency invariance (FI) and could be done for cpufreq-driven FI as
well.
As for the current performance, at scale factor computation time we can
either receive this value (given by the cpufreq framework) or we can
compute it using performance counters.
Given this, a scale computation function can be generalised to be used
for both cpufreq and counter-driven FI. Here, this is called
topology_set_freq_scale_unified() and it's used at the moment for arm64
only, with the intention of making this generic and available in the
arch_topology driver in the future.
Also, the initialisation code previously used for AMU validation and
initialization (init_amu_fie()) can now be used for cpufreq FI as well,
under the name init_freq_inv().
Signed-off-by:
Ionela Voinescu <ionela.voinescu@arm.com>
Please register or sign in to comment