From patchwork Wed Nov 4 09:46:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 7548551 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 970C39F36A for ; Wed, 4 Nov 2015 09:49:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72B89206B7 for ; Wed, 4 Nov 2015 09:49:51 +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 790A8206BE for ; Wed, 4 Nov 2015 09:49:50 +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 1Ztufy-00038V-35; Wed, 04 Nov 2015 09:48:18 +0000 Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZtufE-0002cw-ON for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2015 09:47:36 +0000 Received: by lbjm5 with SMTP id m5so11831031lbj.3 for ; Wed, 04 Nov 2015 01:47:10 -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=KNtLyEceavwHb07/PXEytX7sGeom5cRNsQbwIXSzxYQ=; b=B7zN5n2OMitTHq6fsAi47M/9ckZa6hmzOf4N0aAYMDWzeTvCorluqzTVcsH0AnuUe2 CTV4SlcNXyIpp+U4z3ee3FiQUs/JsNKuF4AN5+Qoi9pNaEpQ0ayfe8QzTwiESn6B9QTI GRz0Qx64Y7BbxI5agODPLp+aqBX6GgLs6j184Oif6IYE3bXn9XrAqj/n/KxZBhxVO+AA f51jJvznnurk6DBHXBspIwWe8bB09WuGSWDiGQdgeAAKUS1CenIPxp3hVbdp8vy/O2ic xVasXdGPrZnpH33M1EVXwCEJADAoNMKWd1iqTBUEIBDBi3teKwzui/y6qdS+P7PbG+WD 0VdQ== 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=KNtLyEceavwHb07/PXEytX7sGeom5cRNsQbwIXSzxYQ=; b=E61/ayTexw3tvq2aa+wvUd+Ghvk2CsByjthZ9U9sWI7dhUXDa984KHLqsmzffZxqBh fLqLl3VSxigN6FH8L58bvyZc6Zqo5akZlly/KRdgZjX69kWLWEt04tqjNAVg/OnsMvR/ JmAH7XPD5qheFPUygPoPGq4xX/boM0CeBQEVbo1O5VutbppjaBPrfIfRhwhMXJlX4g9Y mPxk1oGOwWLQ+K8AHldNX/kl605MEBVO2bgRt7J4uKZpZVivJVm5YoKf2TCFHsSsIWun G72qa1OfE8CLUVsoEF9I635JAVznvtIGHiLkZfwNOTTw1JZCIqbvFj1Bp9zWVB6J2QJu sIJg== X-Gm-Message-State: ALoCoQlK0e/5Ef5zD8jNNZGUJw9BXKGdMZF/99RBDoalUBJhVn46GT2WDAM0VCya4P/yzJ2YeUiT X-Received: by 10.112.55.97 with SMTP id r1mr384466lbp.119.1446630430627; Wed, 04 Nov 2015 01:47:10 -0800 (PST) Received: from ermac.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id qh2sm74250lbb.42.2015.11.04.01.47.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Nov 2015 01:47:09 -0800 (PST) From: Jens Wiklander To: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Mark Rutland , Will Deacon , Catalin Marinas , Russell King Subject: [PATCH 4/4] drivers: psci: replace psci firmware calls Date: Wed, 4 Nov 2015 10:46:12 +0100 Message-Id: <1446630372-1598-5-git-send-email-jens.wiklander@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1446630372-1598-1-git-send-email-jens.wiklander@linaro.org> References: <1446630372-1598-1-git-send-email-jens.wiklander@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151104_014733_122278_4AA8E985 X-CRM114-Status: GOOD ( 17.08 ) 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: Jens Wiklander , Lars Persson 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Switch to use a generic interface for issuing SMC/HVC based on ARM SMC Calling Convention. Removes now the now unused psci-call.S. Signed-off-by: Jens Wiklander --- arch/arm/kernel/Makefile | 1 - arch/arm/kernel/psci-call.S | 31 ------------------------------- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/psci-call.S | 28 ---------------------------- drivers/firmware/psci.c | 23 +++++++++++++++++++++-- 5 files changed, 22 insertions(+), 63 deletions(-) delete mode 100644 arch/arm/kernel/psci-call.S delete mode 100644 arch/arm64/kernel/psci-call.S diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index c89e6ab..e8afdc6 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -88,7 +88,6 @@ obj-$(CONFIG_EARLY_PRINTK) += early_printk.o obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o ifeq ($(CONFIG_ARM_PSCI),y) -obj-y += psci-call.o obj-$(CONFIG_SMP) += psci_smp.o endif diff --git a/arch/arm/kernel/psci-call.S b/arch/arm/kernel/psci-call.S deleted file mode 100644 index a78e9e1..0000000 --- a/arch/arm/kernel/psci-call.S +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Copyright (C) 2015 ARM Limited - * - * Author: Mark Rutland - */ - -#include - -#include -#include - -/* int __invoke_psci_fn_hvc(u32 function_id, u32 arg0, u32 arg1, u32 arg2) */ -ENTRY(__invoke_psci_fn_hvc) - __HVC(0) - bx lr -ENDPROC(__invoke_psci_fn_hvc) - -/* int __invoke_psci_fn_smc(u32 function_id, u32 arg0, u32 arg1, u32 arg2) */ -ENTRY(__invoke_psci_fn_smc) - __SMC(0) - bx lr -ENDPROC(__invoke_psci_fn_smc) diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index c61d758..ff4b88a 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -15,7 +15,7 @@ CFLAGS_REMOVE_return_address.o = -pg arm64-obj-y := debug-monitors.o entry.o irq.o fpsimd.o \ entry-fpsimd.o process.o ptrace.o setup.o signal.o \ sys.o stacktrace.o time.o traps.o io.o vdso.o \ - hyp-stub.o psci.o psci-call.o cpu_ops.o insn.o \ + hyp-stub.o psci.o cpu_ops.o insn.o \ return_address.o cpuinfo.o cpu_errata.o \ cpufeature.o alternative.o cacheinfo.o \ smp.o smp_spin_table.o topology.o diff --git a/arch/arm64/kernel/psci-call.S b/arch/arm64/kernel/psci-call.S deleted file mode 100644 index cf83e61..0000000 --- a/arch/arm64/kernel/psci-call.S +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Copyright (C) 2015 ARM Limited - * - * Author: Will Deacon - */ - -#include - -/* int __invoke_psci_fn_hvc(u64 function_id, u64 arg0, u64 arg1, u64 arg2) */ -ENTRY(__invoke_psci_fn_hvc) - hvc #0 - ret -ENDPROC(__invoke_psci_fn_hvc) - -/* int __invoke_psci_fn_smc(u64 function_id, u64 arg0, u64 arg1, u64 arg2) */ -ENTRY(__invoke_psci_fn_smc) - smc #0 - ret -ENDPROC(__invoke_psci_fn_smc) diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c index 42700f0..9c55d11 100644 --- a/drivers/firmware/psci.c +++ b/drivers/firmware/psci.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -56,8 +57,6 @@ struct psci_operations psci_ops; typedef unsigned long (psci_fn)(unsigned long, unsigned long, unsigned long, unsigned long); -asmlinkage psci_fn __invoke_psci_fn_hvc; -asmlinkage psci_fn __invoke_psci_fn_smc; static psci_fn *invoke_psci_fn; enum psci_function { @@ -70,6 +69,26 @@ enum psci_function { static u32 psci_function_id[PSCI_FN_MAX]; +static unsigned long __invoke_psci_fn_hvc(unsigned long function_id, + unsigned long arg0, unsigned long arg1, + unsigned long arg2) +{ + struct arm_smccc_res res; + + arm_smccc_hvc(function_id, arg0, arg1, arg2, 0, 0, 0, 0, &res); + return res.a0; +} + +static unsigned long __invoke_psci_fn_smc(unsigned long function_id, + unsigned long arg0, unsigned long arg1, + unsigned long arg2) +{ + struct arm_smccc_res res; + + arm_smccc_smc(function_id, arg0, arg1, arg2, 0, 0, 0, 0, &res); + return res.a0; +} + static int psci_to_linux_errno(int errno) { switch (errno) {