1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/spi/renesas,rspi.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Renesas (Quad) Serial Peripheral Interface (RSPI/QSPI)
8
9maintainers:
10  - Geert Uytterhoeven <geert+renesas@glider.be>
11
12properties:
13  compatible:
14    oneOf:
15      - items:
16          - enum:
17              - renesas,rspi-sh7757    # SH7757
18          - const: renesas,rspi        # Legacy SH
19
20      - items:
21          - enum:
22              - renesas,rspi-r7s72100  # RZ/A1H
23              - renesas,rspi-r7s9210   # RZ/A2
24              - renesas,r9a07g044-rspi # RZ/G2{L,LC}
25          - const: renesas,rspi-rz     # RZ/A and RZ/G2{L,LC}
26
27      - items:
28          - enum:
29              - renesas,qspi-r8a7742   # RZ/G1H
30              - renesas,qspi-r8a7743   # RZ/G1M
31              - renesas,qspi-r8a7744   # RZ/G1N
32              - renesas,qspi-r8a7745   # RZ/G1E
33              - renesas,qspi-r8a77470  # RZ/G1C
34              - renesas,qspi-r8a7790   # R-Car H2
35              - renesas,qspi-r8a7791   # R-Car M2-W
36              - renesas,qspi-r8a7792   # R-Car V2H
37              - renesas,qspi-r8a7793   # R-Car M2-N
38              - renesas,qspi-r8a7794   # R-Car E2
39          - const: renesas,qspi        # R-Car Gen2 and RZ/G1
40
41  reg:
42    maxItems: 1
43
44  interrupts:
45    oneOf:
46      - items:
47          - description: A combined interrupt
48      - items:
49          - description: Error interrupt (SPEI)
50          - description: Receive Interrupt (SPRI)
51          - description: Transmit Interrupt (SPTI)
52
53  interrupt-names:
54    oneOf:
55      - items:
56          - const: mux
57      - items:
58          - const: error
59          - const: rx
60          - const: tx
61
62  clocks:
63    maxItems: 1
64
65  power-domains:
66    maxItems: 1
67
68  resets:
69    maxItems: 1
70
71  dmas:
72    minItems: 2
73    maxItems: 4
74    description:
75      Must contain a list of pairs of references to DMA specifiers, one for
76      transmission, and one for reception.
77
78  dma-names:
79    minItems: 2
80    maxItems: 4
81    items:
82      enum:
83        - tx
84        - rx
85
86  num-cs:
87    description: |
88      Total number of native chip selects.
89      Hardware limitations related to chip selects:
90        - When using GPIO chip selects, at least one native chip select must
91          be left unused, as it will be driven anyway.
92    minimum: 1
93    maximum: 2
94    default: 1
95
96required:
97  - compatible
98  - reg
99  - interrupts
100  - clocks
101  - power-domains
102  - '#address-cells'
103  - '#size-cells'
104
105allOf:
106  - $ref: spi-controller.yaml#
107  - if:
108      properties:
109        compatible:
110          contains:
111            enum:
112              - renesas,rspi-rz
113    then:
114      properties:
115        interrupts:
116          minItems: 3
117      required:
118        - interrupt-names
119
120  - if:
121      properties:
122        compatible:
123          contains:
124            enum:
125              - renesas,qspi
126              - renesas,r9a07g044-rspi
127    then:
128      required:
129        - resets
130
131unevaluatedProperties: false
132
133examples:
134  - |
135    #include <dt-bindings/clock/r8a7791-cpg-mssr.h>
136    #include <dt-bindings/interrupt-controller/arm-gic.h>
137    #include <dt-bindings/power/r8a7791-sysc.h>
138
139    qspi: spi@e6b10000 {
140            compatible = "renesas,qspi-r8a7791", "renesas,qspi";
141            reg = <0xe6b10000 0x2c>;
142            interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
143            clocks = <&cpg CPG_MOD 917>;
144            dmas = <&dmac0 0x17>, <&dmac0 0x18>, <&dmac1 0x17>, <&dmac1 0x18>;
145            dma-names = "tx", "rx", "tx", "rx";
146            power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
147            resets = <&cpg 917>;
148            num-cs = <1>;
149            #address-cells = <1>;
150            #size-cells = <0>;
151    };
152