From patchwork Sun Jul 23 23:23:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 9858641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 18F07602B9 for ; Sun, 23 Jul 2017 23:27:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08E6328448 for ; Sun, 23 Jul 2017 23:27:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F18E52845C; Sun, 23 Jul 2017 23:27:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4465C28448 for ; Sun, 23 Jul 2017 23:27:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=iO2AybamdZJKDh95chrsOIPsLA34fX5tYXg4ap/Dop4=; b=sS/3vLUKcyGLuduS2oFo2xo3nV q+ub8mquiXj24ox4s96HdfVcOAsc8QcpVrmMCzt/s3xFUWT+FKwK3YjTezoh6BSqPsIF+DMh3En0o DSgkUiBl/Q/9PIvLvGbrWa1Q033+jZQh3IKCi2zPlMjmItF+ajYpOsY6T8mMUglVPXDlrPYbx3Jp6 CS2aTnwOK5ajqCJuqjvtELPNoOtylVuzu+y9uq4RCTACX3cV5ozDsOIfGuqftgAderljcKG1Qc5ZN M3X4K83PQgh/ouvuVYdpAPaGLZESuyvNYiPEPxUhugwpDnu2Br8iArquyAwSedkbuDGe2W9KL/ObB ILefBRgQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dZQHH-0006QU-NW; Sun, 23 Jul 2017 23:27:11 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dZQHD-0006PF-Mi for linux-arm-kernel@lists.infradead.org; Sun, 23 Jul 2017 23:27:09 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DEE1C15A2; Sun, 23 Jul 2017 16:26:49 -0700 (PDT) Received: from slackpad.lan (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4BAE63F592; Sun, 23 Jul 2017 16:26:47 -0700 (PDT) From: Andre Przywara To: Jassi Brar , Sudeep Holla Subject: [PATCH v2 1/3] DT: mailbox: add binding doc for the ARM SMC mailbox Date: Mon, 24 Jul 2017 00:23:24 +0100 Message-Id: <1500852206-28771-2-git-send-email-andre.przywara@arm.com> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1500852206-28771-1-git-send-email-andre.przywara@arm.com> References: <1500852206-28771-1-git-send-email-andre.przywara@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170723_162707_815393_FA7ACFDA X-CRM114-Status: GOOD ( 16.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Alex Graf , Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Rob Herring , Icenowy Zheng , Maxime Ripard , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The ARM SMC mailbox binding describes a firmware interface to trigger actions in software layers running in the EL2 or EL3 exception levels. The term "ARM" here relates to the SMC instruction as part of the ARM instruction set, not as a standard endorsed by ARM Ltd. Signed-off-by: Andre Przywara --- .../devicetree/bindings/mailbox/arm-smc.txt | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/arm-smc.txt diff --git a/Documentation/devicetree/bindings/mailbox/arm-smc.txt b/Documentation/devicetree/bindings/mailbox/arm-smc.txt new file mode 100644 index 0000000..d9de57b --- /dev/null +++ b/Documentation/devicetree/bindings/mailbox/arm-smc.txt @@ -0,0 +1,76 @@ +ARM SMC Mailbox Interface +========================= + +This mailbox uses the ARM smc (secure monitor call) instruction to +trigger a mailbox-connected activity in firmware, executing on the very same +core as the caller. By nature this operation is synchronous and this +mailbox provides no way for asynchronous messages to be delivered the other +way round, from firmware to the OS. However the value of r0/w0/x0 the firmware +returns after the smc call is delivered as a received message to the +mailbox framework, so a synchronous communication can be established. +The exact meaning of both the action the mailbox triggers as well as the +return value is defined by their users and is not subject to this binding. + +One use case of this mailbox is the SCP interface, which uses shared memory +to transfer commands and parameters, and a mailbox to trigger a function +call. This allows SoCs without a separate management processor (or +when such a processor is not available or used) to use this standardized +interface anyway. + +This binding describes no hardware, but establishes a firmware interface. +Upon receiving an SMC using one of the described SMC function identifiers, +the firmware is expected to trigger some mailbox connected functionality. +The communication follows the ARM SMC calling convention[1]: +Firmware expects an SMC function identifier in r0 or w0 to identify a +particular mailbox. The supported identifiers are listed in the the +arm,func-ids properties, as described below. +Apart from those mandatory SMC function identifier there are no further +arguments handled by the receiving end. +The firmware can return one value in the first SMC result register, it +is expected to be an error value, which shall be propagated to the mailbox +client. +The C prototype of the function would be: + unsigned long smc_mailbox_call(unsigned long mailbox_identifier); +The SMC function call is expected to be a fast call and could be from +any of the defined function ranges. + +Any core which supports the SMC or HVC instruction can be used, as long as +a firmware component running in EL3 or EL2 is handling these calls. + +Mailbox Device Node: +==================== + +This node is expected to be a child of the /firmware node. + +Required properties: +-------------------- +- compatible: Shall be "arm,smc-mbox" +- #mbox-cells Shall be 1 - the index of the channel needed. +- arm,func-ids An array of 32-bit values specifying the function + IDs used by each mailbox channel. Those function IDs + follow the ARM SMC calling convention standard [1]. + There is one identifier per channel and the number + of supported channels is determined by the length + of this array. +- method: A string, either: + "hvc": if the driver shall use an HVC call, or + "smc": if the driver shall use an SMC call. + +Example: +-------- + + smc_mbox: mailbox { + #mbox-cells = <1>; + compatible = "arm,smc-mbox"; + arm,func-ids = <0x82000001>, <0x82000002>; + }; + + scpi { + compatible = "arm,scpi"; + mboxes = <&mailbox 0>; + shmem = <&cpu_scp_shmem>; + }; + + +[1] +http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0028a/index.html