From patchwork Fri Oct 9 15:33:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars Persson X-Patchwork-Id: 7362431 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 5D54FBEEA4 for ; Fri, 9 Oct 2015 15:36:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6EC13206EE for ; Fri, 9 Oct 2015 15:36:42 +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 8921C205FA for ; Fri, 9 Oct 2015 15:36:41 +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 1ZkZhF-0004uB-4e; Fri, 09 Oct 2015 15:35:01 +0000 Received: from bes.se.axis.com ([195.60.68.10]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZkZh2-0004hR-3T for linux-arm-kernel@lists.infradead.org; Fri, 09 Oct 2015 15:34:49 +0000 Received: from localhost (localhost [127.0.0.1]) by bes.se.axis.com (Postfix) with ESMTP id B1E742E57C; Fri, 9 Oct 2015 17:34:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bes.se.axis.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from bes.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bes.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3au5tltjuc5v; Fri, 9 Oct 2015 17:34:26 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by bes.se.axis.com (Postfix) with ESMTP id 448A22E47F; Fri, 9 Oct 2015 17:34:26 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id 2D37713D0; Fri, 9 Oct 2015 17:34:26 +0200 (CEST) Received: from thoth.se.axis.com (thoth.se.axis.com [10.0.2.173]) by boulder.se.axis.com (Postfix) with ESMTP id 21ED8125A; Fri, 9 Oct 2015 17:34:26 +0200 (CEST) Received: from lnxlarper1.se.axis.com (lnxlarper1.se.axis.com [10.88.41.2]) by thoth.se.axis.com (Postfix) with ESMTP id 1F60734009; Fri, 9 Oct 2015 17:34:26 +0200 (CEST) Received: by lnxlarper1.se.axis.com (Postfix, from userid 20456) id 1C063800E9; Fri, 9 Oct 2015 17:34:26 +0200 (CEST) From: Lars Persson To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux@arm.linux.org.uk Subject: [PATCH 1/1] arm: Add generic smc wrapper Date: Fri, 9 Oct 2015 17:33:33 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151009_083448_433349_6EDFB6F9 X-CRM114-Status: GOOD ( 13.03 ) 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: 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 This adds an smc wrapper according to the ARM standard for secure monitor calling conventions (ARM DEN 0028A). Signed-off-by: Lars Persson --- arch/arm/include/asm/smc-call.h | 12 ++++++++++++ arch/arm/kernel/Makefile | 3 +++ arch/arm/kernel/smc-call.S | 22 ++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 arch/arm/include/asm/smc-call.h create mode 100644 arch/arm/kernel/smc-call.S diff --git a/arch/arm/include/asm/smc-call.h b/arch/arm/include/asm/smc-call.h new file mode 100644 index 0000000..88a83d4 --- /dev/null +++ b/arch/arm/include/asm/smc-call.h @@ -0,0 +1,12 @@ +/* + * Wrapper for secure monitor calls using the ARM SMC calling + * convention. + */ +#ifndef __ASM_SMC_CALL_H +#define __ASM_SMC_CALL_H + +#include + +extern int invoke_smc(u32 function_id, u32 arg0, u32 arg1, u32 arg2); + +#endif diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index af9e59b..73c95e0 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -92,4 +92,7 @@ obj-y += psci-call.o obj-$(CONFIG_SMP) += psci_smp.o endif +obj-$(CONFIG_CPU_V6) += smc-call.o +obj-$(CONFIG_CPU_V7) += smc-call.o + extra-y := $(head-y) vmlinux.lds diff --git a/arch/arm/kernel/smc-call.S b/arch/arm/kernel/smc-call.S new file mode 100644 index 0000000..a07ebf9 --- /dev/null +++ b/arch/arm/kernel/smc-call.S @@ -0,0 +1,22 @@ +/* + * 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. + * + * Copied from: psci-call.S. + */ + +#include + +#include + +/* int invoke_smc(u32 function_id, u32 arg0, u32 arg1, u32 arg2) */ +ENTRY(invoke_smc) + __SMC(0) + bx lr +ENDPROC(invoke_smc)