1c66ec88fSEmmanuel VadotMediatek Video Codec 2c66ec88fSEmmanuel Vadot 3c66ec88fSEmmanuel VadotMediatek Video Codec is the video codec hw present in Mediatek SoCs which 4c66ec88fSEmmanuel Vadotsupports high resolution encoding and decoding functionalities. 5c66ec88fSEmmanuel Vadot 6c66ec88fSEmmanuel VadotRequired properties: 72eb4d8dcSEmmanuel Vadot- compatible : must be one of the following string: 82eb4d8dcSEmmanuel Vadot "mediatek,mt8173-vcodec-enc-vp8" for mt8173 vp8 encoder. 92eb4d8dcSEmmanuel Vadot "mediatek,mt8173-vcodec-enc" for mt8173 avc encoder. 106be33864SEmmanuel Vadot "mediatek,mt8183-vcodec-enc" for MT8183 encoder. 116be33864SEmmanuel Vadot "mediatek,mt8173-vcodec-dec" for MT8173 decoder. 125956d97fSEmmanuel Vadot "mediatek,mt8192-vcodec-enc" for MT8192 encoder. 13*8cc087a1SEmmanuel Vadot "mediatek,mt8183-vcodec-dec" for MT8183 decoder. 14*8cc087a1SEmmanuel Vadot "mediatek,mt8195-vcodec-enc" for MT8195 encoder. 15c66ec88fSEmmanuel Vadot- reg : Physical base address of the video codec registers and length of 16c66ec88fSEmmanuel Vadot memory mapped region. 17c66ec88fSEmmanuel Vadot- interrupts : interrupt number to the cpu. 18c66ec88fSEmmanuel Vadot- mediatek,larb : must contain the local arbiters in the current Socs. 19c66ec88fSEmmanuel Vadot- clocks : list of clock specifiers, corresponding to entries in 20c66ec88fSEmmanuel Vadot the clock-names property. 212eb4d8dcSEmmanuel Vadot- clock-names: avc encoder must contain "venc_sel", vp8 encoder must 222eb4d8dcSEmmanuel Vadot contain "venc_lt_sel", decoder must contain "vcodecpll", "univpll_d2", 232eb4d8dcSEmmanuel Vadot "clk_cci400_sel", "vdec_sel", "vdecpll", "vencpll", "venc_lt_sel", 242eb4d8dcSEmmanuel Vadot "vdec_bus_clk_src". 25c66ec88fSEmmanuel Vadot- iommus : should point to the respective IOMMU block with master port as 262eb4d8dcSEmmanuel Vadot argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml 27c66ec88fSEmmanuel Vadot for details. 285956d97fSEmmanuel Vadot- dma-ranges : describes the dma address range space that the codec hw access. 296be33864SEmmanuel VadotOne of the two following nodes: 306be33864SEmmanuel Vadot- mediatek,vpu : the node of the video processor unit, if using VPU. 316be33864SEmmanuel Vadot- mediatek,scp : the node of the SCP unit, if using SCP. 32c66ec88fSEmmanuel Vadot 33c66ec88fSEmmanuel Vadot 34c66ec88fSEmmanuel VadotExample: 35c66ec88fSEmmanuel Vadot 36c66ec88fSEmmanuel Vadotvcodec_dec: vcodec@16000000 { 37c66ec88fSEmmanuel Vadot compatible = "mediatek,mt8173-vcodec-dec"; 38c66ec88fSEmmanuel Vadot reg = <0 0x16000000 0 0x100>, /*VDEC_SYS*/ 39c66ec88fSEmmanuel Vadot <0 0x16020000 0 0x1000>, /*VDEC_MISC*/ 40c66ec88fSEmmanuel Vadot <0 0x16021000 0 0x800>, /*VDEC_LD*/ 41c66ec88fSEmmanuel Vadot <0 0x16021800 0 0x800>, /*VDEC_TOP*/ 42c66ec88fSEmmanuel Vadot <0 0x16022000 0 0x1000>, /*VDEC_CM*/ 43c66ec88fSEmmanuel Vadot <0 0x16023000 0 0x1000>, /*VDEC_AD*/ 44c66ec88fSEmmanuel Vadot <0 0x16024000 0 0x1000>, /*VDEC_AV*/ 45c66ec88fSEmmanuel Vadot <0 0x16025000 0 0x1000>, /*VDEC_PP*/ 46c66ec88fSEmmanuel Vadot <0 0x16026800 0 0x800>, /*VP8_VD*/ 47c66ec88fSEmmanuel Vadot <0 0x16027000 0 0x800>, /*VP6_VD*/ 48c66ec88fSEmmanuel Vadot <0 0x16027800 0 0x800>, /*VP8_VL*/ 49c66ec88fSEmmanuel Vadot <0 0x16028400 0 0x400>; /*VP9_VD*/ 50c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 204 IRQ_TYPE_LEVEL_LOW>; 51c66ec88fSEmmanuel Vadot mediatek,larb = <&larb1>; 52c66ec88fSEmmanuel Vadot iommus = <&iommu M4U_PORT_HW_VDEC_MC_EXT>, 53c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_HW_VDEC_PP_EXT>, 54c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_HW_VDEC_AVC_MV_EXT>, 55c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_HW_VDEC_PRED_RD_EXT>, 56c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_HW_VDEC_PRED_WR_EXT>, 57c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_HW_VDEC_UFO_EXT>, 58c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_HW_VDEC_VLD_EXT>, 59c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_HW_VDEC_VLD2_EXT>; 60c66ec88fSEmmanuel Vadot mediatek,vpu = <&vpu>; 61c66ec88fSEmmanuel Vadot power-domains = <&scpsys MT8173_POWER_DOMAIN_VDEC>; 62c66ec88fSEmmanuel Vadot clocks = <&apmixedsys CLK_APMIXED_VCODECPLL>, 63c66ec88fSEmmanuel Vadot <&topckgen CLK_TOP_UNIVPLL_D2>, 64c66ec88fSEmmanuel Vadot <&topckgen CLK_TOP_CCI400_SEL>, 65c66ec88fSEmmanuel Vadot <&topckgen CLK_TOP_VDEC_SEL>, 66c66ec88fSEmmanuel Vadot <&topckgen CLK_TOP_VCODECPLL>, 67c66ec88fSEmmanuel Vadot <&apmixedsys CLK_APMIXED_VENCPLL>, 68c66ec88fSEmmanuel Vadot <&topckgen CLK_TOP_VENC_LT_SEL>, 69c66ec88fSEmmanuel Vadot <&topckgen CLK_TOP_VCODECPLL_370P5>; 70c66ec88fSEmmanuel Vadot clock-names = "vcodecpll", 71c66ec88fSEmmanuel Vadot "univpll_d2", 72c66ec88fSEmmanuel Vadot "clk_cci400_sel", 73c66ec88fSEmmanuel Vadot "vdec_sel", 74c66ec88fSEmmanuel Vadot "vdecpll", 75c66ec88fSEmmanuel Vadot "vencpll", 76c66ec88fSEmmanuel Vadot "venc_lt_sel", 77c66ec88fSEmmanuel Vadot "vdec_bus_clk_src"; 78c66ec88fSEmmanuel Vadot assigned-clocks = <&topckgen CLK_TOP_VENC_LT_SEL>, 79c66ec88fSEmmanuel Vadot <&topckgen CLK_TOP_CCI400_SEL>, 80c66ec88fSEmmanuel Vadot <&topckgen CLK_TOP_VDEC_SEL>, 81c66ec88fSEmmanuel Vadot <&apmixedsys CLK_APMIXED_VCODECPLL>, 82c66ec88fSEmmanuel Vadot <&apmixedsys CLK_APMIXED_VENCPLL>; 83c66ec88fSEmmanuel Vadot assigned-clock-parents = <&topckgen CLK_TOP_VCODECPLL_370P5>, 84c66ec88fSEmmanuel Vadot <&topckgen CLK_TOP_UNIVPLL_D2>, 85c66ec88fSEmmanuel Vadot <&topckgen CLK_TOP_VCODECPLL>; 86c66ec88fSEmmanuel Vadot assigned-clock-rates = <0>, <0>, <0>, <1482000000>, <800000000>; 87c66ec88fSEmmanuel Vadot }; 88c66ec88fSEmmanuel Vadot 892eb4d8dcSEmmanuel Vadotvcodec_enc_avc: vcodec@18002000 { 90c66ec88fSEmmanuel Vadot compatible = "mediatek,mt8173-vcodec-enc"; 912eb4d8dcSEmmanuel Vadot reg = <0 0x18002000 0 0x1000>; 922eb4d8dcSEmmanuel Vadot interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_LOW>; 93c66ec88fSEmmanuel Vadot iommus = <&iommu M4U_PORT_VENC_RCPU>, 94c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_REC>, 95c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_BSDMA>, 96c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_SV_COMV>, 97c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_RD_COMV>, 98c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_CUR_LUMA>, 99c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_CUR_CHROMA>, 100c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_REF_LUMA>, 101c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_REF_CHROMA>, 102c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_NBM_RDMA>, 1032eb4d8dcSEmmanuel Vadot <&iommu M4U_PORT_VENC_NBM_WDMA>; 1042eb4d8dcSEmmanuel Vadot mediatek,larb = <&larb3>; 1052eb4d8dcSEmmanuel Vadot mediatek,vpu = <&vpu>; 1062eb4d8dcSEmmanuel Vadot clocks = <&topckgen CLK_TOP_VENC_SEL>; 1072eb4d8dcSEmmanuel Vadot clock-names = "venc_sel"; 1082eb4d8dcSEmmanuel Vadot assigned-clocks = <&topckgen CLK_TOP_VENC_SEL>; 1092eb4d8dcSEmmanuel Vadot assigned-clock-parents = <&topckgen CLK_TOP_VCODECPLL>; 1102eb4d8dcSEmmanuel Vadot }; 1112eb4d8dcSEmmanuel Vadot 1122eb4d8dcSEmmanuel Vadotvcodec_enc_vp8: vcodec@19002000 { 1132eb4d8dcSEmmanuel Vadot compatible = "mediatek,mt8173-vcodec-enc-vp8"; 1142eb4d8dcSEmmanuel Vadot reg = <0 0x19002000 0 0x1000>; /* VENC_LT_SYS */ 1152eb4d8dcSEmmanuel Vadot interrupts = <GIC_SPI 202 IRQ_TYPE_LEVEL_LOW>; 1162eb4d8dcSEmmanuel Vadot iommus = <&iommu M4U_PORT_VENC_RCPU_SET2>, 117c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_REC_FRM_SET2>, 118c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_BSDMA_SET2>, 119c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_SV_COMA_SET2>, 120c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_RD_COMA_SET2>, 121c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_CUR_LUMA_SET2>, 122c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_CUR_CHROMA_SET2>, 123c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_REF_LUMA_SET2>, 124c66ec88fSEmmanuel Vadot <&iommu M4U_PORT_VENC_REC_CHROMA_SET2>; 1252eb4d8dcSEmmanuel Vadot mediatek,larb = <&larb5>; 126c66ec88fSEmmanuel Vadot mediatek,vpu = <&vpu>; 1272eb4d8dcSEmmanuel Vadot clocks = <&topckgen CLK_TOP_VENC_LT_SEL>; 1282eb4d8dcSEmmanuel Vadot clock-names = "venc_lt_sel"; 1292eb4d8dcSEmmanuel Vadot assigned-clocks = <&topckgen CLK_TOP_VENC_LT_SEL>; 1302eb4d8dcSEmmanuel Vadot assigned-clock-parents = <&topckgen CLK_TOP_VCODECPLL_370P5>; 131c66ec88fSEmmanuel Vadot }; 132