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

1 // SPDX-License-Identifier: GPL-2.0-only
24 #include <asm/mach-types.h>
39 if (of_property_read_string(node, "enable-method", &method)) in set_smp_ops_by_method()
42 for (; m->method; m++) in set_smp_ops_by_method()
43 if (!strcmp(m->method, method)) { in set_smp_ops_by_method()
44 smp_set_ops(m->ops); in set_smp_ops_by_method()
59 * arm_dt_init_cpu_maps - Function retrieves cpu nodes from the device tree
60 * and builds the cpu logical map array containing MPIDR values related to
63 * Updates the cpu possible mask with the number of parsed cpu nodes
68 * Temp logical map is initialized with UINT_MAX values that are in arm_dt_init_cpu_maps()
69 * considered invalid logical map entries since the logical map must in arm_dt_init_cpu_maps()
73 struct device_node *cpu, *cpus; in arm_dt_init_cpu_maps() local
78 u32 tmp_map[NR_CPUS] = { [0 ... NR_CPUS-1] = MPIDR_INVALID }; in arm_dt_init_cpu_maps()
85 for_each_of_cpu_node(cpu) { in arm_dt_init_cpu_maps()
86 u32 hwid = of_get_cpu_hwid(cpu, 0); in arm_dt_init_cpu_maps()
88 pr_debug(" * %pOF...\n", cpu); in arm_dt_init_cpu_maps()
95 of_node_put(cpu); in arm_dt_init_cpu_maps()
108 "Duplicate /cpu reg properties in the DT\n")) { in arm_dt_init_cpu_maps()
109 of_node_put(cpu); in arm_dt_init_cpu_maps()
115 * requires that if detected the boot CPU must be assigned in arm_dt_init_cpu_maps()
117 * from 1. If a CPU node with a reg property matching the in arm_dt_init_cpu_maps()
118 * boot CPU MPIDR is detected, this is recorded so that the in arm_dt_init_cpu_maps()
119 * logical map built from DT is validated and can be used in arm_dt_init_cpu_maps()
120 * to override the map created in smp_setup_processor_id(). in arm_dt_init_cpu_maps()
129 if (WARN(cpuidx > nr_cpu_ids, "DT /cpu %u nodes greater than " in arm_dt_init_cpu_maps()
133 of_node_put(cpu); in arm_dt_init_cpu_maps()
140 found_method = set_smp_ops_by_method(cpu); in arm_dt_init_cpu_maps()
144 * Fallback to an enable-method in the cpus node if nothing found in in arm_dt_init_cpu_maps()
145 * a cpu node. in arm_dt_init_cpu_maps()
151 pr_warn("DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map\n"); in arm_dt_init_cpu_maps()
156 * Since the boot CPU node contains proper data, and all nodes have in arm_dt_init_cpu_maps()
157 * a reg property, the DT CPU list can be considered valid and the in arm_dt_init_cpu_maps()
158 * logical map created in smp_setup_processor_id() can be overridden in arm_dt_init_cpu_maps()
163 pr_debug("cpu logical map 0x%x\n", cpu_logical_map(i)); in arm_dt_init_cpu_maps()
167 bool arch_match_cpu_phys_id(int cpu, u64 phys_id) in arch_match_cpu_phys_id() argument
169 return phys_id == cpu_logical_map(cpu); in arch_match_cpu_phys_id()
181 *match = m->dt_compat; in arch_get_next_mach()
186 * setup_machine_fdt - Machine setup when an dtb was passed to the kernel
220 size -= strlen(prop) + 1; in setup_machine_fdt()
229 if (mdesc->dt_fixup) in setup_machine_fdt()
230 mdesc->dt_fixup(); in setup_machine_fdt()
235 __machine_arch_type = mdesc->nr; in setup_machine_fdt()