/* If the CPUs share the same clock, then they are in the same cluster. */ staticvoid __init armada_8k_get_sharing_cpus(struct clk *cur_clk, struct cpumask *cpumask)
{ int cpu;
cpu_dev = get_cpu_device(cpu); if (!cpu_dev) {
pr_warn("Failed to get cpu%d device\n", cpu); continue;
}
clk = clk_get(cpu_dev, NULL); if (IS_ERR(clk)) {
pr_warn("Cannot get clock for CPU %d\n", cpu);
} else { if (clk_is_match(clk, cur_clk))
cpumask_set_cpu(cpu, cpumask);
clk_put(clk);
}
}
}
staticint __init armada_8k_add_opp(struct clk *clk, struct device *cpu_dev, struct freq_table *freq_tables, int opps_index)
{ unsignedint cur_frequency; unsignedint freq; int i, ret;
/* Get nominal (current) CPU frequency. */
cur_frequency = clk_get_rate(clk); if (!cur_frequency) {
dev_err(cpu_dev, "Failed to get clock rate for this CPU\n"); return -EINVAL;
}
freq_tables[opps_index].cpu_dev = cpu_dev;
for (i = 0; i < ARRAY_SIZE(opps_div); i++) {
freq = cur_frequency / opps_div[i];
ret = dev_pm_opp_add(cpu_dev, freq, 0); if (ret) return ret;
freq_tables[opps_index].freq[i] = freq;
}
return0;
}
staticvoid armada_8k_cpufreq_free_table(struct freq_table *freq_tables)
{ int opps_index, nb_cpus = num_possible_cpus();
for (opps_index = 0 ; opps_index < nb_cpus; opps_index++) { int i;
/* If cpu_dev is NULL then we reached the end of the array */ if (!freq_tables[opps_index].cpu_dev) break;
for (i = 0; i < ARRAY_SIZE(opps_div); i++) { /* *A0Hzfrequencyisnotvalid,thismeant *thatitwasnotyetinitializedsothereis *nomoreopptofree
*/ if (freq_tables[opps_index].freq[i] == 0) break;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.