1*7d0873ebSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2*7d0873ebSEmmanuel Vadot%YAML 1.2 3*7d0873ebSEmmanuel Vadot--- 4*7d0873ebSEmmanuel Vadot$id: http://devicetree.org/schemas/mailbox/arm,mhuv3.yaml# 5*7d0873ebSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6*7d0873ebSEmmanuel Vadot 7*7d0873ebSEmmanuel Vadottitle: ARM MHUv3 Mailbox Controller 8*7d0873ebSEmmanuel Vadot 9*7d0873ebSEmmanuel Vadotmaintainers: 10*7d0873ebSEmmanuel Vadot - Sudeep Holla <sudeep.holla@arm.com> 11*7d0873ebSEmmanuel Vadot - Cristian Marussi <cristian.marussi@arm.com> 12*7d0873ebSEmmanuel Vadot 13*7d0873ebSEmmanuel Vadotdescription: | 14*7d0873ebSEmmanuel Vadot The Arm Message Handling Unit (MHU) Version 3 is a mailbox controller that 15*7d0873ebSEmmanuel Vadot enables unidirectional communications with remote processors through various 16*7d0873ebSEmmanuel Vadot possible transport protocols. 17*7d0873ebSEmmanuel Vadot The controller can optionally support a varying number of extensions that, in 18*7d0873ebSEmmanuel Vadot turn, enable different kinds of transport to be used for communication. 19*7d0873ebSEmmanuel Vadot Number, type and characteristics of each supported extension can be discovered 20*7d0873ebSEmmanuel Vadot dynamically at runtime. 21*7d0873ebSEmmanuel Vadot 22*7d0873ebSEmmanuel Vadot Given the unidirectional nature of the controller, an MHUv3 mailbox controller 23*7d0873ebSEmmanuel Vadot is composed of a MHU Sender (MHUS) containing a PostBox (PBX) block and a MHU 24*7d0873ebSEmmanuel Vadot Receiver (MHUR) containing a MailBox (MBX) block, where 25*7d0873ebSEmmanuel Vadot 26*7d0873ebSEmmanuel Vadot PBX is used to 27*7d0873ebSEmmanuel Vadot - Configure the MHU 28*7d0873ebSEmmanuel Vadot - Send Transfers to the Receiver 29*7d0873ebSEmmanuel Vadot - Optionally receive acknowledgment of a Transfer from the Receiver 30*7d0873ebSEmmanuel Vadot 31*7d0873ebSEmmanuel Vadot MBX is used to 32*7d0873ebSEmmanuel Vadot - Configure the MHU 33*7d0873ebSEmmanuel Vadot - Receive Transfers from the Sender 34*7d0873ebSEmmanuel Vadot - Optionally acknowledge Transfers sent by the Sender 35*7d0873ebSEmmanuel Vadot 36*7d0873ebSEmmanuel Vadot Both PBX and MBX need to be present and defined in the DT description if you 37*7d0873ebSEmmanuel Vadot need to establish a bidirectional communication, since you will have to 38*7d0873ebSEmmanuel Vadot acquire two distinct unidirectional channels, one for each block. 39*7d0873ebSEmmanuel Vadot 40*7d0873ebSEmmanuel Vadot As a consequence both blocks needs to be represented separately and specified 41*7d0873ebSEmmanuel Vadot as distinct DT nodes in order to properly describe their resources. 42*7d0873ebSEmmanuel Vadot 43*7d0873ebSEmmanuel Vadot Note that, though, thanks to the runtime discoverability, there is no need to 44*7d0873ebSEmmanuel Vadot identify the type of blocks with distinct compatibles. 45*7d0873ebSEmmanuel Vadot 46*7d0873ebSEmmanuel Vadot Following are the MHUv3 possible extensions. 47*7d0873ebSEmmanuel Vadot 48*7d0873ebSEmmanuel Vadot - Doorbell Extension (DBE): DBE defines a type of channel called a Doorbell 49*7d0873ebSEmmanuel Vadot Channel (DBCH). DBCH enables a single bit Transfer to be sent from the 50*7d0873ebSEmmanuel Vadot Sender to Receiver. The Transfer indicates that an event has occurred. 51*7d0873ebSEmmanuel Vadot When DBE is implemented, the number of DBCHs that an implementation of the 52*7d0873ebSEmmanuel Vadot MHU can support is between 1 and 128, numbered starting from 0 in ascending 53*7d0873ebSEmmanuel Vadot order and discoverable at run-time. 54*7d0873ebSEmmanuel Vadot Each DBCH contains 32 individual fields, referred to as flags, each of which 55*7d0873ebSEmmanuel Vadot can be used independently. It is possible for the Sender to send multiple 56*7d0873ebSEmmanuel Vadot Transfers at once using a single DBCH, so long as each Transfer uses 57*7d0873ebSEmmanuel Vadot a different flag in the DBCH. 58*7d0873ebSEmmanuel Vadot Optionally, data may be transmitted through an out-of-band shared memory 59*7d0873ebSEmmanuel Vadot region, wherein the MHU Doorbell is used strictly as an interrupt generation 60*7d0873ebSEmmanuel Vadot mechanism, but this is out of the scope of these bindings. 61*7d0873ebSEmmanuel Vadot 62*7d0873ebSEmmanuel Vadot - FastChannel Extension (FCE): FCE defines a type of channel called a Fast 63*7d0873ebSEmmanuel Vadot Channel (FCH). FCH is intended for lower overhead communication between 64*7d0873ebSEmmanuel Vadot Sender and Receiver at the expense of determinism. An FCH allows the Sender 65*7d0873ebSEmmanuel Vadot to update the channel value at any time, regardless of whether the previous 66*7d0873ebSEmmanuel Vadot value has been seen by the Receiver. When the Receiver reads the channel's 67*7d0873ebSEmmanuel Vadot content it gets the last value written to the channel. 68*7d0873ebSEmmanuel Vadot FCH is considered lossy in nature, and means that the Sender has no way of 69*7d0873ebSEmmanuel Vadot knowing if, or when, the Receiver will act on the Transfer. 70*7d0873ebSEmmanuel Vadot FCHs are expected to behave as RAM which generates interrupts when writes 71*7d0873ebSEmmanuel Vadot occur to the locations within the RAM. 72*7d0873ebSEmmanuel Vadot When FCE is implemented, the number of FCHs that an implementation of the 73*7d0873ebSEmmanuel Vadot MHU can support is between 1-1024, if the FastChannel word-size is 32-bits, 74*7d0873ebSEmmanuel Vadot or between 1-512, when the FastChannel word-size is 64-bits. 75*7d0873ebSEmmanuel Vadot FCHs are numbered from 0 in ascending order. 76*7d0873ebSEmmanuel Vadot Note that the number of FCHs and the word-size are implementation defined, 77*7d0873ebSEmmanuel Vadot not configurable but discoverable at run-time. 78*7d0873ebSEmmanuel Vadot Optionally, data may be transmitted through an out-of-band shared memory 79*7d0873ebSEmmanuel Vadot region, wherein the MHU FastChannel is used as an interrupt generation 80*7d0873ebSEmmanuel Vadot mechanism which carries also a pointer to such out-of-band data, but this 81*7d0873ebSEmmanuel Vadot is out of the scope of these bindings. 82*7d0873ebSEmmanuel Vadot 83*7d0873ebSEmmanuel Vadot - FIFO Extension (FE): FE defines a Channel type called a FIFO Channel (FFCH). 84*7d0873ebSEmmanuel Vadot FFCH allows a Sender to send 85*7d0873ebSEmmanuel Vadot - Multiple Transfers to the Receiver without having to wait for the 86*7d0873ebSEmmanuel Vadot previous Transfer to be acknowledged by the Receiver, as long as the 87*7d0873ebSEmmanuel Vadot FIFO has room for the Transfer. 88*7d0873ebSEmmanuel Vadot - Transfers which require the Receiver to provide acknowledgment. 89*7d0873ebSEmmanuel Vadot - Transfers which have in-band payload. 90*7d0873ebSEmmanuel Vadot In all cases, the data is guaranteed to be observed by the Receiver in the 91*7d0873ebSEmmanuel Vadot same order which the Sender sent it. 92*7d0873ebSEmmanuel Vadot When FE is implemented, the number of FFCHs that an implementation of the 93*7d0873ebSEmmanuel Vadot MHU can support is between 1 and 64, numbered starting from 0 in ascending 94*7d0873ebSEmmanuel Vadot order. The number of FFCHs, their depth (same for all implemented FFCHs) and 95*7d0873ebSEmmanuel Vadot the access-granularity are implementation defined, not configurable but 96*7d0873ebSEmmanuel Vadot discoverable at run-time. 97*7d0873ebSEmmanuel Vadot Optionally, additional data may be transmitted through an out-of-band shared 98*7d0873ebSEmmanuel Vadot memory region, wherein the MHU FIFO is used to transmit, in order, a small 99*7d0873ebSEmmanuel Vadot part of the payload (like a header) and a reference to the shared memory 100*7d0873ebSEmmanuel Vadot area holding the remaining, bigger, chunk of the payload, but this is out of 101*7d0873ebSEmmanuel Vadot the scope of these bindings. 102*7d0873ebSEmmanuel Vadot 103*7d0873ebSEmmanuel Vadotproperties: 104*7d0873ebSEmmanuel Vadot compatible: 105*7d0873ebSEmmanuel Vadot const: arm,mhuv3 106*7d0873ebSEmmanuel Vadot 107*7d0873ebSEmmanuel Vadot reg: 108*7d0873ebSEmmanuel Vadot maxItems: 1 109*7d0873ebSEmmanuel Vadot 110*7d0873ebSEmmanuel Vadot interrupts: 111*7d0873ebSEmmanuel Vadot minItems: 1 112*7d0873ebSEmmanuel Vadot maxItems: 74 113*7d0873ebSEmmanuel Vadot 114*7d0873ebSEmmanuel Vadot interrupt-names: 115*7d0873ebSEmmanuel Vadot description: | 116*7d0873ebSEmmanuel Vadot The MHUv3 controller generates a number of events some of which are used 117*7d0873ebSEmmanuel Vadot to generate interrupts; as a consequence it can expose a varying number of 118*7d0873ebSEmmanuel Vadot optional PBX/MBX interrupts, representing the events generated during the 119*7d0873ebSEmmanuel Vadot operation of the various transport protocols associated with different 120*7d0873ebSEmmanuel Vadot extensions. All interrupts of the MHU are level-sensitive. 121*7d0873ebSEmmanuel Vadot Some of these optional interrupts are defined per-channel, where the 122*7d0873ebSEmmanuel Vadot number of channels effectively available is implementation defined and 123*7d0873ebSEmmanuel Vadot run-time discoverable. 124*7d0873ebSEmmanuel Vadot In the following names are enumerated using patterns, with per-channel 125*7d0873ebSEmmanuel Vadot interrupts implicitly capped at the maximum channels allowed by the 126*7d0873ebSEmmanuel Vadot specification for each extension type. 127*7d0873ebSEmmanuel Vadot For the sake of simplicity maxItems is anyway capped to a most plausible 128*7d0873ebSEmmanuel Vadot number, assuming way less channels would be implemented than actually 129*7d0873ebSEmmanuel Vadot possible. 130*7d0873ebSEmmanuel Vadot 131*7d0873ebSEmmanuel Vadot The only mandatory interrupts on the MHU are: 132*7d0873ebSEmmanuel Vadot - combined 133*7d0873ebSEmmanuel Vadot - mbx-fch-xfer-<N> but only if mbx-fcgrp-xfer-<N> is not implemented. 134*7d0873ebSEmmanuel Vadot 135*7d0873ebSEmmanuel Vadot minItems: 1 136*7d0873ebSEmmanuel Vadot maxItems: 74 137*7d0873ebSEmmanuel Vadot items: 138*7d0873ebSEmmanuel Vadot oneOf: 139*7d0873ebSEmmanuel Vadot - const: combined 140*7d0873ebSEmmanuel Vadot description: PBX/MBX Combined interrupt 141*7d0873ebSEmmanuel Vadot - const: combined-ffch 142*7d0873ebSEmmanuel Vadot description: PBX/MBX FIFO Combined interrupt 143*7d0873ebSEmmanuel Vadot - pattern: '^ffch-low-tide-[0-9]+$' 144*7d0873ebSEmmanuel Vadot description: PBX/MBX FIFO Channel <N> Low Tide interrupt 145*7d0873ebSEmmanuel Vadot - pattern: '^ffch-high-tide-[0-9]+$' 146*7d0873ebSEmmanuel Vadot description: PBX/MBX FIFO Channel <N> High Tide interrupt 147*7d0873ebSEmmanuel Vadot - pattern: '^ffch-flush-[0-9]+$' 148*7d0873ebSEmmanuel Vadot description: PBX/MBX FIFO Channel <N> Flush interrupt 149*7d0873ebSEmmanuel Vadot - pattern: '^mbx-dbch-xfer-[0-9]+$' 150*7d0873ebSEmmanuel Vadot description: MBX Doorbell Channel <N> Transfer interrupt 151*7d0873ebSEmmanuel Vadot - pattern: '^mbx-fch-xfer-[0-9]+$' 152*7d0873ebSEmmanuel Vadot description: MBX FastChannel <N> Transfer interrupt 153*7d0873ebSEmmanuel Vadot - pattern: '^mbx-fchgrp-xfer-[0-9]+$' 154*7d0873ebSEmmanuel Vadot description: MBX FastChannel <N> Group Transfer interrupt 155*7d0873ebSEmmanuel Vadot - pattern: '^mbx-ffch-xfer-[0-9]+$' 156*7d0873ebSEmmanuel Vadot description: MBX FIFO Channel <N> Transfer interrupt 157*7d0873ebSEmmanuel Vadot - pattern: '^pbx-dbch-xfer-ack-[0-9]+$' 158*7d0873ebSEmmanuel Vadot description: PBX Doorbell Channel <N> Transfer Ack interrupt 159*7d0873ebSEmmanuel Vadot - pattern: '^pbx-ffch-xfer-ack-[0-9]+$' 160*7d0873ebSEmmanuel Vadot description: PBX FIFO Channel <N> Transfer Ack interrupt 161*7d0873ebSEmmanuel Vadot 162*7d0873ebSEmmanuel Vadot '#mbox-cells': 163*7d0873ebSEmmanuel Vadot description: | 164*7d0873ebSEmmanuel Vadot The first argument in the consumers 'mboxes' property represents the 165*7d0873ebSEmmanuel Vadot extension type, the second is for the channel number while the third 166*7d0873ebSEmmanuel Vadot depends on extension type. 167*7d0873ebSEmmanuel Vadot 168*7d0873ebSEmmanuel Vadot Extension types constants are defined in <dt-bindings/arm/mhuv3-dt.h>. 169*7d0873ebSEmmanuel Vadot 170*7d0873ebSEmmanuel Vadot Extension type for DBE is DBE_EXT and the third parameter represents the 171*7d0873ebSEmmanuel Vadot doorbell flag number to use. 172*7d0873ebSEmmanuel Vadot Extension type for FCE is FCE_EXT, third parameter unused. 173*7d0873ebSEmmanuel Vadot Extension type for FE is FE_EXT, third parameter unused. 174*7d0873ebSEmmanuel Vadot 175*7d0873ebSEmmanuel Vadot mboxes = <&mhu DBE_EXT 0 5>; // DBE, Doorbell Channel Window 0, doorbell 5. 176*7d0873ebSEmmanuel Vadot mboxes = <&mhu DBE_EXT 7>; // DBE, Doorbell Channel Window 1, doorbell 7. 177*7d0873ebSEmmanuel Vadot mboxes = <&mhu FCE_EXT 0 0>; // FCE, FastChannel Window 0. 178*7d0873ebSEmmanuel Vadot mboxes = <&mhu FCE_EXT 3 0>; // FCE, FastChannel Window 3. 179*7d0873ebSEmmanuel Vadot mboxes = <&mhu FE_EXT 1 0>; // FE, FIFO Channel Window 1. 180*7d0873ebSEmmanuel Vadot mboxes = <&mhu FE_EXT 7 0>; // FE, FIFO Channel Window 7. 181*7d0873ebSEmmanuel Vadot const: 3 182*7d0873ebSEmmanuel Vadot 183*7d0873ebSEmmanuel Vadot clocks: 184*7d0873ebSEmmanuel Vadot maxItems: 1 185*7d0873ebSEmmanuel Vadot 186*7d0873ebSEmmanuel Vadotrequired: 187*7d0873ebSEmmanuel Vadot - compatible 188*7d0873ebSEmmanuel Vadot - reg 189*7d0873ebSEmmanuel Vadot - interrupts 190*7d0873ebSEmmanuel Vadot - interrupt-names 191*7d0873ebSEmmanuel Vadot - '#mbox-cells' 192*7d0873ebSEmmanuel Vadot 193*7d0873ebSEmmanuel VadotadditionalProperties: false 194*7d0873ebSEmmanuel Vadot 195*7d0873ebSEmmanuel Vadotexamples: 196*7d0873ebSEmmanuel Vadot - | 197*7d0873ebSEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 198*7d0873ebSEmmanuel Vadot 199*7d0873ebSEmmanuel Vadot soc { 200*7d0873ebSEmmanuel Vadot #address-cells = <2>; 201*7d0873ebSEmmanuel Vadot #size-cells = <2>; 202*7d0873ebSEmmanuel Vadot 203*7d0873ebSEmmanuel Vadot mailbox@2aaa0000 { 204*7d0873ebSEmmanuel Vadot compatible = "arm,mhuv3"; 205*7d0873ebSEmmanuel Vadot #mbox-cells = <3>; 206*7d0873ebSEmmanuel Vadot reg = <0 0x2aaa0000 0 0x10000>; 207*7d0873ebSEmmanuel Vadot clocks = <&clock 0>; 208*7d0873ebSEmmanuel Vadot interrupt-names = "combined", "pbx-dbch-xfer-ack-1", 209*7d0873ebSEmmanuel Vadot "ffch-high-tide-0"; 210*7d0873ebSEmmanuel Vadot interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>, 211*7d0873ebSEmmanuel Vadot <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; 212*7d0873ebSEmmanuel Vadot }; 213*7d0873ebSEmmanuel Vadot 214*7d0873ebSEmmanuel Vadot mailbox@2ab00000 { 215*7d0873ebSEmmanuel Vadot compatible = "arm,mhuv3"; 216*7d0873ebSEmmanuel Vadot #mbox-cells = <3>; 217*7d0873ebSEmmanuel Vadot reg = <0 0x2aab0000 0 0x10000>; 218*7d0873ebSEmmanuel Vadot clocks = <&clock 0>; 219*7d0873ebSEmmanuel Vadot interrupt-names = "combined", "mbx-dbch-xfer-1", "ffch-low-tide-0"; 220*7d0873ebSEmmanuel Vadot interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>, 221*7d0873ebSEmmanuel Vadot <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>, 222*7d0873ebSEmmanuel Vadot <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>; 223*7d0873ebSEmmanuel Vadot }; 224*7d0873ebSEmmanuel Vadot }; 225