arm64: topology: move store_cpu_topology() to shared code
[platform/kernel/linux-rpi.git] / drivers / base / arch_topology.c
index ef4fc89..31bd6f4 100644 (file)
@@ -690,4 +690,23 @@ void __init init_cpu_topology(void)
        else if (of_have_populated_dt() && parse_dt_topology())
                reset_cpu_topology();
 }
+
+void store_cpu_topology(unsigned int cpuid)
+{
+       struct cpu_topology *cpuid_topo = &cpu_topology[cpuid];
+
+       if (cpuid_topo->package_id != -1)
+               goto topology_populated;
+
+       cpuid_topo->thread_id = -1;
+       cpuid_topo->core_id = cpuid;
+       cpuid_topo->package_id = cpu_to_node(cpuid);
+
+       pr_debug("CPU%u: package %d core %d thread %d\n",
+                cpuid, cpuid_topo->package_id, cpuid_topo->core_id,
+                cpuid_topo->thread_id);
+
+topology_populated:
+       update_siblings_masks(cpuid);
+}
 #endif