Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757529Ab3GVLcr (ORCPT ); Mon, 22 Jul 2013 07:32:47 -0400 Received: from service87.mimecast.com ([91.220.42.44]:36177 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756180Ab3GVLcl (ORCPT ); Mon, 22 Jul 2013 07:32:41 -0400 From: Sudeep KarkadaNagesha To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org Cc: Sudeep.KarkadaNagesha@arm.com, Russell King , Shawn Guo , Gregory Clement , Greg Kroah-Hartman , Viresh Kumar , "Rafael J. Wysocki" , Grant Likely , Rob Herring , Lorenzo Pieralisi , Olof Johansson , Arnd Bergmann , Sudeep KarkadaNagesha Subject: [PATCH v3 02/16] ARM: DT/kernel: define ARM specific arch_match_cpu_phys_id Date: Mon, 22 Jul 2013 12:32:13 +0100 Message-Id: <1374492747-13879-3-git-send-email-Sudeep.KarkadaNagesha@arm.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1374492747-13879-1-git-send-email-Sudeep.KarkadaNagesha@arm.com> References: <1374069984-20567-1-git-send-email-Sudeep.KarkadaNagesha@arm.com> <1374492747-13879-1-git-send-email-Sudeep.KarkadaNagesha@arm.com> X-OriginalArrivalTime: 22 Jul 2013 11:32:35.0843 (UTC) FILETIME=[29D3ED30:01CE86CF] X-MC-Unique: 113072212323714201 Content-Type: text/plain; charset=WINDOWS-1252 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id r6MBZKc2009673 Content-Length: 1476 Lines: 43 From: Sudeep KarkadaNagesha 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 Cc: Lorenzo Pieralisi Acked-by: Rob Herring Signed-off-by: Sudeep KarkadaNagesha --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/