From patchwork Mon Dec 2 11:08:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 21926 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A752623FCF for ; Mon, 2 Dec 2013 11:09:40 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id va2sf40556092obc.4 for ; Mon, 02 Dec 2013 03:09:39 -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=Zto0DmEQHoYtn03HT2xmvC6ozc0SGJTFJwFX9gWqagI=; b=DuzPwuk0Ar4fMXhLiswRSfBgRzthNqtxz1Rq9lLJYG225ECRfO4x7OeBhVly2w2B6F Uyoo9dfRP6WUzWkV9ftp6oWXLI82vhuPvvJm2kAjapZ9TgOUHLS3+d/n7r7Ez6Kqj253 PKJjMLuSCxBAi9JhRXRu6n+GY0CBqQ/b4ZGRhHmF/c6OerfBwizcRwORKUeksyLQZM23 w8Frc5CVKawQwDqROSKEvlOPmzx/CjT/8cgBRVbROYNmA+3eMEMP53hWcrHm/6fudmmJ gkVpHBup6WUb0bTleli49jj9MEW67/XoDp8fNdYD+HlnY/igs15rEbu4D0MOnSdwlXh7 7H8Q== X-Gm-Message-State: ALoCoQmLgA6t+Nwd1X952Bk9HoUzH7YMmqnbgSfm9H9MT+/sgvZe8UUtke3NnfCopaP07m6lFesj X-Received: by 10.182.158.4 with SMTP id wq4mr21957767obb.18.1385982579173; Mon, 02 Dec 2013 03:09:39 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.195 with SMTP id a3ls4579898qek.88.gmail; Mon, 02 Dec 2013 03:09:39 -0800 (PST) X-Received: by 10.58.48.162 with SMTP id m2mr6274ven.77.1385982579019; Mon, 02 Dec 2013 03:09:39 -0800 (PST) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id de6si29427766vcb.109.2013.12.02.03.09.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Dec 2013 03:09:39 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.171 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.171; Received: by mail-vc0-f171.google.com with SMTP id ik5so8165194vcb.2 for ; Mon, 02 Dec 2013 03:09:38 -0800 (PST) X-Received: by 10.58.181.230 with SMTP id dz6mr191758vec.35.1385982578916; Mon, 02 Dec 2013 03:09:38 -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 u4csp110804vcz; Mon, 2 Dec 2013 03:09:38 -0800 (PST) X-Received: by 10.204.77.65 with SMTP id f1mr76234bkk.156.1385982577870; Mon, 02 Dec 2013 03:09:37 -0800 (PST) Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com [209.85.214.41]) by mx.google.com with ESMTPS id ci7si19079580bkc.4.2013.12.02.03.09.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Dec 2013 03:09:37 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.41 is neither permitted nor denied by best guess record for domain of andre.przywara@linaro.org) client-ip=209.85.214.41; Received: by mail-bk0-f41.google.com with SMTP id v15so5408414bkz.0 for ; Mon, 02 Dec 2013 03:09:37 -0800 (PST) X-Received: by 10.204.111.136 with SMTP id s8mr37258bkp.173.1385982577240; Mon, 02 Dec 2013 03:09:37 -0800 (PST) Received: from slackpad.drs.calxeda.com (f053082149.adsl.alicedsl.de. [78.53.82.149]) by mx.google.com with ESMTPSA id z6sm74390807bkn.8.2013.12.02.03.09.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Dec 2013 03:09:36 -0800 (PST) From: Andre Przywara To: Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com Cc: julien.grall@linaro.org, xen-devel@lists.xenproject.org, patches@linaro.org, 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> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1385982538-17855-1-git-send-email-andre.przywara@linaro.org> References: <1385982538-17855-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.171 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 Acked-by: Ian Campbell --- 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);