Lines Matching +full:capacity +full:- +full:dmips +full:- +full:mhz
1 // SPDX-License-Identifier: GPL-2.0
66 void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity) in topology_set_cpu_scale() argument
68 per_cpu(cpu_scale, cpu) = capacity; in topology_set_cpu_scale()
90 return sysfs_emit(buf, "%lu\n", topology_get_cpu_scale(cpu->dev.id)); in cpu_capacity_show()
153 u64 capacity; in topology_normalize_cpu_scale() local
162 capacity = raw_capacity[cpu] * per_cpu(freq_factor, cpu); in topology_normalize_cpu_scale()
163 capacity_scale = max(capacity, capacity_scale); in topology_normalize_cpu_scale()
168 capacity = raw_capacity[cpu] * per_cpu(freq_factor, cpu); in topology_normalize_cpu_scale()
169 capacity = div64_u64(capacity << SCHED_CAPACITY_SHIFT, in topology_normalize_cpu_scale()
171 topology_set_cpu_scale(cpu, capacity); in topology_normalize_cpu_scale()
187 ret = of_property_read_u32(cpu_node, "capacity-dmips-mhz", in topology_parse_cpu_capacity()
205 * For non-clk CPU DVFS mechanism, there's no way to get the in topology_parse_cpu_capacity()
217 pr_err("cpu_capacity: missing %pOF raw capacity\n", in topology_parse_cpu_capacity()
247 pr_debug("cpu_capacity: init cpu capacity for CPUs [%*pbl] (to_visit=%*pbl)\n", in init_cpu_capacity_callback()
248 cpumask_pr_args(policy->related_cpus), in init_cpu_capacity_callback()
251 cpumask_andnot(cpus_to_visit, cpus_to_visit, policy->related_cpus); in init_cpu_capacity_callback()
253 for_each_cpu(cpu, policy->related_cpus) in init_cpu_capacity_callback()
254 per_cpu(freq_factor, cpu) = policy->cpuinfo.max_freq / 1000; in init_cpu_capacity_callback()
276 * on ACPI-based systems we need to use the default cpu capacity in register_cpufreq_notifier()
277 * until we have the necessary code to parse the cpu capacity, so in register_cpufreq_notifier()
281 return -EINVAL; in register_cpufreq_notifier()
284 return -ENOMEM; in register_cpufreq_notifier()
314 * (2) -ENODEV when the device tree(DT) node is valid and found in the DT but
318 * (3) -1 if the node does not exist in the device tree
327 return -1; in get_cpu_for_node()
359 } else if (cpu != -ENODEV) { in parse_core()
362 return -EINVAL; in parse_core()
374 return -EINVAL; in parse_core()
379 } else if (leaf && cpu != -ENODEV) { in parse_core()
381 return -EINVAL; in parse_core()
425 pr_err("%pOF: cpu-map children should be clusters\n", in parse_cluster()
428 return -EINVAL; in parse_cluster()
434 pr_err("%pOF: Non-leaf cluster with core %s\n", in parse_cluster()
436 ret = -EINVAL; in parse_cluster()
468 * When topology is provided cpu-map is essentially a root in parse_dt_topology()
471 map = of_get_child_by_name(cn, "cpu-map"); in parse_dt_topology()
486 if (cpu_topology[cpu].package_id == -1) in parse_dt_topology()
487 ret = -EINVAL; in parse_dt_topology()
512 if (cpu_topology[cpu].llc_id != -1) { in cpu_coregroup_mask()
529 if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) { in update_siblings_masks()
530 cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling); in update_siblings_masks()
531 cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling); in update_siblings_masks()
534 if (cpuid_topo->package_id != cpu_topo->package_id) in update_siblings_masks()
537 cpumask_set_cpu(cpuid, &cpu_topo->core_sibling); in update_siblings_masks()
538 cpumask_set_cpu(cpu, &cpuid_topo->core_sibling); in update_siblings_masks()
540 if (cpuid_topo->core_id != cpu_topo->core_id) in update_siblings_masks()
543 cpumask_set_cpu(cpuid, &cpu_topo->thread_sibling); in update_siblings_masks()
544 cpumask_set_cpu(cpu, &cpuid_topo->thread_sibling); in update_siblings_masks()
552 cpumask_clear(&cpu_topo->llc_sibling); in clear_cpu_topology()
553 cpumask_set_cpu(cpu, &cpu_topo->llc_sibling); in clear_cpu_topology()
555 cpumask_clear(&cpu_topo->core_sibling); in clear_cpu_topology()
556 cpumask_set_cpu(cpu, &cpu_topo->core_sibling); in clear_cpu_topology()
557 cpumask_clear(&cpu_topo->thread_sibling); in clear_cpu_topology()
558 cpumask_set_cpu(cpu, &cpu_topo->thread_sibling); in clear_cpu_topology()
568 cpu_topo->thread_id = -1; in reset_cpu_topology()
569 cpu_topo->core_id = -1; in reset_cpu_topology()
570 cpu_topo->package_id = -1; in reset_cpu_topology()
571 cpu_topo->llc_id = -1; in reset_cpu_topology()
615 if (cpuid_topo->package_id != -1) in store_cpu_topology()
618 cpuid_topo->thread_id = -1; in store_cpu_topology()
619 cpuid_topo->core_id = cpuid; in store_cpu_topology()
620 cpuid_topo->package_id = cpu_to_node(cpuid); in store_cpu_topology()
623 cpuid, cpuid_topo->package_id, cpuid_topo->core_id, in store_cpu_topology()
624 cpuid_topo->thread_id); in store_cpu_topology()