summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml
blob: 84f11b987af83085bff3853edd91e3a6086d5671 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/allwinner,sun4i-a10-tcon.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner A10 Timings Controller (TCON)

maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Maxime Ripard <mripard@kernel.org>

description: |
  The TCON acts as a timing controller for RGB, LVDS and TV
  interfaces.

properties:
  "#clock-cells":
    const: 0

  compatible:
    oneOf:
      - const: allwinner,sun4i-a10-tcon
      - const: allwinner,sun5i-a13-tcon
      - const: allwinner,sun6i-a31-tcon
      - const: allwinner,sun6i-a31s-tcon
      - const: allwinner,sun7i-a20-tcon
      - const: allwinner,sun8i-a23-tcon
      - const: allwinner,sun8i-a33-tcon
      - const: allwinner,sun8i-a83t-tcon-lcd
      - const: allwinner,sun8i-a83t-tcon-tv
      - const: allwinner,sun8i-r40-tcon-tv
      - const: allwinner,sun8i-v3s-tcon
      - const: allwinner,sun9i-a80-tcon-lcd
      - const: allwinner,sun9i-a80-tcon-tv
      - const: allwinner,sun20i-d1-tcon-lcd
      - const: allwinner,sun20i-d1-tcon-tv

      - items:
          - enum:
              - allwinner,sun7i-a20-tcon0
              - allwinner,sun7i-a20-tcon1
          - const: allwinner,sun7i-a20-tcon

      - items:
          - enum:
              - allwinner,sun50i-a64-tcon-lcd
          - const: allwinner,sun8i-a83t-tcon-lcd

      - items:
          - enum:
              - allwinner,sun8i-h3-tcon-tv
              - allwinner,sun50i-a64-tcon-tv
          - const: allwinner,sun8i-a83t-tcon-tv

      - items:
          - enum:
              - allwinner,sun50i-h6-tcon-tv
          - const: allwinner,sun8i-r40-tcon-tv

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    minItems: 1
    maxItems: 4

  clock-names:
    minItems: 1
    maxItems: 4

  clock-output-names:
    description:
      Name of the LCD pixel clock created.
    maxItems: 1

  dmas:
    maxItems: 1

  resets:
    anyOf:
      - items:
          - description: TCON Reset Line

      - items:
          - description: TCON Reset Line
          - description: TCON LVDS Reset Line

      - items:
          - description: TCON Reset Line
          - description: TCON eDP Reset Line

      - items:
          - description: TCON Reset Line
          - description: TCON eDP Reset Line
          - description: TCON LVDS Reset Line

  reset-names:
    oneOf:
      - const: lcd

      - items:
          - const: lcd
          - const: lvds

      - items:
          - const: lcd
          - const: edp

      - items:
          - const: lcd
          - const: edp
          - const: lvds

  ports:
    $ref: /schemas/graph.yaml#/properties/ports

    properties:
      port@0:
        $ref: /schemas/graph.yaml#/properties/port
        description: |
          Input endpoints of the controller.

      port@1:
        $ref: /schemas/graph.yaml#/$defs/port-base
        unevaluatedProperties: false
        description: |
          Output endpoints of the controller.

        patternProperties:
          "^endpoint(@[0-9])$":
            $ref: /schemas/graph.yaml#/$defs/endpoint-base
            unevaluatedProperties: false

            properties:
              allwinner,tcon-channel:
                $ref: /schemas/types.yaml#/definitions/uint32
                description: |
                  TCON can have 1 or 2 channels, usually with the
                  first channel being used for the panels interfaces
                  (RGB, LVDS, etc.), and the second being used for the
                  outputs that require another controller (TV Encoder,
                  HDMI, etc.).

                  If that property is present, specifies the TCON
                  channel the endpoint is associated to. If that
                  property is not present, the endpoint number will be
                  used as the channel number.

    required:
      - port@0
      - port@1

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - resets
  - ports

additionalProperties: false

allOf:
  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun4i-a10-tcon
              - allwinner,sun5i-a13-tcon
              - allwinner,sun7i-a20-tcon

    then:
      properties:
        clocks:
          minItems: 3

        clock-names:
          items:
            - const: ahb
            - const: tcon-ch0
            - const: tcon-ch1

  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun6i-a31-tcon
              - allwinner,sun6i-a31s-tcon

    then:
      properties:
        clocks:
          minItems: 4

        clock-names:
          items:
            - const: ahb
            - const: tcon-ch0
            - const: tcon-ch1
            - const: lvds-alt

  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun8i-a23-tcon
              - allwinner,sun8i-a33-tcon

    then:
      properties:
        clocks:
          minItems: 3

        clock-names:
          items:
            - const: ahb
            - const: tcon-ch0
            - const: lvds-alt

  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun8i-a83t-tcon-lcd
              - allwinner,sun8i-v3s-tcon
              - allwinner,sun9i-a80-tcon-lcd

    then:
      properties:
        clocks:
          minItems: 2

        clock-names:
          items:
            - const: ahb
            - const: tcon-ch0

  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun8i-a83t-tcon-tv
              - allwinner,sun8i-r40-tcon-tv
              - allwinner,sun9i-a80-tcon-tv

    then:
      properties:
        clocks:
          minItems: 2

        clock-names:
          items:
            - const: ahb
            - const: tcon-ch1

  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun5i-a13-tcon
              - allwinner,sun6i-a31-tcon
              - allwinner,sun6i-a31s-tcon
              - allwinner,sun7i-a20-tcon
              - allwinner,sun8i-a23-tcon
              - allwinner,sun8i-a33-tcon
              - allwinner,sun8i-v3s-tcon
              - allwinner,sun9i-a80-tcon-lcd
              - allwinner,sun4i-a10-tcon
              - allwinner,sun8i-a83t-tcon-lcd

    then:
      required:
        - "#clock-cells"
        - clock-output-names

  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun6i-a31-tcon
              - allwinner,sun6i-a31s-tcon
              - allwinner,sun8i-a23-tcon
              - allwinner,sun8i-a33-tcon
              - allwinner,sun8i-a83t-tcon-lcd

    then:
      properties:
        resets:
          minItems: 2

        reset-names:
          items:
            - const: lcd
            - const: lvds

  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun9i-a80-tcon-lcd

    then:
      properties:
        resets:
          minItems: 3

        reset-names:
          items:
            - const: lcd
            - const: edp
            - const: lvds

  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun9i-a80-tcon-tv

    then:
      properties:
        resets:
          minItems: 2

        reset-names:
          items:
            - const: lcd
            - const: edp

  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun4i-a10-tcon
              - allwinner,sun5i-a13-tcon
              - allwinner,sun6i-a31-tcon
              - allwinner,sun6i-a31s-tcon
              - allwinner,sun7i-a20-tcon
              - allwinner,sun8i-a23-tcon
              - allwinner,sun8i-a33-tcon

    then:
      required:
        - dmas

examples:
  - |
    #include <dt-bindings/dma/sun4i-a10.h>

    /*
     * This comes from the clock/sun4i-a10-ccu.h and
     * reset/sun4i-a10-ccu.h headers, but we can't include them since
     * it would trigger a bunch of warnings for redefinitions of
     * symbols with the other example.
     */

    #define CLK_AHB_LCD0	56
    #define CLK_TCON0_CH0	149
    #define CLK_TCON0_CH1	155
    #define RST_TCON0		11

    lcd-controller@1c0c000 {
        compatible = "allwinner,sun4i-a10-tcon";
        reg = <0x01c0c000 0x1000>;
        interrupts = <44>;
        resets = <&ccu RST_TCON0>;
        reset-names = "lcd";
        clocks = <&ccu CLK_AHB_LCD0>,
                 <&ccu CLK_TCON0_CH0>,
                 <&ccu CLK_TCON0_CH1>;
        clock-names = "ahb",
                      "tcon-ch0",
                      "tcon-ch1";
        clock-output-names = "tcon0-pixel-clock";
        #clock-cells = <0>;
        dmas = <&dma SUN4I_DMA_DEDICATED 14>;

        ports {
            #address-cells = <1>;
            #size-cells = <0>;

            port@0 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0>;

                endpoint@0 {
                    reg = <0>;
                    remote-endpoint = <&be0_out_tcon0>;
                };

                endpoint@1 {
                    reg = <1>;
                    remote-endpoint = <&be1_out_tcon0>;
                };
            };

            port@1 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <1>;

                endpoint@1 {
                    reg = <1>;
                    remote-endpoint = <&hdmi_in_tcon0>;
                    allwinner,tcon-channel = <1>;
                };
            };
        };
    };

    #undef CLK_AHB_LCD0
    #undef CLK_TCON0_CH0
    #undef CLK_TCON0_CH1
    #undef RST_TCON0

  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    /*
     * This comes from the clock/sun6i-a31-ccu.h and
     * reset/sun6i-a31-ccu.h headers, but we can't include them since
     * it would trigger a bunch of warnings for redefinitions of
     * symbols with the other example.
     */

    #define CLK_PLL_MIPI	15
    #define CLK_AHB1_LCD0	47
    #define CLK_LCD0_CH0	127
    #define CLK_LCD0_CH1	129
    #define RST_AHB1_LCD0	27
    #define RST_AHB1_LVDS	41

    lcd-controller@1c0c000 {
        compatible = "allwinner,sun6i-a31-tcon";
        reg = <0x01c0c000 0x1000>;
        interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
        dmas = <&dma 11>;
        resets = <&ccu RST_AHB1_LCD0>, <&ccu RST_AHB1_LVDS>;
        reset-names = "lcd", "lvds";
        clocks = <&ccu CLK_AHB1_LCD0>,
                 <&ccu CLK_LCD0_CH0>,
                 <&ccu CLK_LCD0_CH1>,
                 <&ccu CLK_PLL_MIPI>;
        clock-names = "ahb",
                      "tcon-ch0",
                      "tcon-ch1",
                      "lvds-alt";
        clock-output-names = "tcon0-pixel-clock";
        #clock-cells = <0>;

        ports {
            #address-cells = <1>;
            #size-cells = <0>;

            port@0 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0>;

                endpoint@0 {
                    reg = <0>;
                    remote-endpoint = <&drc0_out_tcon0>;
                };

                endpoint@1 {
                    reg = <1>;
                    remote-endpoint = <&drc1_out_tcon0>;
                };
            };

            port@1 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <1>;

                endpoint@1 {
                    reg = <1>;
                    remote-endpoint = <&hdmi_in_tcon0>;
                    allwinner,tcon-channel = <1>;
                };
            };
        };
    };

    #undef CLK_PLL_MIPI
    #undef CLK_AHB1_LCD0
    #undef CLK_LCD0_CH0
    #undef CLK_LCD0_CH1
    #undef RST_AHB1_LCD0
    #undef RST_AHB1_LVDS

  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    /*
     * This comes from the clock/sun9i-a80-ccu.h and
     * reset/sun9i-a80-ccu.h headers, but we can't include them since
     * it would trigger a bunch of warnings for redefinitions of
     * symbols with the other example.
     */

    #define CLK_BUS_LCD0	102
    #define CLK_LCD0		58
    #define RST_BUS_LCD0	22
    #define RST_BUS_EDP		24
    #define RST_BUS_LVDS	25

    lcd-controller@3c00000 {
        compatible = "allwinner,sun9i-a80-tcon-lcd";
        reg = <0x03c00000 0x10000>;
        interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&ccu CLK_BUS_LCD0>, <&ccu CLK_LCD0>;
        clock-names = "ahb", "tcon-ch0";
        resets = <&ccu RST_BUS_LCD0>, <&ccu RST_BUS_EDP>, <&ccu RST_BUS_LVDS>;
        reset-names = "lcd", "edp", "lvds";
        clock-output-names = "tcon0-pixel-clock";
        #clock-cells = <0>;

        ports {
            #address-cells = <1>;
            #size-cells = <0>;

            port@0 {
                reg = <0>;

                endpoint {
                    remote-endpoint = <&drc0_out_tcon0>;
                };
            };

            port@1 {
                reg = <1>;
            };
        };
    };

    #undef CLK_BUS_TCON0
    #undef CLK_TCON0
    #undef RST_BUS_TCON0
    #undef RST_BUS_EDP
    #undef RST_BUS_LVDS

  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    /*
     * This comes from the clock/sun8i-a83t-ccu.h and
     * reset/sun8i-a83t-ccu.h headers, but we can't include them since
     * it would trigger a bunch of warnings for redefinitions of
     * symbols with the other example.
     */

    #define CLK_BUS_TCON0	36
    #define CLK_TCON0		85
    #define RST_BUS_TCON0	22
    #define RST_BUS_LVDS	31

    lcd-controller@1c0c000 {
        compatible = "allwinner,sun8i-a83t-tcon-lcd";
        reg = <0x01c0c000 0x1000>;
        interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&ccu CLK_BUS_TCON0>, <&ccu CLK_TCON0>;
        clock-names = "ahb", "tcon-ch0";
        clock-output-names = "tcon-pixel-clock";
        #clock-cells = <0>;
        resets = <&ccu RST_BUS_TCON0>, <&ccu RST_BUS_LVDS>;
        reset-names = "lcd", "lvds";

        ports {
            #address-cells = <1>;
            #size-cells = <0>;

            port@0 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0>;

                endpoint@0 {
                    reg = <0>;
                    remote-endpoint = <&mixer0_out_tcon0>;
                };

                endpoint@1 {
                    reg = <1>;
                    remote-endpoint = <&mixer1_out_tcon0>;
                };
            };

            port@1 {
                reg = <1>;
            };
        };
    };

    #undef CLK_BUS_TCON0
    #undef CLK_TCON0
    #undef RST_BUS_TCON0
    #undef RST_BUS_LVDS

  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    /*
     * This comes from the clock/sun8i-r40-ccu.h and
     * reset/sun8i-r40-ccu.h headers, but we can't include them since
     * it would trigger a bunch of warnings for redefinitions of
     * symbols with the other example.
     */

    #define CLK_BUS_TCON_TV0	73
    #define RST_BUS_TCON_TV0	49

    tcon_tv0: lcd-controller@1c73000 {
        compatible = "allwinner,sun8i-r40-tcon-tv";
        reg = <0x01c73000 0x1000>;
        interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&ccu CLK_BUS_TCON_TV0>, <&tcon_top 0>;
        clock-names = "ahb", "tcon-ch1";
        resets = <&ccu RST_BUS_TCON_TV0>;
        reset-names = "lcd";

        ports {
            #address-cells = <1>;
            #size-cells = <0>;

            port@0 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0>;

                endpoint@0 {
                    reg = <0>;
                    remote-endpoint = <&tcon_top_mixer0_out_tcon_tv0>;
                };

                endpoint@1 {
                    reg = <1>;
                    remote-endpoint = <&tcon_top_mixer1_out_tcon_tv0>;
                };
            };

            tcon_tv0_out: port@1 {
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <1>;

                endpoint@1 {
                    reg = <1>;
                    remote-endpoint = <&tcon_top_hdmi_in_tcon_tv0>;
                };
            };
        };
    };

    #undef CLK_BUS_TCON_TV0
    #undef RST_BUS_TCON_TV0

...