xref: /freebsd/sys/contrib/device-tree/Bindings/display/allwinner,sun8i-r40-tcon-top.yaml (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/display/allwinner,sun8i-r40-tcon-top.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7*7ef62cebSEmmanuel Vadottitle: Allwinner R40 TCON TOP
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Chen-Yu Tsai <wens@csie.org>
11c66ec88fSEmmanuel Vadot  - Maxime Ripard <mripard@kernel.org>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotdescription: |
14c66ec88fSEmmanuel Vadot  TCON TOPs main purpose is to configure whole display pipeline. It
15c66ec88fSEmmanuel Vadot  determines relationships between mixers and TCONs, selects source
16c66ec88fSEmmanuel Vadot  TCON for HDMI, muxes LCD and TV encoder GPIO output, selects TV
17c66ec88fSEmmanuel Vadot  encoder clock source and contains additional TV TCON and DSI gates.
18c66ec88fSEmmanuel Vadot
19c66ec88fSEmmanuel Vadot  It allows display pipeline to be configured in very different ways:
20c66ec88fSEmmanuel Vadot
21c66ec88fSEmmanuel Vadot                                  / LCD0/LVDS0
22c66ec88fSEmmanuel Vadot                   / [0] TCON-LCD0
23c66ec88fSEmmanuel Vadot                   |              \ MIPI DSI
24c66ec88fSEmmanuel Vadot   mixer0          |
25c66ec88fSEmmanuel Vadot          \        / [1] TCON-LCD1 - LCD1/LVDS1
26c66ec88fSEmmanuel Vadot           TCON-TOP
27c66ec88fSEmmanuel Vadot          /        \ [2] TCON-TV0 [0] - TVE0/RGB
28c66ec88fSEmmanuel Vadot   mixer1          |                  \
29c66ec88fSEmmanuel Vadot                   |                   TCON-TOP - HDMI
30c66ec88fSEmmanuel Vadot                   |                  /
31c66ec88fSEmmanuel Vadot                   \ [3] TCON-TV1 [1] - TVE1/RGB
32c66ec88fSEmmanuel Vadot
33c66ec88fSEmmanuel Vadot  Note that both TCON TOP references same physical unit. Both mixers
34c66ec88fSEmmanuel Vadot  can be connected to any TCON. Not all TCON TOP variants support all
35c66ec88fSEmmanuel Vadot  features.
36c66ec88fSEmmanuel Vadot
37c66ec88fSEmmanuel Vadotproperties:
38c66ec88fSEmmanuel Vadot  "#clock-cells":
39c66ec88fSEmmanuel Vadot    const: 1
40c66ec88fSEmmanuel Vadot
41c66ec88fSEmmanuel Vadot  compatible:
42c66ec88fSEmmanuel Vadot    enum:
43c66ec88fSEmmanuel Vadot      - allwinner,sun8i-r40-tcon-top
44d5b0e70fSEmmanuel Vadot      - allwinner,sun20i-d1-tcon-top
45c66ec88fSEmmanuel Vadot      - allwinner,sun50i-h6-tcon-top
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel Vadot  reg:
48c66ec88fSEmmanuel Vadot    maxItems: 1
49c66ec88fSEmmanuel Vadot
50c66ec88fSEmmanuel Vadot  clocks:
51c66ec88fSEmmanuel Vadot    minItems: 2
52d5b0e70fSEmmanuel Vadot    maxItems: 6
53c66ec88fSEmmanuel Vadot
54c66ec88fSEmmanuel Vadot  clock-names:
55c66ec88fSEmmanuel Vadot    minItems: 2
56d5b0e70fSEmmanuel Vadot    maxItems: 6
57c66ec88fSEmmanuel Vadot
58c66ec88fSEmmanuel Vadot  clock-output-names:
59c66ec88fSEmmanuel Vadot    minItems: 1
60c66ec88fSEmmanuel Vadot    maxItems: 3
61c66ec88fSEmmanuel Vadot
62c66ec88fSEmmanuel Vadot  resets:
63c66ec88fSEmmanuel Vadot    maxItems: 1
64c66ec88fSEmmanuel Vadot
65c66ec88fSEmmanuel Vadot  ports:
665def4c47SEmmanuel Vadot    $ref: /schemas/graph.yaml#/properties/ports
67c66ec88fSEmmanuel Vadot
68c66ec88fSEmmanuel Vadot    properties:
69c66ec88fSEmmanuel Vadot      port@0:
705def4c47SEmmanuel Vadot        $ref: /schemas/graph.yaml#/properties/port
71c66ec88fSEmmanuel Vadot        description: |
72c66ec88fSEmmanuel Vadot          Input endpoint for Mixer 0 mux.
73c66ec88fSEmmanuel Vadot
74c66ec88fSEmmanuel Vadot      port@1:
755def4c47SEmmanuel Vadot        $ref: /schemas/graph.yaml#/properties/port
76c66ec88fSEmmanuel Vadot        description: |
77c66ec88fSEmmanuel Vadot          Output endpoint for Mixer 0 mux
78c66ec88fSEmmanuel Vadot
79c66ec88fSEmmanuel Vadot      port@2:
805def4c47SEmmanuel Vadot        $ref: /schemas/graph.yaml#/properties/port
81c66ec88fSEmmanuel Vadot        description: |
82c66ec88fSEmmanuel Vadot          Input endpoint for Mixer 1 mux.
83c66ec88fSEmmanuel Vadot
84c66ec88fSEmmanuel Vadot      port@3:
855def4c47SEmmanuel Vadot        $ref: /schemas/graph.yaml#/properties/port
86c66ec88fSEmmanuel Vadot        description: |
87c66ec88fSEmmanuel Vadot          Output endpoint for Mixer 1 mux
88c66ec88fSEmmanuel Vadot
89c66ec88fSEmmanuel Vadot      port@4:
905def4c47SEmmanuel Vadot        $ref: /schemas/graph.yaml#/properties/port
91c66ec88fSEmmanuel Vadot        description: |
92c66ec88fSEmmanuel Vadot          Input endpoint for HDMI mux.
93c66ec88fSEmmanuel Vadot
94c66ec88fSEmmanuel Vadot      port@5:
955def4c47SEmmanuel Vadot        $ref: /schemas/graph.yaml#/properties/port
96c66ec88fSEmmanuel Vadot        description: |
97c66ec88fSEmmanuel Vadot          Output endpoint for HDMI mux
98c66ec88fSEmmanuel Vadot
99c66ec88fSEmmanuel Vadot    required:
100c66ec88fSEmmanuel Vadot      - port@0
101c66ec88fSEmmanuel Vadot      - port@1
102c66ec88fSEmmanuel Vadot      - port@4
103c66ec88fSEmmanuel Vadot      - port@5
104c66ec88fSEmmanuel Vadot
105c66ec88fSEmmanuel Vadotrequired:
106c66ec88fSEmmanuel Vadot  - "#clock-cells"
107c66ec88fSEmmanuel Vadot  - compatible
108c66ec88fSEmmanuel Vadot  - reg
109c66ec88fSEmmanuel Vadot  - clocks
110c66ec88fSEmmanuel Vadot  - clock-names
111c66ec88fSEmmanuel Vadot  - clock-output-names
112c66ec88fSEmmanuel Vadot  - resets
113c66ec88fSEmmanuel Vadot  - ports
114c66ec88fSEmmanuel Vadot
115c66ec88fSEmmanuel VadotadditionalProperties: false
116c66ec88fSEmmanuel Vadot
117d5b0e70fSEmmanuel VadotallOf:
118d5b0e70fSEmmanuel Vadot  - if:
119d5b0e70fSEmmanuel Vadot      properties:
120d5b0e70fSEmmanuel Vadot        compatible:
121d5b0e70fSEmmanuel Vadot          contains:
122d5b0e70fSEmmanuel Vadot            const: allwinner,sun8i-r40-tcon-top
123d5b0e70fSEmmanuel Vadot
124d5b0e70fSEmmanuel Vadot    then:
125d5b0e70fSEmmanuel Vadot      properties:
126d5b0e70fSEmmanuel Vadot        clocks:
127d5b0e70fSEmmanuel Vadot          items:
128d5b0e70fSEmmanuel Vadot            - description: The TCON TOP interface clock
129d5b0e70fSEmmanuel Vadot            - description: The TCON TOP TV0 clock
130d5b0e70fSEmmanuel Vadot            - description: The TCON TOP TVE0 clock
131d5b0e70fSEmmanuel Vadot            - description: The TCON TOP TV1 clock
132d5b0e70fSEmmanuel Vadot            - description: The TCON TOP TVE1 clock
133d5b0e70fSEmmanuel Vadot            - description: The TCON TOP MIPI DSI clock
134d5b0e70fSEmmanuel Vadot
135d5b0e70fSEmmanuel Vadot        clock-names:
136d5b0e70fSEmmanuel Vadot          items:
137d5b0e70fSEmmanuel Vadot            - const: bus
138d5b0e70fSEmmanuel Vadot            - const: tcon-tv0
139d5b0e70fSEmmanuel Vadot            - const: tve0
140d5b0e70fSEmmanuel Vadot            - const: tcon-tv1
141d5b0e70fSEmmanuel Vadot            - const: tve1
142d5b0e70fSEmmanuel Vadot            - const: dsi
143d5b0e70fSEmmanuel Vadot
144d5b0e70fSEmmanuel Vadot        clock-output-names:
145d5b0e70fSEmmanuel Vadot          items:
146d5b0e70fSEmmanuel Vadot            - description: TCON TV0 output clock name
147d5b0e70fSEmmanuel Vadot            - description: TCON TV1 output clock name
148d5b0e70fSEmmanuel Vadot            - description: DSI output clock name
149d5b0e70fSEmmanuel Vadot
150d5b0e70fSEmmanuel Vadot        ports:
151d5b0e70fSEmmanuel Vadot          required:
152d5b0e70fSEmmanuel Vadot            - port@2
153d5b0e70fSEmmanuel Vadot            - port@3
154d5b0e70fSEmmanuel Vadot
155d5b0e70fSEmmanuel Vadot  - if:
156d5b0e70fSEmmanuel Vadot      properties:
157d5b0e70fSEmmanuel Vadot        compatible:
158d5b0e70fSEmmanuel Vadot          contains:
159d5b0e70fSEmmanuel Vadot            const: allwinner,sun20i-d1-tcon-top
160d5b0e70fSEmmanuel Vadot
161d5b0e70fSEmmanuel Vadot    then:
162d5b0e70fSEmmanuel Vadot      properties:
163d5b0e70fSEmmanuel Vadot        clocks:
164d5b0e70fSEmmanuel Vadot          items:
165d5b0e70fSEmmanuel Vadot            - description: The TCON TOP interface clock
166d5b0e70fSEmmanuel Vadot            - description: The TCON TOP TV0 clock
167d5b0e70fSEmmanuel Vadot            - description: The TCON TOP TVE0 clock
168d5b0e70fSEmmanuel Vadot            - description: The TCON TOP MIPI DSI clock
169d5b0e70fSEmmanuel Vadot
170d5b0e70fSEmmanuel Vadot        clock-names:
171d5b0e70fSEmmanuel Vadot          items:
172d5b0e70fSEmmanuel Vadot            - const: bus
173d5b0e70fSEmmanuel Vadot            - const: tcon-tv0
174d5b0e70fSEmmanuel Vadot            - const: tve0
175d5b0e70fSEmmanuel Vadot            - const: dsi
176d5b0e70fSEmmanuel Vadot
177d5b0e70fSEmmanuel Vadot        clock-output-names:
178d5b0e70fSEmmanuel Vadot          items:
179d5b0e70fSEmmanuel Vadot            - description: TCON TV0 output clock name
180d5b0e70fSEmmanuel Vadot            - description: DSI output clock name
181d5b0e70fSEmmanuel Vadot
182d5b0e70fSEmmanuel Vadot  - if:
183c66ec88fSEmmanuel Vadot      properties:
184c66ec88fSEmmanuel Vadot        compatible:
185c66ec88fSEmmanuel Vadot          contains:
186c66ec88fSEmmanuel Vadot            const: allwinner,sun50i-h6-tcon-top
187c66ec88fSEmmanuel Vadot
188c66ec88fSEmmanuel Vadot    then:
189c66ec88fSEmmanuel Vadot      properties:
190c66ec88fSEmmanuel Vadot        clocks:
191d5b0e70fSEmmanuel Vadot          items:
192d5b0e70fSEmmanuel Vadot            - description: The TCON TOP interface clock
193d5b0e70fSEmmanuel Vadot            - description: The TCON TOP TV0 clock
194d5b0e70fSEmmanuel Vadot
195d5b0e70fSEmmanuel Vadot        clock-names:
196d5b0e70fSEmmanuel Vadot          items:
197d5b0e70fSEmmanuel Vadot            - const: bus
198d5b0e70fSEmmanuel Vadot            - const: tcon-tv0
199c66ec88fSEmmanuel Vadot
200c66ec88fSEmmanuel Vadot        clock-output-names:
201d5b0e70fSEmmanuel Vadot          items:
202d5b0e70fSEmmanuel Vadot            - description: TCON TV0 output clock name
203c66ec88fSEmmanuel Vadot
204c66ec88fSEmmanuel Vadotexamples:
205c66ec88fSEmmanuel Vadot  - |
206c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
207c66ec88fSEmmanuel Vadot
208c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/sun8i-r40-ccu.h>
209c66ec88fSEmmanuel Vadot    #include <dt-bindings/reset/sun8i-r40-ccu.h>
210c66ec88fSEmmanuel Vadot
211c66ec88fSEmmanuel Vadot      tcon_top: tcon-top@1c70000 {
212c66ec88fSEmmanuel Vadot          compatible = "allwinner,sun8i-r40-tcon-top";
213c66ec88fSEmmanuel Vadot          reg = <0x01c70000 0x1000>;
214c66ec88fSEmmanuel Vadot          clocks = <&ccu CLK_BUS_TCON_TOP>,
215c66ec88fSEmmanuel Vadot                   <&ccu CLK_TCON_TV0>,
216c66ec88fSEmmanuel Vadot                   <&ccu CLK_TVE0>,
217c66ec88fSEmmanuel Vadot                   <&ccu CLK_TCON_TV1>,
218c66ec88fSEmmanuel Vadot                   <&ccu CLK_TVE1>,
219c66ec88fSEmmanuel Vadot                   <&ccu CLK_DSI_DPHY>;
220c66ec88fSEmmanuel Vadot          clock-names = "bus",
221c66ec88fSEmmanuel Vadot                        "tcon-tv0",
222c66ec88fSEmmanuel Vadot                        "tve0",
223c66ec88fSEmmanuel Vadot                        "tcon-tv1",
224c66ec88fSEmmanuel Vadot                        "tve1",
225c66ec88fSEmmanuel Vadot                        "dsi";
226c66ec88fSEmmanuel Vadot          clock-output-names = "tcon-top-tv0",
227c66ec88fSEmmanuel Vadot                               "tcon-top-tv1",
228c66ec88fSEmmanuel Vadot                               "tcon-top-dsi";
229c66ec88fSEmmanuel Vadot          resets = <&ccu RST_BUS_TCON_TOP>;
230c66ec88fSEmmanuel Vadot          #clock-cells = <1>;
231c66ec88fSEmmanuel Vadot
232c66ec88fSEmmanuel Vadot          ports {
233c66ec88fSEmmanuel Vadot              #address-cells = <1>;
234c66ec88fSEmmanuel Vadot              #size-cells = <0>;
235c66ec88fSEmmanuel Vadot
236c66ec88fSEmmanuel Vadot              tcon_top_mixer0_in: port@0 {
237c66ec88fSEmmanuel Vadot                  reg = <0>;
238c66ec88fSEmmanuel Vadot
239c66ec88fSEmmanuel Vadot                  tcon_top_mixer0_in_mixer0: endpoint {
240c66ec88fSEmmanuel Vadot                      remote-endpoint = <&mixer0_out_tcon_top>;
241c66ec88fSEmmanuel Vadot                  };
242c66ec88fSEmmanuel Vadot              };
243c66ec88fSEmmanuel Vadot
244c66ec88fSEmmanuel Vadot              tcon_top_mixer0_out: port@1 {
245c66ec88fSEmmanuel Vadot                  #address-cells = <1>;
246c66ec88fSEmmanuel Vadot                  #size-cells = <0>;
247c66ec88fSEmmanuel Vadot                  reg = <1>;
248c66ec88fSEmmanuel Vadot
249c66ec88fSEmmanuel Vadot                  tcon_top_mixer0_out_tcon_lcd0: endpoint@0 {
250c66ec88fSEmmanuel Vadot                      reg = <0>;
251c66ec88fSEmmanuel Vadot                  };
252c66ec88fSEmmanuel Vadot
253c66ec88fSEmmanuel Vadot                  tcon_top_mixer0_out_tcon_lcd1: endpoint@1 {
254c66ec88fSEmmanuel Vadot                      reg = <1>;
255c66ec88fSEmmanuel Vadot                  };
256c66ec88fSEmmanuel Vadot
257c66ec88fSEmmanuel Vadot                  tcon_top_mixer0_out_tcon_tv0: endpoint@2 {
258c66ec88fSEmmanuel Vadot                      reg = <2>;
259c66ec88fSEmmanuel Vadot                      remote-endpoint = <&tcon_tv0_in_tcon_top_mixer0>;
260c66ec88fSEmmanuel Vadot                  };
261c66ec88fSEmmanuel Vadot
262c66ec88fSEmmanuel Vadot                  tcon_top_mixer0_out_tcon_tv1: endpoint@3 {
263c66ec88fSEmmanuel Vadot                      reg = <3>;
264c66ec88fSEmmanuel Vadot                      remote-endpoint = <&tcon_tv1_in_tcon_top_mixer0>;
265c66ec88fSEmmanuel Vadot                  };
266c66ec88fSEmmanuel Vadot              };
267c66ec88fSEmmanuel Vadot
268c66ec88fSEmmanuel Vadot              tcon_top_mixer1_in: port@2 {
269c66ec88fSEmmanuel Vadot                  #address-cells = <1>;
270c66ec88fSEmmanuel Vadot                  #size-cells = <0>;
271c66ec88fSEmmanuel Vadot                  reg = <2>;
272c66ec88fSEmmanuel Vadot
273c66ec88fSEmmanuel Vadot                  tcon_top_mixer1_in_mixer1: endpoint@1 {
274c66ec88fSEmmanuel Vadot                      reg = <1>;
275c66ec88fSEmmanuel Vadot                      remote-endpoint = <&mixer1_out_tcon_top>;
276c66ec88fSEmmanuel Vadot                  };
277c66ec88fSEmmanuel Vadot              };
278c66ec88fSEmmanuel Vadot
279c66ec88fSEmmanuel Vadot              tcon_top_mixer1_out: port@3 {
280c66ec88fSEmmanuel Vadot                  #address-cells = <1>;
281c66ec88fSEmmanuel Vadot                  #size-cells = <0>;
282c66ec88fSEmmanuel Vadot                  reg = <3>;
283c66ec88fSEmmanuel Vadot
284c66ec88fSEmmanuel Vadot                  tcon_top_mixer1_out_tcon_lcd0: endpoint@0 {
285c66ec88fSEmmanuel Vadot                      reg = <0>;
286c66ec88fSEmmanuel Vadot                  };
287c66ec88fSEmmanuel Vadot
288c66ec88fSEmmanuel Vadot                  tcon_top_mixer1_out_tcon_lcd1: endpoint@1 {
289c66ec88fSEmmanuel Vadot                      reg = <1>;
290c66ec88fSEmmanuel Vadot                  };
291c66ec88fSEmmanuel Vadot
292c66ec88fSEmmanuel Vadot                  tcon_top_mixer1_out_tcon_tv0: endpoint@2 {
293c66ec88fSEmmanuel Vadot                      reg = <2>;
294c66ec88fSEmmanuel Vadot                      remote-endpoint = <&tcon_tv0_in_tcon_top_mixer1>;
295c66ec88fSEmmanuel Vadot                  };
296c66ec88fSEmmanuel Vadot
297c66ec88fSEmmanuel Vadot                  tcon_top_mixer1_out_tcon_tv1: endpoint@3 {
298c66ec88fSEmmanuel Vadot                      reg = <3>;
299c66ec88fSEmmanuel Vadot                      remote-endpoint = <&tcon_tv1_in_tcon_top_mixer1>;
300c66ec88fSEmmanuel Vadot                  };
301c66ec88fSEmmanuel Vadot              };
302c66ec88fSEmmanuel Vadot
303c66ec88fSEmmanuel Vadot              tcon_top_hdmi_in: port@4 {
304c66ec88fSEmmanuel Vadot                  #address-cells = <1>;
305c66ec88fSEmmanuel Vadot                  #size-cells = <0>;
306c66ec88fSEmmanuel Vadot                  reg = <4>;
307c66ec88fSEmmanuel Vadot
308c66ec88fSEmmanuel Vadot                  tcon_top_hdmi_in_tcon_tv0: endpoint@0 {
309c66ec88fSEmmanuel Vadot                      reg = <0>;
310c66ec88fSEmmanuel Vadot                      remote-endpoint = <&tcon_tv0_out_tcon_top>;
311c66ec88fSEmmanuel Vadot                  };
312c66ec88fSEmmanuel Vadot
313c66ec88fSEmmanuel Vadot                  tcon_top_hdmi_in_tcon_tv1: endpoint@1 {
314c66ec88fSEmmanuel Vadot                      reg = <1>;
315c66ec88fSEmmanuel Vadot                      remote-endpoint = <&tcon_tv1_out_tcon_top>;
316c66ec88fSEmmanuel Vadot                  };
317c66ec88fSEmmanuel Vadot              };
318c66ec88fSEmmanuel Vadot
319c66ec88fSEmmanuel Vadot              tcon_top_hdmi_out: port@5 {
320c66ec88fSEmmanuel Vadot                  reg = <5>;
321c66ec88fSEmmanuel Vadot
322c66ec88fSEmmanuel Vadot                  tcon_top_hdmi_out_hdmi: endpoint {
323c66ec88fSEmmanuel Vadot                      remote-endpoint = <&hdmi_in_tcon_top>;
324c66ec88fSEmmanuel Vadot                  };
325c66ec88fSEmmanuel Vadot              };
326c66ec88fSEmmanuel Vadot          };
327c66ec88fSEmmanuel Vadot      };
328c66ec88fSEmmanuel Vadot
329c66ec88fSEmmanuel Vadot...
330