1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/spi/renesas,sh-msiof.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: Renesas MSIOF SPI controller
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Geert Uytterhoeven <geert+renesas@glider.be>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel VadotallOf:
13c66ec88fSEmmanuel Vadot  - $ref: spi-controller.yaml#
14c66ec88fSEmmanuel Vadot
15c66ec88fSEmmanuel Vadotproperties:
16c66ec88fSEmmanuel Vadot  compatible:
17c66ec88fSEmmanuel Vadot    oneOf:
18c66ec88fSEmmanuel Vadot      - items:
19c66ec88fSEmmanuel Vadot          - const: renesas,msiof-sh73a0     # SH-Mobile AG5
20c66ec88fSEmmanuel Vadot          - const: renesas,sh-mobile-msiof  # generic SH-Mobile compatible
21c66ec88fSEmmanuel Vadot                                            # device
22c66ec88fSEmmanuel Vadot      - items:
23c66ec88fSEmmanuel Vadot          - enum:
24c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a7742       # RZ/G1H
25c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a7743       # RZ/G1M
26c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a7744       # RZ/G1N
27c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a7745       # RZ/G1E
28c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a77470      # RZ/G1C
29c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a7790       # R-Car H2
30c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a7791       # R-Car M2-W
31c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a7792       # R-Car V2H
32c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a7793       # R-Car M2-N
33c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a7794       # R-Car E2
34c66ec88fSEmmanuel Vadot          - const: renesas,rcar-gen2-msiof  # generic R-Car Gen2 and RZ/G1
35c66ec88fSEmmanuel Vadot                                            # compatible device
36c66ec88fSEmmanuel Vadot      - items:
37c66ec88fSEmmanuel Vadot          - enum:
38c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a774a1      # RZ/G2M
39c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a774b1      # RZ/G2N
40c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a774c0      # RZ/G2E
41c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a774e1      # RZ/G2H
42c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a7795       # R-Car H3
43c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a7796       # R-Car M3-W
446be33864SEmmanuel Vadot              - renesas,msiof-r8a77961      # R-Car M3-W+
45c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a77965      # R-Car M3-N
46c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a77970      # R-Car V3M
47c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a77980      # R-Car V3H
48c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a77990      # R-Car E3
49c66ec88fSEmmanuel Vadot              - renesas,msiof-r8a77995      # R-Car D3
50c66ec88fSEmmanuel Vadot          - const: renesas,rcar-gen3-msiof  # generic R-Car Gen3 and RZ/G2
51c66ec88fSEmmanuel Vadot                                            # compatible device
52c66ec88fSEmmanuel Vadot      - items:
537ef62cebSEmmanuel Vadot          - enum:
547ef62cebSEmmanuel Vadot              - renesas,msiof-r8a779a0      # R-Car V3U
557ef62cebSEmmanuel Vadot              - renesas,msiof-r8a779f0      # R-Car S4-8
567ef62cebSEmmanuel Vadot              - renesas,msiof-r8a779g0      # R-Car V4H
577ef62cebSEmmanuel Vadot          - const: renesas,rcar-gen4-msiof  # generic R-Car Gen4
587ef62cebSEmmanuel Vadot                                            # compatible device
597ef62cebSEmmanuel Vadot      - items:
60c66ec88fSEmmanuel Vadot          - const: renesas,sh-msiof  # deprecated
61c66ec88fSEmmanuel Vadot
62c66ec88fSEmmanuel Vadot  reg:
63c66ec88fSEmmanuel Vadot    minItems: 1
64c66ec88fSEmmanuel Vadot    maxItems: 2
65c66ec88fSEmmanuel Vadot    oneOf:
66c66ec88fSEmmanuel Vadot      - items:
67c66ec88fSEmmanuel Vadot          - description: CPU and DMA engine registers
68c66ec88fSEmmanuel Vadot      - items:
69c66ec88fSEmmanuel Vadot          - description: CPU registers
70c66ec88fSEmmanuel Vadot          - description: DMA engine registers
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot  interrupts:
73c66ec88fSEmmanuel Vadot    maxItems: 1
74c66ec88fSEmmanuel Vadot
75c66ec88fSEmmanuel Vadot  clocks:
76c66ec88fSEmmanuel Vadot    maxItems: 1
77c66ec88fSEmmanuel Vadot
787ef62cebSEmmanuel Vadot  power-domains:
797ef62cebSEmmanuel Vadot    maxItems: 1
807ef62cebSEmmanuel Vadot
817ef62cebSEmmanuel Vadot  resets:
827ef62cebSEmmanuel Vadot    maxItems: 1
837ef62cebSEmmanuel Vadot
84c66ec88fSEmmanuel Vadot  num-cs:
85c66ec88fSEmmanuel Vadot    description: |
86c66ec88fSEmmanuel Vadot      Total number of chip selects (default is 1).
87c66ec88fSEmmanuel Vadot      Up to 3 native chip selects are supported:
88c66ec88fSEmmanuel Vadot        0: MSIOF_SYNC
89c66ec88fSEmmanuel Vadot        1: MSIOF_SS1
90c66ec88fSEmmanuel Vadot        2: MSIOF_SS2
91c66ec88fSEmmanuel Vadot      Hardware limitations related to chip selects:
92c66ec88fSEmmanuel Vadot        - Native chip selects are always deasserted in between transfers
93c66ec88fSEmmanuel Vadot          that are part of the same message.  Use cs-gpios to work around
94c66ec88fSEmmanuel Vadot          this.
95c66ec88fSEmmanuel Vadot        - All slaves using native chip selects must use the same spi-cs-high
96c66ec88fSEmmanuel Vadot          configuration.  Use cs-gpios to work around this.
97c66ec88fSEmmanuel Vadot        - When using GPIO chip selects, at least one native chip select must
98c66ec88fSEmmanuel Vadot          be left unused, as it will be driven anyway.
99c66ec88fSEmmanuel Vadot    minimum: 1
100c66ec88fSEmmanuel Vadot    maximum: 3
101c66ec88fSEmmanuel Vadot    default: 1
102c66ec88fSEmmanuel Vadot
103c66ec88fSEmmanuel Vadot  dmas:
104c66ec88fSEmmanuel Vadot    minItems: 2
105c66ec88fSEmmanuel Vadot    maxItems: 4
106c66ec88fSEmmanuel Vadot
107c66ec88fSEmmanuel Vadot  dma-names:
108c66ec88fSEmmanuel Vadot    minItems: 2
109c66ec88fSEmmanuel Vadot    maxItems: 4
110c66ec88fSEmmanuel Vadot    items:
111c66ec88fSEmmanuel Vadot      enum: [ tx, rx ]
112c66ec88fSEmmanuel Vadot
113c66ec88fSEmmanuel Vadot  renesas,dtdl:
114c66ec88fSEmmanuel Vadot    description: delay sync signal (setup) in transmit mode.
115c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
116c66ec88fSEmmanuel Vadot    enum:
117c66ec88fSEmmanuel Vadot      - 0        # no bit delay
118c66ec88fSEmmanuel Vadot      - 50       # 0.5-clock-cycle delay
119c66ec88fSEmmanuel Vadot      - 100      # 1-clock-cycle delay
120c66ec88fSEmmanuel Vadot      - 150      # 1.5-clock-cycle delay
121c66ec88fSEmmanuel Vadot      - 200      # 2-clock-cycle delay
122c66ec88fSEmmanuel Vadot
123c66ec88fSEmmanuel Vadot  renesas,syncdl:
124c66ec88fSEmmanuel Vadot    description: delay sync signal (hold) in transmit mode
125c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
126c66ec88fSEmmanuel Vadot    enum:
127c66ec88fSEmmanuel Vadot      - 0        # no bit delay
128c66ec88fSEmmanuel Vadot      - 50       # 0.5-clock-cycle delay
129c66ec88fSEmmanuel Vadot      - 100      # 1-clock-cycle delay
130c66ec88fSEmmanuel Vadot      - 150      # 1.5-clock-cycle delay
131c66ec88fSEmmanuel Vadot      - 200      # 2-clock-cycle delay
132c66ec88fSEmmanuel Vadot      - 300      # 3-clock-cycle delay
133c66ec88fSEmmanuel Vadot
134c66ec88fSEmmanuel Vadot  renesas,tx-fifo-size:
135c66ec88fSEmmanuel Vadot    # deprecated for soctype-specific bindings
136c66ec88fSEmmanuel Vadot    description: |
137c66ec88fSEmmanuel Vadot      Override the default TX fifo size.  Unit is words.  Ignored if 0.
138c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
139c66ec88fSEmmanuel Vadot    default: 64
140c66ec88fSEmmanuel Vadot
141c66ec88fSEmmanuel Vadot  renesas,rx-fifo-size:
142c66ec88fSEmmanuel Vadot    # deprecated for soctype-specific bindings
143c66ec88fSEmmanuel Vadot    description: |
144c66ec88fSEmmanuel Vadot      Override the default RX fifo size.  Unit is words.  Ignored if 0.
145c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
146c66ec88fSEmmanuel Vadot    default: 64
147c66ec88fSEmmanuel Vadot
148c66ec88fSEmmanuel Vadotrequired:
149c66ec88fSEmmanuel Vadot  - compatible
150c66ec88fSEmmanuel Vadot  - reg
151c66ec88fSEmmanuel Vadot  - interrupts
152*fac71e4eSEmmanuel Vadot  - clocks
153*fac71e4eSEmmanuel Vadot  - power-domains
154c66ec88fSEmmanuel Vadot  - '#address-cells'
155c66ec88fSEmmanuel Vadot  - '#size-cells'
156c66ec88fSEmmanuel Vadot
157*fac71e4eSEmmanuel Vadotif:
158*fac71e4eSEmmanuel Vadot  not:
159*fac71e4eSEmmanuel Vadot    properties:
160*fac71e4eSEmmanuel Vadot      compatible:
161*fac71e4eSEmmanuel Vadot        contains:
162*fac71e4eSEmmanuel Vadot          const: renesas,sh-mobile-msiof
163*fac71e4eSEmmanuel Vadotthen:
164*fac71e4eSEmmanuel Vadot  required:
165*fac71e4eSEmmanuel Vadot    - resets
166*fac71e4eSEmmanuel Vadot
1676be33864SEmmanuel VadotunevaluatedProperties: false
1686be33864SEmmanuel Vadot
169c66ec88fSEmmanuel Vadotexamples:
170c66ec88fSEmmanuel Vadot  - |
171*fac71e4eSEmmanuel Vadot    #include <dt-bindings/clock/r8a7791-cpg-mssr.h>
172*fac71e4eSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
173*fac71e4eSEmmanuel Vadot    #include <dt-bindings/power/r8a7791-sysc.h>
174c66ec88fSEmmanuel Vadot
175c66ec88fSEmmanuel Vadot    msiof0: spi@e6e20000 {
176c66ec88fSEmmanuel Vadot        compatible = "renesas,msiof-r8a7791", "renesas,rcar-gen2-msiof";
177c66ec88fSEmmanuel Vadot        reg = <0xe6e20000 0x0064>;
178*fac71e4eSEmmanuel Vadot        interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>;
179*fac71e4eSEmmanuel Vadot        clocks = <&cpg CPG_MOD 000>;
180c66ec88fSEmmanuel Vadot        dmas = <&dmac0 0x51>, <&dmac0 0x52>;
181c66ec88fSEmmanuel Vadot        dma-names = "tx", "rx";
182*fac71e4eSEmmanuel Vadot        power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
183*fac71e4eSEmmanuel Vadot        resets = <&cpg 0>;
184c66ec88fSEmmanuel Vadot        #address-cells = <1>;
185c66ec88fSEmmanuel Vadot        #size-cells = <0>;
186c66ec88fSEmmanuel Vadot    };
187