From patchwork Sun May 17 20:03:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parth Dixit X-Patchwork-Id: 48633 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3832A21411 for ; Sun, 17 May 2015 20:05:59 +0000 (UTC) Received: by wivs14 with SMTP id s14sf15380004wiv.1 for ; Sun, 17 May 2015 13:05:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=5R8WllKkK+nnfjzhembVJyKwjQO0K+mWbU0TmWFnJMg=; b=M6MKLr7Greevn2HP88++pdG378OGn6phKQf+rUdhUwDltm8S1gx/YXKqbkjfQt61XF weSAtuvTo2iTBO5H5/2XvTES9AE6VjR/clHeGkpJasnMTNjtejAguxeJ6Qqc+nMzNsSz 9XnxDcYyB38gykaC4zTH1ebtKbtm+jCmriADymzJp8JJSyDFzkPIHJqwvs0UesAMMzt/ s30Z8kc4paG2xQ7tUd4CzVzVmad5Zc9m+aoWYFrkgIDhsFBE3y6erxcmXN85FvmjBYv3 DcFLnwz+oEplrEwCDhy5wPC6JzPbub8Jw9fETH6JSF5CaxPpuduoR6/YSvAh7tzmjcuz S7oA== X-Gm-Message-State: ALoCoQn0ggQBTIP0ohQHz9yplCLawVxYjforigTKF9XkccRdv5cDs6n+vA1ctmWcwZIYLh++LH5y X-Received: by 10.194.202.229 with SMTP id kl5mr1763729wjc.3.1431893158550; Sun, 17 May 2015 13:05:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.111 with SMTP id v15ls704518lal.5.gmail; Sun, 17 May 2015 13:05:58 -0700 (PDT) X-Received: by 10.112.54.225 with SMTP id m1mr15129577lbp.34.1431893158326; Sun, 17 May 2015 13:05:58 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id sj5si5337983lbb.44.2015.05.17.13.05.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 May 2015 13:05:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by laat2 with SMTP id t2so191048591laa.1 for ; Sun, 17 May 2015 13:05:57 -0700 (PDT) X-Received: by 10.112.13.6 with SMTP id d6mr14529821lbc.117.1431893157901; Sun, 17 May 2015 13:05:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3507696lbb; Sun, 17 May 2015 13:05:56 -0700 (PDT) X-Received: by 10.229.185.193 with SMTP id cp1mr26290195qcb.18.1431893153539; Sun, 17 May 2015 13:05:53 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id c195si8289180qka.45.2015.05.17.13.05.52 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 17 May 2015 13:05:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yu4oF-0001iv-Km; Sun, 17 May 2015 20:05:15 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yu4oE-0001hE-J6 for xen-devel@lists.xen.org; Sun, 17 May 2015 20:05:14 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 2C/F9-03026-974F8555; Sun, 17 May 2015 20:05:13 +0000 X-Env-Sender: parth.dixit@linaro.org X-Msg-Ref: server-4.tower-206.messagelabs.com!1431893110!11154559!1 X-Originating-IP: [209.85.192.177] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.15; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30827 invoked from network); 17 May 2015 20:05:12 -0000 Received: from mail-pd0-f177.google.com (HELO mail-pd0-f177.google.com) (209.85.192.177) by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 17 May 2015 20:05:12 -0000 Received: by pdfh10 with SMTP id h10so117338406pdf.3 for ; Sun, 17 May 2015 13:05:10 -0700 (PDT) X-Received: by 10.70.43.225 with SMTP id z1mr37564402pdl.45.1431893110648; Sun, 17 May 2015 13:05:10 -0700 (PDT) Received: from localhost.localdomain ([117.247.24.139]) by mx.google.com with ESMTPSA id j9sm7838401pdm.53.2015.05.17.13.05.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 May 2015 13:05:10 -0700 (PDT) From: Parth Dixit To: xen-devel@lists.xen.org Date: Mon, 18 May 2015 01:33:39 +0530 Message-Id: <1431893048-5214-13-git-send-email-parth.dixit@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431893048-5214-1-git-send-email-parth.dixit@linaro.org> References: <1431893048-5214-1-git-send-email-parth.dixit@linaro.org> Cc: keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com, tim@xen.org, julien.grall@citrix.com, stefano.stabellini@citrix.com, jbeulich@suse.com, parth.dixit@linaro.org, christoffer.dall@linaro.org Subject: [Xen-devel] [PATCH v2 12/41] arm : 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: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: parth.dixit@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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 --- xen/arch/arm/arm64/smpboot.c | 7 ++++++- xen/arch/arm/smpboot.c | 28 +++++++++++++++++----------- 2 files changed, 23 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 a96cda2..90f9ef2 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,22 @@ 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) {