From patchwork Tue Nov 17 09:40:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 7634591 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 02857BF90C for ; Tue, 17 Nov 2015 09:53:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E95B6204EA for ; Tue, 17 Nov 2015 09:53:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 039A720499 for ; Tue, 17 Nov 2015 09:53:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zycul-00072a-LR; Tue, 17 Nov 2015 09:51:03 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZycoK-0006nj-GM for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 09:44:33 +0000 Received: by wmvv187 with SMTP id v187so217788785wmv.1 for ; Tue, 17 Nov 2015 01:44:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NKudHueKni7+0C9nKEWb7tfv9fPk7NKOE7RKNPdSgQU=; b=vGiQ2KmAWe5SAmmEbrx7/4/sbUgSBieSD73RBaXdgE6PYBUkmtSiaV8hRO1KWT5ivw r6u7n8cROix53KM9+MLRGwVn9pmTINhu1Puy99oMoloGEn2f9BZtRv99MunwAQfi+bmo ugziBFwGzKbh+23I0Y9n5Fqg9Lu7VuvAmgzowdocW5LfRk3ugC/KDbbJCw5oAm9Uccm2 bsOwjGj+ks2y7hLsIo3fdGRIRWWw1cq1wsfvI6CgCEKgz5/yd1X6XUqjIp4CSwHSMHUU 3d+/BOJ1FS/+w12diBqBs37TbC+H8pEdgXEck3G/Bbvmj2HwcvlnVFhHECp9ljqeZV8O KTew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NKudHueKni7+0C9nKEWb7tfv9fPk7NKOE7RKNPdSgQU=; b=jSTLWTx+ZWoAMgCLXZrdwtQC2VBU0IsQtXnM851mGMNyRjrJJ7N3P3Z/EuhMjyut76 dAm0/4c3O+FgwCx+yuHWyTChOd0BPDHBLZyTpiXYhLaMdxm30w/C7quFChhc78ojJFMN JA/prSirzj+fUCIvnssC/FamPgz/tJQqasSiB1GBexjjRs7bGP7e22V1n7SRthA5EfDL hQr7gipXeIWACBNhlsS+9vaOrost4UbcIGzfmsMtmYAoCl0diDo8qUBf2l98a0Z5Vvyc fqE+fNDSR+mo70qhGTM3vo8v5iGK8hQ5fJoGie7S+e6javIbZD7HPLjy0rQ0PYfOAiOr MZoA== X-Gm-Message-State: ALoCoQkiUW7HKWuIgmGFWj/B0TEHc/Ok4XVgK3F/tlSv0UTREmnsGK/0Rh/6NlmvmCVEcj6zPORE X-Received: by 10.195.12.67 with SMTP id eo3mr48006430wjd.158.1447753443010; Tue, 17 Nov 2015 01:44:03 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id l128sm22939166wmf.10.2015.11.17.01.44.00 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:44:02 -0800 (PST) From: shannon.zhao@linaro.org To: ian.campbell@citrix.com, stefano.stabellini@citrix.com, keir@xen.org, jbeulich@suse.com, andrew.cooper3@citrix.com, julien.grall@citrix.com, xen-devel@lists.xen.org Subject: [PATCH v3 20/62] arm/acpi: Add ACPI support for SMP initialization Date: Tue, 17 Nov 2015 17:40:19 +0800 Message-Id: <1447753261-7552-21-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> References: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_014425_226784_FF54C1A8 X-CRM114-Status: GOOD ( 15.49 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, hangaohuai@huawei.com, ard.biesheuvel@linaro.org, shannon.zhao@linaro.org, christoffer.dall@linaro.org, peter.huangpeng@huawei.com, david.vrabel@citrix.com, zhaoshenglong@huawei.com, linux-arm-kernel@lists.infradead.org, roger.pau@citrix.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shannon Zhao ACPI 5.1 only has two explicit methods to boot up SMP, PSCI and Parking protocol, but the Parking protocol is only specified for ARMv7 now, so make PSCI as the only way for the SMP boot protocol before some updates for the ACPI spec or the Parking protocol spec. Signed-off-by: Hanjun Guo Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao --- xen/arch/arm/arm64/smpboot.c | 7 ++++++- xen/arch/arm/psci.c | 30 +++++++++++++++++++++++------- xen/arch/arm/smpboot.c | 7 ++++++- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c index 7928f69..93cb6b3 100644 --- a/xen/arch/arm/arm64/smpboot.c +++ b/xen/arch/arm/arm64/smpboot.c @@ -7,6 +7,7 @@ #include #include #include +#include struct smp_enable_ops { int (*prepare_cpu)(int); @@ -96,7 +97,11 @@ static int __init dt_arch_cpu_init(int cpu, struct dt_device_node *dn) int __init arch_cpu_init(int cpu, struct dt_device_node *dn) { - return dt_arch_cpu_init(cpu, dn); + if( acpi_disabled ) + return dt_arch_cpu_init(cpu, dn); + else + /* acpi only supports psci at present */ + return smp_psci_init(cpu); } int __init arch_cpu_up(int cpu) diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c index d800cb6..dede0e1 100644 --- a/xen/arch/arm/psci.c +++ b/xen/arch/arm/psci.c @@ -22,6 +22,7 @@ #include #include #include +#include /* * While a 64-bit OS can make calls with SMC32 calling conventions, for @@ -86,6 +87,9 @@ int __init psci_init_0_1(void) int ret; const struct dt_device_node *psci; + if ( !acpi_disabled ) + return -EINVAL; + psci = dt_find_compatible_node(NULL, NULL, "arm,psci"); if ( !psci ) return -EOPNOTSUPP; @@ -116,15 +120,24 @@ int __init psci_init_0_2(void) { /* sentinel */ }, }; int ret; - const struct dt_device_node *psci; - psci = dt_find_matching_node(NULL, psci_ids); - if ( !psci ) - return -EOPNOTSUPP; + if( acpi_disabled ) + { + const struct dt_device_node *psci; - ret = psci_is_smc_method(psci); - if ( ret ) - return -EINVAL; + psci = dt_find_matching_node(NULL, psci_ids); + if ( !psci ) + return -EOPNOTSUPP; + + ret = psci_is_smc_method(psci); + if ( ret ) + return -EINVAL; + } + else + { + if ( acpi_psci_hvc_present() ) + return -EINVAL; + } psci_ver = call_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0); @@ -148,6 +161,9 @@ int __init psci_init(void) { int ret; + if( !acpi_disabled && !acpi_psci_present() ) + return -EOPNOTSUPP; + ret = psci_init_0_2(); if ( ret ) ret = psci_init_0_1(); diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index d115228..513f1f6 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -31,6 +31,7 @@ #include #include #include +#include cpumask_t cpu_online_map; cpumask_t cpu_present_map; @@ -247,7 +248,11 @@ void __init smp_init_cpus(void) return; } - dt_smp_init_cpus(); + if ( acpi_disabled ) + dt_smp_init_cpus(); + else + acpi_smp_init_cpus(); + } int __init