Lines Matching +full:capacity +full:- +full:dmips +full:- +full:mhz
1 // SPDX-License-Identifier: GPL-2.0
61 void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity) in topology_set_cpu_scale() argument
63 per_cpu(cpu_scale, cpu) = capacity; in topology_set_cpu_scale()
83 return sysfs_emit(buf, "%lu\n", topology_get_cpu_scale(cpu->dev.id)); in cpu_capacity_show()
142 u64 capacity; in topology_normalize_cpu_scale() local
151 capacity = raw_capacity[cpu] * per_cpu(freq_factor, cpu); in topology_normalize_cpu_scale()
152 capacity_scale = max(capacity, capacity_scale); in topology_normalize_cpu_scale()
157 capacity = raw_capacity[cpu] * per_cpu(freq_factor, cpu); in topology_normalize_cpu_scale()
158 capacity = div64_u64(capacity << SCHED_CAPACITY_SHIFT, in topology_normalize_cpu_scale()
160 topology_set_cpu_scale(cpu, capacity); in topology_normalize_cpu_scale()
176 ret = of_property_read_u32(cpu_node, "capacity-dmips-mhz", in topology_parse_cpu_capacity()
194 * For non-clk CPU DVFS mechanism, there's no way to get the in topology_parse_cpu_capacity()
206 pr_err("cpu_capacity: missing %pOF raw capacity\n", in topology_parse_cpu_capacity()
236 pr_debug("cpu_capacity: init cpu capacity for CPUs [%*pbl] (to_visit=%*pbl)\n", in init_cpu_capacity_callback()
237 cpumask_pr_args(policy->related_cpus), in init_cpu_capacity_callback()
240 cpumask_andnot(cpus_to_visit, cpus_to_visit, policy->related_cpus); in init_cpu_capacity_callback()
242 for_each_cpu(cpu, policy->related_cpus) in init_cpu_capacity_callback()
243 per_cpu(freq_factor, cpu) = policy->cpuinfo.max_freq / 1000; in init_cpu_capacity_callback()
265 * on ACPI-based systems we need to use the default cpu capacity in register_cpufreq_notifier()
266 * until we have the necessary code to parse the cpu capacity, so in register_cpufreq_notifier()
270 return -EINVAL; in register_cpufreq_notifier()
273 return -ENOMEM; in register_cpufreq_notifier()
303 * (2) -ENODEV when the device tree(DT) node is valid and found in the DT but
307 * (3) -1 if the node does not exist in the device tree
316 return -1; in get_cpu_for_node()
348 } else if (cpu != -ENODEV) { in parse_core()
351 return -EINVAL; in parse_core()
363 return -EINVAL; in parse_core()
368 } else if (leaf && cpu != -ENODEV) { in parse_core()
370 return -EINVAL; in parse_core()
414 pr_err("%pOF: cpu-map children should be clusters\n", in parse_cluster()
417 return -EINVAL; in parse_cluster()
423 pr_err("%pOF: Non-leaf cluster with core %s\n", in parse_cluster()
425 ret = -EINVAL; in parse_cluster()
457 * When topology is provided cpu-map is essentially a root in parse_dt_topology()
460 map = of_get_child_by_name(cn, "cpu-map"); in parse_dt_topology()
475 if (cpu_topology[cpu].package_id == -1) in parse_dt_topology()
476 ret = -EINVAL; in parse_dt_topology()
501 if (cpu_topology[cpu].llc_id != -1) { in cpu_coregroup_mask()
518 if (cpuid_topo->llc_id == cpu_topo->llc_id) { in update_siblings_masks()
519 cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling); in update_siblings_masks()
520 cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling); in update_siblings_masks()
523 if (cpuid_topo->package_id != cpu_topo->package_id) in update_siblings_masks()
526 cpumask_set_cpu(cpuid, &cpu_topo->core_sibling); in update_siblings_masks()
527 cpumask_set_cpu(cpu, &cpuid_topo->core_sibling); in update_siblings_masks()
529 if (cpuid_topo->core_id != cpu_topo->core_id) in update_siblings_masks()
532 cpumask_set_cpu(cpuid, &cpu_topo->thread_sibling); in update_siblings_masks()
533 cpumask_set_cpu(cpu, &cpuid_topo->thread_sibling); in update_siblings_masks()
541 cpumask_clear(&cpu_topo->llc_sibling); in clear_cpu_topology()
542 cpumask_set_cpu(cpu, &cpu_topo->llc_sibling); in clear_cpu_topology()
544 cpumask_clear(&cpu_topo->core_sibling); in clear_cpu_topology()
545 cpumask_set_cpu(cpu, &cpu_topo->core_sibling); in clear_cpu_topology()
546 cpumask_clear(&cpu_topo->thread_sibling); in clear_cpu_topology()
547 cpumask_set_cpu(cpu, &cpu_topo->thread_sibling); in clear_cpu_topology()
557 cpu_topo->thread_id = -1; in reset_cpu_topology()
558 cpu_topo->core_id = -1; in reset_cpu_topology()
559 cpu_topo->package_id = -1; in reset_cpu_topology()
560 cpu_topo->llc_id = -1; in reset_cpu_topology()