xref: /freebsd/sys/contrib/device-tree/Bindings/media/mediatek,vcodec-encoder.yaml (revision 01950c46b8155250f64374fb72fc11faa44bf099)
1c9ccf3a3SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c9ccf3a3SEmmanuel Vadot
3c9ccf3a3SEmmanuel Vadot%YAML 1.2
4c9ccf3a3SEmmanuel Vadot---
5c9ccf3a3SEmmanuel Vadot$id: http://devicetree.org/schemas/media/mediatek,vcodec-encoder.yaml#
6c9ccf3a3SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
7c9ccf3a3SEmmanuel Vadot
8c9ccf3a3SEmmanuel Vadottitle: Mediatek Video Encode Accelerator
9c9ccf3a3SEmmanuel Vadot
10c9ccf3a3SEmmanuel Vadotmaintainers:
11c9ccf3a3SEmmanuel Vadot  - Yunfei Dong <yunfei.dong@mediatek.com>
12c9ccf3a3SEmmanuel Vadot
13c9ccf3a3SEmmanuel Vadotdescription: |+
14c9ccf3a3SEmmanuel Vadot  Mediatek Video Encode is the video encode hardware present in Mediatek
15c9ccf3a3SEmmanuel Vadot  SoCs which supports high resolution encoding functionalities.
16c9ccf3a3SEmmanuel Vadot
17c9ccf3a3SEmmanuel Vadotproperties:
18c9ccf3a3SEmmanuel Vadot  compatible:
19*01950c46SEmmanuel Vadot    oneOf:
20*01950c46SEmmanuel Vadot      - items:
21*01950c46SEmmanuel Vadot          - enum:
22c9ccf3a3SEmmanuel Vadot              - mediatek,mt8173-vcodec-enc-vp8
23c9ccf3a3SEmmanuel Vadot              - mediatek,mt8173-vcodec-enc
24c9ccf3a3SEmmanuel Vadot              - mediatek,mt8183-vcodec-enc
257ef62cebSEmmanuel Vadot              - mediatek,mt8188-vcodec-enc
26c9ccf3a3SEmmanuel Vadot              - mediatek,mt8192-vcodec-enc
27c9ccf3a3SEmmanuel Vadot              - mediatek,mt8195-vcodec-enc
28*01950c46SEmmanuel Vadot      - items:
29*01950c46SEmmanuel Vadot          - const: mediatek,mt8186-vcodec-enc
30*01950c46SEmmanuel Vadot          - const: mediatek,mt8183-vcodec-enc
31c9ccf3a3SEmmanuel Vadot  reg:
32c9ccf3a3SEmmanuel Vadot    maxItems: 1
33c9ccf3a3SEmmanuel Vadot
34c9ccf3a3SEmmanuel Vadot  interrupts:
35c9ccf3a3SEmmanuel Vadot    maxItems: 1
36c9ccf3a3SEmmanuel Vadot
37c9ccf3a3SEmmanuel Vadot  clocks:
38c9ccf3a3SEmmanuel Vadot    minItems: 1
39c9ccf3a3SEmmanuel Vadot    maxItems: 5
40c9ccf3a3SEmmanuel Vadot
41c9ccf3a3SEmmanuel Vadot  clock-names:
42c9ccf3a3SEmmanuel Vadot    minItems: 1
43c9ccf3a3SEmmanuel Vadot    maxItems: 5
44c9ccf3a3SEmmanuel Vadot
45c9ccf3a3SEmmanuel Vadot  assigned-clocks: true
46c9ccf3a3SEmmanuel Vadot
47c9ccf3a3SEmmanuel Vadot  assigned-clock-parents: true
48c9ccf3a3SEmmanuel Vadot
49c9ccf3a3SEmmanuel Vadot  iommus:
50c9ccf3a3SEmmanuel Vadot    minItems: 1
51c9ccf3a3SEmmanuel Vadot    maxItems: 32
52c9ccf3a3SEmmanuel Vadot    description: |
53c9ccf3a3SEmmanuel Vadot      List of the hardware port in respective IOMMU block for current Socs.
54c9ccf3a3SEmmanuel Vadot      Refer to bindings/iommu/mediatek,iommu.yaml.
55c9ccf3a3SEmmanuel Vadot
56c9ccf3a3SEmmanuel Vadot  mediatek,vpu:
57c9ccf3a3SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
58c9ccf3a3SEmmanuel Vadot    description:
59c9ccf3a3SEmmanuel Vadot      Describes point to vpu.
60c9ccf3a3SEmmanuel Vadot
61c9ccf3a3SEmmanuel Vadot  mediatek,scp:
62c9ccf3a3SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
63c9ccf3a3SEmmanuel Vadot    description:
64c9ccf3a3SEmmanuel Vadot      Describes point to scp.
65c9ccf3a3SEmmanuel Vadot
66d5b0e70fSEmmanuel Vadot  power-domains:
67d5b0e70fSEmmanuel Vadot    maxItems: 1
68d5b0e70fSEmmanuel Vadot
698bab661aSEmmanuel Vadot  "#address-cells":
708bab661aSEmmanuel Vadot    const: 2
718bab661aSEmmanuel Vadot
728bab661aSEmmanuel Vadot  "#size-cells":
738bab661aSEmmanuel Vadot    const: 2
748bab661aSEmmanuel Vadot
75c9ccf3a3SEmmanuel Vadotrequired:
76c9ccf3a3SEmmanuel Vadot  - compatible
77c9ccf3a3SEmmanuel Vadot  - reg
78c9ccf3a3SEmmanuel Vadot  - interrupts
79c9ccf3a3SEmmanuel Vadot  - clocks
80c9ccf3a3SEmmanuel Vadot  - clock-names
81c9ccf3a3SEmmanuel Vadot  - iommus
82c9ccf3a3SEmmanuel Vadot  - assigned-clocks
83c9ccf3a3SEmmanuel Vadot  - assigned-clock-parents
84c9ccf3a3SEmmanuel Vadot
85c9ccf3a3SEmmanuel VadotallOf:
86c9ccf3a3SEmmanuel Vadot  - if:
87c9ccf3a3SEmmanuel Vadot      properties:
88c9ccf3a3SEmmanuel Vadot        compatible:
89c9ccf3a3SEmmanuel Vadot          contains:
90c9ccf3a3SEmmanuel Vadot            enum:
91c9ccf3a3SEmmanuel Vadot              - mediatek,mt8183-vcodec-enc
928bab661aSEmmanuel Vadot              - mediatek,mt8188-vcodec-enc
93c9ccf3a3SEmmanuel Vadot              - mediatek,mt8192-vcodec-enc
948bab661aSEmmanuel Vadot              - mediatek,mt8195-vcodec-enc
95c9ccf3a3SEmmanuel Vadot
96c9ccf3a3SEmmanuel Vadot    then:
97c9ccf3a3SEmmanuel Vadot      required:
98c9ccf3a3SEmmanuel Vadot        - mediatek,scp
99c9ccf3a3SEmmanuel Vadot
100c9ccf3a3SEmmanuel Vadot  - if:
101c9ccf3a3SEmmanuel Vadot      properties:
102c9ccf3a3SEmmanuel Vadot        compatible:
103c9ccf3a3SEmmanuel Vadot          contains:
104c9ccf3a3SEmmanuel Vadot            enum:
105c9ccf3a3SEmmanuel Vadot              - mediatek,mt8173-vcodec-enc-vp8
106c9ccf3a3SEmmanuel Vadot              - mediatek,mt8173-vcodec-enc
107c9ccf3a3SEmmanuel Vadot
108c9ccf3a3SEmmanuel Vadot    then:
109c9ccf3a3SEmmanuel Vadot      required:
110c9ccf3a3SEmmanuel Vadot        - mediatek,vpu
111c9ccf3a3SEmmanuel Vadot
112c9ccf3a3SEmmanuel Vadot  - if:
113c9ccf3a3SEmmanuel Vadot      properties:
114c9ccf3a3SEmmanuel Vadot        compatible:
115c9ccf3a3SEmmanuel Vadot          enum:
116*01950c46SEmmanuel Vadot            - mediatek,mt8173-vcodec-enc-vp8
117c9ccf3a3SEmmanuel Vadot
118c9ccf3a3SEmmanuel Vadot    then:
119c9ccf3a3SEmmanuel Vadot      properties:
120c9ccf3a3SEmmanuel Vadot        clock:
121c9ccf3a3SEmmanuel Vadot          items:
122c9ccf3a3SEmmanuel Vadot            minItems: 1
123c9ccf3a3SEmmanuel Vadot            maxItems: 1
124c9ccf3a3SEmmanuel Vadot        clock-names:
125c9ccf3a3SEmmanuel Vadot          items:
126*01950c46SEmmanuel Vadot            - const: venc_lt_sel
127*01950c46SEmmanuel Vadot    else:
128c9ccf3a3SEmmanuel Vadot      properties:
129c9ccf3a3SEmmanuel Vadot        clock:
130c9ccf3a3SEmmanuel Vadot          items:
131c9ccf3a3SEmmanuel Vadot            minItems: 1
132c9ccf3a3SEmmanuel Vadot            maxItems: 1
133c9ccf3a3SEmmanuel Vadot        clock-names:
134c9ccf3a3SEmmanuel Vadot          items:
135*01950c46SEmmanuel Vadot            - const: venc_sel
136c9ccf3a3SEmmanuel Vadot
137c9ccf3a3SEmmanuel VadotadditionalProperties: false
138c9ccf3a3SEmmanuel Vadot
139c9ccf3a3SEmmanuel Vadotexamples:
140c9ccf3a3SEmmanuel Vadot  - |
141c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
142c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/clock/mt8173-clk.h>
143c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/memory/mt8173-larb-port.h>
144c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
145c9ccf3a3SEmmanuel Vadot
146c9ccf3a3SEmmanuel Vadot    vcodec_enc_avc: vcodec@18002000 {
147c9ccf3a3SEmmanuel Vadot      compatible = "mediatek,mt8173-vcodec-enc";
148c9ccf3a3SEmmanuel Vadot      reg = <0x18002000 0x1000>;
149c9ccf3a3SEmmanuel Vadot      interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_LOW>;
150c9ccf3a3SEmmanuel Vadot      iommus = <&iommu M4U_PORT_VENC_RCPU>,
151c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_REC>,
152c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_BSDMA>,
153c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_SV_COMV>,
154c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_RD_COMV>,
155c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_CUR_LUMA>,
156c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_CUR_CHROMA>,
157c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_REF_LUMA>,
158c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_REF_CHROMA>,
159c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_NBM_RDMA>,
160c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_NBM_WDMA>;
161c9ccf3a3SEmmanuel Vadot      mediatek,vpu = <&vpu>;
162c9ccf3a3SEmmanuel Vadot      clocks = <&topckgen CLK_TOP_VENC_SEL>;
163c9ccf3a3SEmmanuel Vadot      clock-names = "venc_sel";
164c9ccf3a3SEmmanuel Vadot      assigned-clocks = <&topckgen CLK_TOP_VENC_SEL>;
165c9ccf3a3SEmmanuel Vadot      assigned-clock-parents = <&topckgen CLK_TOP_VCODECPLL>;
166c9ccf3a3SEmmanuel Vadot    };
167c9ccf3a3SEmmanuel Vadot
168c9ccf3a3SEmmanuel Vadot    vcodec_enc_vp8: vcodec@19002000 {
169c9ccf3a3SEmmanuel Vadot      compatible = "mediatek,mt8173-vcodec-enc-vp8";
170c9ccf3a3SEmmanuel Vadot      reg =  <0x19002000 0x1000>;	/* VENC_LT_SYS */
171c9ccf3a3SEmmanuel Vadot      interrupts = <GIC_SPI 202 IRQ_TYPE_LEVEL_LOW>;
172c9ccf3a3SEmmanuel Vadot      iommus = <&iommu M4U_PORT_VENC_RCPU_SET2>,
173c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_REC_FRM_SET2>,
174c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_BSDMA_SET2>,
175c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_SV_COMA_SET2>,
176c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_RD_COMA_SET2>,
177c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_CUR_LUMA_SET2>,
178c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_CUR_CHROMA_SET2>,
179c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_REF_LUMA_SET2>,
180c9ccf3a3SEmmanuel Vadot             <&iommu M4U_PORT_VENC_REC_CHROMA_SET2>;
181c9ccf3a3SEmmanuel Vadot      mediatek,vpu = <&vpu>;
182c9ccf3a3SEmmanuel Vadot      clocks = <&topckgen CLK_TOP_VENC_LT_SEL>;
183c9ccf3a3SEmmanuel Vadot      clock-names = "venc_lt_sel";
184c9ccf3a3SEmmanuel Vadot      assigned-clocks = <&topckgen CLK_TOP_VENC_LT_SEL>;
185c9ccf3a3SEmmanuel Vadot      assigned-clock-parents = <&topckgen CLK_TOP_VCODECPLL_370P5>;
186c9ccf3a3SEmmanuel Vadot    };
187