From patchwork Thu May 23 05:50:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1103834 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="s8iIeKRx"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 458dsT5kYTz9s6w for ; Thu, 23 May 2019 15:51:09 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725806AbfEWFvE (ORCPT ); Thu, 23 May 2019 01:51:04 -0400 Received: from mail-eopbgr10048.outbound.protection.outlook.com ([40.107.1.48]:7844 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725873AbfEWFvD (ORCPT ); Thu, 23 May 2019 01:51:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mtKNTwaKLzob0itOvH8iWjYzWGHKZZWtULJ1yn3w2II=; b=s8iIeKRx+MBs86dEV1LMbKaBYiwOwHFQcyfjhstPHEJ5j0DNqf+YfqE/lDEqiQPoB0fQgVtoG9TYUTfIDyhyEtFVfbiBIKOhhJdqBZbOJkpIDXZnXhCM/F4F7SaZMb6kAsfAiIUhZzLtZKTzAdXaA3cA9j6fgRr2Qs+sbyqMLAU= Received: from AM0PR04MB4481.eurprd04.prod.outlook.com (52.135.147.15) by AM0PR04MB3956.eurprd04.prod.outlook.com (52.134.93.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.18; Thu, 23 May 2019 05:50:58 +0000 Received: from AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378]) by AM0PR04MB4481.eurprd04.prod.outlook.com ([fe80::3173:24:d401:2378%6]) with mapi id 15.20.1900.020; Thu, 23 May 2019 05:50:58 +0000 From: Peng Fan To: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "jassisinghbrar@gmail.com" , "sudeep.holla@arm.com" CC: "kernel@pengutronix.de" , dl-linux-imx , "shawnguo@kernel.org" , "festevam@gmail.com" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "andre.przywara@arm.com" , "van.freenix@gmail.com" , Peng Fan Subject: [PATCH 1/2] DT: mailbox: add binding doc for the ARM SMC mailbox Thread-Topic: [PATCH 1/2] DT: mailbox: add binding doc for the ARM SMC mailbox Thread-Index: AQHVESt+5fp+4ZxwMEmNHJCtGp/VNQ== Date: Thu, 23 May 2019 05:50:58 +0000 Message-ID: <20190523060437.11059-2-peng.fan@nxp.com> References: <20190523060437.11059-1-peng.fan@nxp.com> In-Reply-To: <20190523060437.11059-1-peng.fan@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.16.4 x-clientproxiedby: HK0P153CA0040.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::28) To AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ecf51b94-0f2d-4601-2daf-08d6df42a0e7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR04MB3956; x-ms-traffictypediagnostic: AM0PR04MB3956: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 00462943DE x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(376002)(346002)(396003)(366004)(199004)(189003)(2201001)(86362001)(6512007)(7110500001)(256004)(6436002)(6306002)(44832011)(486006)(2501003)(2906002)(2616005)(476003)(6116002)(3846002)(81166006)(8676002)(25786009)(6486002)(305945005)(81156014)(8936002)(50226002)(2420400007)(4326008)(53936002)(11346002)(15650500001)(7736002)(316002)(446003)(186003)(26005)(14454004)(66066001)(68736007)(1076003)(36756003)(71200400001)(71190400001)(102836004)(5660300002)(347745004)(386003)(54906003)(110136005)(76176011)(6506007)(99286004)(66556008)(66446008)(66476007)(7416002)(66946007)(478600001)(73956011)(52116002)(64756008); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB3956; H:AM0PR04MB4481.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: JXL3dIoOZdZqNPGrNhAq5vYhmav5WqYMdZ73VFtEXIb+gs1vjXXBmQh4H1LDjWSp1hSCiT4IvIegnoKGYQ7CTmbOrHkIalsRGV5O+fGJZTBr2QjCmsibR8SYut4f5Jb8IA66radeYBcGMv15DKVmDBgqEm/lRHZQ7aN64CGA+cA+RnaO8kMq5cAV5zQWqoUOPUWkK6KoflFPlLZs2U6rHEEUFIryup3QX2GZj2TLkDTZaQDDjhVwrQl0ZTDA2nZcnGrbravQs7NOgP7uCK8ZUTiO3z3bho93/iLPbvVmsP8GzLD05lehLe9r1btRIye7IGpuJyeZqmLTbavcFwRYddPQt2KOz/6EVP5CBCIptqb/deORpcmui+WT1VE+QQtvTDOatxww+ZCcIlUOg8NAGVyBEvAKU6OL1MtRIdxAkyY= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ecf51b94-0f2d-4601-2daf-08d6df42a0e7 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2019 05:50:58.3462 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB3956 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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: Peng Fan --- V1: arm,func-ids is still kept as an optional property, because there is no defined SMC funciton id passed from SCMI. So in my test, I still use arm,func-ids for ARM SIP service. .../devicetree/bindings/mailbox/arm-smc.txt | 96 ++++++++++++++++++++++ 1 file changed, 96 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 000000000000..12fc5997933d --- /dev/null +++ b/Documentation/devicetree/bindings/mailbox/arm-smc.txt @@ -0,0 +1,96 @@ +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 SCMI 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. The supported +identifiers are passed from consumers, or listed in the the arm,func-ids +properties as described below. 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. + +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,num-chans The number of channels supported. +- method: A string, either: + "hvc": if the driver shall use an HVC call, or + "smc": if the driver shall use an SMC call. + +Optional properties: +- 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. + +Example: +-------- + + sram@910000 { + compatible = "mmio-sram"; + reg = <0x0 0x93f000 0x0 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x0 0x93f000 0x1000>; + + cpu_scp_lpri: scp-shmem@0 { + compatible = "arm,scmi-shmem"; + reg = <0x0 0x200>; + }; + + cpu_scp_hpri: scp-shmem@200 { + compatible = "arm,scmi-shmem"; + reg = <0x200 0x200>; + }; + }; + + smc_mbox: mailbox { + #mbox-cells = <1>; + compatible = "arm,smc-mbox"; + method = "smc"; + arm,num-chans = <0x2>; + /* Optional */ + arm,func-ids = <0xc20000fe>, <0xc20000ff>; + }; + + firmware { + scmi { + compatible = "arm,scmi"; + mboxes = <&mailbox 0 &mailbox 1>; + mbox-names = "tx", "rx"; + shmem = <&cpu_scp_lpri &cpu_scp_hpri>; + }; + }; + + +[1] +http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0028a/index.html