blob: 4e9b95745217d8a28f4cf0626c98622ecd2b2c55 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASM_ARM_TOPOLOGY_H
2#define _ASM_ARM_TOPOLOGY_H
3
Vincent Guittotc9018aa2011-08-08 13:21:59 +01004#ifdef CONFIG_ARM_CPU_TOPOLOGY
5
Steve Muckle05739342016-05-04 18:56:45 -07006#include <linux/cpufreq.h>
Vincent Guittotc9018aa2011-08-08 13:21:59 +01007#include <linux/cpumask.h>
8
9struct cputopo_arm {
10 int thread_id;
11 int core_id;
12 int socket_id;
13 cpumask_t thread_sibling;
14 cpumask_t core_sibling;
15};
16
17extern struct cputopo_arm cpu_topology[NR_CPUS];
18
19#define topology_physical_package_id(cpu) (cpu_topology[cpu].socket_id)
20#define topology_core_id(cpu) (cpu_topology[cpu].core_id)
21#define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling)
Bartosz Golaszewski06931e62015-05-26 15:11:28 +020022#define topology_sibling_cpumask(cpu) (&cpu_topology[cpu].thread_sibling)
Vincent Guittotc9018aa2011-08-08 13:21:59 +010023
Vincent Guittotc9018aa2011-08-08 13:21:59 +010024void init_cpu_topology(void);
25void store_cpu_topology(unsigned int cpuid);
Vincent Guittot4cbd6b12011-11-29 15:50:20 +010026const struct cpumask *cpu_coregroup_mask(int cpu);
Vincent Guittotc9018aa2011-08-08 13:21:59 +010027
Dietmar Eggemann42083ec2015-09-23 12:47:48 +010028#ifdef CONFIG_CPU_FREQ
Dietmar Eggemann42083ec2015-09-23 12:47:48 +010029#define arch_scale_freq_capacity cpufreq_scale_freq_capacity
Dietmar Eggemann47a69f02017-07-14 14:37:26 +010030#define arch_scale_max_freq_capacity cpufreq_scale_max_freq_capacity
Ionela Voinescu4f7837d2017-12-07 17:58:37 +000031#define arch_scale_min_freq_capacity cpufreq_scale_min_freq_capacity
Dietmar Eggemann42083ec2015-09-23 12:47:48 +010032#endif
Morten Rasmussen25cea242015-04-14 16:25:31 +010033#define arch_scale_cpu_capacity scale_cpu_capacity
34extern unsigned long scale_cpu_capacity(struct sched_domain *sd, int cpu);
Dietmar Eggemann42083ec2015-09-23 12:47:48 +010035
Vincent Guittotc9018aa2011-08-08 13:21:59 +010036#else
37
38static inline void init_cpu_topology(void) { }
39static inline void store_cpu_topology(unsigned int cpuid) { }
40
41#endif
42
Linus Torvalds1da177e2005-04-16 15:20:36 -070043#include <asm-generic/topology.h>
44
45#endif /* _ASM_ARM_TOPOLOGY_H */