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          - const: renesas,rspi-rz     # RZ/A
25
26      - items:
27          - enum:
28              - renesas,qspi-r8a7743   # RZ/G1M
29              - renesas,qspi-r8a7744   # RZ/G1N
30              - renesas,qspi-r8a7745   # RZ/G1E
31              - renesas,qspi-r8a77470  # RZ/G1C
32              - renesas,qspi-r8a7790   # R-Car H2
33              - renesas,qspi-r8a7791   # R-Car M2-W
34              - renesas,qspi-r8a7792   # R-Car V2H
35              - renesas,qspi-r8a7793   # R-Car M2-N
36              - renesas,qspi-r8a7794   # R-Car E2
37          - const: renesas,qspi        # R-Car Gen2 and RZ/G1
38
39  reg:
40    maxItems: 1
41
42  interrupts:
43    oneOf:
44      - items:
45          - description: A combined interrupt
46      - items:
47          - description: Error interrupt (SPEI)
48          - description: Receive Interrupt (SPRI)
49          - description: Transmit Interrupt (SPTI)
50
51  interrupt-names:
52    oneOf:
53      - items:
54          - const: mux
55      - items:
56          - const: error
57          - const: rx
58          - const: tx
59
60  clocks:
61    maxItems: 1
62
63  power-domains:
64    maxItems: 1
65
66  resets:
67    maxItems: 1
68
69  dmas:
70    description:
71      Must contain a list of pairs of references to DMA specifiers, one for
72      transmission, and one for reception.
73
74  dma-names:
75    minItems: 2
76    maxItems: 4
77    items:
78      enum:
79        - tx
80        - rx
81
82  num-cs:
83    description: |
84      Total number of native chip selects.
85      Hardware limitations related to chip selects:
86        - When using GPIO chip selects, at least one native chip select must
87          be left unused, as it will be driven anyway.
88    minimum: 1
89    maximum: 2
90    default: 1
91
92required:
93  - compatible
94  - reg
95  - interrupts
96  - clocks
97  - power-domains
98  - '#address-cells'
99  - '#size-cells'
100
101allOf:
102  - $ref: spi-controller.yaml#
103  - if:
104      properties:
105        compatible:
106          contains:
107            enum:
108              - renesas,rspi-rz
109    then:
110      properties:
111        interrupts:
112          minItems: 3
113      required:
114        - interrupt-names
115
116  - if:
117      properties:
118        compatible:
119          contains:
120            enum:
121              - renesas,qspi
122    then:
123      required:
124        - resets
125
126examples:
127  - |
128    #include <dt-bindings/clock/r8a7791-cpg-mssr.h>
129    #include <dt-bindings/interrupt-controller/arm-gic.h>
130    #include <dt-bindings/power/r8a7791-sysc.h>
131
132    qspi: spi@e6b10000 {
133            compatible = "renesas,qspi-r8a7791", "renesas,qspi";
134            reg = <0xe6b10000 0x2c>;
135            interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
136            clocks = <&cpg CPG_MOD 917>;
137            dmas = <&dmac0 0x17>, <&dmac0 0x18>, <&dmac1 0x17>, <&dmac1 0x18>;
138            dma-names = "tx", "rx", "tx", "rx";
139            power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
140            resets = <&cpg 917>;
141            num-cs = <1>;
142            #address-cells = <1>;
143            #size-cells = <0>;
144    };
145