Thread (127 messages) 127 messages, 17 authors, 2013-09-10

[PATCH v3 02/16] ARM: DT/kernel: define ARM specific arch_match_cpu_phys_id

From: Nicolas Pitre <hidden>
Date: 2013-07-22 14:15:00
Also in: linux-pm, lkml

On Mon, 22 Jul 2013, Sudeep KarkadaNagesha wrote:
From: Sudeep KarkadaNagesha <redacted>

OF/DT core library now provides architecture specific hook to match the
logical cpu index with the corresponding physical identifier. Most of the
cpu DT node parsing and initialisation is contained in devtree.c. So it's
better to define ARM specific arch_match_cpu_phys_id there.

This mainly helps to avoid replication of the code doing CPU node parsing
and physical(MPIDR) to logical mapping.

Cc: Russell King <redacted>
Cc: Lorenzo Pieralisi <redacted>
Acked-by: Rob Herring <redacted>
Signed-off-by: Sudeep KarkadaNagesha <redacted>
Acked-by: Nicolas Pitre <redacted>

quoted hunk ↗ jump to hunk
---
 arch/arm/kernel/devtree.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index 5859c8b..2ee8a17 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -169,6 +169,11 @@ void __init arm_dt_init_cpu_maps(void)
 	}
 }
 
+bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
+{
+	return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu);
+}
+
 /**
  * setup_machine_fdt - Machine setup when an dtb was passed to the kernel
  * @dt_phys: physical address of dt blob
-- 
1.8.1.2


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help