硬编码cpu topo

Signed-off-by: a@b.com <a@b.com>
This commit is contained in:
a@b.com 2023-04-27 15:50:43 +08:00
parent 788dc6a895
commit 9753f2c5b3
2 changed files with 19 additions and 3 deletions

View File

@ -205,6 +205,9 @@ static int c_show(struct seq_file *m, void *v)
}
}
#endif
else {
seq_printf(m, "model name\t: %s\n", midr_to_desc(midr));
}
seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
loops_per_jiffy / (500000UL/HZ),
loops_per_jiffy / (5000UL/HZ) % 100);

View File

@ -17,10 +17,12 @@
#include <linux/cpufreq.h>
#include <linux/init.h>
#include <linux/percpu.h>
#include <linux/cputypes.h>
#include <asm/cpu.h>
#include <asm/cputype.h>
#include <asm/topology.h>
#include <linux/classtypes.h>
void store_cpu_topology(unsigned int cpuid)
{
@ -51,15 +53,26 @@ void store_cpu_topology(unsigned int cpuid)
* need to entirely ignore MPIDR for any topology deduction.
*/
cpuid_topo->thread_id = -1;
cpuid_topo->core_id = cpuid;
cpuid_topo->package_id = cpu_to_node(cpuid);
pr_info("Q cpu_name %s\n", get_cpu_name());
if(cpu_is_ft2004()) {
cpuid_topo->core_id = cpuid%2;
cpuid_topo->package_id = cpuid/2;
} else {
cpuid_topo->core_id = cpuid;
cpuid_topo->package_id = cpu_to_node(cpuid);
}
pr_debug("CPU%u: cluster %d core %d thread %d mpidr %#016llx\n",
cpuid, cpuid_topo->package_id, cpuid_topo->core_id,
cpuid_topo->thread_id, mpidr);
topology_populated:
pr_info("x CPU%u: cluster %d core %d thread %d mpidr %#016llx\n",
cpuid, cpuid_topo->package_id, cpuid_topo->core_id,
cpuid_topo->thread_id, mpidr);
update_siblings_masks(cpuid);
pr_info("y CPU%u: cluster %d core %d thread %d mpidr %#016llx\n",
cpuid, cpuid_topo->package_id, cpuid_topo->core_id,
cpuid_topo->thread_id, mpidr);
}
#ifdef CONFIG_ACPI