xref: /linux/Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.yaml (revision 068cf93f900267fb4aaf2b14ff369f80aa4b5406)
1*068cf93fSThierry Reding# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*068cf93fSThierry Reding%YAML 1.2
3*068cf93fSThierry Reding---
4*068cf93fSThierry Reding$id: http://devicetree.org/schemas/mailbox/nvidia,tegra186-hsp.yaml#
5*068cf93fSThierry Reding$schema: http://devicetree.org/meta-schemas/core.yaml#
6*068cf93fSThierry Reding
7*068cf93fSThierry Redingtitle: NVIDIA Tegra Hardware Synchronization Primitives (HSP)
8*068cf93fSThierry Reding
9*068cf93fSThierry Redingmaintainers:
10*068cf93fSThierry Reding  - Thierry Reding <thierry.reding@gmail.com>
11*068cf93fSThierry Reding  - Jon Hunter <jonathanh@nvidia.com>
12*068cf93fSThierry Reding
13*068cf93fSThierry Redingdescription: |
14*068cf93fSThierry Reding  The HSP modules are used for the processors to share resources and
15*068cf93fSThierry Reding  communicate together. It provides a set of hardware synchronization
16*068cf93fSThierry Reding  primitives for interprocessor communication. So the interprocessor
17*068cf93fSThierry Reding  communication (IPC) protocols can use hardware synchronization
18*068cf93fSThierry Reding  primitives, when operating between two processors not in an SMP
19*068cf93fSThierry Reding  relationship.
20*068cf93fSThierry Reding
21*068cf93fSThierry Reding  The features that HSP supported are shared mailboxes, shared
22*068cf93fSThierry Reding  semaphores, arbitrated semaphores and doorbells.
23*068cf93fSThierry Reding
24*068cf93fSThierry Reding  The mbox specifier of the "mboxes" property in the client node should
25*068cf93fSThierry Reding  contain two cells. The first cell determines the HSP type and the
26*068cf93fSThierry Reding  second cell is used to identify the mailbox that the client is going
27*068cf93fSThierry Reding  to use.
28*068cf93fSThierry Reding
29*068cf93fSThierry Reding  For doorbells, the second cell specifies the index of the doorbell to
30*068cf93fSThierry Reding  use.
31*068cf93fSThierry Reding
32*068cf93fSThierry Reding  For shared mailboxes, the second cell is composed of two fields:
33*068cf93fSThierry Reding    - bits 31..24:
34*068cf93fSThierry Reding        A bit mask of flags that further specify how the shared mailbox
35*068cf93fSThierry Reding        will be used. Valid flags are:
36*068cf93fSThierry Reding          - bit 31:
37*068cf93fSThierry Reding              Defines the direction of the mailbox. If set, the mailbox
38*068cf93fSThierry Reding              will be used as a producer (i.e. used to send data). If
39*068cf93fSThierry Reding              cleared, the mailbox is the consumer of data sent by a
40*068cf93fSThierry Reding              producer.
41*068cf93fSThierry Reding
42*068cf93fSThierry Reding    - bits 23..0:
43*068cf93fSThierry Reding        The index of the shared mailbox to use. The number of available
44*068cf93fSThierry Reding        mailboxes may vary by instance of the HSP block and SoC
45*068cf93fSThierry Reding        generation.
46*068cf93fSThierry Reding
47*068cf93fSThierry Reding    The following file contains definitions that can be used to
48*068cf93fSThierry Reding    construct mailbox specifiers:
49*068cf93fSThierry Reding
50*068cf93fSThierry Reding        <dt-bindings/mailbox/tegra186-hsp.h>
51*068cf93fSThierry Reding
52*068cf93fSThierry Redingproperties:
53*068cf93fSThierry Reding  $nodename:
54*068cf93fSThierry Reding    pattern: "^hsp@[0-9a-f]+$"
55*068cf93fSThierry Reding
56*068cf93fSThierry Reding  compatible:
57*068cf93fSThierry Reding    oneOf:
58*068cf93fSThierry Reding      - const: nvidia,tegra186-hsp
59*068cf93fSThierry Reding      - const: nvidia,tegra194-hsp
60*068cf93fSThierry Reding
61*068cf93fSThierry Reding  reg:
62*068cf93fSThierry Reding    maxItems: 1
63*068cf93fSThierry Reding
64*068cf93fSThierry Reding  interrupts:
65*068cf93fSThierry Reding    minItems: 1
66*068cf93fSThierry Reding    maxItems: 9
67*068cf93fSThierry Reding
68*068cf93fSThierry Reding  interrupt-names:
69*068cf93fSThierry Reding    oneOf:
70*068cf93fSThierry Reding      # shared interrupts are optional
71*068cf93fSThierry Reding      - items:
72*068cf93fSThierry Reding          - const: doorbell
73*068cf93fSThierry Reding
74*068cf93fSThierry Reding      - items:
75*068cf93fSThierry Reding          - const: doorbell
76*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
77*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
78*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
79*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
80*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
81*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
82*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
83*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
84*068cf93fSThierry Reding
85*068cf93fSThierry Reding      - items:
86*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
87*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
88*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
89*068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
90*068cf93fSThierry Reding
91*068cf93fSThierry Reding  "#mbox-cells":
92*068cf93fSThierry Reding    const: 2
93*068cf93fSThierry Reding
94*068cf93fSThierry RedingadditionalProperties: false
95*068cf93fSThierry Reding
96*068cf93fSThierry Redingexamples:
97*068cf93fSThierry Reding  - |
98*068cf93fSThierry Reding    #include <dt-bindings/interrupt-controller/arm-gic.h>
99*068cf93fSThierry Reding    #include <dt-bindings/mailbox/tegra186-hsp.h>
100*068cf93fSThierry Reding
101*068cf93fSThierry Reding    hsp_top0: hsp@3c00000 {
102*068cf93fSThierry Reding        compatible = "nvidia,tegra186-hsp";
103*068cf93fSThierry Reding        reg = <0x03c00000 0xa0000>;
104*068cf93fSThierry Reding        interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
105*068cf93fSThierry Reding        interrupt-names = "doorbell";
106*068cf93fSThierry Reding        #mbox-cells = <2>;
107*068cf93fSThierry Reding    };
108*068cf93fSThierry Reding
109*068cf93fSThierry Reding    client {
110*068cf93fSThierry Reding        mboxes = <&hsp_top0 TEGRA_HSP_MBOX_TYPE_DB TEGRA_HSP_DB_MASTER_CCPLEX>;
111*068cf93fSThierry Reding    };
112