1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2
3%YAML 1.2
4---
5$id: http://devicetree.org/schemas/media/mediatek,vcodec-decoder.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: Mediatek Video Decode Accelerator
9
10maintainers:
11  - Yunfei Dong <yunfei.dong@mediatek.com>
12
13description: |+
14  Mediatek Video Decode is the video decode hardware present in Mediatek
15  SoCs which supports high resolution decoding functionalities.
16
17properties:
18  compatible:
19    enum:
20      - mediatek,mt8173-vcodec-dec
21      - mediatek,mt8183-vcodec-dec
22
23  reg:
24    maxItems: 12
25
26  interrupts:
27    maxItems: 1
28
29  clocks:
30    maxItems: 8
31
32  clock-names:
33    items:
34      - const: vcodecpll
35      - const: univpll_d2
36      - const: clk_cci400_sel
37      - const: vdec_sel
38      - const: vdecpll
39      - const: vencpll
40      - const: venc_lt_sel
41      - const: vdec_bus_clk_src
42
43  assigned-clocks: true
44
45  assigned-clock-parents: true
46
47  assigned-clock-rates: true
48
49  power-domains:
50    maxItems: 1
51
52  iommus:
53    minItems: 1
54    maxItems: 32
55    description: |
56      List of the hardware port in respective IOMMU block for current Socs.
57      Refer to bindings/iommu/mediatek,iommu.yaml.
58
59  dma-ranges:
60    maxItems: 1
61    description: |
62      Describes the physical address space of IOMMU maps to memory.
63
64  mediatek,vpu:
65    $ref: /schemas/types.yaml#/definitions/phandle
66    maxItems: 1
67    description:
68      Describes point to vpu.
69
70  mediatek,scp:
71    $ref: /schemas/types.yaml#/definitions/phandle
72    maxItems: 1
73    description:
74      Describes point to scp.
75
76required:
77  - compatible
78  - reg
79  - interrupts
80  - clocks
81  - clock-names
82  - iommus
83  - assigned-clocks
84  - assigned-clock-parents
85
86allOf:
87  - if:
88      properties:
89        compatible:
90          contains:
91            enum:
92              - mediatek,mt8183-vcodec-dec
93
94    then:
95      required:
96        - mediatek,scp
97
98  - if:
99      properties:
100        compatible:
101          contains:
102            enum:
103              - mediatek,mt8173-vcodec-dec
104
105    then:
106      required:
107        - mediatek,vpu
108
109additionalProperties: false
110
111examples:
112  - |
113    #include <dt-bindings/interrupt-controller/arm-gic.h>
114    #include <dt-bindings/clock/mt8173-clk.h>
115    #include <dt-bindings/memory/mt8173-larb-port.h>
116    #include <dt-bindings/interrupt-controller/irq.h>
117    #include <dt-bindings/power/mt8173-power.h>
118
119    vcodec_dec: vcodec@16000000 {
120      compatible = "mediatek,mt8173-vcodec-dec";
121      reg = <0x16000000 0x100>,   /*VDEC_SYS*/
122          <0x16020000 0x1000>,  /*VDEC_MISC*/
123          <0x16021000 0x800>,   /*VDEC_LD*/
124          <0x16021800 0x800>,   /*VDEC_TOP*/
125          <0x16022000 0x1000>,  /*VDEC_CM*/
126          <0x16023000 0x1000>,  /*VDEC_AD*/
127          <0x16024000 0x1000>,  /*VDEC_AV*/
128          <0x16025000 0x1000>,  /*VDEC_PP*/
129          <0x16026800 0x800>,   /*VP8_VD*/
130          <0x16027000 0x800>,   /*VP6_VD*/
131          <0x16027800 0x800>,   /*VP8_VL*/
132          <0x16028400 0x400>;   /*VP9_VD*/
133      interrupts = <GIC_SPI 204 IRQ_TYPE_LEVEL_LOW>;
134      iommus = <&iommu M4U_PORT_HW_VDEC_MC_EXT>,
135             <&iommu M4U_PORT_HW_VDEC_PP_EXT>,
136             <&iommu M4U_PORT_HW_VDEC_AVC_MV_EXT>,
137             <&iommu M4U_PORT_HW_VDEC_PRED_RD_EXT>,
138             <&iommu M4U_PORT_HW_VDEC_PRED_WR_EXT>,
139             <&iommu M4U_PORT_HW_VDEC_UFO_EXT>,
140             <&iommu M4U_PORT_HW_VDEC_VLD_EXT>,
141             <&iommu M4U_PORT_HW_VDEC_VLD2_EXT>;
142      mediatek,vpu = <&vpu>;
143      power-domains = <&scpsys MT8173_POWER_DOMAIN_VDEC>;
144      clocks = <&apmixedsys CLK_APMIXED_VCODECPLL>,
145             <&topckgen CLK_TOP_UNIVPLL_D2>,
146             <&topckgen CLK_TOP_CCI400_SEL>,
147             <&topckgen CLK_TOP_VDEC_SEL>,
148             <&topckgen CLK_TOP_VCODECPLL>,
149             <&apmixedsys CLK_APMIXED_VENCPLL>,
150             <&topckgen CLK_TOP_VENC_LT_SEL>,
151             <&topckgen CLK_TOP_VCODECPLL_370P5>;
152      clock-names = "vcodecpll",
153                  "univpll_d2",
154                  "clk_cci400_sel",
155                  "vdec_sel",
156                  "vdecpll",
157                  "vencpll",
158                  "venc_lt_sel",
159                  "vdec_bus_clk_src";
160      assigned-clocks = <&topckgen CLK_TOP_VENC_LT_SEL>,
161                      <&topckgen CLK_TOP_CCI400_SEL>,
162                      <&topckgen CLK_TOP_VDEC_SEL>,
163                      <&apmixedsys CLK_APMIXED_VCODECPLL>,
164                      <&apmixedsys CLK_APMIXED_VENCPLL>;
165      assigned-clock-parents = <&topckgen CLK_TOP_VCODECPLL_370P5>,
166                             <&topckgen CLK_TOP_UNIVPLL_D2>,
167                             <&topckgen CLK_TOP_VCODECPLL>;
168      assigned-clock-rates = <0>, <0>, <0>, <1482000000>, <800000000>;
169    };
170