From patchwork Tue Apr 4 11:50:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 79038 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2973781vqo; Tue, 4 Apr 2023 05:09:39 -0700 (PDT) X-Google-Smtp-Source: AKy350Y+k45NBlMCuW7jQmXs6h6FmCgwn2ZZ8jqVoSgF1tu7Jnitkibc5iFcn4iHcIkeJRfXY/UD X-Received: by 2002:a17:906:492:b0:947:630b:35f8 with SMTP id f18-20020a170906049200b00947630b35f8mr1972405eja.17.1680610179437; Tue, 04 Apr 2023 05:09:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680610179; cv=none; d=google.com; s=arc-20160816; b=rKyWHiKt3UVeHM8gvuakZ48KjxroYboi9aNVxZ/roAEo4/Jgx+Ua2N/FtcrB6p23f0 GwqJ0yxbNHKt9EWtyqkfsvoeaMmUPwzcgqrOXGyvutsA7bOc+Nx9C1TLvD4PTJt2Ntaz elNlNQ1t1sgey3IdMctcJyq8y6WaWa4dHrjfBn7IqKvFQWaUCmTfoTBD5h+CC/qpEmJ0 ccCngC97FYgF61sVZAcFvkcg2LtWixKnYIjVDha/Jb88u2tUixDAbmRo44gf5qjmX6hO Sx9lCPkMDRZcFQXenqsWoU3pguxxTwVDx5fTOxJif+AFabD8xMcpXKpVcExEqr0UVLD8 Wy8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ove56bcIVlPIAqMF3jeomIAbdQY5DKk62/U/FIJHyuk=; b=Y6snkmzGXNlPs9Mt6fJgJNmaLR20Cq2ABLZRGpQdnvKemXA+ossNp98yv4NssNIaMY 64ZhW1Hy2tzWc3LODwLSGyOH6esvlA/plLj3yMYI/l0tJYZ2oI//fQk+zSx+4K/SXfHk eizYcu9s0lQdOfcEUNxEdXh7ttEwiWbt5x+JKx34rquw+67jiuHUCuMWJ8k5bnplHwp7 6bRER4Mj43kQzT47mn1bex2vhdxTd0n+bC+khjwk0ujFUUcRTpBsFSmycvdI8tusbGl5 mibS6/nRT3/pFXaphusH9J+fkVB1+jD7e7aDQQM28LczRk7Minbjtq1xn3h99f1kvp3q e12A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a056402000b00b004af7147d830si970289edu.195.2023.04.04.05.09.14; Tue, 04 Apr 2023 05:09:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234911AbjDDLvU (ORCPT + 99 others); Tue, 4 Apr 2023 07:51:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234997AbjDDLvA (ORCPT ); Tue, 4 Apr 2023 07:51:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D5CB530C1; Tue, 4 Apr 2023 04:50:52 -0700 (PDT) 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 1CEDAFEC; Tue, 4 Apr 2023 04:51:37 -0700 (PDT) Received: from e120937-lin.. (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 282F83F762; Tue, 4 Apr 2023 04:50:51 -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 , Rob Herring , Krzysztof Kozlowski Subject: [PATCH v3 1/2] dt-bindings: firmware: arm,scmi: Support mailboxes unidirectional channels Date: Tue, 4 Apr 2023 12:50:25 +0100 Message-Id: <20230404115026.2828149-2-cristian.marussi@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230404115026.2828149-1-cristian.marussi@arm.com> References: <20230404115026.2828149-1-cristian.marussi@arm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762247499376948169?= X-GMAIL-MSGID: =?utf-8?q?1762247499376948169?= 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. Signed-off-by: Cristian Marussi Reviewed-by: Rob Herring --- Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: devicetree@vger.kernel.org v2 --> v3 - coalesced oneOf entries using proper minItems - removed unidirectional channels example v1 --> v2 - added mbox-names unidirectional definitions and example --- .../bindings/firmware/arm,scmi.yaml | 48 +++++++++++++++---- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml index 2f7c51c75e85..5824c43e9893 100644 --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml @@ -56,17 +56,38 @@ properties: description: Specifies the mailboxes used to communicate with SCMI compliant firmware. - items: - - const: tx - - const: rx + oneOf: + - items: + - const: tx + - const: rx + minItems: 1 + - items: + - const: tx + - const: tx_reply + - const: rx + minItems: 2 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: @@ -228,13 +249,20 @@ $defs: maxItems: 1 mbox-names: - items: - - const: tx - - const: rx + oneOf: + - items: + - const: tx + - const: rx + minItems: 1 + - items: + - const: tx + - const: tx_reply + - const: rx + minItems: 2 mboxes: minItems: 1 - maxItems: 2 + maxItems: 3 shmem: minItems: 1