Lines Matching +full:cpu +full:- +full:map

1 // SPDX-License-Identifier: GPL-2.0-only
25 #include <asm/mach-types.h>
40 if (of_property_read_string(node, "enable-method", &method)) in set_smp_ops_by_method()
43 for (; m->method; m++) in set_smp_ops_by_method()
44 if (!strcmp(m->method, method)) { in set_smp_ops_by_method()
45 smp_set_ops(m->ops); in set_smp_ops_by_method()
60 * arm_dt_init_cpu_maps - Function retrieves cpu nodes from the device tree
61 * and builds the cpu logical map array containing MPIDR values related to
64 * Updates the cpu possible mask with the number of parsed cpu nodes
69 * Temp logical map is initialized with UINT_MAX values that are in arm_dt_init_cpu_maps()
70 * considered invalid logical map entries since the logical map must in arm_dt_init_cpu_maps()
74 struct device_node *cpu, *cpus; in arm_dt_init_cpu_maps() local
79 u32 tmp_map[NR_CPUS] = { [0 ... NR_CPUS-1] = MPIDR_INVALID }; in arm_dt_init_cpu_maps()
86 for_each_of_cpu_node(cpu) { in arm_dt_init_cpu_maps()
87 u32 hwid = of_get_cpu_hwid(cpu, 0); in arm_dt_init_cpu_maps()
89 pr_debug(" * %pOF...\n", cpu); in arm_dt_init_cpu_maps()
96 of_node_put(cpu); in arm_dt_init_cpu_maps()
109 "Duplicate /cpu reg properties in the DT\n")) { in arm_dt_init_cpu_maps()
110 of_node_put(cpu); in arm_dt_init_cpu_maps()
116 * requires that if detected the boot CPU must be assigned in arm_dt_init_cpu_maps()
118 * from 1. If a CPU node with a reg property matching the in arm_dt_init_cpu_maps()
119 * boot CPU MPIDR is detected, this is recorded so that the in arm_dt_init_cpu_maps()
120 * logical map built from DT is validated and can be used in arm_dt_init_cpu_maps()
121 * to override the map created in smp_setup_processor_id(). in arm_dt_init_cpu_maps()
130 if (WARN(cpuidx > nr_cpu_ids, "DT /cpu %u nodes greater than " in arm_dt_init_cpu_maps()
134 of_node_put(cpu); in arm_dt_init_cpu_maps()
141 found_method = set_smp_ops_by_method(cpu); in arm_dt_init_cpu_maps()
145 * Fallback to an enable-method in the cpus node if nothing found in in arm_dt_init_cpu_maps()
146 * a cpu node. in arm_dt_init_cpu_maps()
152 pr_warn("DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map\n"); in arm_dt_init_cpu_maps()
157 * Since the boot CPU node contains proper data, and all nodes have in arm_dt_init_cpu_maps()
158 * a reg property, the DT CPU list can be considered valid and the in arm_dt_init_cpu_maps()
159 * logical map created in smp_setup_processor_id() can be overridden in arm_dt_init_cpu_maps()
164 pr_debug("cpu logical map 0x%x\n", cpu_logical_map(i)); in arm_dt_init_cpu_maps()
168 bool arch_match_cpu_phys_id(int cpu, u64 phys_id) in arch_match_cpu_phys_id() argument
170 return phys_id == cpu_logical_map(cpu); in arch_match_cpu_phys_id()
182 *match = m->dt_compat; in arch_get_next_mach()
187 * setup_machine_fdt - Machine setup when an dtb was passed to the kernel
221 size -= strlen(prop) + 1; in setup_machine_fdt()
230 if (mdesc->dt_fixup) in setup_machine_fdt()
231 mdesc->dt_fixup(); in setup_machine_fdt()
236 __machine_arch_type = mdesc->nr; in setup_machine_fdt()