As we have option in u-boot to set CPU mask for running linux,
we want to pass information to kernel about CPU cores should
be brought up.
So we patch kernel dtb in u-boot to set CPUs status.
On linux boot we setup cpu possible mask according to status
field in each cpu node. It is generic method according to ePAPR:
status - a standard property describing the state of a CPU.
This property shall be present for nodes representing CPUs in a
symmetric multiprocessing (SMP) configuration. For a CPU node
the meaning of the "okay" and "disabled" values are as follows:
"okay" - The CPU is running; "disabled" - The CPU is in a
quiescent state."
Also we setup MCIP debug mask according cpu possible mask.
[snip]
@@ -102,9 +104,13 @@ static void mcip_probe_n_setup(void)
cpuinfo_arc700[0].extn.gfrc = mp.gfrc;
+ for (i = 0; i < NR_CPUS; i++)
+ if (cpu_possible(i))
+ mcip_mask |= BIT(i);
+
[snip]
+/* Mark cpu as possible if cpu status is "okay" or status absents */
+void __init smp_init_cpumask(void)
+{
+ const struct fdt_property *prop;
+ char fdt_cpu_path[25];
+ unsigned int i, oft;
+
+ for (i = 0; i < NR_CPUS; i++) {
+ sprintf(fdt_cpu_path, "/cpus/cpu@%u", i);
+ oft = fdt_path_offset(initial_boot_params, fdt_cpu_path);
+ prop = fdt_get_property(initial_boot_params, oft, "status", NULL);
+
+ /* No status property == status OK */
+ if (!prop) {
+ set_cpu_possible(i, true);
+ continue;
+ }
+
+ if (!strcmp("okay", prop->data))
+ set_cpu_possible(i, true);
+ }
+}