Merge tag 'riscv-for-linus-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / arch / arm / mach-imx / platsmp.c
index cf4e933..9726390 100644 (file)
@@ -92,6 +92,32 @@ const struct smp_operations imx_smp_ops __initconst = {
 #endif
 };
 
+/*
+ * Initialise the CPU possible map early - this describes the CPUs
+ * which may be present or become present in the system.
+ */
+static void __init imx7_smp_init_cpus(void)
+{
+       struct device_node *np;
+       int i, ncores = 0;
+
+       /* The iMX7D SCU does not report core count, get it from DT */
+       for_each_of_cpu_node(np)
+               ncores++;
+
+       for (i = ncores; i < NR_CPUS; i++)
+               set_cpu_possible(i, false);
+}
+
+const struct smp_operations imx7_smp_ops __initconst = {
+       .smp_init_cpus          = imx7_smp_init_cpus,
+       .smp_boot_secondary     = imx_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+       .cpu_die                = imx_cpu_die,
+       .cpu_kill               = imx_cpu_kill,
+#endif
+};
+
 #define DCFG_CCSR_SCRATCHRW1   0x200
 
 static int ls1021a_boot_secondary(unsigned int cpu, struct task_struct *idle)