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