From patchwork Thu Dec 5 10:08:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 22055 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3FE83202E0 for ; Thu, 5 Dec 2013 10:08:51 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id o6sf56935437oag.7 for ; Thu, 05 Dec 2013 02:08:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Aw3qLdqHcl6C4OLP2btvmcWVeI5Jn2JgSWlCh09DKf8=; b=hoZHqM2PdvEpakT/0GeKqBObxRqkZt6lg045lWyYsK9/NeBph54Dnc9AfrfraKBdzF NVgCoJ0tkRinRFgdBBZnbOz8Fo8juU/LucUu9y2zoioGOMuQwIkuY7ULULcQ7pXbdZ2A vm60JpnSUDgY+jYaG9SBYmG/oSbaG1lF9PPr0j3/XEjbUMryYb4sFrp/jWskyw5WhI/j w5uSYlKNzCWIRXw0HaOkvxE86axfIHUg77HRDUCwNEGog6QhPMuxIZ+P3//4EGvkHoP5 au55peOUnbf54Mlo3g/23MFT9okZJWp1zY9Z8CrzLu3KT6YZ4bbrYRLsv3jrYq3yEgJA OpnA== X-Gm-Message-State: ALoCoQmU/wuV96+F10tse/t1TXhLJKWDoQ7o8E880Zg/aSgrU9td0jtbhLREhNvOguXsRaNIOkHT X-Received: by 10.182.19.164 with SMTP id g4mr12603766obe.21.1386238130843; Thu, 05 Dec 2013 02:08:50 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.120.5 with SMTP id ky5ls679661qeb.26.gmail; Thu, 05 Dec 2013 02:08:50 -0800 (PST) X-Received: by 10.52.171.198 with SMTP id aw6mr326300vdc.51.1386238130735; Thu, 05 Dec 2013 02:08:50 -0800 (PST) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id ta5si34193320veb.69.2013.12.05.02.08.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 02:08:50 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ld13so12776472vcb.34 for ; Thu, 05 Dec 2013 02:08:50 -0800 (PST) X-Received: by 10.58.46.77 with SMTP id t13mr1755189vem.32.1386238130506; Thu, 05 Dec 2013 02:08:50 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp2683vcz; Thu, 5 Dec 2013 02:08:50 -0800 (PST) X-Received: by 10.204.234.202 with SMTP id kd10mr826841bkb.53.1386238129547; Thu, 05 Dec 2013 02:08:49 -0800 (PST) Received: from mail-bk0-f47.google.com (mail-bk0-f47.google.com [209.85.214.47]) by mx.google.com with ESMTPS id ri6si4891700bkb.250.2013.12.05.02.08.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 02:08:49 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.47 is neither permitted nor denied by best guess record for domain of andre.przywara@linaro.org) client-ip=209.85.214.47; Received: by mail-bk0-f47.google.com with SMTP id mx12so7021410bkb.20 for ; Thu, 05 Dec 2013 02:08:49 -0800 (PST) X-Received: by 10.204.200.138 with SMTP id ew10mr7627873bkb.34.1386238128944; Thu, 05 Dec 2013 02:08:48 -0800 (PST) Received: from slackpad.drs.calxeda.com (g224192075.adsl.alicedsl.de. [92.224.192.75]) by mx.google.com with ESMTPSA id xm9sm28206859bkb.1.2013.12.05.02.08.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Dec 2013 02:08:48 -0800 (PST) From: Andre Przywara To: Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com Cc: julien.grall@linaro.org, George.Dunlap@eu.citrix.com, xen-devel@lists.xenproject.org, patches@linaro.org, Andre Przywara Subject: [PATCH v3 6/6] arm64: enable PSCI secondary CPU bringup Date: Thu, 5 Dec 2013 11:08:12 +0100 Message-Id: <1386238092-22216-7-git-send-email-andre.przywara@linaro.org> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1386238092-22216-1-git-send-email-andre.przywara@linaro.org> References: <1386238092-22216-1-git-send-email-andre.przywara@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: andre.przywara@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c index 6a34bd4..1287c72 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,18 @@ 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 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 = call_psci_cpu_on; + return 0; +} + int __init arch_smp_init(void) { /* Nothing */ @@ -71,7 +84,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);