xref: /freebsd/sys/contrib/device-tree/Bindings/mailbox/ti,omap-mailbox.yaml (revision 5956d97f4b3204318ceb6aa9c77bd0bc6ea87a41)
1*5956d97fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
2*5956d97fSEmmanuel Vadot%YAML 1.2
3*5956d97fSEmmanuel Vadot---
4*5956d97fSEmmanuel Vadot$id: http://devicetree.org/schemas/mailbox/ti,omap-mailbox.yaml#
5*5956d97fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*5956d97fSEmmanuel Vadot
7*5956d97fSEmmanuel Vadottitle: TI OMAP2+ and K3 Mailbox devices
8*5956d97fSEmmanuel Vadot
9*5956d97fSEmmanuel Vadotmaintainers:
10*5956d97fSEmmanuel Vadot  - Suman Anna <s-anna@ti.com>
11*5956d97fSEmmanuel Vadot
12*5956d97fSEmmanuel Vadotdescription: |
13*5956d97fSEmmanuel Vadot  The OMAP Mailbox hardware facilitates communication between different
14*5956d97fSEmmanuel Vadot  processors using a queued mailbox interrupt mechanism. The IP block is
15*5956d97fSEmmanuel Vadot  external to the various processor subsystems and is connected on an
16*5956d97fSEmmanuel Vadot  interconnect bus. The communication is achieved through a set of registers
17*5956d97fSEmmanuel Vadot  for message storage and interrupt configuration registers.
18*5956d97fSEmmanuel Vadot
19*5956d97fSEmmanuel Vadot  Each mailbox IP block/cluster has a certain number of h/w fifo queues and
20*5956d97fSEmmanuel Vadot  output interrupt lines. An output interrupt line is routed to an interrupt
21*5956d97fSEmmanuel Vadot  controller within a processor subsystem, and there can be more than one line
22*5956d97fSEmmanuel Vadot  going to a specific processor's interrupt controller. The interrupt line
23*5956d97fSEmmanuel Vadot  connections are fixed for an instance and are dictated by the IP integration
24*5956d97fSEmmanuel Vadot  into the SoC (excluding the SoCs that have an Interrupt Crossbar or an
25*5956d97fSEmmanuel Vadot  Interrupt Router IP). Each interrupt line is programmable through a set of
26*5956d97fSEmmanuel Vadot  interrupt configuration registers, and have a rx and tx interrupt source per
27*5956d97fSEmmanuel Vadot  h/w fifo. Communication between different processors is achieved through the
28*5956d97fSEmmanuel Vadot  appropriate programming of the rx and tx interrupt sources on the appropriate
29*5956d97fSEmmanuel Vadot  interrupt lines.
30*5956d97fSEmmanuel Vadot
31*5956d97fSEmmanuel Vadot  The number of h/w fifo queues and interrupt lines dictate the usable
32*5956d97fSEmmanuel Vadot  registers. All the current OMAP SoCs except for the newest DRA7xx SoC has a
33*5956d97fSEmmanuel Vadot  single IP instance. DRA7xx has multiple instances with different number of
34*5956d97fSEmmanuel Vadot  h/w fifo queues and interrupt lines between different instances. The interrupt
35*5956d97fSEmmanuel Vadot  lines can also be routed to different processor sub-systems on DRA7xx as they
36*5956d97fSEmmanuel Vadot  are routed through the Crossbar, a kind of interrupt router/multiplexer. The
37*5956d97fSEmmanuel Vadot  K3 AM65x, J721E and J7200 SoCs has each of these instances form a cluster and
38*5956d97fSEmmanuel Vadot  combine multiple clusters into a single IP block present within the Main
39*5956d97fSEmmanuel Vadot  NavSS. The interrupt lines from all these clusters are multiplexed and routed
40*5956d97fSEmmanuel Vadot  to different processor subsystems over a limited number of common interrupt
41*5956d97fSEmmanuel Vadot  output lines of an Interrupt Router. The AM64x SoCS also uses a single IP
42*5956d97fSEmmanuel Vadot  block comprising of multiple clusters, but the number of clusters are
43*5956d97fSEmmanuel Vadot  smaller, and the interrupt output lines are connected directly to various
44*5956d97fSEmmanuel Vadot  processors.
45*5956d97fSEmmanuel Vadot
46*5956d97fSEmmanuel Vadot  Mailbox Controller Nodes
47*5956d97fSEmmanuel Vadot  =========================
48*5956d97fSEmmanuel Vadot  A Mailbox device node is used to represent a Mailbox IP instance/cluster
49*5956d97fSEmmanuel Vadot  within a SoC. The sub-mailboxes (actual communication channels) are
50*5956d97fSEmmanuel Vadot  represented as child nodes of this parent node.
51*5956d97fSEmmanuel Vadot
52*5956d97fSEmmanuel Vadot  Mailbox Users
53*5956d97fSEmmanuel Vadot  ==============
54*5956d97fSEmmanuel Vadot  A device needing to communicate with a target processor device should specify
55*5956d97fSEmmanuel Vadot  them using the common mailbox binding properties, "mboxes" and the optional
56*5956d97fSEmmanuel Vadot  "mbox-names" (please see Documentation/devicetree/bindings/mailbox/mailbox.txt
57*5956d97fSEmmanuel Vadot  for details). Each value of the mboxes property should contain a phandle to
58*5956d97fSEmmanuel Vadot  the mailbox controller device node and an args specifier that will be the
59*5956d97fSEmmanuel Vadot  phandle to the intended sub-mailbox child node to be used for communication.
60*5956d97fSEmmanuel Vadot  The equivalent "mbox-names" property value can be used to give a name to the
61*5956d97fSEmmanuel Vadot  communication channel to be used by the client user.
62*5956d97fSEmmanuel Vadot
63*5956d97fSEmmanuel Vadot$defs:
64*5956d97fSEmmanuel Vadot  omap-mbox-descriptor:
65*5956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
66*5956d97fSEmmanuel Vadot    description:
67*5956d97fSEmmanuel Vadot      The omap-mbox-descriptor is made of up of 3 cells and represents a single
68*5956d97fSEmmanuel Vadot      uni-directional communication channel. A typical sub-mailbox device uses
69*5956d97fSEmmanuel Vadot      two such channels - one for transmitting (Tx) and one for receiving (Rx).
70*5956d97fSEmmanuel Vadot    items:
71*5956d97fSEmmanuel Vadot      - description:
72*5956d97fSEmmanuel Vadot          mailbox fifo id used either for transmitting on ti,mbox-tx channel or
73*5956d97fSEmmanuel Vadot          for receiving on ti,mbox-rx channel (fifo_id). This is the hardware
74*5956d97fSEmmanuel Vadot          fifo number within a mailbox cluster.
75*5956d97fSEmmanuel Vadot      - description:
76*5956d97fSEmmanuel Vadot          irq identifier index number to use from the parent's interrupts data.
77*5956d97fSEmmanuel Vadot          Should be 0 for most of the cases, a positive index value is seen only
78*5956d97fSEmmanuel Vadot          on mailboxes that have multiple interrupt lines connected to the MPU
79*5956d97fSEmmanuel Vadot          processor (irq_id). This is an index number in the listed interrupts
80*5956d97fSEmmanuel Vadot          property in the DT nodes.
81*5956d97fSEmmanuel Vadot      - description:
82*5956d97fSEmmanuel Vadot          mailbox user id for identifying the interrupt line associated with
83*5956d97fSEmmanuel Vadot          generating a tx/rx fifo interrupt (usr_id). This is the hardware
84*5956d97fSEmmanuel Vadot          user id number within a mailbox cluster.
85*5956d97fSEmmanuel Vadot
86*5956d97fSEmmanuel Vadot  omap-sub-mailbox:
87*5956d97fSEmmanuel Vadot    type: object
88*5956d97fSEmmanuel Vadot    description:
89*5956d97fSEmmanuel Vadot      The omap-sub-mailbox is a child node within a Mailbox controller device
90*5956d97fSEmmanuel Vadot      node and represents the actual communication channel used to send and
91*5956d97fSEmmanuel Vadot      receive messages between the host processor and a remote processor. Each
92*5956d97fSEmmanuel Vadot      child node should have a unique node name across all the different mailbox
93*5956d97fSEmmanuel Vadot      device nodes.
94*5956d97fSEmmanuel Vadot
95*5956d97fSEmmanuel Vadot    properties:
96*5956d97fSEmmanuel Vadot      ti,mbox-tx:
97*5956d97fSEmmanuel Vadot        $ref: "#/$defs/omap-mbox-descriptor"
98*5956d97fSEmmanuel Vadot        description: sub-mailbox descriptor property defining a Tx fifo.
99*5956d97fSEmmanuel Vadot
100*5956d97fSEmmanuel Vadot      ti,mbox-rx:
101*5956d97fSEmmanuel Vadot        $ref: "#/$defs/omap-mbox-descriptor"
102*5956d97fSEmmanuel Vadot        description: sub-mailbox descriptor property defining a Rx fifo.
103*5956d97fSEmmanuel Vadot
104*5956d97fSEmmanuel Vadot      ti,mbox-send-noirq:
105*5956d97fSEmmanuel Vadot        type: boolean
106*5956d97fSEmmanuel Vadot        description:
107*5956d97fSEmmanuel Vadot          Quirk flag to allow the client user of this sub-mailbox to send
108*5956d97fSEmmanuel Vadot          messages without triggering a Tx ready interrupt, and to control
109*5956d97fSEmmanuel Vadot          the Tx ticker. Should be used only on sub-mailboxes used to
110*5956d97fSEmmanuel Vadot          communicate with WkupM3 remote processor on AM33xx/AM43xx SoCs.
111*5956d97fSEmmanuel Vadot
112*5956d97fSEmmanuel Vadot    required:
113*5956d97fSEmmanuel Vadot      - ti,mbox-tx
114*5956d97fSEmmanuel Vadot      - ti,mbox-rx
115*5956d97fSEmmanuel Vadot
116*5956d97fSEmmanuel Vadotproperties:
117*5956d97fSEmmanuel Vadot  compatible:
118*5956d97fSEmmanuel Vadot    enum:
119*5956d97fSEmmanuel Vadot      - ti,omap2-mailbox # for OMAP2420, OMAP2430 SoCs
120*5956d97fSEmmanuel Vadot      - ti,omap3-mailbox # for OMAP3430, OMAP3630 SoCs
121*5956d97fSEmmanuel Vadot      - ti,omap4-mailbox # for OMAP44xx, OMAP54xx, AM33xx, AM43xx and DRA7xx SoCs
122*5956d97fSEmmanuel Vadot      - ti,am654-mailbox # for K3 AM65x, J721E and J7200 SoCs
123*5956d97fSEmmanuel Vadot      - ti,am64-mailbox  # for K3 AM64x SoCs
124*5956d97fSEmmanuel Vadot
125*5956d97fSEmmanuel Vadot  reg:
126*5956d97fSEmmanuel Vadot    maxItems: 1
127*5956d97fSEmmanuel Vadot
128*5956d97fSEmmanuel Vadot  interrupts:
129*5956d97fSEmmanuel Vadot    description:
130*5956d97fSEmmanuel Vadot      Contains the interrupt information for the mailbox device. The format is
131*5956d97fSEmmanuel Vadot      dependent on which interrupt controller the Mailbox device uses. The
132*5956d97fSEmmanuel Vadot      number of interrupts listed will at most be the value specified in
133*5956d97fSEmmanuel Vadot      ti,mbox-num-users property, but is usually limited by the number of
134*5956d97fSEmmanuel Vadot      interrupts reaching the main processor. An interrupt-parent property
135*5956d97fSEmmanuel Vadot      is required on SoCs where the interrupt lines are connected through a
136*5956d97fSEmmanuel Vadot      Interrupt Router before reaching the main processor's GIC.
137*5956d97fSEmmanuel Vadot
138*5956d97fSEmmanuel Vadot  "#mbox-cells":
139*5956d97fSEmmanuel Vadot    const: 1
140*5956d97fSEmmanuel Vadot    description:
141*5956d97fSEmmanuel Vadot      The specifier is a phandle to an omap-sub-mailbox device.
142*5956d97fSEmmanuel Vadot
143*5956d97fSEmmanuel Vadot  ti,mbox-num-users:
144*5956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
145*5956d97fSEmmanuel Vadot    description:
146*5956d97fSEmmanuel Vadot      Number of targets (processor devices) that the mailbox device can
147*5956d97fSEmmanuel Vadot      interrupt.
148*5956d97fSEmmanuel Vadot
149*5956d97fSEmmanuel Vadot  ti,mbox-num-fifos:
150*5956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
151*5956d97fSEmmanuel Vadot    description: Number of h/w fifo queues within the mailbox IP block.
152*5956d97fSEmmanuel Vadot
153*5956d97fSEmmanuel Vadot  ti,hwmods:
154*5956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
155*5956d97fSEmmanuel Vadot    deprecated: true
156*5956d97fSEmmanuel Vadot    description:
157*5956d97fSEmmanuel Vadot      Name of the hwmod associated with the mailbox. This should be defined
158*5956d97fSEmmanuel Vadot      in the mailbox node only if the node is not defined as a child node of
159*5956d97fSEmmanuel Vadot      a corresponding sysc interconnect node.
160*5956d97fSEmmanuel Vadot
161*5956d97fSEmmanuel Vadot      This property is only needed on some legacy OMAP SoCs which have not
162*5956d97fSEmmanuel Vadot      yet been converted to the ti,sysc interconnect hierarachy, but is
163*5956d97fSEmmanuel Vadot      otherwise considered obsolete.
164*5956d97fSEmmanuel Vadot
165*5956d97fSEmmanuel VadotpatternProperties:
166*5956d97fSEmmanuel Vadot  "^mbox-[a-z0-9-]+$":
167*5956d97fSEmmanuel Vadot    $ref: "#/$defs/omap-sub-mailbox"
168*5956d97fSEmmanuel Vadot
169*5956d97fSEmmanuel Vadotrequired:
170*5956d97fSEmmanuel Vadot  - compatible
171*5956d97fSEmmanuel Vadot  - reg
172*5956d97fSEmmanuel Vadot  - interrupts
173*5956d97fSEmmanuel Vadot  - "#mbox-cells"
174*5956d97fSEmmanuel Vadot  - ti,mbox-num-users
175*5956d97fSEmmanuel Vadot  - ti,mbox-num-fifos
176*5956d97fSEmmanuel Vadot
177*5956d97fSEmmanuel VadotallOf:
178*5956d97fSEmmanuel Vadot  - if:
179*5956d97fSEmmanuel Vadot      properties:
180*5956d97fSEmmanuel Vadot        compatible:
181*5956d97fSEmmanuel Vadot          enum:
182*5956d97fSEmmanuel Vadot            - ti,am654-mailbox
183*5956d97fSEmmanuel Vadot    then:
184*5956d97fSEmmanuel Vadot      required:
185*5956d97fSEmmanuel Vadot        - interrupt-parent
186*5956d97fSEmmanuel Vadot
187*5956d97fSEmmanuel Vadot  - if:
188*5956d97fSEmmanuel Vadot      properties:
189*5956d97fSEmmanuel Vadot        compatible:
190*5956d97fSEmmanuel Vadot          enum:
191*5956d97fSEmmanuel Vadot            - ti,am654-mailbox
192*5956d97fSEmmanuel Vadot            - ti,am64-mailbox
193*5956d97fSEmmanuel Vadot    then:
194*5956d97fSEmmanuel Vadot      properties:
195*5956d97fSEmmanuel Vadot        ti,mbox-num-users:
196*5956d97fSEmmanuel Vadot          const: 4
197*5956d97fSEmmanuel Vadot        ti,mbox-num-fifos:
198*5956d97fSEmmanuel Vadot          const: 16
199*5956d97fSEmmanuel Vadot        interrupts:
200*5956d97fSEmmanuel Vadot          minItems: 1
201*5956d97fSEmmanuel Vadot          maxItems: 4
202*5956d97fSEmmanuel Vadot
203*5956d97fSEmmanuel Vadot  - if:
204*5956d97fSEmmanuel Vadot      properties:
205*5956d97fSEmmanuel Vadot        compatible:
206*5956d97fSEmmanuel Vadot          enum:
207*5956d97fSEmmanuel Vadot            - ti,omap4-mailbox
208*5956d97fSEmmanuel Vadot    then:
209*5956d97fSEmmanuel Vadot      properties:
210*5956d97fSEmmanuel Vadot        ti,mbox-num-users:
211*5956d97fSEmmanuel Vadot          enum: [3, 4]
212*5956d97fSEmmanuel Vadot        ti,mbox-num-fifos:
213*5956d97fSEmmanuel Vadot          enum: [8, 12]
214*5956d97fSEmmanuel Vadot        interrupts:
215*5956d97fSEmmanuel Vadot          minItems: 1
216*5956d97fSEmmanuel Vadot          maxItems: 4
217*5956d97fSEmmanuel Vadot
218*5956d97fSEmmanuel Vadot  - if:
219*5956d97fSEmmanuel Vadot      properties:
220*5956d97fSEmmanuel Vadot        compatible:
221*5956d97fSEmmanuel Vadot          enum:
222*5956d97fSEmmanuel Vadot            - ti,omap3-mailbox
223*5956d97fSEmmanuel Vadot    then:
224*5956d97fSEmmanuel Vadot      properties:
225*5956d97fSEmmanuel Vadot        ti,mbox-num-users:
226*5956d97fSEmmanuel Vadot          const: 2
227*5956d97fSEmmanuel Vadot        ti,mbox-num-fifos:
228*5956d97fSEmmanuel Vadot          const: 2
229*5956d97fSEmmanuel Vadot        interrupts:
230*5956d97fSEmmanuel Vadot          minItems: 1
231*5956d97fSEmmanuel Vadot          maxItems: 1
232*5956d97fSEmmanuel Vadot
233*5956d97fSEmmanuel Vadot  - if:
234*5956d97fSEmmanuel Vadot      properties:
235*5956d97fSEmmanuel Vadot        compatible:
236*5956d97fSEmmanuel Vadot          enum:
237*5956d97fSEmmanuel Vadot            - ti,omap2-mailbox
238*5956d97fSEmmanuel Vadot    then:
239*5956d97fSEmmanuel Vadot      properties:
240*5956d97fSEmmanuel Vadot        ti,mbox-num-users:
241*5956d97fSEmmanuel Vadot          const: 4
242*5956d97fSEmmanuel Vadot        ti,mbox-num-fifos:
243*5956d97fSEmmanuel Vadot          const: 6
244*5956d97fSEmmanuel Vadot        interrupts:
245*5956d97fSEmmanuel Vadot          minItems: 1
246*5956d97fSEmmanuel Vadot          maxItems: 2
247*5956d97fSEmmanuel Vadot
248*5956d97fSEmmanuel VadotadditionalProperties: false
249*5956d97fSEmmanuel Vadot
250*5956d97fSEmmanuel Vadotexamples:
251*5956d97fSEmmanuel Vadot  - |
252*5956d97fSEmmanuel Vadot    /* OMAP4 */
253*5956d97fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
254*5956d97fSEmmanuel Vadot    mailbox: mailbox@4a0f4000 {
255*5956d97fSEmmanuel Vadot        compatible = "ti,omap4-mailbox";
256*5956d97fSEmmanuel Vadot        reg = <0x4a0f4000 0x200>;
257*5956d97fSEmmanuel Vadot        interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
258*5956d97fSEmmanuel Vadot        #mbox-cells = <1>;
259*5956d97fSEmmanuel Vadot        ti,mbox-num-users = <3>;
260*5956d97fSEmmanuel Vadot        ti,mbox-num-fifos = <8>;
261*5956d97fSEmmanuel Vadot
262*5956d97fSEmmanuel Vadot        mbox_ipu: mbox-ipu {
263*5956d97fSEmmanuel Vadot            ti,mbox-tx = <0 0 0>;
264*5956d97fSEmmanuel Vadot            ti,mbox-rx = <1 0 0>;
265*5956d97fSEmmanuel Vadot        };
266*5956d97fSEmmanuel Vadot        mbox_dsp: mbox-dsp {
267*5956d97fSEmmanuel Vadot            ti,mbox-tx = <3 0 0>;
268*5956d97fSEmmanuel Vadot            ti,mbox-rx = <2 0 0>;
269*5956d97fSEmmanuel Vadot        };
270*5956d97fSEmmanuel Vadot    };
271*5956d97fSEmmanuel Vadot
272*5956d97fSEmmanuel Vadot    dsp {
273*5956d97fSEmmanuel Vadot        mboxes = <&mailbox &mbox_dsp>;
274*5956d97fSEmmanuel Vadot    };
275*5956d97fSEmmanuel Vadot
276*5956d97fSEmmanuel Vadot  - |
277*5956d97fSEmmanuel Vadot    /* AM33xx */
278*5956d97fSEmmanuel Vadot    mailbox1: mailbox@480c8000 {
279*5956d97fSEmmanuel Vadot        compatible = "ti,omap4-mailbox";
280*5956d97fSEmmanuel Vadot        reg = <0x480c8000 0x200>;
281*5956d97fSEmmanuel Vadot        interrupts = <77>;
282*5956d97fSEmmanuel Vadot        #mbox-cells = <1>;
283*5956d97fSEmmanuel Vadot        ti,mbox-num-users = <4>;
284*5956d97fSEmmanuel Vadot        ti,mbox-num-fifos = <8>;
285*5956d97fSEmmanuel Vadot
286*5956d97fSEmmanuel Vadot        mbox_wkupm3: mbox-wkup-m3 {
287*5956d97fSEmmanuel Vadot            ti,mbox-tx = <0 0 0>;
288*5956d97fSEmmanuel Vadot            ti,mbox-rx = <0 0 3>;
289*5956d97fSEmmanuel Vadot            ti,mbox-send-noirq;
290*5956d97fSEmmanuel Vadot        };
291*5956d97fSEmmanuel Vadot    };
292*5956d97fSEmmanuel Vadot
293*5956d97fSEmmanuel Vadot  - |
294*5956d97fSEmmanuel Vadot    /* AM65x */
295*5956d97fSEmmanuel Vadot    mailbox0_cluster0: mailbox@31f80000 {
296*5956d97fSEmmanuel Vadot        compatible = "ti,am654-mailbox";
297*5956d97fSEmmanuel Vadot        reg = <0x31f80000 0x200>;
298*5956d97fSEmmanuel Vadot        #mbox-cells = <1>;
299*5956d97fSEmmanuel Vadot        ti,mbox-num-users = <4>;
300*5956d97fSEmmanuel Vadot        ti,mbox-num-fifos = <16>;
301*5956d97fSEmmanuel Vadot        interrupt-parent = <&intr_main_navss>;
302*5956d97fSEmmanuel Vadot        interrupts = <436>;
303*5956d97fSEmmanuel Vadot
304*5956d97fSEmmanuel Vadot        mbox_mcu_r5fss0_core0: mbox-mcu-r5fss0-core0 {
305*5956d97fSEmmanuel Vadot            ti,mbox-tx = <1 0 0>;
306*5956d97fSEmmanuel Vadot            ti,mbox-rx = <0 0 0>;
307*5956d97fSEmmanuel Vadot        };
308*5956d97fSEmmanuel Vadot    };
309