15def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 25def4c47SEmmanuel Vadot%YAML 1.2 35def4c47SEmmanuel Vadot--- 45def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/mailbox/arm,mhuv2.yaml# 55def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 65def4c47SEmmanuel Vadot 75def4c47SEmmanuel Vadottitle: ARM MHUv2 Mailbox Controller 85def4c47SEmmanuel Vadot 95def4c47SEmmanuel Vadotmaintainers: 105def4c47SEmmanuel Vadot - Tushar Khandelwal <tushar.khandelwal@arm.com> 115def4c47SEmmanuel Vadot - Viresh Kumar <viresh.kumar@linaro.org> 125def4c47SEmmanuel Vadot 135def4c47SEmmanuel Vadotdescription: | 145def4c47SEmmanuel Vadot The Arm Message Handling Unit (MHU) Version 2 is a mailbox controller that has 155def4c47SEmmanuel Vadot between 1 and 124 channel windows (each 32-bit wide) to provide unidirectional 165def4c47SEmmanuel Vadot communication with remote processor(s), where the number of channel windows 175def4c47SEmmanuel Vadot are implementation dependent. 185def4c47SEmmanuel Vadot 195def4c47SEmmanuel Vadot Given the unidirectional nature of the controller, an MHUv2 mailbox may only 205def4c47SEmmanuel Vadot be written to or read from. If a pair of MHU controllers is implemented 215def4c47SEmmanuel Vadot between two processing elements to provide bidirectional communication, these 225def4c47SEmmanuel Vadot must be specified as two separate mailboxes. 235def4c47SEmmanuel Vadot 245def4c47SEmmanuel Vadot If the interrupts property is present in device tree node, then its treated as 255def4c47SEmmanuel Vadot a "receiver" mailbox, otherwise a "sender". 265def4c47SEmmanuel Vadot 275def4c47SEmmanuel Vadot An MHU controller must be specified along with the supported transport 285def4c47SEmmanuel Vadot protocols. The transport protocols determine the method of data transmission 295def4c47SEmmanuel Vadot as well as the number of provided mailbox channels. 305def4c47SEmmanuel Vadot 315def4c47SEmmanuel Vadot Following are the possible transport protocols. 325def4c47SEmmanuel Vadot 335def4c47SEmmanuel Vadot - Data-transfer: Each transfer is made of one or more words, using one or more 345def4c47SEmmanuel Vadot channel windows. 355def4c47SEmmanuel Vadot 365def4c47SEmmanuel Vadot - Doorbell: Each transfer is made up of single bit flag, using any one of the 375def4c47SEmmanuel Vadot bits in a channel window. A channel window can support up to 32 doorbells 385def4c47SEmmanuel Vadot and the entire window shall be used in doorbell protocol. Optionally, data 395def4c47SEmmanuel Vadot may be transmitted through a shared memory region, wherein the MHU is used 405def4c47SEmmanuel Vadot strictly as an interrupt generation mechanism but that is out of the scope 415def4c47SEmmanuel Vadot of these bindings. 425def4c47SEmmanuel Vadot 435def4c47SEmmanuel Vadot# We need a select here so we don't match all nodes with 'arm,primecell' 445def4c47SEmmanuel Vadotselect: 455def4c47SEmmanuel Vadot properties: 465def4c47SEmmanuel Vadot compatible: 475def4c47SEmmanuel Vadot contains: 485def4c47SEmmanuel Vadot enum: 495def4c47SEmmanuel Vadot - arm,mhuv2-tx 505def4c47SEmmanuel Vadot - arm,mhuv2-rx 515def4c47SEmmanuel Vadot required: 525def4c47SEmmanuel Vadot - compatible 535def4c47SEmmanuel Vadot 545def4c47SEmmanuel Vadotproperties: 555def4c47SEmmanuel Vadot compatible: 565def4c47SEmmanuel Vadot oneOf: 575def4c47SEmmanuel Vadot - description: Sender mode 585def4c47SEmmanuel Vadot items: 595def4c47SEmmanuel Vadot - const: arm,mhuv2-tx 605def4c47SEmmanuel Vadot - const: arm,primecell 615def4c47SEmmanuel Vadot 625def4c47SEmmanuel Vadot - description: Receiver-mode 635def4c47SEmmanuel Vadot items: 645def4c47SEmmanuel Vadot - const: arm,mhuv2-rx 655def4c47SEmmanuel Vadot - const: arm,primecell 665def4c47SEmmanuel Vadot 675def4c47SEmmanuel Vadot reg: 685def4c47SEmmanuel Vadot maxItems: 1 695def4c47SEmmanuel Vadot 705def4c47SEmmanuel Vadot interrupts: 715def4c47SEmmanuel Vadot description: | 725def4c47SEmmanuel Vadot The MHUv2 controller always implements an interrupt in the "receiver" 735def4c47SEmmanuel Vadot mode, while the interrupt in the "sender" mode was not available in the 745def4c47SEmmanuel Vadot version MHUv2.0, but the later versions do have it. 755def4c47SEmmanuel Vadot maxItems: 1 765def4c47SEmmanuel Vadot 775def4c47SEmmanuel Vadot clocks: 785def4c47SEmmanuel Vadot maxItems: 1 795def4c47SEmmanuel Vadot 805def4c47SEmmanuel Vadot clock-names: 815def4c47SEmmanuel Vadot maxItems: 1 825def4c47SEmmanuel Vadot 835def4c47SEmmanuel Vadot arm,mhuv2-protocols: 845def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32-matrix 855def4c47SEmmanuel Vadot description: | 865def4c47SEmmanuel Vadot The MHUv2 controller may contain up to 124 channel windows (each 32-bit 875def4c47SEmmanuel Vadot wide). The hardware and the DT bindings allows any combination of those to 885def4c47SEmmanuel Vadot be used for various transport protocols. 895def4c47SEmmanuel Vadot 905def4c47SEmmanuel Vadot This property allows a platform to describe how these channel windows are 915def4c47SEmmanuel Vadot used in various transport protocols. The entries in this property shall be 925def4c47SEmmanuel Vadot present as an array of tuples, where each tuple describes details about 935def4c47SEmmanuel Vadot one of the transport protocol being implemented over some channel 945def4c47SEmmanuel Vadot window(s). 955def4c47SEmmanuel Vadot 965def4c47SEmmanuel Vadot The first field of a tuple signifies the transfer protocol, 0 is reserved 975def4c47SEmmanuel Vadot for doorbell protocol, and 1 is reserved for data-transfer protocol. 985def4c47SEmmanuel Vadot Using any other value in the first field of a tuple makes it invalid. 995def4c47SEmmanuel Vadot 1005def4c47SEmmanuel Vadot The second field of a tuple signifies the number of channel windows where 1015def4c47SEmmanuel Vadot the protocol would be used and should be set to a non zero value. For 1025def4c47SEmmanuel Vadot doorbell protocol this field signifies the number of 32-bit channel 1035def4c47SEmmanuel Vadot windows that implement the doorbell protocol. For data-transfer protocol, 1045def4c47SEmmanuel Vadot this field signifies the number of 32-bit channel windows that implement 1055def4c47SEmmanuel Vadot the data-transfer protocol. 1065def4c47SEmmanuel Vadot 1075def4c47SEmmanuel Vadot The total number of channel windows specified here shouldn't be more than 1085def4c47SEmmanuel Vadot the ones implemented by the platform, though one can specify lesser number 1095def4c47SEmmanuel Vadot of windows here than what the platform implements. 1105def4c47SEmmanuel Vadot 1115def4c47SEmmanuel Vadot mhu: mailbox@2b1f0000 { 1125def4c47SEmmanuel Vadot ... 1135def4c47SEmmanuel Vadot 1145def4c47SEmmanuel Vadot arm,mhuv2-protocols = <0 2>, <1 1>, <1 5>, <1 7>; 1155def4c47SEmmanuel Vadot } 1165def4c47SEmmanuel Vadot 1175def4c47SEmmanuel Vadot The above example defines the protocols of an ARM MHUv2 mailbox 1185def4c47SEmmanuel Vadot controller, where a total of 15 channel windows are used. The first two 1195def4c47SEmmanuel Vadot windows are used in doorbell protocol (64 doorbells), followed by 1, 5 and 1205def4c47SEmmanuel Vadot 7 windows (separately) used in data-transfer protocol. 1215def4c47SEmmanuel Vadot 1225def4c47SEmmanuel Vadot minItems: 1 1235def4c47SEmmanuel Vadot maxItems: 124 1245def4c47SEmmanuel Vadot items: 1255def4c47SEmmanuel Vadot items: 1265def4c47SEmmanuel Vadot - enum: [ 0, 1 ] 1275def4c47SEmmanuel Vadot - minimum: 0 1285def4c47SEmmanuel Vadot maximum: 124 1295def4c47SEmmanuel Vadot 1305def4c47SEmmanuel Vadot 1315def4c47SEmmanuel Vadot '#mbox-cells': 1325def4c47SEmmanuel Vadot description: | 1335def4c47SEmmanuel Vadot It is always set to 2. The first argument in the consumers 'mboxes' 1345def4c47SEmmanuel Vadot property represents the channel window group, which may be used in 1355def4c47SEmmanuel Vadot doorbell, or data-transfer protocol, and the second argument (only 1365def4c47SEmmanuel Vadot relevant in doorbell protocol, should be 0 otherwise) represents the 1375def4c47SEmmanuel Vadot doorbell number within the 32 bit wide channel window. 1385def4c47SEmmanuel Vadot 1395def4c47SEmmanuel Vadot From the example given above for arm,mhuv2-protocols, here is how a client 1405def4c47SEmmanuel Vadot node can reference them. 1415def4c47SEmmanuel Vadot 1425def4c47SEmmanuel Vadot mboxes = <&mhu 0 5>; // Channel Window Group 0, doorbell 5. 1435def4c47SEmmanuel Vadot mboxes = <&mhu 1 7>; // Channel Window Group 1, doorbell 7. 1445def4c47SEmmanuel Vadot mboxes = <&mhu 2 0>; // Channel Window Group 2, data transfer protocol with 1 window. 1455def4c47SEmmanuel Vadot mboxes = <&mhu 3 0>; // Channel Window Group 3, data transfer protocol with 5 windows. 1465def4c47SEmmanuel Vadot mboxes = <&mhu 4 0>; // Channel Window Group 4, data transfer protocol with 7 windows. 1475def4c47SEmmanuel Vadot 1485def4c47SEmmanuel Vadot const: 2 1495def4c47SEmmanuel Vadot 1505def4c47SEmmanuel Vadotif: 1515def4c47SEmmanuel Vadot # Interrupt is compulsory for receiver 1525def4c47SEmmanuel Vadot properties: 1535def4c47SEmmanuel Vadot compatible: 1545def4c47SEmmanuel Vadot contains: 1555def4c47SEmmanuel Vadot const: arm,mhuv2-rx 1565def4c47SEmmanuel Vadotthen: 1575def4c47SEmmanuel Vadot required: 1585def4c47SEmmanuel Vadot - interrupts 1595def4c47SEmmanuel Vadot 1605def4c47SEmmanuel Vadotrequired: 1615def4c47SEmmanuel Vadot - compatible 1625def4c47SEmmanuel Vadot - reg 1635def4c47SEmmanuel Vadot - '#mbox-cells' 1645def4c47SEmmanuel Vadot - arm,mhuv2-protocols 1655def4c47SEmmanuel Vadot 1665def4c47SEmmanuel VadotadditionalProperties: false 1675def4c47SEmmanuel Vadot 1685def4c47SEmmanuel Vadotexamples: 1695def4c47SEmmanuel Vadot # Multiple transport protocols implemented by the mailbox controllers 1705def4c47SEmmanuel Vadot - | 1715def4c47SEmmanuel Vadot soc { 1725def4c47SEmmanuel Vadot #address-cells = <2>; 1735def4c47SEmmanuel Vadot #size-cells = <2>; 1745def4c47SEmmanuel Vadot 1755def4c47SEmmanuel Vadot mhu_tx: mailbox@2b1f0000 { 1765def4c47SEmmanuel Vadot #mbox-cells = <2>; 1775def4c47SEmmanuel Vadot compatible = "arm,mhuv2-tx", "arm,primecell"; 1785def4c47SEmmanuel Vadot reg = <0 0x2b1f0000 0 0x1000>; 1795def4c47SEmmanuel Vadot clocks = <&clock 0>; 1805def4c47SEmmanuel Vadot clock-names = "apb_pclk"; 1815def4c47SEmmanuel Vadot interrupts = <0 45 4>; 1825def4c47SEmmanuel Vadot arm,mhuv2-protocols = <1 5>, <1 2>, <1 5>, <1 7>, <0 2>; 1835def4c47SEmmanuel Vadot }; 1845def4c47SEmmanuel Vadot 1855def4c47SEmmanuel Vadot mhu_rx: mailbox@2b1f1000 { 1865def4c47SEmmanuel Vadot #mbox-cells = <2>; 1875def4c47SEmmanuel Vadot compatible = "arm,mhuv2-rx", "arm,primecell"; 1885def4c47SEmmanuel Vadot reg = <0 0x2b1f1000 0 0x1000>; 1895def4c47SEmmanuel Vadot clocks = <&clock 0>; 1905def4c47SEmmanuel Vadot clock-names = "apb_pclk"; 1915def4c47SEmmanuel Vadot interrupts = <0 46 4>; 1925def4c47SEmmanuel Vadot arm,mhuv2-protocols = <1 1>, <1 7>, <0 2>; 1935def4c47SEmmanuel Vadot }; 1945def4c47SEmmanuel Vadot 195*5956d97fSEmmanuel Vadot mhu_client: dsp@596e8000 { 196*5956d97fSEmmanuel Vadot compatible = "fsl,imx8qxp-dsp"; 197*5956d97fSEmmanuel Vadot reg = <0 0x596e8000 0 0x88000>; 198*5956d97fSEmmanuel Vadot clocks = <&adma_lpcg 0>, <&adma_lpcg 1>, <&adma_lpcg 2>; 199*5956d97fSEmmanuel Vadot clock-names = "ipg", "ocram", "core"; 200*5956d97fSEmmanuel Vadot power-domains = <&pd 0>, <&pd 1>, <&pd 2>, <&pd 3>; 201*5956d97fSEmmanuel Vadot mbox-names = "txdb0", "txdb1", "rxdb0", "rxdb1"; 202*5956d97fSEmmanuel Vadot mboxes = <&mhu_tx 2 0>, //data-transfer protocol with 5 windows, mhu-tx 203*5956d97fSEmmanuel Vadot <&mhu_tx 3 0>, //data-transfer protocol with 7 windows, mhu-tx 204*5956d97fSEmmanuel Vadot <&mhu_rx 2 27>, //doorbell protocol channel 2, doorbell 27, mhu-rx 205*5956d97fSEmmanuel Vadot <&mhu_rx 0 0>; //data-transfer protocol with 1 window, mhu-rx 206*5956d97fSEmmanuel Vadot memory-region = <&dsp_reserved>; 2075def4c47SEmmanuel Vadot }; 2085def4c47SEmmanuel Vadot }; 209