Merge tag 'tilcdc-4.15-fixes' of https://github.com/jsarha/linux into drm-next
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / display / sunxi / sun4i-drm.txt
1 Allwinner A10 Display Pipeline
2 ==============================
3
4 The Allwinner A10 Display pipeline is composed of several components
5 that are going to be documented below:
6
7 For all connections between components up to the TCONs in the display
8 pipeline, when there are multiple components of the same type at the
9 same depth, the local endpoint ID must be the same as the remote
10 component's index. For example, if the remote endpoint is Frontend 1,
11 then the local endpoint ID must be 1.
12
13     Frontend 0  [0] ------- [0]  Backend 0  [0] ------- [0]  TCON 0
14                 [1] --   -- [1]             [1] --   -- [1]
15                       \ /                         \ /
16                        X                           X
17                       / \                         / \
18                 [0] --   -- [0]             [0] --   -- [0]
19     Frontend 1  [1] ------- [1]  Backend 1  [1] ------- [1]  TCON 1
20
21 For a two pipeline system such as the one depicted above, the lines
22 represent the connections between the components, while the numbers
23 within the square brackets corresponds to the ID of the local endpoint.
24
25 The same rule also applies to DE 2.0 mixer-TCON connections:
26
27     Mixer 0  [0] ----------- [0]  TCON 0
28              [1] ----   ---- [1]
29                      \ /
30                       X
31                      / \
32              [0] ----   ---- [0]
33     Mixer 1  [1] ----------- [1]  TCON 1
34
35 HDMI Encoder
36 ------------
37
38 The HDMI Encoder supports the HDMI video and audio outputs, and does
39 CEC. It is one end of the pipeline.
40
41 Required properties:
42   - compatible: value must be one of:
43     * allwinner,sun4i-a10-hdmi
44     * allwinner,sun5i-a10s-hdmi
45     * allwinner,sun6i-a31-hdmi
46   - reg: base address and size of memory-mapped region
47   - interrupts: interrupt associated to this IP
48   - clocks: phandles to the clocks feeding the HDMI encoder
49     * ahb: the HDMI interface clock
50     * mod: the HDMI module clock
51     * ddc: the HDMI ddc clock (A31 only)
52     * pll-0: the first video PLL
53     * pll-1: the second video PLL
54   - clock-names: the clock names mentioned above
55   - resets: phandle to the reset control for the HDMI encoder (A31 only)
56   - dmas: phandles to the DMA channels used by the HDMI encoder
57     * ddc-tx: The channel for DDC transmission
58     * ddc-rx: The channel for DDC reception
59     * audio-tx: The channel used for audio transmission
60   - dma-names: the channel names mentioned above
61
62   - ports: A ports node with endpoint definitions as defined in
63     Documentation/devicetree/bindings/media/video-interfaces.txt. The
64     first port should be the input endpoint. The second should be the
65     output, usually to an HDMI connector.
66
67 TV Encoder
68 ----------
69
70 The TV Encoder supports the composite and VGA output. It is one end of
71 the pipeline.
72
73 Required properties:
74  - compatible: value should be "allwinner,sun4i-a10-tv-encoder".
75  - reg: base address and size of memory-mapped region
76  - clocks: the clocks driving the TV encoder
77  - resets: phandle to the reset controller driving the encoder
78
79 - ports: A ports node with endpoint definitions as defined in
80   Documentation/devicetree/bindings/media/video-interfaces.txt. The
81   first port should be the input endpoint.
82
83 TCON
84 ----
85
86 The TCON acts as a timing controller for RGB, LVDS and TV interfaces.
87
88 Required properties:
89  - compatible: value must be either:
90    * allwinner,sun4i-a10-tcon
91    * allwinner,sun5i-a13-tcon
92    * allwinner,sun6i-a31-tcon
93    * allwinner,sun6i-a31s-tcon
94    * allwinner,sun7i-a20-tcon
95    * allwinner,sun8i-a33-tcon
96    * allwinner,sun8i-v3s-tcon
97  - reg: base address and size of memory-mapped region
98  - interrupts: interrupt associated to this IP
99  - clocks: phandles to the clocks feeding the TCON. Three are needed:
100    - 'ahb': the interface clocks
101    - 'tcon-ch0': The clock driving the TCON channel 0
102  - resets: phandles to the reset controllers driving the encoder
103    - "lcd": the reset line for the TCON channel 0
104
105  - clock-names: the clock names mentioned above
106  - reset-names: the reset names mentioned above
107  - clock-output-names: Name of the pixel clock created
108
109 - ports: A ports node with endpoint definitions as defined in
110   Documentation/devicetree/bindings/media/video-interfaces.txt. The
111   first port should be the input endpoint, the second one the output
112
113   The output may have multiple endpoints. The TCON has two channels,
114   usually with the first channel being used for the panels interfaces
115   (RGB, LVDS, etc.), and the second being used for the outputs that
116   require another controller (TV Encoder, HDMI, etc.). The endpoints
117   will take an extra property, allwinner,tcon-channel, to specify the
118   channel the endpoint is associated to. If that property is not
119   present, the endpoint number will be used as the channel number.
120
121 On SoCs other than the A33 and V3s, there is one more clock required:
122    - 'tcon-ch1': The clock driving the TCON channel 1
123
124 DRC
125 ---
126
127 The DRC (Dynamic Range Controller), found in the latest Allwinner SoCs
128 (A31, A23, A33), allows to dynamically adjust pixel
129 brightness/contrast based on histogram measurements for LCD content
130 adaptive backlight control.
131
132
133 Required properties:
134   - compatible: value must be one of:
135     * allwinner,sun6i-a31-drc
136     * allwinner,sun6i-a31s-drc
137     * allwinner,sun8i-a33-drc
138   - reg: base address and size of the memory-mapped region.
139   - interrupts: interrupt associated to this IP
140   - clocks: phandles to the clocks feeding the DRC
141     * ahb: the DRC interface clock
142     * mod: the DRC module clock
143     * ram: the DRC DRAM clock
144   - clock-names: the clock names mentioned above
145   - resets: phandles to the reset line driving the DRC
146
147 - ports: A ports node with endpoint definitions as defined in
148   Documentation/devicetree/bindings/media/video-interfaces.txt. The
149   first port should be the input endpoints, the second one the outputs
150
151 Display Engine Backend
152 ----------------------
153
154 The display engine backend exposes layers and sprites to the
155 system.
156
157 Required properties:
158   - compatible: value must be one of:
159     * allwinner,sun4i-a10-display-backend
160     * allwinner,sun5i-a13-display-backend
161     * allwinner,sun6i-a31-display-backend
162     * allwinner,sun7i-a20-display-backend
163     * allwinner,sun8i-a33-display-backend
164   - reg: base address and size of the memory-mapped region.
165   - interrupts: interrupt associated to this IP
166   - clocks: phandles to the clocks feeding the frontend and backend
167     * ahb: the backend interface clock
168     * mod: the backend module clock
169     * ram: the backend DRAM clock
170   - clock-names: the clock names mentioned above
171   - resets: phandles to the reset controllers driving the backend
172
173 - ports: A ports node with endpoint definitions as defined in
174   Documentation/devicetree/bindings/media/video-interfaces.txt. The
175   first port should be the input endpoints, the second one the output
176
177 On the A33, some additional properties are required:
178   - reg needs to have an additional region corresponding to the SAT
179   - reg-names need to be set, with "be" and "sat"
180   - clocks and clock-names need to have a phandle to the SAT bus
181     clocks, whose name will be "sat"
182   - resets and reset-names need to have a phandle to the SAT bus
183     resets, whose name will be "sat"
184
185 Display Engine Frontend
186 -----------------------
187
188 The display engine frontend does formats conversion, scaling,
189 deinterlacing and color space conversion.
190
191 Required properties:
192   - compatible: value must be one of:
193     * allwinner,sun4i-a10-display-frontend
194     * allwinner,sun5i-a13-display-frontend
195     * allwinner,sun6i-a31-display-frontend
196     * allwinner,sun7i-a20-display-frontend
197     * allwinner,sun8i-a33-display-frontend
198   - reg: base address and size of the memory-mapped region.
199   - interrupts: interrupt associated to this IP
200   - clocks: phandles to the clocks feeding the frontend and backend
201     * ahb: the backend interface clock
202     * mod: the backend module clock
203     * ram: the backend DRAM clock
204   - clock-names: the clock names mentioned above
205   - resets: phandles to the reset controllers driving the backend
206
207 - ports: A ports node with endpoint definitions as defined in
208   Documentation/devicetree/bindings/media/video-interfaces.txt. The
209   first port should be the input endpoints, the second one the outputs
210
211 Display Engine 2.0 Mixer
212 ------------------------
213
214 The DE2 mixer have many functionalities, currently only layer blending is
215 supported.
216
217 Required properties:
218   - compatible: value must be one of:
219     * allwinner,sun8i-v3s-de2-mixer
220   - reg: base address and size of the memory-mapped region.
221   - clocks: phandles to the clocks feeding the mixer
222     * bus: the mixer interface clock
223     * mod: the mixer module clock
224   - clock-names: the clock names mentioned above
225   - resets: phandles to the reset controllers driving the mixer
226
227 - ports: A ports node with endpoint definitions as defined in
228   Documentation/devicetree/bindings/media/video-interfaces.txt. The
229   first port should be the input endpoints, the second one the output
230
231
232 Display Engine Pipeline
233 -----------------------
234
235 The display engine pipeline (and its entry point, since it can be
236 either directly the backend or the frontend) is represented as an
237 extra node.
238
239 Required properties:
240   - compatible: value must be one of:
241     * allwinner,sun4i-a10-display-engine
242     * allwinner,sun5i-a10s-display-engine
243     * allwinner,sun5i-a13-display-engine
244     * allwinner,sun6i-a31-display-engine
245     * allwinner,sun6i-a31s-display-engine
246     * allwinner,sun7i-a20-display-engine
247     * allwinner,sun8i-a33-display-engine
248     * allwinner,sun8i-v3s-display-engine
249
250   - allwinner,pipelines: list of phandle to the display engine
251     frontends (DE 1.0) or mixers (DE 2.0) available.
252
253 Example:
254
255 panel: panel {
256         compatible = "olimex,lcd-olinuxino-43-ts";
257         #address-cells = <1>;
258         #size-cells = <0>;
259
260         port {
261                 #address-cells = <1>;
262                 #size-cells = <0>;
263
264                 panel_input: endpoint {
265                         remote-endpoint = <&tcon0_out_panel>;
266                 };
267         };
268 };
269
270 connector {
271         compatible = "hdmi-connector";
272         type = "a";
273
274         port {
275                 hdmi_con_in: endpoint {
276                         remote-endpoint = <&hdmi_out_con>;
277                 };
278         };
279 };
280
281 hdmi: hdmi@01c16000 {
282         compatible = "allwinner,sun5i-a10s-hdmi";
283         reg = <0x01c16000 0x1000>;
284         interrupts = <58>;
285         clocks = <&ccu CLK_AHB_HDMI>, <&ccu CLK_HDMI>,
286                  <&ccu CLK_PLL_VIDEO0_2X>,
287                  <&ccu CLK_PLL_VIDEO1_2X>;
288         clock-names = "ahb", "mod", "pll-0", "pll-1";
289         dmas = <&dma SUN4I_DMA_NORMAL 16>,
290                <&dma SUN4I_DMA_NORMAL 16>,
291                <&dma SUN4I_DMA_DEDICATED 24>;
292         dma-names = "ddc-tx", "ddc-rx", "audio-tx";
293
294         ports {
295                 #address-cells = <1>;
296                 #size-cells = <0>;
297
298                 port@0 {
299                         #address-cells = <1>;
300                         #size-cells = <0>;
301                         reg = <0>;
302
303                         hdmi_in_tcon0: endpoint {
304                                 remote-endpoint = <&tcon0_out_hdmi>;
305                         };
306                 };
307
308                 port@1 {
309                         #address-cells = <1>;
310                         #size-cells = <0>;
311                         reg = <1>;
312
313                         hdmi_out_con: endpoint {
314                                 remote-endpoint = <&hdmi_con_in>;
315                         };
316                 };
317         };
318 };
319
320 tve0: tv-encoder@01c0a000 {
321         compatible = "allwinner,sun4i-a10-tv-encoder";
322         reg = <0x01c0a000 0x1000>;
323         clocks = <&ahb_gates 34>;
324         resets = <&tcon_ch0_clk 0>;
325
326         port {
327                 #address-cells = <1>;
328                 #size-cells = <0>;
329
330                 tve0_in_tcon0: endpoint@0 {
331                         reg = <0>;
332                         remote-endpoint = <&tcon0_out_tve0>;
333                 };
334         };
335 };
336
337 tcon0: lcd-controller@1c0c000 {
338         compatible = "allwinner,sun5i-a13-tcon";
339         reg = <0x01c0c000 0x1000>;
340         interrupts = <44>;
341         resets = <&tcon_ch0_clk 1>;
342         reset-names = "lcd";
343         clocks = <&ahb_gates 36>,
344                  <&tcon_ch0_clk>,
345                  <&tcon_ch1_clk>;
346         clock-names = "ahb",
347                       "tcon-ch0",
348                       "tcon-ch1";
349         clock-output-names = "tcon-pixel-clock";
350
351         ports {
352                 #address-cells = <1>;
353                 #size-cells = <0>;
354
355                 tcon0_in: port@0 {
356                         #address-cells = <1>;
357                         #size-cells = <0>;
358                         reg = <0>;
359
360                         tcon0_in_be0: endpoint@0 {
361                                 reg = <0>;
362                                 remote-endpoint = <&be0_out_tcon0>;
363                         };
364                 };
365
366                 tcon0_out: port@1 {
367                         #address-cells = <1>;
368                         #size-cells = <0>;
369                         reg = <1>;
370
371                         tcon0_out_panel: endpoint@0 {
372                                 reg = <0>;
373                                 remote-endpoint = <&panel_input>;
374                         };
375
376                         tcon0_out_tve0: endpoint@1 {
377                                 reg = <1>;
378                                 remote-endpoint = <&tve0_in_tcon0>;
379                         };
380                 };
381         };
382 };
383
384 fe0: display-frontend@1e00000 {
385         compatible = "allwinner,sun5i-a13-display-frontend";
386         reg = <0x01e00000 0x20000>;
387         interrupts = <47>;
388         clocks = <&ahb_gates 46>, <&de_fe_clk>,
389                  <&dram_gates 25>;
390         clock-names = "ahb", "mod",
391                       "ram";
392         resets = <&de_fe_clk>;
393
394         ports {
395                 #address-cells = <1>;
396                 #size-cells = <0>;
397
398                 fe0_out: port@1 {
399                         #address-cells = <1>;
400                         #size-cells = <0>;
401                         reg = <1>;
402
403                         fe0_out_be0: endpoint {
404                                 remote-endpoint = <&be0_in_fe0>;
405                         };
406                 };
407         };
408 };
409
410 be0: display-backend@1e60000 {
411         compatible = "allwinner,sun5i-a13-display-backend";
412         reg = <0x01e60000 0x10000>;
413         interrupts = <47>;
414         clocks = <&ahb_gates 44>, <&de_be_clk>,
415                  <&dram_gates 26>;
416         clock-names = "ahb", "mod",
417                       "ram";
418         resets = <&de_be_clk>;
419
420         ports {
421                 #address-cells = <1>;
422                 #size-cells = <0>;
423
424                 be0_in: port@0 {
425                         #address-cells = <1>;
426                         #size-cells = <0>;
427                         reg = <0>;
428
429                         be0_in_fe0: endpoint@0 {
430                                 reg = <0>;
431                                 remote-endpoint = <&fe0_out_be0>;
432                         };
433                 };
434
435                 be0_out: port@1 {
436                         #address-cells = <1>;
437                         #size-cells = <0>;
438                         reg = <1>;
439
440                         be0_out_tcon0: endpoint@0 {
441                                 reg = <0>;
442                                 remote-endpoint = <&tcon0_in_be0>;
443                         };
444                 };
445         };
446 };
447
448 display-engine {
449         compatible = "allwinner,sun5i-a13-display-engine";
450         allwinner,pipelines = <&fe0>;
451 };