xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/mailbox/omap-mailbox.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunOMAP2+ and K3 Mailbox
2*4882a593Smuzhiyun=====================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunThe OMAP mailbox hardware facilitates communication between different processors
5*4882a593Smuzhiyunusing a queued mailbox interrupt mechanism. The IP block is external to the
6*4882a593Smuzhiyunvarious processor subsystems and is connected on an interconnect bus. The
7*4882a593Smuzhiyuncommunication is achieved through a set of registers for message storage and
8*4882a593Smuzhiyuninterrupt configuration registers.
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunEach mailbox IP block/cluster has a certain number of h/w fifo queues and output
11*4882a593Smuzhiyuninterrupt lines. An output interrupt line is routed to an interrupt controller
12*4882a593Smuzhiyunwithin a processor subsystem, and there can be more than one line going to a
13*4882a593Smuzhiyunspecific processor's interrupt controller. The interrupt line connections are
14*4882a593Smuzhiyunfixed for an instance and are dictated by the IP integration into the SoC
15*4882a593Smuzhiyun(excluding the SoCs that have a Interrupt Crossbar IP). Each interrupt line is
16*4882a593Smuzhiyunprogrammable through a set of interrupt configuration registers, and have a rx
17*4882a593Smuzhiyunand tx interrupt source per h/w fifo. Communication between different processors
18*4882a593Smuzhiyunis achieved through the appropriate programming of the rx and tx interrupt
19*4882a593Smuzhiyunsources on the appropriate interrupt lines.
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunThe number of h/w fifo queues and interrupt lines dictate the usable registers.
22*4882a593SmuzhiyunAll the current OMAP SoCs except for the newest DRA7xx SoC has a single IP
23*4882a593Smuzhiyuninstance. DRA7xx has multiple instances with different number of h/w fifo queues
24*4882a593Smuzhiyunand interrupt lines between different instances. The interrupt lines can also be
25*4882a593Smuzhiyunrouted to different processor sub-systems on DRA7xx as they are routed through
26*4882a593Smuzhiyunthe Crossbar, a kind of interrupt router/multiplexer. The K3 AM65x and J721E
27*4882a593SmuzhiyunSoCs has each of these instances form a cluster and combine multiple clusters
28*4882a593Smuzhiyuninto a single IP block present within the Main NavSS. The interrupt lines from
29*4882a593Smuzhiyunall these clusters are multiplexed and routed to different processor subsystems
30*4882a593Smuzhiyunover a limited number of common interrupt output lines of an Interrupt Router.
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunMailbox Device Node:
33*4882a593Smuzhiyun====================
34*4882a593SmuzhiyunA Mailbox device node is used to represent a Mailbox IP instance/cluster within
35*4882a593Smuzhiyuna SoC. The sub-mailboxes are represented as child nodes of this parent node.
36*4882a593Smuzhiyun
37*4882a593SmuzhiyunRequired properties:
38*4882a593Smuzhiyun--------------------
39*4882a593Smuzhiyun- compatible:		Should be one of the following,
40*4882a593Smuzhiyun			    "ti,omap2-mailbox" for OMAP2420, OMAP2430 SoCs
41*4882a593Smuzhiyun			    "ti,omap3-mailbox" for OMAP3430, OMAP3630 SoCs
42*4882a593Smuzhiyun			    "ti,omap4-mailbox" for OMAP44xx, OMAP54xx, AM33xx,
43*4882a593Smuzhiyun						   AM43xx and DRA7xx SoCs
44*4882a593Smuzhiyun			    "ti,am654-mailbox" for K3 AM65x and J721E SoCs
45*4882a593Smuzhiyun- reg:			Contains the mailbox register address range (base
46*4882a593Smuzhiyun			address and length)
47*4882a593Smuzhiyun- interrupts:		Contains the interrupt information for the mailbox
48*4882a593Smuzhiyun			device. The format is dependent on which interrupt
49*4882a593Smuzhiyun			controller the Mailbox device uses
50*4882a593Smuzhiyun- #mbox-cells:		Common mailbox binding property to identify the number
51*4882a593Smuzhiyun			of cells required for the mailbox specifier. Should be
52*4882a593Smuzhiyun			1
53*4882a593Smuzhiyun- ti,mbox-num-users:	Number of targets (processor devices) that the mailbox
54*4882a593Smuzhiyun			device can interrupt
55*4882a593Smuzhiyun- ti,mbox-num-fifos:	Number of h/w fifo queues within the mailbox IP block
56*4882a593Smuzhiyun
57*4882a593SmuzhiyunSoC-specific Required properties:
58*4882a593Smuzhiyun---------------------------------
59*4882a593SmuzhiyunThe following are mandatory properties for the OMAP architecture based SoCs
60*4882a593Smuzhiyunonly:
61*4882a593Smuzhiyun- ti,hwmods:		Name of the hwmod associated with the mailbox. This
62*4882a593Smuzhiyun			should be defined in the mailbox node only if the node
63*4882a593Smuzhiyun			is not defined as a child node of a corresponding sysc
64*4882a593Smuzhiyun			interconnect node.
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunThe following are mandatory properties for the K3 AM65x and J721E SoCs only:
67*4882a593Smuzhiyun- interrupt-parent:	Should contain a phandle to the TI-SCI interrupt
68*4882a593Smuzhiyun			controller node that is used to dynamically program
69*4882a593Smuzhiyun			the interrupt routes between the IP and the main GIC
70*4882a593Smuzhiyun			controllers. See the following binding for additional
71*4882a593Smuzhiyun			details,
72*4882a593Smuzhiyun			Documentation/devicetree/bindings/interrupt-controller/ti,sci-intr.yaml
73*4882a593Smuzhiyun
74*4882a593SmuzhiyunChild Nodes:
75*4882a593Smuzhiyun============
76*4882a593SmuzhiyunA child node is used for representing the actual sub-mailbox device that is
77*4882a593Smuzhiyunused for the communication between the host processor and a remote processor.
78*4882a593SmuzhiyunEach child node should have a unique node name across all the different
79*4882a593Smuzhiyunmailbox device nodes.
80*4882a593Smuzhiyun
81*4882a593SmuzhiyunRequired properties:
82*4882a593Smuzhiyun--------------------
83*4882a593Smuzhiyun- ti,mbox-tx:		sub-mailbox descriptor property defining a Tx fifo
84*4882a593Smuzhiyun- ti,mbox-rx:		sub-mailbox descriptor property defining a Rx fifo
85*4882a593Smuzhiyun
86*4882a593SmuzhiyunSub-mailbox Descriptor Data
87*4882a593Smuzhiyun---------------------------
88*4882a593SmuzhiyunEach of the above ti,mbox-tx and ti,mbox-rx properties should have 3 cells of
89*4882a593Smuzhiyundata that represent the following:
90*4882a593Smuzhiyun    Cell #1 (fifo_id) - mailbox fifo id used either for transmitting
91*4882a593Smuzhiyun                        (ti,mbox-tx) or for receiving (ti,mbox-rx)
92*4882a593Smuzhiyun    Cell #2 (irq_id)  - irq identifier index number to use from the parent's
93*4882a593Smuzhiyun                        interrupts data. Should be 0 for most of the cases, a
94*4882a593Smuzhiyun                        positive index value is seen only on mailboxes that have
95*4882a593Smuzhiyun                        multiple interrupt lines connected to the MPU processor.
96*4882a593Smuzhiyun    Cell #3 (usr_id)  - mailbox user id for identifying the interrupt line
97*4882a593Smuzhiyun                        associated with generating a tx/rx fifo interrupt.
98*4882a593Smuzhiyun
99*4882a593SmuzhiyunOptional Properties:
100*4882a593Smuzhiyun--------------------
101*4882a593Smuzhiyun- ti,mbox-send-noirq:   Quirk flag to allow the client user of this sub-mailbox
102*4882a593Smuzhiyun                        to send messages without triggering a Tx ready interrupt,
103*4882a593Smuzhiyun                        and to control the Tx ticker. Should be used only on
104*4882a593Smuzhiyun                        sub-mailboxes used to communicate with WkupM3 remote
105*4882a593Smuzhiyun                        processor on AM33xx/AM43xx SoCs.
106*4882a593Smuzhiyun
107*4882a593SmuzhiyunMailbox Users:
108*4882a593Smuzhiyun==============
109*4882a593SmuzhiyunA device needing to communicate with a target processor device should specify
110*4882a593Smuzhiyunthem using the common mailbox binding properties, "mboxes" and the optional
111*4882a593Smuzhiyun"mbox-names" (please see Documentation/devicetree/bindings/mailbox/mailbox.txt
112*4882a593Smuzhiyunfor details). Each value of the mboxes property should contain a phandle to the
113*4882a593Smuzhiyunmailbox controller device node and an args specifier that will be the phandle to
114*4882a593Smuzhiyunthe intended sub-mailbox child node to be used for communication. The equivalent
115*4882a593Smuzhiyun"mbox-names" property value can be used to give a name to the communication channel
116*4882a593Smuzhiyunto be used by the client user.
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun
119*4882a593SmuzhiyunExample:
120*4882a593Smuzhiyun--------
121*4882a593Smuzhiyun
122*4882a593Smuzhiyun1. /* OMAP4 */
123*4882a593Smuzhiyunmailbox: mailbox@4a0f4000 {
124*4882a593Smuzhiyun	compatible = "ti,omap4-mailbox";
125*4882a593Smuzhiyun	reg = <0x4a0f4000 0x200>;
126*4882a593Smuzhiyun	interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
127*4882a593Smuzhiyun	ti,hwmods = "mailbox";
128*4882a593Smuzhiyun	#mbox-cells = <1>;
129*4882a593Smuzhiyun	ti,mbox-num-users = <3>;
130*4882a593Smuzhiyun	ti,mbox-num-fifos = <8>;
131*4882a593Smuzhiyun	mbox_ipu: mbox_ipu {
132*4882a593Smuzhiyun		ti,mbox-tx = <0 0 0>;
133*4882a593Smuzhiyun		ti,mbox-rx = <1 0 0>;
134*4882a593Smuzhiyun	};
135*4882a593Smuzhiyun	mbox_dsp: mbox_dsp {
136*4882a593Smuzhiyun		ti,mbox-tx = <3 0 0>;
137*4882a593Smuzhiyun		ti,mbox-rx = <2 0 0>;
138*4882a593Smuzhiyun	};
139*4882a593Smuzhiyun};
140*4882a593Smuzhiyun
141*4882a593Smuzhiyundsp {
142*4882a593Smuzhiyun	...
143*4882a593Smuzhiyun	mboxes = <&mailbox &mbox_dsp>;
144*4882a593Smuzhiyun	...
145*4882a593Smuzhiyun};
146*4882a593Smuzhiyun
147*4882a593Smuzhiyun2. /* AM33xx */
148*4882a593Smuzhiyunmailbox: mailbox@480c8000 {
149*4882a593Smuzhiyun	compatible = "ti,omap4-mailbox";
150*4882a593Smuzhiyun	reg = <0x480C8000 0x200>;
151*4882a593Smuzhiyun	interrupts = <77>;
152*4882a593Smuzhiyun	ti,hwmods = "mailbox";
153*4882a593Smuzhiyun	#mbox-cells = <1>;
154*4882a593Smuzhiyun	ti,mbox-num-users = <4>;
155*4882a593Smuzhiyun	ti,mbox-num-fifos = <8>;
156*4882a593Smuzhiyun	mbox_wkupm3: wkup_m3 {
157*4882a593Smuzhiyun		ti,mbox-tx = <0 0 0>;
158*4882a593Smuzhiyun		ti,mbox-rx = <0 0 3>;
159*4882a593Smuzhiyun	};
160*4882a593Smuzhiyun};
161*4882a593Smuzhiyun
162*4882a593Smuzhiyun3. /* AM65x */
163*4882a593Smuzhiyun&cbass_main {
164*4882a593Smuzhiyun	cbass_main_navss: interconnect0 {
165*4882a593Smuzhiyun		mailbox0_cluster0: mailbox@31f80000 {
166*4882a593Smuzhiyun			compatible = "ti,am654-mailbox";
167*4882a593Smuzhiyun			reg = <0x00 0x31f80000 0x00 0x200>;
168*4882a593Smuzhiyun			#mbox-cells = <1>;
169*4882a593Smuzhiyun			ti,mbox-num-users = <4>;
170*4882a593Smuzhiyun			ti,mbox-num-fifos = <16>;
171*4882a593Smuzhiyun			interrupt-parent = <&intr_main_navss>;
172*4882a593Smuzhiyun			interrupts = <164 0>;
173*4882a593Smuzhiyun
174*4882a593Smuzhiyun			mbox_mcu_r5fss0_core0: mbox-mcu-r5fss0-core0 {
175*4882a593Smuzhiyun				ti,mbox-tx = <1 0 0>;
176*4882a593Smuzhiyun				ti,mbox-rx = <0 0 0>;
177*4882a593Smuzhiyun			};
178*4882a593Smuzhiyun		};
179*4882a593Smuzhiyun	};
180*4882a593Smuzhiyun};
181