blob: 1da75ea84e25321f6d63e801eaabef704189b583 [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001From cdda49168d42c897574388356555f8130c021bb5 Mon Sep 17 00:00:00 2001
2From: Viresh Kumar <viresh.kumar@linaro.org>
3Date: Tue, 17 Nov 2020 15:32:05 +0530
4Subject: [PATCH 03/22] dt-bindings: mailbox : arm,mhuv2: Add bindings
5
6This patch adds device tree binding for ARM Message Handling Unit (MHU)
7controller version 2.
8
9Based on earlier work by Morten Borup Petersen.
10
11Reviewed-by: Rob Herring <robh@kernel.org>
12Co-developed-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
13Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
14Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
15Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
16
17Upstream-Status: Backport [https://lkml.org/lkml/2020/11/17/234]
18Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
19---
20 .../bindings/mailbox/arm,mhuv2.yaml | 209 ++++++++++++++++++
21 1 file changed, 209 insertions(+)
22 create mode 100644 Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml
23
24diff --git a/Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml b/Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml
25new file mode 100644
26index 000000000000..6608545ea66f
27--- /dev/null
28+++ b/Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml
29@@ -0,0 +1,209 @@
30+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
31+%YAML 1.2
32+---
33+$id: http://devicetree.org/schemas/mailbox/arm,mhuv2.yaml#
34+$schema: http://devicetree.org/meta-schemas/core.yaml#
35+
36+title: ARM MHUv2 Mailbox Controller
37+
38+maintainers:
39+ - Tushar Khandelwal <tushar.khandelwal@arm.com>
40+ - Viresh Kumar <viresh.kumar@linaro.org>
41+
42+description: |
43+ The Arm Message Handling Unit (MHU) Version 2 is a mailbox controller that has
44+ between 1 and 124 channel windows (each 32-bit wide) to provide unidirectional
45+ communication with remote processor(s), where the number of channel windows
46+ are implementation dependent.
47+
48+ Given the unidirectional nature of the controller, an MHUv2 mailbox may only
49+ be written to or read from. If a pair of MHU controllers is implemented
50+ between two processing elements to provide bidirectional communication, these
51+ must be specified as two separate mailboxes.
52+
53+ If the interrupts property is present in device tree node, then its treated as
54+ a "receiver" mailbox, otherwise a "sender".
55+
56+ An MHU controller must be specified along with the supported transport
57+ protocols. The transport protocols determine the method of data transmission
58+ as well as the number of provided mailbox channels.
59+
60+ Following are the possible transport protocols.
61+
62+ - Data-transfer: Each transfer is made of one or more words, using one or more
63+ channel windows.
64+
65+ - Doorbell: Each transfer is made up of single bit flag, using any one of the
66+ bits in a channel window. A channel window can support up to 32 doorbells
67+ and the entire window shall be used in doorbell protocol. Optionally, data
68+ may be transmitted through a shared memory region, wherein the MHU is used
69+ strictly as an interrupt generation mechanism but that is out of the scope
70+ of these bindings.
71+
72+# We need a select here so we don't match all nodes with 'arm,primecell'
73+select:
74+ properties:
75+ compatible:
76+ contains:
77+ enum:
78+ - arm,mhuv2-tx
79+ - arm,mhuv2-rx
80+ required:
81+ - compatible
82+
83+properties:
84+ compatible:
85+ oneOf:
86+ - description: Sender mode
87+ items:
88+ - const: arm,mhuv2-tx
89+ - const: arm,primecell
90+
91+ - description: Receiver-mode
92+ items:
93+ - const: arm,mhuv2-rx
94+ - const: arm,primecell
95+
96+ reg:
97+ maxItems: 1
98+
99+ interrupts:
100+ description: |
101+ The MHUv2 controller always implements an interrupt in the "receiver"
102+ mode, while the interrupt in the "sender" mode was not available in the
103+ version MHUv2.0, but the later versions do have it.
104+ maxItems: 1
105+
106+ clocks:
107+ maxItems: 1
108+
109+ clock-names:
110+ maxItems: 1
111+
112+ arm,mhuv2-protocols:
113+ $ref: /schemas/types.yaml#/definitions/uint32-matrix
114+ description: |
115+ The MHUv2 controller may contain up to 124 channel windows (each 32-bit
116+ wide). The hardware and the DT bindings allows any combination of those to
117+ be used for various transport protocols.
118+
119+ This property allows a platform to describe how these channel windows are
120+ used in various transport protocols. The entries in this property shall be
121+ present as an array of tuples, where each tuple describes details about
122+ one of the transport protocol being implemented over some channel
123+ window(s).
124+
125+ The first field of a tuple signifies the transfer protocol, 0 is reserved
126+ for doorbell protocol, and 1 is reserved for data-transfer protocol.
127+ Using any other value in the first field of a tuple makes it invalid.
128+
129+ The second field of a tuple signifies the number of channel windows where
130+ the protocol would be used and should be set to a non zero value. For
131+ doorbell protocol this field signifies the number of 32-bit channel
132+ windows that implement the doorbell protocol. For data-transfer protocol,
133+ this field signifies the number of 32-bit channel windows that implement
134+ the data-transfer protocol.
135+
136+ The total number of channel windows specified here shouldn't be more than
137+ the ones implemented by the platform, though one can specify lesser number
138+ of windows here than what the platform implements.
139+
140+ mhu: mailbox@2b1f0000 {
141+ ...
142+
143+ arm,mhuv2-protocols = <0 2>, <1 1>, <1 5>, <1 7>;
144+ }
145+
146+ The above example defines the protocols of an ARM MHUv2 mailbox
147+ controller, where a total of 15 channel windows are used. The first two
148+ windows are used in doorbell protocol (64 doorbells), followed by 1, 5 and
149+ 7 windows (separately) used in data-transfer protocol.
150+
151+ minItems: 1
152+ maxItems: 124
153+ items:
154+ items:
155+ - enum: [ 0, 1 ]
156+ - minimum: 0
157+ maximum: 124
158+
159+
160+ '#mbox-cells':
161+ description: |
162+ It is always set to 2. The first argument in the consumers 'mboxes'
163+ property represents the channel window group, which may be used in
164+ doorbell, or data-transfer protocol, and the second argument (only
165+ relevant in doorbell protocol, should be 0 otherwise) represents the
166+ doorbell number within the 32 bit wide channel window.
167+
168+ From the example given above for arm,mhuv2-protocols, here is how a client
169+ node can reference them.
170+
171+ mboxes = <&mhu 0 5>; // Channel Window Group 0, doorbell 5.
172+ mboxes = <&mhu 1 7>; // Channel Window Group 1, doorbell 7.
173+ mboxes = <&mhu 2 0>; // Channel Window Group 2, data transfer protocol with 1 window.
174+ mboxes = <&mhu 3 0>; // Channel Window Group 3, data transfer protocol with 5 windows.
175+ mboxes = <&mhu 4 0>; // Channel Window Group 4, data transfer protocol with 7 windows.
176+
177+ const: 2
178+
179+if:
180+ # Interrupt is compulsory for receiver
181+ properties:
182+ compatible:
183+ contains:
184+ const: arm,mhuv2-rx
185+then:
186+ required:
187+ - interrupts
188+
189+required:
190+ - compatible
191+ - reg
192+ - '#mbox-cells'
193+ - arm,mhuv2-protocols
194+
195+additionalProperties: false
196+
197+examples:
198+ # Multiple transport protocols implemented by the mailbox controllers
199+ - |
200+ soc {
201+ #address-cells = <2>;
202+ #size-cells = <2>;
203+
204+ mhu_tx: mailbox@2b1f0000 {
205+ #mbox-cells = <2>;
206+ compatible = "arm,mhuv2-tx", "arm,primecell";
207+ reg = <0 0x2b1f0000 0 0x1000>;
208+ clocks = <&clock 0>;
209+ clock-names = "apb_pclk";
210+ interrupts = <0 45 4>;
211+ arm,mhuv2-protocols = <1 5>, <1 2>, <1 5>, <1 7>, <0 2>;
212+ };
213+
214+ mhu_rx: mailbox@2b1f1000 {
215+ #mbox-cells = <2>;
216+ compatible = "arm,mhuv2-rx", "arm,primecell";
217+ reg = <0 0x2b1f1000 0 0x1000>;
218+ clocks = <&clock 0>;
219+ clock-names = "apb_pclk";
220+ interrupts = <0 46 4>;
221+ arm,mhuv2-protocols = <1 1>, <1 7>, <0 2>;
222+ };
223+
224+ mhu_client: scb@2e000000 {
225+ compatible = "fujitsu,mb86s70-scb-1.0";
226+ reg = <0 0x2e000000 0 0x4000>;
227+
228+ mboxes =
229+ //data-transfer protocol with 5 windows, mhu-tx
230+ <&mhu_tx 2 0>,
231+ //data-transfer protocol with 7 windows, mhu-tx
232+ <&mhu_tx 3 0>,
233+ //doorbell protocol channel 4, doorbell 27, mhu-tx
234+ <&mhu_tx 4 27>,
235+ //data-transfer protocol with 1 window, mhu-rx
236+ <&mhu_rx 0 0>;
237+ };
238+ };
239--
2402.17.1
241