From patchwork Mon Mar 27 14:03:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 13189417 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3F64C76195 for ; Mon, 27 Mar 2023 14:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ndYnNmD6SeLi+YnKcjIWX47r+jp5UMhbiEXuCSBOvNg=; b=AwI3jRqKAUDRGS L3hCgpjk205TdVrFUP4DJsaPJwgWohYD5tyBeMSEs2KQmrKULN6hd4Mim9Jfrx1NMntHNZJiHNdTi onAJuTOIONBw+UIq5Tl2A3OumgvmleBDBkxfNIHJygNqNz8Y4r59pbRt2azXppXHpbnZZsbX3SbAK 6Oq4GiUK0ONkKuU4BVn0/08FJhHz7RzJrc+KN5uvp/ZJjjiFbHLawVwRWWPti74x8dXfO67R9//My zh2QDY+AghVixZ9JDBBzMnhJOiA80pTHZhreORazfEhHpFvH/frqAYwDcl9D/0F2Z9+lxgdCCDZN3 o+885rUIPZvgeB6AYm2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgnSl-00BCo1-1X; Mon, 27 Mar 2023 14:04:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pgnSW-00BCl5-1P for linux-arm-kernel@lists.infradead.org; Mon, 27 Mar 2023 14:04:34 +0000 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 9A62E1042; Mon, 27 Mar 2023 07:05:08 -0700 (PDT) Received: from e120937-lin.. (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 087A93F6C4; Mon, 27 Mar 2023 07:04:22 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Cc: sudeep.holla@arm.com, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, nicola.mazzucato@arm.com, cristian.marussi@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Subject: [PATCH 1/2] dt-bindings: firmware: arm,scmi: Support mailboxes unidirectional channels Date: Mon, 27 Mar 2023 15:03:41 +0100 Message-Id: <20230327140342.222168-2-cristian.marussi@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230327140342.222168-1-cristian.marussi@arm.com> References: <20230327140342.222168-1-cristian.marussi@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230327_070428_578040_F16B5E36 X-CRM114-Status: GOOD ( 16.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org SCMI defines two kinds of communication channels between the agent and the platform: one bidirectional 'a2p' channel used by the agent to send SCMI commands and synchronously receive the related replies, and an optional 'p2a' unidirectional channel used to asynchronously receive delayed responses and notifications emitted from the platform. When configuring an SCMI transport based on mailboxes, the current binding supports only mailboxes providing bidirectional channels: in such a case one mailbox channel can be easily assigned to each SCMI channel as above described. In case, instead, to have to deal with mailboxes providing only distinct unidirectional channels, it becomes necessary to extend the binding in order to be able to bind 2 distinct unidirectional mailbox channels to the same SCMI 'a2p' channel. Bidirectional and unidirectional channels support for the SCMI mailbox transport can coexist by carefully considering the effective combination of defined 'mboxes' and 'shmem' descriptors. Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: devicetree@vger.kernel.org Signed-off-by: Cristian Marussi --- .../bindings/firmware/arm,scmi.yaml | 42 +++++++++++++++++-- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml index 2f7c51c75e85..9a7dc30e386f 100644 --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml @@ -63,10 +63,24 @@ properties: mboxes: description: List of phandle and mailbox channel specifiers. It should contain - exactly one or two mailboxes, one for transmitting messages("tx") - and another optional for receiving the notifications("rx") if supported. + exactly one, two or three mailboxes; the first one or two for transmitting + messages ("tx") and another optional ("rx") for receiving notifications + and delayed responses, if supported by the platform. + The number of mailboxes needed for transmitting messages depends on the + type of channels exposed by the specific underlying mailbox controller; + one single channel descriptor is enough if such channel is bidirectional, + while two channel descriptors are needed to represent the SCMI ("tx") + channel if the underlying mailbox channels are of unidirectional type. + The effective combination in numbers of mboxes and shmem descriptors let + the SCMI subsystem determine unambiguosly which type of SCMI channels are + made available by the underlying mailbox controller and how to use them. + 1 mbox / 1 shmem => SCMI TX over 1 mailbox bidirectional channel + 2 mbox / 2 shmem => SCMI TX and RX over 2 mailbox bidirectional channels + 2 mbox / 1 shmem => SCMI TX over 2 mailbox unidirectional channels + 3 mbox / 2 shmem => SCMI TX and RX over 3 mailbox unidirectional channels + Any other combination of mboxes and shmem is invalid. minItems: 1 - maxItems: 2 + maxItems: 3 shmem: description: @@ -234,7 +248,7 @@ $defs: mboxes: minItems: 1 - maxItems: 2 + maxItems: 3 shmem: minItems: 1 @@ -393,6 +407,26 @@ examples: }; }; + - | + firmware { + scmi { + compatible = "arm,scmi"; + mboxes = <&mhu_U_tx 0 0>, <&mhu_U_rx 0 0>; + shmem = <&cpu_scp_lpri0>; + + #address-cells = <1>; + #size-cells = <0>; + + scmi_dvfs_2: protocol@13 { + reg = <0x13>; + #clock-cells = <1>; + + mboxes = <&mhu_U_tx 1 0>, <&mhu_U_rx 1 0>, <&mhu_U_rx 1 1>; + shmem = <&cpu_scp_hpri0>, <&cpu_scp_hpri1>; + }; + }; + }; + - | firmware { scmi {