arm64, topology: Updates to use DT bindings for EAS costing data
With the bindings and the associated accessors to extract data from the bindings in place, remove the static hard-coded data from topology.c and use the accesors instead. Signed-off-by: Robin Randhawa <robin.randhawa@arm.com>
This commit is contained in:
parent
907f4d5e6a
commit
10c505ffd2
1 changed files with 33 additions and 0 deletions
|
@ -19,6 +19,8 @@
|
||||||
#include <linux/nodemask.h>
|
#include <linux/nodemask.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
#include <linux/sched_energy.h>
|
||||||
|
|
||||||
#include <asm/cputype.h>
|
#include <asm/cputype.h>
|
||||||
#include <asm/topology.h>
|
#include <asm/topology.h>
|
||||||
|
@ -218,6 +220,33 @@ out:
|
||||||
struct cpu_topology cpu_topology[NR_CPUS];
|
struct cpu_topology cpu_topology[NR_CPUS];
|
||||||
EXPORT_SYMBOL_GPL(cpu_topology);
|
EXPORT_SYMBOL_GPL(cpu_topology);
|
||||||
|
|
||||||
|
/* sd energy functions */
|
||||||
|
static inline
|
||||||
|
const struct sched_group_energy * const cpu_cluster_energy(int cpu)
|
||||||
|
{
|
||||||
|
struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL1];
|
||||||
|
|
||||||
|
if (!sge) {
|
||||||
|
pr_warn("Invalid sched_group_energy for Cluster%d\n", cpu);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return sge;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline
|
||||||
|
const struct sched_group_energy * const cpu_core_energy(int cpu)
|
||||||
|
{
|
||||||
|
struct sched_group_energy *sge = sge_array[cpu][SD_LEVEL0];
|
||||||
|
|
||||||
|
if (!sge) {
|
||||||
|
pr_warn("Invalid sched_group_energy for CPU%d\n", cpu);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return sge;
|
||||||
|
}
|
||||||
|
|
||||||
const struct cpumask *cpu_coregroup_mask(int cpu)
|
const struct cpumask *cpu_coregroup_mask(int cpu)
|
||||||
{
|
{
|
||||||
return &cpu_topology[cpu].core_sibling;
|
return &cpu_topology[cpu].core_sibling;
|
||||||
|
@ -344,4 +373,8 @@ void __init init_cpu_topology(void)
|
||||||
*/
|
*/
|
||||||
if (of_have_populated_dt() && parse_dt_topology())
|
if (of_have_populated_dt() && parse_dt_topology())
|
||||||
reset_cpu_topology();
|
reset_cpu_topology();
|
||||||
|
else
|
||||||
|
set_sched_topology(arm64_topology);
|
||||||
|
|
||||||
|
init_sched_energy_costs();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue