Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1162349ybi; Wed, 17 Jul 2019 10:29:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmmdCh+8XQZVvYesE4+w6uVlCRoAZEYbphMJQ/lw00fhxzC9hv3ZiD1ItkJLI5Jtlc/094 X-Received: by 2002:a65:47c1:: with SMTP id f1mr41833286pgs.169.1563384551603; Wed, 17 Jul 2019 10:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563384551; cv=none; d=google.com; s=arc-20160816; b=FzIBBrttOoNrn4sRmPwwK4YwnSnkUj1z/hZGbp7d1cgvZOwlV1Er90+8+COjyZejZh W7NYr5S0xmKAQjoBlGQAww2bCcwqFZYQRdoNkxCBcfNQ/RqlT50S710KatVdCM7wCdhj p4qsrKHzgBSaWG5tlwJslpnd4AoJztL0SNr/dQnoOfSLm0Vh5zY0VdCYjACz/VbFtyVL GiHXPgoSOdgF68UmQmsCQeKoG8jD379tlT65fXe7CaLDGwEEQ+EqMbPRLG85/HmWDv0Q kkB9y0LD0EShDLFQ9LjEV+yMlEjdLhPrk1IaPDEw6FqJZXDan1/blZoQc93HWuSi8fFD ECmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=aP+/3KlUjNoYf9c8+5wKsB1vh8uK3n1VVN4T7b1riL8=; b=hueyeuw23YQkuquDHTxw6FlB/WUAo30HX8X5t2kr2QGc9fk6vb5V/dvCwDGytoF1gf SbZT+igdvAPhdFObRP+RQlsxp6xbC2ZnM9HKIatdpXIMw1rzBIJvJhaaKdWDFCnaFgQt mWWi2XIYxH1InuC5zJLp30O57PJPezH/TO+aVv578DDxDxmuRAH7AHQ8uY+tP3Um6LV7 14/0IXfnONhLAzLbHYCdoEA+8ZstAzKOphFaj6YEiS6ztwtx39y1MJ8OtcB5fLu3dB6l 6t541Zyk4GBRPlalN16qns35M9sX7Y6Y90/g0GEYq9Dtnp5y7oI1ZAiZFpFe7lh+xBlk WDNg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si23015581pjl.77.2019.07.17.10.28.55; Wed, 17 Jul 2019 10:29:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387955AbfGQR2G (ORCPT + 99 others); Wed, 17 Jul 2019 13:28:06 -0400 Received: from foss.arm.com ([217.140.110.172]:49426 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726917AbfGQR2F (ORCPT ); Wed, 17 Jul 2019 13:28:05 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CB8E628; Wed, 17 Jul 2019 10:28:04 -0700 (PDT) Received: from e107155-lin (e107155-lin.cambridge.arm.com [10.1.196.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5B65B3F71F; Wed, 17 Jul 2019 10:28:03 -0700 (PDT) Date: Wed, 17 Jul 2019 18:28:01 +0100 From: Sudeep Holla To: Peng Fan Cc: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "jassisinghbrar@gmail.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 , Sudeep Holla Subject: Re: [PATCH v3 1/2] dt-bindings: mailbox: add binding doc for the ARM SMC/HVC mailbox Message-ID: <20190717172801.GG18370@e107155-lin> References: <1563184103-8493-1-git-send-email-peng.fan@nxp.com> <1563184103-8493-2-git-send-email-peng.fan@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1563184103-8493-2-git-send-email-peng.fan@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This looks much better now. On Mon, Jul 15, 2019 at 10:10:10AM +0000, 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 > --- > > V3: > Convert to yaml > Drop interrupt > Introudce transports to indicate mem/reg > The func id is still kept as optional, because like SCMI it only > cares about message. > > V2: > Introduce interrupts as a property. > > .../devicetree/bindings/mailbox/arm-smc.yaml | 124 +++++++++++++++++++++ > 1 file changed, 124 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..da9b1a03bc4e > --- /dev/null > +++ b/Documentation/devicetree/bindings/mailbox/arm-smc.yaml > @@ -0,0 +1,124 @@ > +# 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. > + $ref: /schemas/types.yaml#/definitions/uint32 > + > + method: > + items: > + - enum: > + - smc > + - hvc > + > + transports: > + items: > + - enum: > + - mem > + - reg > + > + arm,func-ids: > + 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? I am new to yaml, is there a way to say the number of entries here must match arm,num-chans ? And not sure if min/maxItems matter then ? > + > +required: > + - compatible > + - "#mbox-cells" > + - arm,num-chans > + - transports > + - method > + Why is arm,func-ids optional ? Is there any standard arm,func-ids we can resort to. Sorry I know you expect ARM Ltd to answer that, but I just want to raise the point that we don't have one today and hence it can't be optional. Or I am missing something ? -- Regards, Sudeep