Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5536552ybl; Tue, 27 Aug 2019 06:15:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaSVseIM5la6Ju4Z1i6Xn8ASumj5+6VsbHR4B8N51JhvVuRFYjM4D7dY8ZCk7QDjhjnQFc X-Received: by 2002:a63:be0d:: with SMTP id l13mr21087327pgf.357.1566911708989; Tue, 27 Aug 2019 06:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566911708; cv=none; d=google.com; s=arc-20160816; b=olsoHmiCxAUv0h6U0Sr7CbqGFiFEpVnnQ2puRcNLicSLbWLasGHDWqmUX7e25bzs2l 99uUTya5UYLIvwCK1d26ed7Iq7rcnHaXCpQHWairuInyDJZq5HKx+1g5+8Jb9bqQF+7x g4ZOGnuTcbZDK1JFDnnEriqArC1DB99BGeukD16r5Njtw2PWoWq9IQLXX6QG+OAyfEme BlpjuEFTVRLyhQrfw5MgzIYVlceQZWQMWz8qZGtBZk0Ih7OfvC+eWX8ek7snrEkyY/O0 Lt/pv5Oj+Z97d+BWGlANkjsz5brXAEinNnZP/DZlxQQR0bb3b/1IrbldIGwri9F1q75k 256g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=90fiEp9rIavEAzPoZk+CUpvBqDOEAlZFPrtVEI7WaJs=; b=ernh7OqN4L1TdIGptUgLb4mqvJUMRnxUYKbDhvfqVn+LAj6zkRzV5of9LF7Y/bU1/w AXIAJaDyu+ukUdn2Y/rsZh+DUCdcHelg6xdLRjZ8VPrQcIiHxecbMQq4s+oobvRhlJP2 pkkzDgzI7CyWl9UMY+1tuN7M+EggT0Fhk8Gtv4MohDYiLYdntHIKahZQ7pesVIuhkDAG 0eUfudUcuZ2xAt6phiUMH45bNNP+qgLPLO7Cfl9kVHTugPpvqrD3GFwgjpZXPEKRXcZG oKDbPyuzJKuHbBdYmyBzBSnbWmDec+V63u39o/dinYN0iFBirj4c6mwEGxqInBfQXdhL 9brg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lSNV9HxR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h17si13875018pfo.210.2019.08.27.06.14.53; Tue, 27 Aug 2019 06:15:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lSNV9HxR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729128AbfH0NOA (ORCPT + 99 others); Tue, 27 Aug 2019 09:14:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:41578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbfH0NOA (ORCPT ); Tue, 27 Aug 2019 09:14:00 -0400 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 56FC8214DA; Tue, 27 Aug 2019 13:13:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566911639; bh=n8ibduXjZXj7Q34xh0Rv5sPDq7/16sV0kGKVNRLgDSs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=lSNV9HxRdPa/5Ef56wsJ6JYR5Xjq4MdznNNx74DNIz4MOmTAVYNQsoy+Xu1Lk6dBW sRVBzin4qJyRoLxOuwFBdMs0YnPpXYwVMWlj8/onYqVPNA/0l4oiiK+0vfrDuiYGNu ApTb/71j0CI5hh9Pqi6kf6tBHis1MHAWXGOJnjS4= Received: by mail-qt1-f169.google.com with SMTP id v38so21222232qtb.0; Tue, 27 Aug 2019 06:13:59 -0700 (PDT) X-Gm-Message-State: APjAAAXNNekc+55DYTYP+RnHJklthMwY4Xi5p5hEw43CAFHMES+cdPFe /h19I9sO5CVXGANRjBGFp0bmjJI0eEjVVx/NXQ== X-Received: by 2002:a0c:eb92:: with SMTP id x18mr20029210qvo.39.1566911638442; Tue, 27 Aug 2019 06:13:58 -0700 (PDT) MIME-Version: 1.0 References: <1566942646-18015-1-git-send-email-peng.fan@nxp.com> <1566942646-18015-2-git-send-email-peng.fan@nxp.com> In-Reply-To: <1566942646-18015-2-git-send-email-peng.fan@nxp.com> From: Rob Herring Date: Tue, 27 Aug 2019 08:13:47 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 1/2] dt-bindings: mailbox: add binding doc for the ARM SMC/HVC mailbox To: Peng Fan Cc: "mark.rutland@arm.com" , "jassisinghbrar@gmail.com" , "sudeep.holla@arm.com" , "andre.przywara@arm.com" , "f.fainelli@gmail.com" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , dl-linux-imx Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 27, 2019 at 4:51 AM Peng Fan wrote: > > From: Peng Fan > > The ARM SMC/HVC 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 > --- > .../devicetree/bindings/mailbox/arm-smc.yaml | 126 +++++++++++++++++++++ > 1 file changed, 126 insertions(+) > create mode 100644 Documentation/devicetree/bindings/mailbox/arm-smc.yaml > > diff --git a/Documentation/devicetree/bindings/mailbox/arm-smc.yaml b/Documentation/devicetree/bindings/mailbox/arm-smc.yaml > new file mode 100644 > index 000000000000..ae677e0c0910 > --- /dev/null > +++ b/Documentation/devicetree/bindings/mailbox/arm-smc.yaml > @@ -0,0 +1,126 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/mailbox/arm-smc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: ARM SMC Mailbox Interface > + > +maintainers: > + - Peng Fan > + > +description: | > + This mailbox uses the ARM smc (secure monitor call) and hvc (hypervisor > + 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, but > + asynchronous notification could also be supported. 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, for a asynchronous notification, no value will be returned. > + 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. > + 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. > + > +properties: > + compatible: > + const: arm,smc-mbox > + > + "#mbox-cells": > + const: 1 > + > + arm,num-chans: > + description: The number of channels supported. > + items: > + minimum: 1 > + maximum: 4096 # Should be enough? > + > + method: > + items: You can drop 'items' as this is a single entry. > + - enum: > + - smc > + - hvc > + > + transports: > + items: same here > + - enum: > + - mem > + - reg > + > + arm,func-ids: Needs a $ref to a type (uint32-array). > + description: | > + 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. > + minItems: 0 > + maxItems: 4096 # Should be enough? > + > +required: > + - compatible > + - "#mbox-cells" > + - arm,num-chans > + - transports > + - method > + > +examples: > + - | > + 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 { Looks like some indentation problem... > + compatible = "arm,scmi-shmem"; > + reg = <0x0 0x200>; > + }; > + > + cpu_scp_hpri: scp-shmem@200 { > + compatible = "arm,scmi-shmem"; > + reg = <0x200 0x200>; > + }; > + }; > + > + firmware { > + smc_mbox: mailbox { > + #mbox-cells = <1>; > + compatible = "arm,smc-mbox"; > + method = "smc"; > + arm,num-chans = <0x2>; > + transports = "mem"; > + /* Optional */ > + arm,func-ids = <0xc20000fe>, <0xc20000ff>; > + }; > + > + scmi { > + compatible = "arm,scmi"; > + mboxes = <&mailbox 0 &mailbox 1>; &smc_mbox and <> each entry. > + mbox-names = "tx", "rx"; > + shmem = <&cpu_scp_lpri &cpu_scp_hpri>; <> each entry > + }; > + }; > + > +... > -- > 2.16.4 >