arm: cpu: read all address cells in dt for cpuid
For v8/arm64 platforms the number of address-cells can be 2. If the same device tree is used on 32-bit platforms,it is currently reading only one cell of 32-bits. Fix this by reading both cells for getting the hwid. Change-Id: Id281b6b8ac3c9312848c39e11019284f970caced Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
This commit is contained in:
parent
5f47a78399
commit
e6855ed3fe
1 changed files with 5 additions and 4 deletions
|
@ -88,6 +88,7 @@ void __init arm_dt_init_cpu_maps(void)
|
||||||
|
|
||||||
for_each_child_of_node(cpus, cpu) {
|
for_each_child_of_node(cpus, cpu) {
|
||||||
u32 hwid;
|
u32 hwid;
|
||||||
|
const __be32 *cell;
|
||||||
|
|
||||||
if (of_node_cmp(cpu->type, "cpu"))
|
if (of_node_cmp(cpu->type, "cpu"))
|
||||||
continue;
|
continue;
|
||||||
|
@ -98,13 +99,13 @@ void __init arm_dt_init_cpu_maps(void)
|
||||||
* properties is considered invalid to build the
|
* properties is considered invalid to build the
|
||||||
* cpu_logical_map.
|
* cpu_logical_map.
|
||||||
*/
|
*/
|
||||||
if (of_property_read_u32(cpu, "reg", &hwid)) {
|
cell = of_get_property(cpu, "reg", NULL);
|
||||||
pr_debug(" * %s missing reg property\n",
|
if (!cell) {
|
||||||
cpu->full_name);
|
pr_err("%s: missing reg property\n", cpu->full_name);
|
||||||
of_node_put(cpu);
|
of_node_put(cpu);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
hwid = of_read_number(cell, of_n_addr_cells(cpu));
|
||||||
/*
|
/*
|
||||||
* 8 MSBs must be set to 0 in the DT since the reg property
|
* 8 MSBs must be set to 0 in the DT since the reg property
|
||||||
* defines the MPIDR[23:0].
|
* defines the MPIDR[23:0].
|
||||||
|
|
Loading…
Add table
Reference in a new issue