From: Andre Przywara Subject: [PATCH v2 6/6] arm64: enable PSCI secondary CPU bringup Date: Mon, 2 Dec 2013 12:08:58 +0100 Message-ID: <1385982538-17855-7-git-send-email-andre.przywara@linaro.org> References: <1385982538-17855-1-git-send-email-andre.przywara@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VnRNj-0006Ko-Ir for xen-devel@lists.xenproject.org; Mon, 02 Dec 2013 11:09:39 +0000 Received: by mail-bk0-f48.google.com with SMTP id v10so5258116bkz.21 for ; Mon, 02 Dec 2013 03:09:37 -0800 (PST) In-Reply-To: <1385982538-17855-1-git-send-email-andre.przywara@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com Cc: xen-devel@lists.xenproject.org, julien.grall@linaro.org, Andre Przywara , patches@linaro.org List-Id: xen-devel@lists.xenproject.org If the device tree contains a PSCI node and the DTB CPU node tells us to use PSCI for enabling secondary cores, we set the function pointer to the PSCI wrapper function to enable PSCI SMP bringup. Signed-off-by: Andre Przywara --- xen/arch/arm/arm64/smpboot.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c index 6a34bd4..a70b860 100644 --- a/xen/arch/arm/arm64/smpboot.c +++ b/xen/arch/arm/arm64/smpboot.c @@ -6,6 +6,7 @@ #include #include #include +#include struct smp_enable_ops { int (*prepare_cpu)(int); @@ -52,6 +53,23 @@ static void __init smp_spin_table_init(int cpu, struct dt_device_node *dn) smp_enable_ops[cpu].prepare_cpu = smp_spin_table_cpu_up; } +static int __init psci_cpu_up(int cpu) +{ + return call_psci_cpu_on(cpu, init_secondary); +} + +static int __init smp_psci_init(int cpu) +{ + if ( !psci_available ) + { + printk("CPU%d asks for PSCI, but DTB has no PSCI node\n", cpu); + return -ENODEV; + } + + smp_enable_ops[cpu].prepare_cpu = psci_cpu_up; + return 0; +} + int __init arch_smp_init(void) { /* Nothing */ @@ -71,7 +89,8 @@ int __init arch_cpu_init(int cpu, struct dt_device_node *dn) if ( !strcmp(enable_method, "spin-table") ) smp_spin_table_init(cpu, dn); - /* TODO: method "psci" */ + else if ( !strcmp(enable_method, "psci") ) + return smp_psci_init(cpu); else { printk("CPU%d has unknown enable method \"%s\"\n", cpu, enable_method); -- 1.7.12.1