mediatek,vcodec-subdev-decoder.yaml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/media/mediatek,vcodec-subdev-decoder.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Mediatek Video Decode Accelerator With Multi Hardware
  7. maintainers:
  8. - Yunfei Dong <yunfei.dong@mediatek.com>
  9. description: |
  10. Mediatek Video Decode is the video decode hardware present in Mediatek
  11. SoCs which supports high resolution decoding functionalities. Required
  12. parent and child device node.
  13. About the Decoder Hardware Block Diagram, please check below:
  14. +------------------------------------------------+-------------------------------------+
  15. | | |
  16. | input -> lat soc HW -> lat HW -> lat buffer --|--> lat buffer -> core HW -> output |
  17. | || || | || |
  18. +------------||-------------||-------------------+---------------------||--------------+
  19. || lat || | core workqueue <parent>
  20. -------------||-------------||-------------------|---------------------||---------------
  21. ||<------------||----------------HW index---------------->|| <child>
  22. \/ \/ \/
  23. +-------------------------------------------------------------+
  24. | enable/disable |
  25. | clk power irq iommu |
  26. | (lat/lat soc/core0/core1) |
  27. +-------------------------------------------------------------+
  28. As above, there are parent and child devices, child mean each hardware. The child device
  29. controls the information of each hardware independent which include clk/power/irq.
  30. There are two workqueues in parent device: lat workqueue and core workqueue. They are used
  31. to lat and core hardware decoder. Lat workqueue need to get input bitstream and lat buffer,
  32. then enable lat to decode, writing the result to lat buffer, dislabe hardware when lat decode
  33. done. Core workqueue need to get lat buffer and output buffer, then enable core to decode,
  34. writing the result to output buffer, disable hardware when core decode done. These two
  35. hardwares will decode each frame cyclically.
  36. For the smi common may not the same for each hardware, can't combine all hardware in one node,
  37. or leading to iommu fault when access dram data.
  38. Lat soc is a hardware which is related with some larb(local arbiter) ports. For mt8195
  39. platform, there are some ports like RDMA, UFO in lat soc larb, need to enable its power and
  40. clock when lat start to work, don't have interrupt.
  41. mt8195: lat soc HW + lat HW + core HW
  42. mt8192: lat HW + core HW
  43. properties:
  44. compatible:
  45. enum:
  46. - mediatek,mt8192-vcodec-dec
  47. - mediatek,mt8186-vcodec-dec
  48. - mediatek,mt8188-vcodec-dec
  49. - mediatek,mt8195-vcodec-dec
  50. reg:
  51. minItems: 1
  52. items:
  53. - description: VDEC_SYS register space
  54. - description: VDEC_RACING_CTRL register space
  55. iommus:
  56. minItems: 1
  57. maxItems: 32
  58. description: |
  59. List of the hardware port in respective IOMMU block for current Socs.
  60. Refer to bindings/iommu/mediatek,iommu.yaml.
  61. mediatek,scp:
  62. $ref: /schemas/types.yaml#/definitions/phandle
  63. description: |
  64. The node of system control processor (SCP), using
  65. the remoteproc & rpmsg framework.
  66. "#address-cells":
  67. const: 2
  68. "#size-cells":
  69. const: 2
  70. ranges: true
  71. # Required child node:
  72. patternProperties:
  73. '^video-codec@[0-9a-f]+$':
  74. type: object
  75. properties:
  76. compatible:
  77. enum:
  78. - mediatek,mtk-vcodec-core
  79. - mediatek,mtk-vcodec-lat
  80. - mediatek,mtk-vcodec-lat-soc
  81. reg:
  82. maxItems: 1
  83. description: VDEC_MISC register space
  84. interrupts:
  85. maxItems: 1
  86. iommus:
  87. minItems: 1
  88. maxItems: 32
  89. description: |
  90. List of the hardware port in respective IOMMU block for current Socs.
  91. Refer to bindings/iommu/mediatek,iommu.yaml.
  92. clocks:
  93. minItems: 4
  94. maxItems: 5
  95. clock-names:
  96. minItems: 4
  97. maxItems: 5
  98. assigned-clocks:
  99. maxItems: 1
  100. assigned-clock-parents:
  101. maxItems: 1
  102. power-domains:
  103. maxItems: 1
  104. required:
  105. - compatible
  106. - reg
  107. - iommus
  108. - clocks
  109. - clock-names
  110. - assigned-clocks
  111. - assigned-clock-parents
  112. - power-domains
  113. additionalProperties: false
  114. required:
  115. - compatible
  116. - reg
  117. - iommus
  118. - mediatek,scp
  119. - ranges
  120. if:
  121. properties:
  122. compatible:
  123. contains:
  124. enum:
  125. - mediatek,mtk-vcodec-core
  126. - mediatek,mtk-vcodec-lat
  127. then:
  128. required:
  129. - interrupts
  130. allOf:
  131. - if:
  132. properties:
  133. compatible:
  134. contains:
  135. enum:
  136. - mediatek,mt8192-vcodec-dec
  137. then:
  138. properties:
  139. clock-names:
  140. items:
  141. - const: sel
  142. - const: soc-vdec
  143. - const: soc-lat
  144. - const: vdec
  145. - const: top
  146. - if:
  147. properties:
  148. compatible:
  149. contains:
  150. enum:
  151. - mediatek,mt8195-vcodec-dec
  152. then:
  153. properties:
  154. clock-names:
  155. items:
  156. - const: sel
  157. - const: vdec
  158. - const: lat
  159. - const: top
  160. additionalProperties: false
  161. examples:
  162. - |
  163. #include <dt-bindings/interrupt-controller/arm-gic.h>
  164. #include <dt-bindings/memory/mt8192-larb-port.h>
  165. #include <dt-bindings/interrupt-controller/irq.h>
  166. #include <dt-bindings/clock/mt8192-clk.h>
  167. #include <dt-bindings/power/mt8192-power.h>
  168. bus@16000000 {
  169. #address-cells = <2>;
  170. #size-cells = <2>;
  171. ranges = <0 0x16000000 0x16000000 0 0x40000>;
  172. video-codec@16000000 {
  173. compatible = "mediatek,mt8192-vcodec-dec";
  174. mediatek,scp = <&scp>;
  175. iommus = <&iommu0 M4U_PORT_L4_VDEC_MC_EXT>;
  176. #address-cells = <2>;
  177. #size-cells = <2>;
  178. ranges = <0 0 0 0x16000000 0 0x40000>;
  179. reg = <0 0x16000000 0 0x1000>; /* VDEC_SYS */
  180. video-codec@10000 {
  181. compatible = "mediatek,mtk-vcodec-lat";
  182. reg = <0 0x10000 0 0x800>;
  183. interrupts = <GIC_SPI 426 IRQ_TYPE_LEVEL_HIGH 0>;
  184. iommus = <&iommu0 M4U_PORT_L5_VDEC_LAT0_VLD_EXT>,
  185. <&iommu0 M4U_PORT_L5_VDEC_LAT0_VLD2_EXT>,
  186. <&iommu0 M4U_PORT_L5_VDEC_LAT0_AVC_MV_EXT>,
  187. <&iommu0 M4U_PORT_L5_VDEC_LAT0_PRED_RD_EXT>,
  188. <&iommu0 M4U_PORT_L5_VDEC_LAT0_TILE_EXT>,
  189. <&iommu0 M4U_PORT_L5_VDEC_LAT0_WDMA_EXT>,
  190. <&iommu0 M4U_PORT_L5_VDEC_LAT0_RG_CTRL_DMA_EXT>,
  191. <&iommu0 M4U_PORT_L5_VDEC_UFO_ENC_EXT>;
  192. clocks = <&topckgen CLK_TOP_VDEC_SEL>,
  193. <&vdecsys_soc CLK_VDEC_SOC_VDEC>,
  194. <&vdecsys_soc CLK_VDEC_SOC_LAT>,
  195. <&vdecsys_soc CLK_VDEC_SOC_LARB1>,
  196. <&topckgen CLK_TOP_MAINPLL_D4>;
  197. clock-names = "sel", "soc-vdec", "soc-lat", "vdec", "top";
  198. assigned-clocks = <&topckgen CLK_TOP_VDEC_SEL>;
  199. assigned-clock-parents = <&topckgen CLK_TOP_MAINPLL_D4>;
  200. power-domains = <&spm MT8192_POWER_DOMAIN_VDEC>;
  201. };
  202. video-codec@25000 {
  203. compatible = "mediatek,mtk-vcodec-core";
  204. reg = <0 0x25000 0 0x1000>;
  205. interrupts = <GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH 0>;
  206. iommus = <&iommu0 M4U_PORT_L4_VDEC_MC_EXT>,
  207. <&iommu0 M4U_PORT_L4_VDEC_UFO_EXT>,
  208. <&iommu0 M4U_PORT_L4_VDEC_PP_EXT>,
  209. <&iommu0 M4U_PORT_L4_VDEC_PRED_RD_EXT>,
  210. <&iommu0 M4U_PORT_L4_VDEC_PRED_WR_EXT>,
  211. <&iommu0 M4U_PORT_L4_VDEC_PPWRAP_EXT>,
  212. <&iommu0 M4U_PORT_L4_VDEC_TILE_EXT>,
  213. <&iommu0 M4U_PORT_L4_VDEC_VLD_EXT>,
  214. <&iommu0 M4U_PORT_L4_VDEC_VLD2_EXT>,
  215. <&iommu0 M4U_PORT_L4_VDEC_AVC_MV_EXT>,
  216. <&iommu0 M4U_PORT_L4_VDEC_RG_CTRL_DMA_EXT>;
  217. clocks = <&topckgen CLK_TOP_VDEC_SEL>,
  218. <&vdecsys CLK_VDEC_VDEC>,
  219. <&vdecsys CLK_VDEC_LAT>,
  220. <&vdecsys CLK_VDEC_LARB1>,
  221. <&topckgen CLK_TOP_MAINPLL_D4>;
  222. clock-names = "sel", "soc-vdec", "soc-lat", "vdec", "top";
  223. assigned-clocks = <&topckgen CLK_TOP_VDEC_SEL>;
  224. assigned-clock-parents = <&topckgen CLK_TOP_MAINPLL_D4>;
  225. power-domains = <&spm MT8192_POWER_DOMAIN_VDEC2>;
  226. };
  227. };
  228. };