From 9753f2c5b3ddd6cc05a1ffaa0e07de3e1bd56062 Mon Sep 17 00:00:00 2001
From: "a@b.com"
Date: Thu, 27 Apr 2023 15:50:43 +0800
Subject: [PATCH] =?UTF-8?q?=E7=A1=AC=E7=BC=96=E7=A0=81cpu=20topo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: a@b.com
---
arch/arm64/kernel/cpuinfo.c | 3 +++
arch/arm64/kernel/topology.c | 19 ++++++++++++++++---
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
index a326ce7ecc8e..51515fb07679 100644
--- a/arch/arm64/kernel/cpuinfo.c
+++ b/arch/arm64/kernel/cpuinfo.c
@@ -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);
diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
index 543c67cae02f..d208a55ae785 100644
--- a/arch/arm64/kernel/topology.c
+++ b/arch/arm64/kernel/topology.c
@@ -17,10 +17,12 @@
#include
#include
#include
+#include
#include
#include
#include
+#include
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