• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# SPDX-License-Identifier: GPL-2.0-only
2# Copyright (C) 2020 Renesas Electronics Corp.
3%YAML 1.2
4---
5$id: http://devicetree.org/schemas/media/renesas,vin.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: Renesas R-Car Video Input (VIN)
9
10maintainers:
11  - Niklas Söderlund <niklas.soderlund@ragnatech.se>
12
13description:
14  The R-Car Video Input (VIN) device provides video input capabilities for the
15  Renesas R-Car family of devices.
16
17  Each VIN instance has a single parallel input that supports RGB and YUV video,
18  with both external synchronization and BT.656 synchronization for the latter.
19  Depending on the instance the VIN input is connected to external SoC pins, or
20  on Gen3 and RZ/G2 platforms to a CSI-2 receiver.
21
22properties:
23  compatible:
24    oneOf:
25      - items:
26          - enum:
27              - renesas,vin-r8a7742  # RZ/G1H
28              - renesas,vin-r8a7743  # RZ/G1M
29              - renesas,vin-r8a7744  # RZ/G1N
30              - renesas,vin-r8a7745  # RZ/G1E
31              - renesas,vin-r8a77470 # RZ/G1C
32              - renesas,vin-r8a7790  # R-Car H2
33              - renesas,vin-r8a7791  # R-Car M2-W
34              - renesas,vin-r8a7792  # R-Car V2H
35              - renesas,vin-r8a7793  # R-Car M2-N
36              - renesas,vin-r8a7794  # R-Car E2
37          - const: renesas,rcar-gen2-vin # Generic R-Car Gen2 or RZ/G1
38
39      - items:
40          - enum:
41              - renesas,vin-r8a774a1 # RZ/G2M
42              - renesas,vin-r8a774b1 # RZ/G2N
43              - renesas,vin-r8a774c0 # RZ/G2E
44              - renesas,vin-r8a774e1 # RZ/G2H
45              - renesas,vin-r8a7778  # R-Car M1
46              - renesas,vin-r8a7779  # R-Car H1
47              - renesas,vin-r8a7795  # R-Car H3
48              - renesas,vin-r8a7796  # R-Car M3-W
49              - renesas,vin-r8a77965 # R-Car M3-N
50              - renesas,vin-r8a77970 # R-Car V3M
51              - renesas,vin-r8a77980 # R-Car V3H
52              - renesas,vin-r8a77990 # R-Car E3
53              - renesas,vin-r8a77995 # R-Car D3
54
55  reg:
56    maxItems: 1
57
58  interrupts:
59    maxItems: 1
60
61  clocks:
62    maxItems: 1
63
64  power-domains:
65    maxItems: 1
66
67  resets:
68    maxItems: 1
69
70  #The per-board settings for Gen2 and RZ/G1 platforms:
71  port:
72    type: object
73    description:
74      A node containing a parallel input with a single endpoint definitions as
75      documented in
76      Documentation/devicetree/bindings/media/video-interfaces.txt
77
78    properties:
79      endpoint:
80        type: object
81
82        properties:
83          hsync-active:
84            description:
85              If both HSYNC and VSYNC polarities are not specified, embedded
86              synchronization is selected.
87            default: 1
88
89          vsync-active:
90            description:
91              If both HSYNC and VSYNC polarities are not specified, embedded
92              synchronization is selected.
93            default: 1
94
95          field-active-even: true
96
97          bus-width: true
98
99          data-shift: true
100
101          data-enable-active:
102            description: Polarity of CLKENB signal
103            default: 1
104
105          pclk-sample: true
106
107          data-active: true
108
109          remote-endpoint: true
110
111        required:
112          - remote-endpoint
113
114        additionalProperties: false
115
116    additionalProperties: false
117
118  #The per-board settings for Gen3 and RZ/G2 platforms:
119  renesas,id:
120    description: VIN channel number
121    $ref: /schemas/types.yaml#/definitions/uint32
122    minimum: 0
123    maximum: 15
124
125  ports:
126    type: object
127    description:
128      A node containing input nodes with endpoint definitions as documented in
129      Documentation/devicetree/bindings/media/video-interfaces.txt
130
131    properties:
132      port@0:
133        type: object
134        description:
135          Input port node, single endpoint describing a parallel input source.
136
137        properties:
138          reg:
139            const: 0
140
141          endpoint:
142            type: object
143
144            properties:
145              hsync-active:
146                description:
147                  If both HSYNC and VSYNC polarities are not specified, embedded
148                  synchronization is selected.
149                default: 1
150
151              vsync-active:
152                description:
153                  If both HSYNC and VSYNC polarities are not specified, embedded
154                  synchronization is selected.
155                default: 1
156
157              field-active-even: true
158
159              bus-width: true
160
161              data-shift: true
162
163              data-enable-active:
164                description: Polarity of CLKENB signal
165                default: 1
166
167              pclk-sample: true
168
169              data-active: true
170
171              remote-endpoint: true
172
173            required:
174              - remote-endpoint
175
176            additionalProperties: false
177
178        required:
179          - endpoint
180
181        additionalProperties: false
182
183      port@1:
184        type: object
185        description:
186          Input port node, multiple endpoints describing all the R-Car CSI-2
187          modules connected the VIN.
188
189        properties:
190          '#address-cells':
191            const: 1
192
193          '#size-cells':
194            const: 0
195
196          reg:
197            const: 1
198
199          endpoint@0:
200            type: object
201            description: Endpoint connected to CSI20.
202
203            properties:
204              reg:
205                const: 0
206
207              remote-endpoint: true
208
209            required:
210              - reg
211              - remote-endpoint
212
213            additionalProperties: false
214
215          endpoint@1:
216            type: object
217            description: Endpoint connected to CSI21.
218
219            properties:
220              reg:
221                const: 1
222
223              remote-endpoint: true
224
225            required:
226              - reg
227              - remote-endpoint
228
229            additionalProperties: false
230
231          endpoint@2:
232            type: object
233            description: Endpoint connected to CSI40.
234
235            properties:
236              reg:
237                const: 2
238
239              remote-endpoint: true
240
241            required:
242              - reg
243              - remote-endpoint
244
245            additionalProperties: false
246
247          endpoint@3:
248            type: object
249            description: Endpoint connected to CSI41.
250
251            properties:
252              reg:
253                const: 3
254
255              remote-endpoint: true
256
257            required:
258              - reg
259              - remote-endpoint
260
261            additionalProperties: false
262
263        anyOf:
264          - required:
265              - endpoint@0
266          - required:
267              - endpoint@1
268          - required:
269              - endpoint@2
270          - required:
271              - endpoint@3
272
273        additionalProperties: false
274
275required:
276  - compatible
277  - reg
278  - interrupts
279  - clocks
280  - power-domains
281
282allOf:
283  - if:
284      not:
285        properties:
286          compatible:
287            contains:
288              enum:
289                - renesas,vin-r8a7778
290                - renesas,vin-r8a7779
291    then:
292      required:
293        - resets
294
295  - if:
296      properties:
297        compatible:
298          contains:
299            enum:
300              - renesas,vin-r8a7778
301              - renesas,vin-r8a7779
302              - renesas,rcar-gen2-vin
303    then:
304      required:
305        - port
306    else:
307      required:
308        - renesas,id
309        - ports
310
311additionalProperties: false
312
313examples:
314  # Device node example for Gen2 platform
315  - |
316    #include <dt-bindings/clock/r8a7790-cpg-mssr.h>
317    #include <dt-bindings/interrupt-controller/arm-gic.h>
318    #include <dt-bindings/power/r8a7790-sysc.h>
319
320    vin1: vin@e6ef1000 {
321            compatible = "renesas,vin-r8a7790",
322                         "renesas,rcar-gen2-vin";
323            reg = <0xe6ef1000 0x1000>;
324            interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
325            clocks = <&cpg CPG_MOD 810>;
326            power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
327            resets = <&cpg 810>;
328
329            port {
330                    vin1ep0: endpoint {
331                            remote-endpoint = <&adv7180>;
332                            bus-width = <8>;
333                    };
334            };
335    };
336
337  # Device node example for Gen3 platform with only CSI-2
338  - |
339    #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
340    #include <dt-bindings/interrupt-controller/arm-gic.h>
341    #include <dt-bindings/power/r8a7795-sysc.h>
342
343    vin0: video@e6ef0000 {
344            compatible = "renesas,vin-r8a7795";
345            reg = <0xe6ef0000 0x1000>;
346            interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
347            clocks = <&cpg CPG_MOD 811>;
348            power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
349            resets = <&cpg 811>;
350            renesas,id = <0>;
351
352            ports {
353                    #address-cells = <1>;
354                    #size-cells = <0>;
355
356                    port@1 {
357                            #address-cells = <1>;
358                            #size-cells = <0>;
359
360                            reg = <1>;
361
362                            vin0csi20: endpoint@0 {
363                                    reg = <0>;
364                                    remote-endpoint= <&csi20vin0>;
365                            };
366                            vin0csi40: endpoint@2 {
367                                    reg = <2>;
368                                    remote-endpoint= <&csi40vin0>;
369                            };
370                    };
371            };
372    };
373
374  # Device node example for Gen3 platform with CSI-2 and parallel
375  - |
376    #include <dt-bindings/clock/r8a77970-cpg-mssr.h>
377    #include <dt-bindings/interrupt-controller/arm-gic.h>
378    #include <dt-bindings/power/r8a77970-sysc.h>
379
380    vin2: video@e6ef2000 {
381            compatible = "renesas,vin-r8a77970";
382            reg = <0xe6ef2000 0x1000>;
383            interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
384            clocks = <&cpg CPG_MOD 809>;
385            power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
386            resets = <&cpg 809>;
387            renesas,id = <2>;
388
389            ports {
390                    #address-cells = <1>;
391                    #size-cells = <0>;
392
393                    port@0 {
394                            reg = <0>;
395
396                            vin2_in: endpoint {
397                                    remote-endpoint = <&adv7612_out>;
398                                    hsync-active = <0>;
399                                    vsync-active = <0>;
400                            };
401                    };
402
403                    port@1 {
404                            #address-cells = <1>;
405                            #size-cells = <0>;
406
407                            reg = <1>;
408
409                            vin2csi40: endpoint@2 {
410                                    reg = <2>;
411                                    remote-endpoint = <&csi40vin2>;
412                            };
413                    };
414            };
415    };
416