summaryrefslogtreecommitdiff
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorSrinivas Ramana <sramana@codeaurora.org>2016-05-13 12:58:08 +0530
committerKyle Yan <kyan@codeaurora.org>2016-06-13 19:06:16 -0700
commite6855ed3fecab3d3e2c30c57ca250de2e7934039 (patch)
tree0875f35faffbf915d044b221823957ea4a4b2aec /arch/arm/kernel
parent5f47a7839972fd1bd777d07c9c3aa3e58329c1a3 (diff)
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>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/devtree.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index 65addcbf5b30..e94422d0405c 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -88,6 +88,7 @@ void __init arm_dt_init_cpu_maps(void)
for_each_child_of_node(cpus, cpu) {
u32 hwid;
+ const __be32 *cell;
if (of_node_cmp(cpu->type, "cpu"))
continue;
@@ -98,13 +99,13 @@ void __init arm_dt_init_cpu_maps(void)
* properties is considered invalid to build the
* cpu_logical_map.
*/
- if (of_property_read_u32(cpu, "reg", &hwid)) {
- pr_debug(" * %s missing reg property\n",
- cpu->full_name);
+ cell = of_get_property(cpu, "reg", NULL);
+ if (!cell) {
+ pr_err("%s: missing reg property\n", cpu->full_name);
of_node_put(cpu);
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
* defines the MPIDR[23:0].