diff mbox

[v2,5/6] arm32: enable PSCI secondary CPU bringup

Message ID 1385982538-17855-6-git-send-email-andre.przywara@linaro.org
State New
Headers show

Commit Message

Andre Przywara Dec. 2, 2013, 11:08 a.m. UTC
If the device tree contains a PSCI node, we bring up secondary CPUs
by invoking the appropriate PSCI handler.
This will take priority over platform specific functions (which could
call the PSCI wrapper themselves if needed), so any PSCI enablement
of a platform will automatically be used (as on Linux).

Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
---
 xen/arch/arm/arm32/smpboot.c | 4 +++-
 xen/arch/arm/platform.c      | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Ian Campbell Dec. 2, 2013, 3:09 p.m. UTC | #1
On Mon, 2013-12-02 at 12:08 +0100, Andre Przywara wrote:
> @@ -109,6 +110,9 @@ int __init platform_specific_mapping(struct domain *d)
>  #ifdef CONFIG_ARM_32
>  int __init platform_cpu_up(int cpu)
>  {
> +    if ( psci_available )
> +        return call_psci_cpu_on(cpu, init_secondary);
> +
>      if ( platform && platform->cpu_up )
>          return platform->cpu_up(cpu);
>  

Make me wonder why we don't either hardcode init_secondary in
call_psci_cpu_on or pass it as a parameter to cpu_up, but regardless:

Acked-by: Ian Campbell <ian.campbell@citrix.com>

(FWIW if you were to change things, I'd be in favour of hardcoding on
the PSCI side)

Ian.
diff mbox

Patch

diff --git a/xen/arch/arm/arm32/smpboot.c b/xen/arch/arm/arm32/smpboot.c
index 88fe8fb..2a77f29 100644
--- a/xen/arch/arm/arm32/smpboot.c
+++ b/xen/arch/arm/arm32/smpboot.c
@@ -10,7 +10,9 @@  int __init arch_smp_init(void)
 
 int __init arch_cpu_init(int cpu, struct dt_device_node *dn)
 {
-    /* TODO handle PSCI init */
+    /* Not needed on ARM32, as there is no relevant information in
+     * the CPU device tree node for ARMv7 CPUs.
+     */
     return 0;
 }
 
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 056d462..608e689 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -20,6 +20,7 @@ 
 #include <asm/platform.h>
 #include <xen/device_tree.h>
 #include <xen/init.h>
+#include <asm/psci.h>
 
 extern const struct platform_desc _splatform[], _eplatform[];
 
@@ -109,6 +110,9 @@  int __init platform_specific_mapping(struct domain *d)
 #ifdef CONFIG_ARM_32
 int __init platform_cpu_up(int cpu)
 {
+    if ( psci_available )
+        return call_psci_cpu_on(cpu, init_secondary);
+
     if ( platform && platform->cpu_up )
         return platform->cpu_up(cpu);