1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/display/renesas,du.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Renesas R-Car Display Unit (DU)
8
9maintainers:
10  - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11
12description: |
13  These DT bindings describe the Display Unit embedded in the Renesas R-Car
14  Gen1, R-Car Gen2, R-Car Gen3, RZ/G1 and RZ/G2 SoCs.
15
16properties:
17  compatible:
18    enum:
19      - renesas,du-r8a7742 # for RZ/G1H compatible DU
20      - renesas,du-r8a7743 # for RZ/G1M compatible DU
21      - renesas,du-r8a7744 # for RZ/G1N compatible DU
22      - renesas,du-r8a7745 # for RZ/G1E compatible DU
23      - renesas,du-r8a77470 # for RZ/G1C compatible DU
24      - renesas,du-r8a774a1 # for RZ/G2M compatible DU
25      - renesas,du-r8a774b1 # for RZ/G2N compatible DU
26      - renesas,du-r8a774c0 # for RZ/G2E compatible DU
27      - renesas,du-r8a774e1 # for RZ/G2H compatible DU
28      - renesas,du-r8a7779 # for R-Car H1 compatible DU
29      - renesas,du-r8a7790 # for R-Car H2 compatible DU
30      - renesas,du-r8a7791 # for R-Car M2-W compatible DU
31      - renesas,du-r8a7792 # for R-Car V2H compatible DU
32      - renesas,du-r8a7793 # for R-Car M2-N compatible DU
33      - renesas,du-r8a7794 # for R-Car E2 compatible DU
34      - renesas,du-r8a7795 # for R-Car H3 compatible DU
35      - renesas,du-r8a7796 # for R-Car M3-W compatible DU
36      - renesas,du-r8a77961 # for R-Car M3-W+ compatible DU
37      - renesas,du-r8a77965 # for R-Car M3-N compatible DU
38      - renesas,du-r8a77970 # for R-Car V3M compatible DU
39      - renesas,du-r8a77980 # for R-Car V3H compatible DU
40      - renesas,du-r8a77990 # for R-Car E3 compatible DU
41      - renesas,du-r8a77995 # for R-Car D3 compatible DU
42
43  reg:
44    maxItems: 1
45
46  # See compatible-specific constraints below.
47  clocks: true
48  clock-names: true
49  interrupts:
50    description: Interrupt specifiers, one per DU channel
51  resets: true
52  reset-names: true
53
54  power-domains:
55    maxItems: 1
56
57  ports:
58    $ref: /schemas/graph.yaml#/properties/ports
59    description: |
60      The connections to the DU output video ports are modeled using the OF
61      graph bindings specified in Documentation/devicetree/bindings/graph.txt.
62      The number of ports and their assignment are model-dependent. Each port
63      shall have a single endpoint.
64
65    patternProperties:
66      "^port@[0-3]$":
67        $ref: /schemas/graph.yaml#/properties/port
68        unevaluatedProperties: false
69
70    required:
71      - port@0
72      - port@1
73
74    unevaluatedProperties: false
75
76  renesas,cmms:
77    $ref: "/schemas/types.yaml#/definitions/phandle-array"
78    description:
79      A list of phandles to the CMM instances present in the SoC, one for each
80      available DU channel.
81
82  renesas,vsps:
83    $ref: "/schemas/types.yaml#/definitions/phandle-array"
84    description:
85      A list of phandle and channel index tuples to the VSPs that handle the
86      memory interfaces for the DU channels. The phandle identifies the VSP
87      instance that serves the DU channel, and the channel index identifies
88      the LIF instance in that VSP.
89
90required:
91  - compatible
92  - reg
93  - clocks
94  - interrupts
95  - ports
96
97allOf:
98  - if:
99      properties:
100        compatible:
101          contains:
102            const: renesas,du-r8a7779
103    then:
104      properties:
105        clocks:
106          minItems: 1
107          maxItems: 3
108          items:
109            - description: Functional clock
110            - description: DU_DOTCLKIN0 input clock
111            - description: DU_DOTCLKIN1 input clock
112
113        clock-names:
114          minItems: 1
115          maxItems: 3
116          items:
117            - const: du.0
118            - pattern: '^dclkin\.[01]$'
119            - pattern: '^dclkin\.[01]$'
120
121        interrupts:
122          maxItems: 1
123
124        resets:
125          maxItems: 1
126
127        ports:
128          properties:
129            port@0:
130              description: DPAD 0
131            port@1:
132              description: DPAD 1
133            # port@2 is TCON, not supported yet
134            port@2: false
135            port@3: false
136
137          required:
138            - port@0
139            - port@1
140
141      required:
142        - interrupts
143
144  - if:
145      properties:
146        compatible:
147          contains:
148            enum:
149              - renesas,du-r8a7743
150              - renesas,du-r8a7744
151              - renesas,du-r8a7791
152              - renesas,du-r8a7793
153    then:
154      properties:
155        clocks:
156          minItems: 2
157          maxItems: 4
158          items:
159            - description: Functional clock for DU0
160            - description: Functional clock for DU1
161            - description: DU_DOTCLKIN0 input clock
162            - description: DU_DOTCLKIN1 input clock
163
164        clock-names:
165          minItems: 2
166          maxItems: 4
167          items:
168            - const: du.0
169            - const: du.1
170            - pattern: '^dclkin\.[01]$'
171            - pattern: '^dclkin\.[01]$'
172
173        interrupts:
174          maxItems: 2
175
176        resets:
177          maxItems: 1
178
179        reset-names:
180          items:
181            - const: du.0
182
183        ports:
184          properties:
185            port@0:
186              description: DPAD 0
187            port@1:
188              description: LVDS 0
189            # port@2 is TCON, not supported yet
190            port@2: false
191            port@3: false
192
193          required:
194            - port@0
195            - port@1
196
197      required:
198        - clock-names
199        - interrupts
200        - resets
201        - reset-names
202
203  - if:
204      properties:
205        compatible:
206          contains:
207            enum:
208              - renesas,du-r8a7745
209              - renesas,du-r8a7792
210    then:
211      properties:
212        clocks:
213          minItems: 2
214          maxItems: 4
215          items:
216            - description: Functional clock for DU0
217            - description: Functional clock for DU1
218            - description: DU_DOTCLKIN0 input clock
219            - description: DU_DOTCLKIN1 input clock
220
221        clock-names:
222          minItems: 2
223          maxItems: 4
224          items:
225            - const: du.0
226            - const: du.1
227            - pattern: '^dclkin\.[01]$'
228            - pattern: '^dclkin\.[01]$'
229
230        interrupts:
231          maxItems: 2
232
233        resets:
234          maxItems: 1
235
236        reset-names:
237          items:
238            - const: du.0
239
240        ports:
241          properties:
242            port@0:
243              description: DPAD 0
244            port@1:
245              description: DPAD 1
246            port@2: false
247            port@3: false
248
249          required:
250            - port@0
251            - port@1
252
253      required:
254        - clock-names
255        - interrupts
256        - resets
257        - reset-names
258
259  - if:
260      properties:
261        compatible:
262          contains:
263            enum:
264              - renesas,du-r8a7794
265    then:
266      properties:
267        clocks:
268          minItems: 2
269          maxItems: 4
270          items:
271            - description: Functional clock for DU0
272            - description: Functional clock for DU1
273            - description: DU_DOTCLKIN0 input clock
274            - description: DU_DOTCLKIN1 input clock
275
276        clock-names:
277          minItems: 2
278          maxItems: 4
279          items:
280            - const: du.0
281            - const: du.1
282            - pattern: '^dclkin\.[01]$'
283            - pattern: '^dclkin\.[01]$'
284
285        interrupts:
286          maxItems: 2
287
288        resets:
289          maxItems: 1
290
291        reset-names:
292          items:
293            - const: du.0
294
295        ports:
296          properties:
297            port@0:
298              description: DPAD 0
299            port@1:
300              description: DPAD 1
301            # port@2 is TCON, not supported yet
302            port@2: false
303            port@3: false
304
305          required:
306            - port@0
307            - port@1
308
309      required:
310        - clock-names
311        - interrupts
312        - resets
313        - reset-names
314
315  - if:
316      properties:
317        compatible:
318          contains:
319            enum:
320              - renesas,du-r8a77470
321    then:
322      properties:
323        clocks:
324          minItems: 2
325          maxItems: 4
326          items:
327            - description: Functional clock for DU0
328            - description: Functional clock for DU1
329            - description: DU_DOTCLKIN0 input clock
330            - description: DU_DOTCLKIN1 input clock
331
332        clock-names:
333          minItems: 2
334          maxItems: 4
335          items:
336            - const: du.0
337            - const: du.1
338            - pattern: '^dclkin\.[01]$'
339            - pattern: '^dclkin\.[01]$'
340
341        interrupts:
342          maxItems: 2
343
344        resets:
345          maxItems: 1
346
347        reset-names:
348          items:
349            - const: du.0
350
351        ports:
352          properties:
353            port@0:
354              description: DPAD 0
355            port@1:
356              description: DPAD 1
357            port@2:
358              description: LVDS 0
359            # port@3 is DVENC, not supported yet
360            port@3: false
361
362          required:
363            - port@0
364            - port@1
365            - port@2
366
367      required:
368        - clock-names
369        - interrupts
370        - resets
371        - reset-names
372
373  - if:
374      properties:
375        compatible:
376          contains:
377            enum:
378              - renesas,du-r8a7742
379              - renesas,du-r8a7790
380    then:
381      properties:
382        clocks:
383          minItems: 3
384          maxItems: 6
385          items:
386            - description: Functional clock for DU0
387            - description: Functional clock for DU1
388            - description: Functional clock for DU2
389            - description: DU_DOTCLKIN0 input clock
390            - description: DU_DOTCLKIN1 input clock
391            - description: DU_DOTCLKIN2 input clock
392
393        clock-names:
394          minItems: 3
395          maxItems: 6
396          items:
397            - const: du.0
398            - const: du.1
399            - const: du.2
400            - pattern: '^dclkin\.[012]$'
401            - pattern: '^dclkin\.[012]$'
402            - pattern: '^dclkin\.[012]$'
403
404        interrupts:
405          maxItems: 3
406
407        resets:
408          maxItems: 1
409
410        reset-names:
411          items:
412            - const: du.0
413
414        ports:
415          properties:
416            port@0:
417              description: DPAD 0
418            port@1:
419              description: LVDS 0
420            port@2:
421              description: LVDS 1
422            # port@3 is TCON, not supported yet
423            port@3: false
424
425          required:
426            - port@0
427            - port@1
428            - port@2
429
430      required:
431        - clock-names
432        - interrupts
433        - resets
434        - reset-names
435
436  - if:
437      properties:
438        compatible:
439          contains:
440            enum:
441              - renesas,du-r8a7795
442    then:
443      properties:
444        clocks:
445          minItems: 4
446          maxItems: 8
447          items:
448            - description: Functional clock for DU0
449            - description: Functional clock for DU1
450            - description: Functional clock for DU2
451            - description: Functional clock for DU4
452            - description: DU_DOTCLKIN0 input clock
453            - description: DU_DOTCLKIN1 input clock
454            - description: DU_DOTCLKIN2 input clock
455            - description: DU_DOTCLKIN3 input clock
456
457        clock-names:
458          minItems: 4
459          maxItems: 8
460          items:
461            - const: du.0
462            - const: du.1
463            - const: du.2
464            - const: du.3
465            - pattern: '^dclkin\.[0123]$'
466            - pattern: '^dclkin\.[0123]$'
467            - pattern: '^dclkin\.[0123]$'
468            - pattern: '^dclkin\.[0123]$'
469
470        interrupts:
471          maxItems: 4
472
473        resets:
474          maxItems: 2
475
476        reset-names:
477          items:
478            - const: du.0
479            - const: du.2
480
481        ports:
482          properties:
483            port@0:
484              description: DPAD 0
485            port@1:
486              description: HDMI 0
487            port@2:
488              description: HDMI 1
489            port@3:
490              description: LVDS 0
491
492          required:
493            - port@0
494            - port@1
495            - port@2
496            - port@3
497
498        renesas,cmms:
499          minItems: 4
500
501        renesas,vsps:
502          minItems: 4
503
504      required:
505        - clock-names
506        - interrupts
507        - resets
508        - reset-names
509        - renesas,vsps
510
511  - if:
512      properties:
513        compatible:
514          contains:
515            enum:
516              - renesas,du-r8a774a1
517              - renesas,du-r8a7796
518              - renesas,du-r8a77961
519    then:
520      properties:
521        clocks:
522          minItems: 3
523          maxItems: 6
524          items:
525            - description: Functional clock for DU0
526            - description: Functional clock for DU1
527            - description: Functional clock for DU2
528            - description: DU_DOTCLKIN0 input clock
529            - description: DU_DOTCLKIN1 input clock
530            - description: DU_DOTCLKIN2 input clock
531
532        clock-names:
533          minItems: 3
534          maxItems: 6
535          items:
536            - const: du.0
537            - const: du.1
538            - const: du.2
539            - pattern: '^dclkin\.[012]$'
540            - pattern: '^dclkin\.[012]$'
541            - pattern: '^dclkin\.[012]$'
542
543        interrupts:
544          maxItems: 3
545
546        resets:
547          maxItems: 2
548
549        reset-names:
550          items:
551            - const: du.0
552            - const: du.2
553
554        ports:
555          properties:
556            port@0:
557              description: DPAD 0
558            port@1:
559              description: HDMI 0
560            port@2:
561              description: LVDS 0
562            port@3: false
563
564          required:
565            - port@0
566            - port@1
567            - port@2
568
569        renesas,cmms:
570          minItems: 3
571
572        renesas,vsps:
573          minItems: 3
574
575      required:
576        - clock-names
577        - interrupts
578        - resets
579        - reset-names
580        - renesas,vsps
581
582  - if:
583      properties:
584        compatible:
585          contains:
586            enum:
587              - renesas,du-r8a774b1
588              - renesas,du-r8a774e1
589              - renesas,du-r8a77965
590    then:
591      properties:
592        clocks:
593          minItems: 3
594          maxItems: 6
595          items:
596            - description: Functional clock for DU0
597            - description: Functional clock for DU1
598            - description: Functional clock for DU3
599            - description: DU_DOTCLKIN0 input clock
600            - description: DU_DOTCLKIN1 input clock
601            - description: DU_DOTCLKIN3 input clock
602
603        clock-names:
604          minItems: 3
605          maxItems: 6
606          items:
607            - const: du.0
608            - const: du.1
609            - const: du.3
610            - pattern: '^dclkin\.[013]$'
611            - pattern: '^dclkin\.[013]$'
612            - pattern: '^dclkin\.[013]$'
613
614        interrupts:
615          maxItems: 3
616
617        resets:
618          maxItems: 2
619
620        reset-names:
621          items:
622            - const: du.0
623            - const: du.3
624
625        ports:
626          properties:
627            port@0:
628              description: DPAD 0
629            port@1:
630              description: HDMI 0
631            port@2:
632              description: LVDS 0
633            port@3: false
634
635          required:
636            - port@0
637            - port@1
638            - port@2
639
640        renesas,cmms:
641          minItems: 3
642
643        renesas,vsps:
644          minItems: 3
645
646      required:
647        - clock-names
648        - interrupts
649        - resets
650        - reset-names
651        - renesas,vsps
652
653  - if:
654      properties:
655        compatible:
656          contains:
657            enum:
658              - renesas,du-r8a77970
659              - renesas,du-r8a77980
660    then:
661      properties:
662        clocks:
663          minItems: 1
664          maxItems: 2
665          items:
666            - description: Functional clock for DU0
667            - description: DU_DOTCLKIN0 input clock
668
669        clock-names:
670          minItems: 1
671          maxItems: 2
672          items:
673            - const: du.0
674            - const: dclkin.0
675
676        interrupts:
677          maxItems: 1
678
679        resets:
680          maxItems: 1
681
682        reset-names:
683          items:
684            - const: du.0
685
686        ports:
687          properties:
688            port@0:
689              description: DPAD 0
690            port@1:
691              description: LVDS 0
692            port@2: false
693            port@3: false
694
695          required:
696            - port@0
697            - port@1
698
699        renesas,vsps:
700          minItems: 1
701
702      required:
703        - clock-names
704        - interrupts
705        - resets
706        - reset-names
707        - renesas,vsps
708
709  - if:
710      properties:
711        compatible:
712          contains:
713            enum:
714              - renesas,du-r8a774c0
715              - renesas,du-r8a77990
716              - renesas,du-r8a77995
717    then:
718      properties:
719        clocks:
720          minItems: 2
721          maxItems: 4
722          items:
723            - description: Functional clock for DU0
724            - description: Functional clock for DU1
725            - description: DU_DOTCLKIN0 input clock
726            - description: DU_DOTCLKIN1 input clock
727
728        clock-names:
729          minItems: 2
730          maxItems: 4
731          items:
732            - const: du.0
733            - const: du.1
734            - pattern: '^dclkin\.[01]$'
735            - pattern: '^dclkin\.[01]$'
736
737        interrupts:
738          maxItems: 2
739
740        resets:
741          maxItems: 1
742
743        reset-names:
744          items:
745            - const: du.0
746
747        ports:
748          properties:
749            port@0:
750              description: DPAD 0
751            port@1:
752              description: LVDS 0
753            port@2:
754              description: LVDS 1
755            # port@3 is TCON, not supported yet
756            port@3: false
757
758          required:
759            - port@0
760            - port@1
761            - port@2
762
763        renesas,cmms:
764          minItems: 2
765
766        renesas,vsps:
767          minItems: 2
768
769      required:
770        - clock-names
771        - interrupts
772        - resets
773        - reset-names
774        - renesas,vsps
775
776additionalProperties: false
777
778examples:
779  # R-Car H3 ES2.0 DU
780  - |
781    #include <dt-bindings/clock/renesas-cpg-mssr.h>
782    #include <dt-bindings/interrupt-controller/arm-gic.h>
783
784    display@feb00000 {
785        compatible = "renesas,du-r8a7795";
786        reg = <0xfeb00000 0x80000>;
787        interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
788                     <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
789                     <GIC_SPI 269 IRQ_TYPE_LEVEL_HIGH>,
790                     <GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH>;
791        clocks = <&cpg CPG_MOD 724>,
792                 <&cpg CPG_MOD 723>,
793                 <&cpg CPG_MOD 722>,
794                 <&cpg CPG_MOD 721>;
795        clock-names = "du.0", "du.1", "du.2", "du.3";
796        resets = <&cpg 724>, <&cpg 722>;
797        reset-names = "du.0", "du.2";
798
799        renesas,cmms = <&cmm0>, <&cmm1>, <&cmm2>, <&cmm3>;
800        renesas,vsps = <&vspd0 0>, <&vspd1 0>, <&vspd2 0>, <&vspd0 1>;
801
802        ports {
803            #address-cells = <1>;
804            #size-cells = <0>;
805
806            port@0 {
807                reg = <0>;
808                endpoint {
809                    remote-endpoint = <&adv7123_in>;
810                };
811            };
812            port@1 {
813                reg = <1>;
814                endpoint {
815                    remote-endpoint = <&dw_hdmi0_in>;
816                };
817            };
818            port@2 {
819                reg = <2>;
820                endpoint {
821                    remote-endpoint = <&dw_hdmi1_in>;
822                };
823            };
824            port@3 {
825                reg = <3>;
826                endpoint {
827                    remote-endpoint = <&lvds0_in>;
828                };
829            };
830        };
831    };
832
833...
834