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