xref: /linux/Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.yaml (revision cdd5b5a9761fd66d17586e4f4ba6588c70e640ea)
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
2958919326SKartik  For shared mailboxes, the first cell composed of two fields:
3058919326SKartik    - bits 15..8:
3158919326SKartik        A bit mask of flags that further specifies the type of shared
3258919326SKartik        mailbox to be used (based on the data size). If no flag is
3358919326SKartik        specified then, 32-bit shared mailbox is used.
3458919326SKartik    - bits 7..0:
3558919326SKartik        Defines the type of the mailbox to be used. This field should be
3658919326SKartik        TEGRA_HSP_MBOX_TYPE_SM for shared mailboxes.
3758919326SKartik
38068cf93fSThierry Reding  For doorbells, the second cell specifies the index of the doorbell to
39068cf93fSThierry Reding  use.
40068cf93fSThierry Reding
41068cf93fSThierry Reding  For shared mailboxes, the second cell is composed of two fields:
42068cf93fSThierry Reding    - bits 31..24:
43068cf93fSThierry Reding        A bit mask of flags that further specify how the shared mailbox
44068cf93fSThierry Reding        will be used. Valid flags are:
45068cf93fSThierry Reding          - bit 31:
46068cf93fSThierry Reding              Defines the direction of the mailbox. If set, the mailbox
47068cf93fSThierry Reding              will be used as a producer (i.e. used to send data). If
48068cf93fSThierry Reding              cleared, the mailbox is the consumer of data sent by a
49068cf93fSThierry Reding              producer.
50068cf93fSThierry Reding
51068cf93fSThierry Reding    - bits 23..0:
52068cf93fSThierry Reding        The index of the shared mailbox to use. The number of available
53068cf93fSThierry Reding        mailboxes may vary by instance of the HSP block and SoC
54068cf93fSThierry Reding        generation.
55068cf93fSThierry Reding
56068cf93fSThierry Reding    The following file contains definitions that can be used to
57068cf93fSThierry Reding    construct mailbox specifiers:
58068cf93fSThierry Reding
59068cf93fSThierry Reding        <dt-bindings/mailbox/tegra186-hsp.h>
60068cf93fSThierry Reding
61068cf93fSThierry Redingproperties:
62068cf93fSThierry Reding  $nodename:
63068cf93fSThierry Reding    pattern: "^hsp@[0-9a-f]+$"
64068cf93fSThierry Reding
65068cf93fSThierry Reding  compatible:
66068cf93fSThierry Reding    oneOf:
67068cf93fSThierry Reding      - const: nvidia,tegra186-hsp
68068cf93fSThierry Reding      - const: nvidia,tegra194-hsp
69*af9dbbbbSPeter De Schrijver      - const: nvidia,tegra264-hsp
700637af94SThierry Reding      - items:
710637af94SThierry Reding          - const: nvidia,tegra234-hsp
720637af94SThierry Reding          - const: nvidia,tegra194-hsp
73068cf93fSThierry Reding
74068cf93fSThierry Reding  reg:
75068cf93fSThierry Reding    maxItems: 1
76068cf93fSThierry Reding
77068cf93fSThierry Reding  interrupts:
78068cf93fSThierry Reding    minItems: 1
79068cf93fSThierry Reding    maxItems: 9
80068cf93fSThierry Reding
81068cf93fSThierry Reding  interrupt-names:
82068cf93fSThierry Reding    oneOf:
83068cf93fSThierry Reding      # shared interrupts are optional
84068cf93fSThierry Reding      - items:
85068cf93fSThierry Reding          - const: doorbell
86068cf93fSThierry Reding
87068cf93fSThierry Reding      - items:
88068cf93fSThierry Reding          - const: doorbell
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          - pattern: "^shared[0-7]$"
94068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
95068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
96068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
97068cf93fSThierry Reding
98068cf93fSThierry Reding      - items:
99068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
100068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
101068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
102068cf93fSThierry Reding          - pattern: "^shared[0-7]$"
103068cf93fSThierry Reding
104068cf93fSThierry Reding  "#mbox-cells":
105068cf93fSThierry Reding    const: 2
106068cf93fSThierry Reding
107068cf93fSThierry RedingadditionalProperties: false
108068cf93fSThierry Reding
109068cf93fSThierry Redingexamples:
110068cf93fSThierry Reding  - |
111068cf93fSThierry Reding    #include <dt-bindings/interrupt-controller/arm-gic.h>
112068cf93fSThierry Reding    #include <dt-bindings/mailbox/tegra186-hsp.h>
113068cf93fSThierry Reding
114068cf93fSThierry Reding    hsp_top0: hsp@3c00000 {
115068cf93fSThierry Reding        compatible = "nvidia,tegra186-hsp";
116068cf93fSThierry Reding        reg = <0x03c00000 0xa0000>;
117068cf93fSThierry Reding        interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
118068cf93fSThierry Reding        interrupt-names = "doorbell";
119068cf93fSThierry Reding        #mbox-cells = <2>;
120068cf93fSThierry Reding    };
121068cf93fSThierry Reding
122068cf93fSThierry Reding    client {
123068cf93fSThierry Reding        mboxes = <&hsp_top0 TEGRA_HSP_MBOX_TYPE_DB TEGRA_HSP_DB_MASTER_CCPLEX>;
124068cf93fSThierry Reding    };
125