Merge tag 'zynqmp-soc-for-v5.9-v2' of https://github.com/Xilinx/linux-xlnx into arm...
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / display / allwinner,sun4i-a10-tcon.yaml
1 # SPDX-License-Identifier: GPL-2.0
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/display/allwinner,sun4i-a10-tcon.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Allwinner A10 Timings Controller (TCON) Device Tree Bindings
8
9 maintainers:
10   - Chen-Yu Tsai <wens@csie.org>
11   - Maxime Ripard <mripard@kernel.org>
12
13 description: |
14   The TCON acts as a timing controller for RGB, LVDS and TV
15   interfaces.
16
17 properties:
18   "#clock-cells":
19     const: 0
20
21   compatible:
22     oneOf:
23       - const: allwinner,sun4i-a10-tcon
24       - const: allwinner,sun5i-a13-tcon
25       - const: allwinner,sun6i-a31-tcon
26       - const: allwinner,sun6i-a31s-tcon
27       - const: allwinner,sun7i-a20-tcon
28       - const: allwinner,sun8i-a23-tcon
29       - const: allwinner,sun8i-a33-tcon
30       - const: allwinner,sun8i-a83t-tcon-lcd
31       - const: allwinner,sun8i-a83t-tcon-tv
32       - const: allwinner,sun8i-r40-tcon-tv
33       - const: allwinner,sun8i-v3s-tcon
34       - const: allwinner,sun9i-a80-tcon-lcd
35       - const: allwinner,sun9i-a80-tcon-tv
36
37       - items:
38           - enum:
39               - allwinner,sun7i-a20-tcon0
40               - allwinner,sun7i-a20-tcon1
41           - const: allwinner,sun7i-a20-tcon
42
43       - items:
44           - enum:
45               - allwinner,sun50i-a64-tcon-lcd
46           - const: allwinner,sun8i-a83t-tcon-lcd
47
48       - items:
49           - enum:
50               - allwinner,sun8i-h3-tcon-tv
51               - allwinner,sun50i-a64-tcon-tv
52           - const: allwinner,sun8i-a83t-tcon-tv
53
54       - items:
55           - enum:
56               - allwinner,sun50i-h6-tcon-tv
57           - const: allwinner,sun8i-r40-tcon-tv
58
59   reg:
60     maxItems: 1
61
62   interrupts:
63     maxItems: 1
64
65   clocks:
66     minItems: 1
67     maxItems: 4
68
69   clock-names:
70     minItems: 1
71     maxItems: 4
72
73   clock-output-names:
74     description:
75       Name of the LCD pixel clock created.
76     $ref: /schemas/types.yaml#/definitions/string-array
77     maxItems: 1
78
79   dmas:
80     maxItems: 1
81
82   resets:
83     anyOf:
84       - items:
85           - description: TCON Reset Line
86
87       - items:
88           - description: TCON Reset Line
89           - description: TCON LVDS Reset Line
90
91       - items:
92           - description: TCON Reset Line
93           - description: TCON eDP Reset Line
94
95       - items:
96           - description: TCON Reset Line
97           - description: TCON eDP Reset Line
98           - description: TCON LVDS Reset Line
99
100   reset-names:
101     oneOf:
102       - const: lcd
103
104       - items:
105           - const: lcd
106           - const: lvds
107
108       - items:
109           - const: lcd
110           - const: edp
111
112       - items:
113           - const: lcd
114           - const: edp
115           - const: lvds
116
117   ports:
118     type: object
119     description: |
120       A ports node with endpoint definitions as defined in
121       Documentation/devicetree/bindings/media/video-interfaces.txt.
122
123     properties:
124       "#address-cells":
125         const: 1
126
127       "#size-cells":
128         const: 0
129
130       port@0:
131         type: object
132         description: |
133           Input endpoints of the controller.
134
135       port@1:
136         type: object
137         description: |
138           Output endpoints of the controller.
139
140         patternProperties:
141           "^endpoint(@[0-9])$":
142             type: object
143
144             properties:
145               allwinner,tcon-channel:
146                 $ref: /schemas/types.yaml#/definitions/uint32
147                 description: |
148                   TCON can have 1 or 2 channels, usually with the
149                   first channel being used for the panels interfaces
150                   (RGB, LVDS, etc.), and the second being used for the
151                   outputs that require another controller (TV Encoder,
152                   HDMI, etc.).
153
154                   If that property is present, specifies the TCON
155                   channel the endpoint is associated to. If that
156                   property is not present, the endpoint number will be
157                   used as the channel number.
158
159             unevaluatedProperties: true
160
161     required:
162       - "#address-cells"
163       - "#size-cells"
164       - port@0
165       - port@1
166
167     additionalProperties: false
168
169 required:
170   - compatible
171   - reg
172   - interrupts
173   - clocks
174   - clock-names
175   - resets
176   - ports
177
178 additionalProperties: false
179
180 allOf:
181   - if:
182       properties:
183         compatible:
184           contains:
185             enum:
186               - allwinner,sun4i-a10-tcon
187               - allwinner,sun5i-a13-tcon
188               - allwinner,sun7i-a20-tcon
189
190     then:
191       properties:
192         clocks:
193           minItems: 3
194
195         clock-names:
196           items:
197             - const: ahb
198             - const: tcon-ch0
199             - const: tcon-ch1
200
201   - if:
202       properties:
203         compatible:
204           contains:
205             enum:
206               - allwinner,sun6i-a31-tcon
207               - allwinner,sun6i-a31s-tcon
208
209     then:
210       properties:
211         clocks:
212           minItems: 4
213
214         clock-names:
215           items:
216             - const: ahb
217             - const: tcon-ch0
218             - const: tcon-ch1
219             - const: lvds-alt
220
221   - if:
222       properties:
223         compatible:
224           contains:
225             enum:
226               - allwinner,sun8i-a23-tcon
227               - allwinner,sun8i-a33-tcon
228
229     then:
230       properties:
231         clocks:
232           minItems: 3
233
234         clock-names:
235           items:
236             - const: ahb
237             - const: tcon-ch0
238             - const: lvds-alt
239
240   - if:
241       properties:
242         compatible:
243           contains:
244             enum:
245               - allwinner,sun8i-a83t-tcon-lcd
246               - allwinner,sun8i-v3s-tcon
247               - allwinner,sun9i-a80-tcon-lcd
248
249     then:
250       properties:
251         clocks:
252           minItems: 2
253
254         clock-names:
255           items:
256             - const: ahb
257             - const: tcon-ch0
258
259   - if:
260       properties:
261         compatible:
262           contains:
263             enum:
264               - allwinner,sun8i-a83t-tcon-tv
265               - allwinner,sun8i-r40-tcon-tv
266               - allwinner,sun9i-a80-tcon-tv
267
268     then:
269       properties:
270         clocks:
271           minItems: 2
272
273         clock-names:
274           items:
275             - const: ahb
276             - const: tcon-ch1
277
278   - if:
279       properties:
280         compatible:
281           contains:
282             enum:
283               - allwinner,sun5i-a13-tcon
284               - allwinner,sun6i-a31-tcon
285               - allwinner,sun6i-a31s-tcon
286               - allwinner,sun7i-a20-tcon
287               - allwinner,sun8i-a23-tcon
288               - allwinner,sun8i-a33-tcon
289               - allwinner,sun8i-v3s-tcon
290               - allwinner,sun9i-a80-tcon-lcd
291               - allwinner,sun4i-a10-tcon
292               - allwinner,sun8i-a83t-tcon-lcd
293
294     then:
295       required:
296         - "#clock-cells"
297         - clock-output-names
298
299   - if:
300       properties:
301         compatible:
302           contains:
303             enum:
304               - allwinner,sun6i-a31-tcon
305               - allwinner,sun6i-a31s-tcon
306               - allwinner,sun8i-a23-tcon
307               - allwinner,sun8i-a33-tcon
308               - allwinner,sun8i-a83t-tcon-lcd
309
310     then:
311       properties:
312         resets:
313           minItems: 2
314
315         reset-names:
316           items:
317             - const: lcd
318             - const: lvds
319
320   - if:
321       properties:
322         compatible:
323           contains:
324             enum:
325               - allwinner,sun9i-a80-tcon-lcd
326
327     then:
328       properties:
329         resets:
330           minItems: 3
331
332         reset-names:
333           items:
334             - const: lcd
335             - const: edp
336             - const: lvds
337
338   - if:
339       properties:
340         compatible:
341           contains:
342             enum:
343               - allwinner,sun9i-a80-tcon-tv
344
345     then:
346       properties:
347         resets:
348           minItems: 2
349
350         reset-names:
351           items:
352             - const: lcd
353             - const: edp
354
355   - if:
356       properties:
357         compatible:
358           contains:
359             enum:
360               - allwinner,sun4i-a10-tcon
361               - allwinner,sun5i-a13-tcon
362               - allwinner,sun6i-a31-tcon
363               - allwinner,sun6i-a31s-tcon
364               - allwinner,sun7i-a20-tcon
365               - allwinner,sun8i-a23-tcon
366               - allwinner,sun8i-a33-tcon
367
368     then:
369       required:
370         - dmas
371
372 examples:
373   - |
374     #include <dt-bindings/dma/sun4i-a10.h>
375
376     /*
377      * This comes from the clock/sun4i-a10-ccu.h and
378      * reset/sun4i-a10-ccu.h headers, but we can't include them since
379      * it would trigger a bunch of warnings for redefinitions of
380      * symbols with the other example.
381      */
382
383     #define CLK_AHB_LCD0        56
384     #define CLK_TCON0_CH0       149
385     #define CLK_TCON0_CH1       155
386     #define RST_TCON0           11
387
388     lcd-controller@1c0c000 {
389         compatible = "allwinner,sun4i-a10-tcon";
390         reg = <0x01c0c000 0x1000>;
391         interrupts = <44>;
392         resets = <&ccu RST_TCON0>;
393         reset-names = "lcd";
394         clocks = <&ccu CLK_AHB_LCD0>,
395                  <&ccu CLK_TCON0_CH0>,
396                  <&ccu CLK_TCON0_CH1>;
397         clock-names = "ahb",
398                       "tcon-ch0",
399                       "tcon-ch1";
400         clock-output-names = "tcon0-pixel-clock";
401         #clock-cells = <0>;
402         dmas = <&dma SUN4I_DMA_DEDICATED 14>;
403
404         ports {
405             #address-cells = <1>;
406             #size-cells = <0>;
407
408             port@0 {
409                 #address-cells = <1>;
410                 #size-cells = <0>;
411                 reg = <0>;
412
413                 endpoint@0 {
414                     reg = <0>;
415                     remote-endpoint = <&be0_out_tcon0>;
416                 };
417
418                 endpoint@1 {
419                     reg = <1>;
420                     remote-endpoint = <&be1_out_tcon0>;
421                 };
422             };
423
424             port@1 {
425                 #address-cells = <1>;
426                 #size-cells = <0>;
427                 reg = <1>;
428
429                 endpoint@1 {
430                     reg = <1>;
431                     remote-endpoint = <&hdmi_in_tcon0>;
432                     allwinner,tcon-channel = <1>;
433                 };
434             };
435         };
436     };
437
438     #undef CLK_AHB_LCD0
439     #undef CLK_TCON0_CH0
440     #undef CLK_TCON0_CH1
441     #undef RST_TCON0
442
443   - |
444     #include <dt-bindings/interrupt-controller/arm-gic.h>
445
446     /*
447      * This comes from the clock/sun6i-a31-ccu.h and
448      * reset/sun6i-a31-ccu.h headers, but we can't include them since
449      * it would trigger a bunch of warnings for redefinitions of
450      * symbols with the other example.
451      */
452
453     #define CLK_PLL_MIPI        15
454     #define CLK_AHB1_LCD0       47
455     #define CLK_LCD0_CH0        127
456     #define CLK_LCD0_CH1        129
457     #define RST_AHB1_LCD0       27
458     #define RST_AHB1_LVDS       41
459
460     lcd-controller@1c0c000 {
461         compatible = "allwinner,sun6i-a31-tcon";
462         reg = <0x01c0c000 0x1000>;
463         interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
464         dmas = <&dma 11>;
465         resets = <&ccu RST_AHB1_LCD0>, <&ccu RST_AHB1_LVDS>;
466         reset-names = "lcd", "lvds";
467         clocks = <&ccu CLK_AHB1_LCD0>,
468                  <&ccu CLK_LCD0_CH0>,
469                  <&ccu CLK_LCD0_CH1>,
470                  <&ccu CLK_PLL_MIPI>;
471         clock-names = "ahb",
472                       "tcon-ch0",
473                       "tcon-ch1",
474                       "lvds-alt";
475         clock-output-names = "tcon0-pixel-clock";
476         #clock-cells = <0>;
477
478         ports {
479             #address-cells = <1>;
480             #size-cells = <0>;
481
482             port@0 {
483                 #address-cells = <1>;
484                 #size-cells = <0>;
485                 reg = <0>;
486
487                 endpoint@0 {
488                     reg = <0>;
489                     remote-endpoint = <&drc0_out_tcon0>;
490                 };
491
492                 endpoint@1 {
493                     reg = <1>;
494                     remote-endpoint = <&drc1_out_tcon0>;
495                 };
496             };
497
498             port@1 {
499                 #address-cells = <1>;
500                 #size-cells = <0>;
501                 reg = <1>;
502
503                 endpoint@1 {
504                     reg = <1>;
505                     remote-endpoint = <&hdmi_in_tcon0>;
506                     allwinner,tcon-channel = <1>;
507                 };
508             };
509         };
510     };
511
512     #undef CLK_PLL_MIPI
513     #undef CLK_AHB1_LCD0
514     #undef CLK_LCD0_CH0
515     #undef CLK_LCD0_CH1
516     #undef RST_AHB1_LCD0
517     #undef RST_AHB1_LVDS
518
519   - |
520     #include <dt-bindings/interrupt-controller/arm-gic.h>
521
522     /*
523      * This comes from the clock/sun9i-a80-ccu.h and
524      * reset/sun9i-a80-ccu.h headers, but we can't include them since
525      * it would trigger a bunch of warnings for redefinitions of
526      * symbols with the other example.
527      */
528
529     #define CLK_BUS_LCD0        102
530     #define CLK_LCD0            58
531     #define RST_BUS_LCD0        22
532     #define RST_BUS_EDP         24
533     #define RST_BUS_LVDS        25
534
535     lcd-controller@3c00000 {
536         compatible = "allwinner,sun9i-a80-tcon-lcd";
537         reg = <0x03c00000 0x10000>;
538         interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
539         clocks = <&ccu CLK_BUS_LCD0>, <&ccu CLK_LCD0>;
540         clock-names = "ahb", "tcon-ch0";
541         resets = <&ccu RST_BUS_LCD0>, <&ccu RST_BUS_EDP>, <&ccu RST_BUS_LVDS>;
542         reset-names = "lcd", "edp", "lvds";
543         clock-output-names = "tcon0-pixel-clock";
544         #clock-cells = <0>;
545
546         ports {
547             #address-cells = <1>;
548             #size-cells = <0>;
549
550             port@0 {
551                 reg = <0>;
552
553                 endpoint {
554                     remote-endpoint = <&drc0_out_tcon0>;
555                 };
556             };
557
558             port@1 {
559                 reg = <1>;
560             };
561         };
562     };
563
564     #undef CLK_BUS_TCON0
565     #undef CLK_TCON0
566     #undef RST_BUS_TCON0
567     #undef RST_BUS_EDP
568     #undef RST_BUS_LVDS
569
570   - |
571     #include <dt-bindings/interrupt-controller/arm-gic.h>
572
573     /*
574      * This comes from the clock/sun8i-a83t-ccu.h and
575      * reset/sun8i-a83t-ccu.h headers, but we can't include them since
576      * it would trigger a bunch of warnings for redefinitions of
577      * symbols with the other example.
578      */
579
580     #define CLK_BUS_TCON0       36
581     #define CLK_TCON0           85
582     #define RST_BUS_TCON0       22
583     #define RST_BUS_LVDS        31
584
585     lcd-controller@1c0c000 {
586         compatible = "allwinner,sun8i-a83t-tcon-lcd";
587         reg = <0x01c0c000 0x1000>;
588         interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
589         clocks = <&ccu CLK_BUS_TCON0>, <&ccu CLK_TCON0>;
590         clock-names = "ahb", "tcon-ch0";
591         clock-output-names = "tcon-pixel-clock";
592         #clock-cells = <0>;
593         resets = <&ccu RST_BUS_TCON0>, <&ccu RST_BUS_LVDS>;
594         reset-names = "lcd", "lvds";
595
596         ports {
597             #address-cells = <1>;
598             #size-cells = <0>;
599
600             port@0 {
601                 #address-cells = <1>;
602                 #size-cells = <0>;
603                 reg = <0>;
604
605                 endpoint@0 {
606                     reg = <0>;
607                     remote-endpoint = <&mixer0_out_tcon0>;
608                 };
609
610                 endpoint@1 {
611                     reg = <1>;
612                     remote-endpoint = <&mixer1_out_tcon0>;
613                 };
614             };
615
616             port@1 {
617                 reg = <1>;
618             };
619         };
620     };
621
622     #undef CLK_BUS_TCON0
623     #undef CLK_TCON0
624     #undef RST_BUS_TCON0
625     #undef RST_BUS_LVDS
626
627   - |
628     #include <dt-bindings/interrupt-controller/arm-gic.h>
629
630     /*
631      * This comes from the clock/sun8i-r40-ccu.h and
632      * reset/sun8i-r40-ccu.h headers, but we can't include them since
633      * it would trigger a bunch of warnings for redefinitions of
634      * symbols with the other example.
635      */
636
637     #define CLK_BUS_TCON_TV0    73
638     #define RST_BUS_TCON_TV0    49
639
640     tcon_tv0: lcd-controller@1c73000 {
641         compatible = "allwinner,sun8i-r40-tcon-tv";
642         reg = <0x01c73000 0x1000>;
643         interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
644         clocks = <&ccu CLK_BUS_TCON_TV0>, <&tcon_top 0>;
645         clock-names = "ahb", "tcon-ch1";
646         resets = <&ccu RST_BUS_TCON_TV0>;
647         reset-names = "lcd";
648
649         ports {
650             #address-cells = <1>;
651             #size-cells = <0>;
652
653             port@0 {
654                 #address-cells = <1>;
655                 #size-cells = <0>;
656                 reg = <0>;
657
658                 endpoint@0 {
659                     reg = <0>;
660                     remote-endpoint = <&tcon_top_mixer0_out_tcon_tv0>;
661                 };
662
663                 endpoint@1 {
664                     reg = <1>;
665                     remote-endpoint = <&tcon_top_mixer1_out_tcon_tv0>;
666                 };
667             };
668
669             tcon_tv0_out: port@1 {
670                 #address-cells = <1>;
671                 #size-cells = <0>;
672                 reg = <1>;
673
674                 endpoint@1 {
675                     reg = <1>;
676                     remote-endpoint = <&tcon_top_hdmi_in_tcon_tv0>;
677                 };
678             };
679         };
680     };
681
682     #undef CLK_BUS_TCON_TV0
683     #undef RST_BUS_TCON_TV0
684
685 ...