From patchwork Fri Oct 9 11:42:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 11825621 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 54281139F for ; Fri, 9 Oct 2020 11:43:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 042D322268 for ; Fri, 9 Oct 2020 11:43:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="E2qOTv7f"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ooZpCbdg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 042D322268 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=f2K9N5VuaGm8/ba7nKS9OirOUk/3iETDUGk4nApTYBg=; b=E2qOTv7f7w+dHkxgNuAKlub4GL kYt7BbEWJg793u19Q+lPlZRAiZvnaW5dlu0a4APdzP7bdY1kPpbHflQBM2oRKpLhiOHS9TN8bayO3 j+j27I3UhE7mRwW3ifIZ4NCtdloEEBXqmg5JbGpJ2CrKuW/pv37iJwk0mSn4ccTz0nIUNhxR4cmkO WsN2cgQ6QV+Osg/IEHzT4psskINBNFVPez2Bu5OIXrcFdQI0meeCi9Z4uLes63lgByuGHXp0h38Ay g5p5XABlRQdkCLQKvKNyEJdt1LE6I/wOKTTdM8AkzQfwlUueVoG0BHIcWHoy0S4XO0xpobZRMUp/t 3LInzKwQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQqnS-000384-BY; Fri, 09 Oct 2020 11:42:50 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQqnO-00037I-Ou for linux-arm-kernel@lists.infradead.org; Fri, 09 Oct 2020 11:42:48 +0000 Received: by mail-pf1-x442.google.com with SMTP id 132so62720pfz.5 for ; Fri, 09 Oct 2020 04:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TPvCR0dn1rkBCd8iZ1AA57V2TMQO/sIjjX3MxWPn6oE=; b=ooZpCbdgLkuUEKASh9Ret34IHKXPOenGCJ0PREyNuAzvD0ADXaq6Yw+Ewv3A0rk8uL FRCY67joFiFKnD4XZJd2Dz2NT6S3nwBz0StXmhKLSZa0GbuerMRvBhIqiVYRmBu9dJWC vlm8QxDawynDABxQUM6f5fbF3GNE/mrwTxJ8kdx9vJxep5BugoVJmTHgnjuNSDCIJtCQ 25GI11Z+F/27M+WpEnnjW+32mE5lk/6ddrtBT8hTOy7P3vH2xRWZp9nrcPFdevSvI3eg GHXqSFozyUW7vxaxgaTmBmKfvvWOX82lzBceOUlEmUiW7UbEtcyj4QV8hKkY/A6CbsbF EWnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TPvCR0dn1rkBCd8iZ1AA57V2TMQO/sIjjX3MxWPn6oE=; b=f1uDtMLSayEejpHPM0245HDv0vquz9TbM8IOaudAmNcf+Gx6mpD0gms5P4UX7v7tR3 yIQQCIY2CH//53NRXDPsP5ghjlngiQx2Wo/X2QwG7R9RBBoxzPlHbR5ljkI08QueymTH EAohICV+wOXbDjyi6ozxZxkf2JmLHEqytf+buuA2Km1U8rnX0UonT1Xkjd8p0SVxzgh6 YHH5CONxfFI+kxAwX+VHTmF2z7IPVxUE8wgg6r62VzH7oWH9lDR2jn1F24MYC9y37OCC e4Ysu3pK0IcOUw0u2TUUhyligs/TVhPBp3OFjFmJRhWQXwo7XxEqPGioBrAMgRHQz9AB yfBQ== X-Gm-Message-State: AOAM530XP1YEFI0RVfmG1kGD64VAlE8QohLtcqk+lEKl0iiW2vM2AnNJ tm6Kg+8fm8APFtqK4nW/BJZ3kw== X-Google-Smtp-Source: ABdhPJzT9zx2RLEKPBiAk8jv2N4fDpYrUpCn+M46NWuEi/803AQs6GRRAPcOQxgGnYOMi7ksXy+YWA== X-Received: by 2002:a62:dd56:0:b029:155:8165:c6c2 with SMTP id w83-20020a62dd560000b02901558165c6c2mr4416346pff.3.1602243764405; Fri, 09 Oct 2020 04:42:44 -0700 (PDT) Received: from localhost ([122.181.54.133]) by smtp.gmail.com with ESMTPSA id x18sm5726556pga.49.2020.10.09.04.42.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Oct 2020 04:42:42 -0700 (PDT) From: Viresh Kumar To: Rob Herring , Jassi Brar , morten_bp@live.dk, Tushar Khandelwal , Viresh Kumar Subject: [PATCH V3] dt-bindings: mailbox: arm,mhuv2: Add bindings Date: Fri, 9 Oct 2020 17:12:38 +0530 Message-Id: <2084ef6975776cabe7a0509fffaf53040c13bfde.1602243670.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201009_074247_081666_C93CB533 X-CRM114-Status: GOOD ( 26.72 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org, Tushar Khandelwal , Sudeep.Holla@arm.com, Frank Rowand , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch adds device tree binding for ARM Message Handling Unit (MHU) controller version 2. Based on earlier work by Morten Borup Petersen. Co-developed-by: Tushar Khandelwal Signed-off-by: Tushar Khandelwal Signed-off-by: Viresh Kumar --- V2->V3: - compatible is changed to arm-mhuv2-tx/rx. Later version of MHUv2 have an interrupt in the sender mode as well and we can't find if a mailbox is sender or receiver just based on an interrupt anymore. We needed a better way. - arm-mhuv2-mode is renamed to arm,mhuv2-protocols to fit the purpose better. - Minor formatting otherwise. - No longer an RFC. Morten: Please let me know if you want me to add your sign-off here from some other email id as you no longer work with ARM. --- .../bindings/mailbox/arm,mhuv2.yaml | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml diff --git a/Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml b/Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml new file mode 100644 index 000000000000..a2b8ecd639c7 --- /dev/null +++ b/Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml @@ -0,0 +1,194 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mailbox/arm,mhuv2.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ARM MHUv2 Mailbox Controller + +maintainers: + - Tushar Khandelwal + - Viresh Kumar + +description: | + The Arm Message Handling Unit (MHU) Version 2 is a mailbox controller that has + between 1 and 124 channel windows (each 32-bit wide) to provide unidirectional + communication with remote processor(s), where the number of channel windows + are implementation dependent. + + Given the unidirectional nature of the controller, an MHUv2 mailbox may only + be written to or read from. If a pair of MHU controllers is implemented + between two processing elements to provide bidirectional communication, these + must be specified as two separate mailboxes. + + If the interrupts property is present in device tree node, then its treated as + a "receiver" mailbox, otherwise a "sender". + + An MHU controller must be specified along with the supported transport + protocols. The transport protocols determine the method of data transmission + as well as the number of provided mailbox channels. + + Following are the possible transport protocols. + + - Doorbell: Each transfer is made up of single bit flag, using any one of the + bits in a channel window. A channel window can support up to 32 doorbells + and the entire window shall be used in doorbell protocol. Optionally, data + may be transmitted through a shared memory region, wherein the MHU is used + strictly as an interrupt generation mechanism but that is out of the scope + of these bindings. + + - Single-word: Each transfer is single word, using a single Channel window. + + - Multi-word: Each transfer is made of two or more words, using two or more + channel windows. + +# We need a select here so we don't match all nodes with 'arm,primecell' +select: + properties: + compatible: + contains: + enum: + - arm,mhuv2-tx + - arm,mhuv2-rx + required: + - compatible + +properties: + compatible: + oneOf: + - description: Sender mode + items: + - const: arm,mhuv2-tx + - const: arm,primecell + + - description: Receiver-mode + items: + - const: arm,mhuv2-rx + - const: arm,primecell + + reg: + maxItems: 1 + + interrupts: + description: | + The MHUv2 controller always implements an interrupt in the "receiver" + mode, while the interrupt in the "sender" mode was not available in the + version MHUv2.0, but the later versions do have it. + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + maxItems: 1 + + arm,mhuv2-protocols: + $ref: /schemas/types.yaml#/definitions/uint32-matrix + description: | + The MHUv2 controller may contain up to 124 channel windows (each 32-bit + wide). The hardware and the DT bindings allows any combination of those to + be used for various transport protocols. + + This property allows a platform to describe how these channel windows are + used in various transport protocols. The entries in this property shall be + present as an array of tuples, where each tuple describes details about + one of the transport protocol being implemented over some channel + window(s). + + The first field of a tuple signifies the transfer protocol, 0 is reserved + for doorbell protocol, 1 is reserved for single-word protocol and 2 is + reserved for multi-word protocol. Using any other value in the first field + of a tuple makes it invalid. + + The second field of a tuple signifies the number of channel windows where + the protocol would be used. For doorbell protocol this field signifies the + number of 32-bit channel windows that implement the doorbell protocol. For + single-word protocol this field signifies the number of 32-bit channel + windows that implement separate single-word protocol mailbox channels. For + multi-word protocol this field signifies the number of channel windows + used for a multi-word protocol, it should be 2 or more. + + The total number of channel windows specified here shouldn't be more than + the ones implemented by the platform, though one can specify lesser number + of windows here than what the platform implements. + + mhu: mailbox@2b1f0000 { + ... + + arm,mhuv2-protocols = <0 2>, <1 3>, <2 5>, <2 7>; + } + + The above example defines the protocols of an ARM MHUv2 mailbox + controller, where a total of 17 channel windows are used. The first two + windows are used in doorbell protocol (64 doorbells), the next 3 windows + are (separately) used in single-word protocol, and the last two mailbox + channels are used in multi-word protocol of length 5 and 7 channel + windows. + + '#mbox-cells': + description: | + It contains two fields, the first field represents the channel number, + which may be used in doorbell, single-word, or multi-word protocol, and + the second field (only relevant in doorbell protocol, should be 0 + otherwise) represents the doorbell number within the 32 bit wide channel + window. + + From the example given above for the arm,mhuv2-protocols, here is how a + client node can reference them. + + mboxes = <&mhu 0 5>; // Mailbox channel 0, doorbell 5. + mboxes = <&mhu 1 7>; // Mailbox channel 1, doorbell 7. + mboxes = <&mhu 2 0>; // Mailbox channel 2, single-word protocol. + mboxes = <&mhu 4 0>; // Mailbox channel 4, single-word protocol. + mboxes = <&mhu 6 0>; // Mailbox channel 6, multi-word protocol with 7 windows. + + const: 2 + +required: + - compatible + - reg + - '#mbox-cells' + - arm,mhuv2-protocols + +additionalProperties: false + +examples: + # Multiple transport protocols implemented by the mailbox controllers + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + mhu_tx: mailbox-tx@2b1f0000 { + #mbox-cells = <2>; + compatible = "arm,mhuv2-tx", "arm,primecell"; + reg = <0 0x2b1f0000 0 0x1000>; + clocks = <&clock 0>; + clock-names = "apb_pclk"; + arm,mhuv2-protocols = <1 5>, <2 2>, <2 5>, <2 7>, <0 2>; + }; + + mhu_rx: mailbox-rx@2b1f1000 { + #mbox-cells = <2>; + compatible = "arm,mhuv2-rx", "arm,primecell"; + reg = <0 0x2b1f1000 0 0x1000>; + clocks = <&clock 0>; + clock-names = "apb_pclk"; + arm,mhuv2-protocols = <1 5>, <2 7>, <0 2>; + }; + + mhu_client: scb@2e000000 { + compatible = "fujitsu,mb86s70-scb-1.0"; + reg = <0 0x2e000000 0 0x4000>; + + mboxes = + //single-word protocol channel 0, mhu-rx + <&mhu_rx 0 0>, + //single-word protocol channel 4, mhu-tx + <&mhu_tx 4 0>, + //multi-word protocol channel 6 with 5 windows, mhu-tx + <&mhu_tx 6 0>, + //doorbell protocol channel 9, doorbell 27, mhu-tx + <&mhu_tx 9 27>; + }; + };