Linux-libre 5.7.6-gnu
[librecmc/linux-libre.git] / Documentation / devicetree / bindings / media / amlogic,gx-vdec.yaml
1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2 # Copyright 2019 BayLibre, SAS
3 %YAML 1.2
4 ---
5 $id: "http://devicetree.org/schemas/media/amlogic,gx-vdec.yaml#"
6 $schema: "http://devicetree.org/meta-schemas/core.yaml#"
7
8 title: Amlogic Video Decoder
9
10 maintainers:
11   - Neil Armstrong <narmstrong@baylibre.com>
12   - Maxime Jourdan <mjourdan@baylibre.com>
13
14 description: |
15   The video decoding IP lies within the DOS memory region,
16   except for the hardware bitstream parser that makes use of an undocumented
17   region.
18
19   It makes use of the following blocks:
20   - ESPARSER is a bitstream parser that outputs to a VIFIFO. Further VDEC blocks
21     then feed from this VIFIFO.
22   - VDEC_1 can decode MPEG-1, MPEG-2, MPEG-4 part 2, MJPEG, H.263, H.264, VC-1.
23   - VDEC_HEVC can decode HEVC and VP9.
24
25   Both VDEC_1 and VDEC_HEVC share the "vdec" IRQ and as such cannot run
26   concurrently.
27
28 properties:
29   compatible:
30     oneOf:
31       - items:
32         - enum:
33           - amlogic,gxbb-vdec # GXBB (S905)
34           - amlogic,gxl-vdec # GXL (S905X, S905D)
35           - amlogic,gxm-vdec # GXM (S912)
36         - const: amlogic,gx-vdec
37       - enum:
38         - amlogic,g12a-vdec # G12A (S905X2, S905D2)
39         - amlogic,sm1-vdec # SM1 (S905X3, S905D3)
40
41   interrupts:
42     minItems: 2
43
44   interrupt-names:
45     items:
46       - const: vdec
47       - const: esparser
48
49   reg:
50     minItems: 2
51
52   reg-names:
53     items:
54       - const: dos
55       - const: esparser
56
57   resets:
58     maxItems: 1
59
60   reset-names:
61     items:
62       - const: esparser
63
64   clocks:
65     minItems: 4
66     maxItems: 5
67
68   clock-names:
69     minItems: 4
70     maxItems: 5
71     items:
72       - const: dos_parser
73       - const: dos
74       - const: vdec_1
75       - const: vdec_hevc
76       - const: vdec_hevcf
77
78   amlogic,ao-sysctrl:
79     description: should point to the AOBUS sysctrl node
80     allOf:
81       - $ref: /schemas/types.yaml#/definitions/phandle
82
83   amlogic,canvas:
84     description: should point to a canvas provider node
85     allOf:
86       - $ref: /schemas/types.yaml#/definitions/phandle
87
88 allOf:
89   - if:
90       properties:
91         compatible:
92           contains:
93             enum:
94               - amlogic,gx-vdec
95
96     then:
97       properties:
98         clock-names:
99           maxItems: 4
100
101   - if:
102       properties:
103         compatible:
104           contains:
105             enum:
106               - amlogic,g12a-vdec
107               - amlogic,sm1-vdec
108
109     then:
110       properties:
111         clock-names:
112           minItems: 5
113
114 required:
115   - compatible
116   - reg
117   - reg-names
118   - interrupts
119   - interrupt-names
120   - clocks
121   - clock-names
122   - resets
123   - reset-names
124   - amlogic,ao-sysctrl
125   - amlogic,canvas
126
127 additionalProperties: false
128
129 examples:
130   - |
131     vdec: video-decoder@c8820000 {
132           compatible = "amlogic,gxl-vdec", "amlogic,gx-vdec";
133           reg = <0xc8820000 0x10000>, <0xc110a580 0xe4>;
134           reg-names = "dos", "esparser";
135           interrupts = <44>, <32>;
136           interrupt-names = "vdec", "esparser";
137           clocks = <&clk_dos_parser> ,<&clk_dos>, <&clk_vdec_1>, <&clk_vdec_hevc>;
138           clock-names = "dos_parser", "dos", "vdec_1", "vdec_hevc";
139           resets = <&reset_parser>;
140           reset-names = "esparser";
141           amlogic,ao-sysctrl = <&sysctrl_AO>;
142           amlogic,canvas = <&canvas>;
143     };