All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shannon Zhao <zhaoshenglong@huawei.com>
To: xen-devel@lists.xen.org
Cc: julien.grall@citrix.com, peter.huangpeng@huawei.com,
	stefano.stabellini@citrix.com, ian.campbell@citrix.com,
	shannon.zhao@linaro.org
Subject: [PATCH v5 4/8] arm/smpboot: Move dt specific code in smp to seperate functions
Date: Sat, 23 Jan 2016 16:00:16 +0800	[thread overview]
Message-ID: <1453536020-16196-5-git-send-email-zhaoshenglong@huawei.com> (raw)
In-Reply-To: <1453536020-16196-1-git-send-email-zhaoshenglong@huawei.com>

From: Shannon Zhao <shannon.zhao@linaro.org>

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 <parth.dixit@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 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)
 {
-- 
2.0.4

  parent reply	other threads:[~2016-01-23  8:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-23  8:00 [PATCH v5 0/8] Refactor DT specific codes preparing for ACPI support on ARM64 Shannon Zhao
2016-01-23  8:00 ` [PATCH v5 1/8] Kconfig: import kconfig.h from Linux 4.3 Shannon Zhao
2016-01-23 17:14   ` Jonathan Creekmore
2016-01-23 18:42     ` Andrew Cooper
2016-01-25  1:58       ` Shannon Zhao
2016-01-25 14:35   ` Jan Beulich
2016-01-26 10:23     ` Shannon Zhao
2016-01-23  8:00 ` [PATCH v5 2/8] ACPI: add config for BIOS table scan Shannon Zhao
2016-01-23 17:25   ` Jonathan Creekmore
2016-01-25  1:57     ` Shannon Zhao
2016-01-25 14:42     ` Jan Beulich
2016-01-23  8:00 ` [PATCH v5 3/8] acpi: Refactor acpi_os_map_memory to be architecturally independent Shannon Zhao
2016-01-25 14:43   ` Jan Beulich
2016-01-23  8:00 ` Shannon Zhao [this message]
2016-01-23  8:00 ` [PATCH v5 5/8] arm/gic-v2: Refactor gicv2_init into generic and dt specific parts Shannon Zhao
2016-01-23  8:00 ` [PATCH v5 6/8] arm/gic-v3: Refactor gicv3_init " Shannon Zhao
2016-01-27 12:18   ` Stefano Stabellini
2016-01-27 12:59     ` Shannon Zhao
2016-01-27 13:59       ` Stefano Stabellini
2016-01-28  2:33   ` [PATCH v6 " Shannon Zhao
2016-01-28 10:27     ` Stefano Stabellini
2016-01-30  9:03       ` Shannon Zhao
2016-02-03 12:14         ` Ian Campbell
2016-01-23  8:00 ` [PATCH v5 7/8] arm/uart: Rename dt-uart.c to arm-uart.c Shannon Zhao
2016-01-25 12:07   ` Ian Campbell
2016-01-23  8:00 ` [PATCH v5 8/8] pl011: Refactor pl011 driver to dt and common initialization parts Shannon Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453536020-16196-5-git-send-email-zhaoshenglong@huawei.com \
    --to=zhaoshenglong@huawei.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=shannon.zhao@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.