xref: /linux/Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.yaml (revision 0637af949a8c75d171a635eb0e41a9104f23bb6b)
1068cf93fSThierry Reding# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2068cf93fSThierry Reding%YAML 1.2
3068cf93fSThierry Reding---
4068cf93fSThierry Reding$id: http://devicetree.org/schemas/mailbox/nvidia,tegra186-hsp.yaml#
5068cf93fSThierry Reding$schema: http://devicetree.org/meta-schemas/core.yaml#
6068cf93fSThierry Reding
7068cf93fSThierry Redingtitle: NVIDIA Tegra Hardware Synchronization Primitives (HSP)
8068cf93fSThierry Reding
9068cf93fSThierry Redingmaintainers:
10068cf93fSThierry Reding  - Thierry Reding <thierry.reding@gmail.com>
11068cf93fSThierry Reding  - Jon Hunter <jonathanh@nvidia.com>
12068cf93fSThierry Reding
13068cf93fSThierry Redingdescription: |
14068cf93fSThierry Reding  The HSP modules are used for the processors to share resources and
15068cf93fSThierry Reding  communicate together. It provides a set of hardware synchronization
16068cf93fSThierry Reding  primitives for interprocessor communication. So the interprocessor
17068cf93fSThierry Reding  communication (IPC) protocols can use hardware synchronization
18068cf93fSThierry Reding  primitives, when operating between two processors not in an SMP
19068cf93fSThierry Reding  relationship.
20068cf93fSThierry Reding
21068cf93fSThierry Reding  The features that HSP supported are shared mailboxes, shared
22068cf93fSThierry Reding  semaphores, arbitrated semaphores and doorbells.
23068cf93fSThierry Reding
24068cf93fSThierry Reding  The mbox specifier of the "mboxes" property in the client node should
25068cf93fSThierry Reding  contain two cells. The first cell determines the HSP type and the
26068cf93fSThierry Reding  second cell is used to identify the mailbox that the client is going
27068cf93fSThierry Reding  to use.
28068cf93fSThierry Reding
29068cf93fSThierry Reding  For doorbells, the second cell specifies the index of the doorbell to
30068cf93fSThierry Reding  use.
31068cf93fSThierry Reding
32068cf93fSThierry Reding  For shared mailboxes, the second cell is composed of two fields:
33068cf93fSThierry Reding    - bits 31..24:
34068cf93fSThierry Reding        A bit mask of flags that further specify how the shared mailbox
35068cf93fSThierry Reding        will be used. Valid flags are:
36068cf93fSThierry Reding          - bit 31:
37068cf93fSThierry Reding              Defines the direction of the mailbox. If set, the mailbox
38068cf93fSThierry Reding              will be used as a producer (i.e. used to send data). If
39068cf93fSThierry Reding              cleared, the mailbox is the consumer of data sent by a
40068cf93fSThierry Reding              producer.
41068cf93fSThierry Reding
42068cf93fSThierry Reding    - bits 23..0:
43068cf93fSThierry Reding        The index of the shared mailbox to use. The number of available
44068cf93fSThierry Reding        mailboxes may vary by instance of the HSP block and SoC
45068cf93fSThierry Reding        generation.
46068cf93fSThierry Reding
47068cf93fSThierry Reding    The following file contains definitions that can be used to
48068cf93fSThierry Reding    construct mailbox specifiers:
49068cf93fSThierry Reding
50068cf93fSThierry Reding        <dt-bindings/mailbox/tegra186-hsp.h>
51068cf93fSThierry Reding
52068cf93fSThierry Redingproperties:
53068cf93fSThierry Reding  $nodename:
54068cf93fSThierry Reding    pattern: "^hsp@[0-9a-f]+$"
55068cf93fSThierry Reding
56068cf93fSThierry Reding  compatible:
57068cf93fSThierry Reding    oneOf:
58068cf93fSThierry Reding      - const: nvidia,tegra186-hsp
59068cf93fSThierry Reding      - const: nvidia,tegra194-hsp
60*0637af94SThierry Reding      - items:
61*0637af94SThierry Reding          - const: nvidia,tegra234-hsp
62*0637af94SThierry Reding          - const: nvidia,tegra194-hsp
63068cf93fSThierry Reding
64068cf93fSThierry Reding  reg:
65068cf93fSThierry Reding    maxItems: 1
66068cf93fSThierry Reding
67068cf93fSThierry Reding  interrupts:
68068cf93fSThierry Reding    minItems: 1
69068cf93fSThierry Reding    maxItems: 9
70068cf93fSThierry Reding
71068cf93fSThierry Reding  interrupt-names:
72068cf93fSThierry Reding    oneOf:
73068cf93fSThierry Reding      # shared interrupts are optional
74068cf93fSThierry Reding      - items:
75068cf93fSThierry Reding          - const: doorbell
76068cf93fSThierry Reding
77068cf93fSThierry Reding      - items:
78068cf93fSThierry Reding          - const: doorbell
79068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
80068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
81068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
82068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
83068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
84068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
85068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
86068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
87068cf93fSThierry Reding
88068cf93fSThierry Reding      - items:
89068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
90068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
91068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
92068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
93068cf93fSThierry Reding
94068cf93fSThierry Reding  "#mbox-cells":
95068cf93fSThierry Reding    const: 2
96068cf93fSThierry Reding
97068cf93fSThierry RedingadditionalProperties: false
98068cf93fSThierry Reding
99068cf93fSThierry Redingexamples:
100068cf93fSThierry Reding  - |
101068cf93fSThierry Reding    #include <dt-bindings/interrupt-controller/arm-gic.h>
102068cf93fSThierry Reding    #include <dt-bindings/mailbox/tegra186-hsp.h>
103068cf93fSThierry Reding
104068cf93fSThierry Reding    hsp_top0: hsp@3c00000 {
105068cf93fSThierry Reding        compatible = "nvidia,tegra186-hsp";
106068cf93fSThierry Reding        reg = <0x03c00000 0xa0000>;
107068cf93fSThierry Reding        interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
108068cf93fSThierry Reding        interrupt-names = "doorbell";
109068cf93fSThierry Reding        #mbox-cells = <2>;
110068cf93fSThierry Reding    };
111068cf93fSThierry Reding
112068cf93fSThierry Reding    client {
113068cf93fSThierry Reding        mboxes = <&hsp_top0 TEGRA_HSP_MBOX_TYPE_DB TEGRA_HSP_DB_MASTER_CCPLEX>;
114068cf93fSThierry Reding    };
115