From patchwork Sat Jan 16 05:01:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8048691 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C7570BEEE5 for ; Sat, 16 Jan 2016 05:11:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E316420381 for ; Sat, 16 Jan 2016 05:11:42 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D81042037F for ; Sat, 16 Jan 2016 05:11:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aKJ6w-00080B-At; Sat, 16 Jan 2016 05:09:14 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aKJ6v-0007zh-2H for xen-devel@lists.xen.org; Sat, 16 Jan 2016 05:09:13 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 11/B2-13487-870D9965; Sat, 16 Jan 2016 05:09:12 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1452920947!16227866!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46581 invoked from network); 16 Jan 2016 05:09:10 -0000 Received: from szxga02-in.huawei.com (HELO szxga02-in.huawei.com) (119.145.14.65) by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 16 Jan 2016 05:09:10 -0000 Received: from 172.24.1.49 (EHLO szxeml430-hub.china.huawei.com) ([172.24.1.49]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CZY66088; Sat, 16 Jan 2016 13:02:29 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.235.1; Sat, 16 Jan 2016 13:02:18 +0800 From: Shannon Zhao To: Date: Sat, 16 Jan 2016 13:01:13 +0800 Message-ID: <1452920477-13916-7-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1452920477-13916-1-git-send-email-zhaoshenglong@huawei.com> References: <1452920477-13916-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.5699CEE5.0140, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 73c5dfca3f9a8f7011914d854209f67a Cc: julien.grall@citrix.com, peter.huangpeng@huawei.com, stefano.stabellini@citrix.com, ian.campbell@citrix.com, shannon.zhao@linaro.org Subject: [Xen-devel] [PATCH v4 06/10] arm/smpboot: Move dt specific code in smp to seperate functions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shannon Zhao Partition smp initialization functions into generic and dt specific parts, this will be useful when introducing new functions for smp initialization based on acpi. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini --- xen/arch/arm/arm64/smpboot.c | 7 ++++++- xen/arch/arm/smpboot.c | 29 ++++++++++++++++++----------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c index 62e6abb..7928f69 100644 --- a/xen/arch/arm/arm64/smpboot.c +++ b/xen/arch/arm/arm64/smpboot.c @@ -70,7 +70,7 @@ int __init arch_smp_init(void) return 0; } -int __init arch_cpu_init(int cpu, struct dt_device_node *dn) +static int __init dt_arch_cpu_init(int cpu, struct dt_device_node *dn) { const char *enable_method; @@ -94,6 +94,11 @@ int __init arch_cpu_init(int cpu, struct dt_device_node *dn) return 0; } +int __init arch_cpu_init(int cpu, struct dt_device_node *dn) +{ + return dt_arch_cpu_init(cpu, dn); +} + int __init arch_cpu_up(int cpu) { if ( !smp_enable_ops[cpu].prepare_cpu ) diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index 00b2b2a..b6119d1 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -92,7 +92,7 @@ smp_clear_cpu_maps (void) * MPIDR values related to logical cpus * Code base on Linux arch/arm/kernel/devtree.c */ -void __init smp_init_cpus(void) +static void __init dt_smp_init_cpus(void) { register_t mpidr; struct dt_device_node *cpus = dt_find_node_by_path("/cpus"); @@ -106,16 +106,6 @@ void __init smp_init_cpus(void) bool_t bootcpu_valid = 0; int rc; - /* scan the DTB for a PSCI node and set a global variable */ - psci_init(); - - if ( (rc = arch_smp_init()) < 0 ) - { - printk(XENLOG_WARNING "SMP init failed (%d)\n" - "Using only 1 CPU\n", rc); - return; - } - mpidr = boot_cpu_data.mpidr.bits & MPIDR_HWID_MASK; if ( !cpus ) @@ -243,6 +233,23 @@ void __init smp_init_cpus(void) } } +void __init smp_init_cpus(void) +{ + int rc; + + /* initialize PSCI and set a global variable */ + psci_init(); + + if ( (rc = arch_smp_init()) < 0 ) + { + printk(XENLOG_WARNING "SMP init failed (%d)\n" + "Using only 1 CPU\n", rc); + return; + } + + dt_smp_init_cpus(); +} + int __init smp_get_max_cpus (void) {