media: iris: Add support for mahua platform
Subsystems (6)
v2 cover media: iris: Add support for mahua platform
Mahua is a derivative of glymur video accelerator with single core. This series introduces qcom,mahua-iris video driver support.
This series depends on the Glymur Iris enablement series:
https://lore.kernel.org/linux-media/[email protected]/
In particular, the qcom,glymur-iris compatible and the corresponding Iris driver is introduced by the prerequisite Glymur series. Therefore, this Mahua series must be applied on top of the Glymur series.
This series adds support for Mahua by:
- adding the qcom,mahua-iris devicetree binding
- adding Mahua Iris platform data for the single-core configuration
- adding the Mahua devicetree changes required for vcodec0 clocks, resets, power domains and operating points
The series was tested with the prerequisite Glymur series (and all glymur series' dependencies rebased) applied locally.
Compliance test for iris_driver device /dev/video16:
Driver Info:
Driver name : iris_driver
Card type : Iris Decoder
Bus info : plat:aa00000.video-codec:dec
Driver version : 7.3.0
Capabilities : 0x84204000 Video Memory-to-Memory Multiplanar Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04204000
Video Memory-to-Memory Multiplanar Streaming
Extended Pix Format
Detected Stateful Decoder
Required ioctls:
test VIDIOC_QUERYCAP: OK
test invalid ioctls: OK
Allow for multiple opens:
test second /dev/video16 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK (Not Supported)
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 12 Private Controls: 0
Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK test VIDIOC_G/S_PARM: OK (Not Supported) test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK
test Composing: OK
test Scaling: OK (Not Supported)
Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK
Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test CREATE_BUFS maximum buffers: OK test VIDIOC_REMOVE_BUFS: OK
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported) test blocking wait: OK
Test input 0:
Streaming ioctls:
test read/write: OK (Not Supported)
Video Capture Multiplanar: Captured 465 buffers
test MMAP (select, REQBUFS): OK
Video Capture Multiplanar: Captured 465 buffers
test MMAP (epoll, REQBUFS): OK
the input file is smaller than 7077888 bytes
Video Capture Multiplanar: Captured 465 buffers
test MMAP (select, CREATE_BUFS): OK
the input file is smaller than 7077888 bytes
Video Capture Multiplanar: Captured 465 buffers
test MMAP (epoll, CREATE_BUFS): OK
test USERPTR (select): OK (Not Supported)
warn: ../utils/v4l2-compliance/v4l2-test-buffers.cpp(2223): Cannot test DMABUF, specify --expbuf-device
test DMABUF (select): OK (Not Supported)
Total for iris_driver device /dev/video16: 55, Succeeded: 55, Failed: 0, Warnings: 1
Fluster test report:
77/135 while testing JVT-AVC_V1 with GStreamer-H.264-V4L2-Gst1.0.JVT-AVC_V1 141/147 tests passed while testing JCT-VC-HEVC_V1 with GStreamer-H.265-V4L2-Gst1.0 234/305 testcases passed while testing VP9-TEST-VECTORS with GStreamer-VP9-V4L2-Gst1.0 200/242 tests passed while tesing AV1-TEST-VECTORS -d GStreamer-AV1-V4L2-Gst1.0
---
Changes in v2:
- Use iommu-ranges instead of memory-region (Vishnu)
- Fix dt-bindings (Krzysztof)
- Fix order of patches and iris entry order in mahua.dtsi (Krzysztof)
- Update to maintain alphabetical order (Vishnu & Krzysztof)
- Update cover letter (Krzysztof)
- Rebase onto latest linux-next
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Deepa Guthyappa Madivalara (3):
dt-bindings: media: qcom,mahua-iris: Add Mahua video codec
media: iris: add mahua platform data and enable qcom,mahua-iris
arm64: dts: qcom: mahua: add iris video codec node
.../devicetree/bindings/media/qcom,mahua-iris.yaml | 200 +++++++++++++++++++++ arch/arm64/boot/dts/qcom/mahua.dtsi | 67 +++++++ drivers/media/platform/qcom/iris/Makefile | 1 + .../platform/qcom/iris/iris_platform_common.h | 1 + .../media/platform/qcom/iris/iris_platform_mahua.c | 44 +++++ .../media/platform/qcom/iris/iris_platform_mahua.h | 14 ++ .../media/platform/qcom/iris/iris_platform_vpu3x.c | 33 ++++ drivers/media/platform/qcom/iris/iris_probe.c | 4 + drivers/media/platform/qcom/iris/iris_vpu3x.c | 10 ++ 9 files changed, 374 insertions(+)
---
base-commit: 0d9d0dbf2fddcff5859d623e90ca73c4054276e1
change-id: 20261113-mahua_iris_enable-8e3026a4a044
prerequisite-message-id: <[email protected]>
prerequisite-patch-id: c790c17f7113da72001a1b83fa0dc0fb82e22760
prerequisite-patch-id: 5a2f89fdc7312d46f01aeb1507c3d179203c1357
prerequisite-patch-id: 1e1b6daab984b81b7ad83108fb532ea25345638d
prerequisite-patch-id: dc22e163717edf23b847a79af253c6b85bec58dc
prerequisite-patch-id: 2cc01cddaccf18ead1c1e2506f0182193afc1dcf
prerequisite-patch-id: a1e82173cdbb9c315bb6cce35108a7a4057cb235
prerequisite-patch-id: 4ed1c23d97cb438c917ab31f4193c58e3deeecda
prerequisite-patch-id: facfccd32a2f70f2bae3357106a3fe493b4c8c32
prerequisite-patch-id: 59bcb5096aef6258f4732dc8f8789c3e846e16c0
Best regards,
Signature · 1 line
Deepa Guthyappa Madivalara <[email protected]>
PATCH v2 1/3 dt-bindings: media: qcom,mahua-iris: Add Mahua video codec
Add a devicetree binding for the Iris3.9 video encoder and decoder block found on the Qualcomm Mahua SoC. This is a single core derivative, leveraging most of Glymur data with the clks, resets present only for vcodec0 core.
--- .../devicetree/bindings/media/qcom,mahua-iris.yaml | 200 +++++++++++++++++++++ 1 file changed, 200 insertions(+)
Documentation/devicetree/bindings/media/qcom,mahua-iris.yaml new file +200 -0
@@ -0,0 +1,200 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,mahua-iris.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Mahua SoC Iris video encoder and decoder + +maintainers: + - Vikash Garodia <[email protected]> + +description: + The Iris video processing unit on Qualcomm Mahua SoC is a video encode and + decode accelerator. + +properties: + compatible: + const: qcom,mahua-iris + + clocks: + maxItems: 6 + + clock-names: + items: + - const: core_iface + - const: core + - const: vcodec0_core + - const: vcodec0_iface + - const: core_freerun + - const: vcodec0_core_freerun + + dma-coherent: true + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: cpu-cfg + - const: video-mem + + non-pixel: + type: object + properties: + iommus: + maxItems: 3 + + operating-points-v2: true + opp-table: + type: object + + power-domains: + maxItems: 4 + + power-domain-names: + items: + - const: venus + - const: vcodec0 + - const: mxc + - const: mmcx + + resets: + maxItems: 4 + + reset-names: + items: + - const: core_bus + - const: vcodec0_bus + - const: core + - const: vcodec0_core + +required: + - clocks + - clock-names + - compatible + - dma-coherent + - interconnects + - interconnect-names + - power-domains + - power-domain-names + - resets + - reset-names + +allOf: + - $ref: qcom,venus-common.yaml# + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/power/qcom,rpmhpd.h> + + video-codec@aa00000 { + compatible = "qcom,mahua-iris"; + reg = <0x0aa00000 0xf0000>; + + clocks = <&gcc_video_axi0c_clk>, + <&videocc_mvs0c_clk>, + <&videocc_mvs0_clk>, + <&gcc_video_axi0_clk>, + <&videocc_mvs0c_freerun_clk>, + <&videocc_mvs0_freerun_clk>; + clock-names = "core_iface", + "core", + "vcodec0_core", + "vcodec0_iface", + "core_freerun", + "vcodec0_core_freerun"; + + dma-coherent; + + interconnects = <&hsc_noc_master_appss_proc &config_noc_slave_venus_cfg>, + <&mmss_noc_master_video &mc_virt_slave_ebi1>; + interconnect-names = "cpu-cfg", + "video-mem"; + + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; + + memory-region = <&video_mem>; + + operating-points-v2 = <&iris_opp_table>; + + power-domains = <&videocc_mvs0c_gdsc>, + <&videocc_mvs0_gdsc>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>; + power-domain-names = "venus", + "vcodec0", + "mxc", + "mmcx"; + + resets = <&gcc_video_axi0c_clk_ares>, + <&gcc_video_axi0_clk_ares>, + <&videocc_mvs0c_freerun_clk_ares>, + <&videocc_mvs0_freerun_clk_ares>; + reset-names = "core_bus", + "vcodec0_bus", + "core", + "vcodec0_core"; + + #address-cells = <1>; + #size-cells = <1>; + dma-ranges = <0x0 0x0 0xffe00000>; + + non-pixel { + iommus = <&apps_smmu 0x1940 0x0000>, + <&apps_smmu 0x1944 0x0000>, + <&apps_smmu 0x19e0 0x0000>; + iommu-ranges = <0x25800000 0xda600000>; + }; + + pixel { + iommus = <&apps_smmu 0x1943 0x0000>; + }; + + video-firmware { + iommus = <&apps_smmu 0x19e2 0x0000>; + }; + + iris_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-240000000 { + opp-hz = /bits/ 64 <240000000 360000000>; + required-opps = <&rpmhpd_opp_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-338000000 { + opp-hz = /bits/ 64 <338000000 507000000>; + required-opps = <&rpmhpd_opp_svs>, + <&rpmhpd_opp_svs>; + }; + + opp-366000000 { + opp-hz = /bits/ 64 <366000000 549000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-444000000 { + opp-hz = /bits/ 64 <444000000 666000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_nom>; + }; + + opp-533333334 { + opp-hz = /bits/ 64 <533333334 800000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_turbo>; + }; + + opp-655000000 { + opp-hz = /bits/ 64 <655000000 982000000>; + required-opps = <&rpmhpd_opp_nom>, + <&rpmhpd_opp_turbo_l1>; + }; + }; + };
Signature · 1 line
2.34.1
Re: [PATCH v2 1/3] dt-bindings: media: qcom,mahua-iris: Add Mahua video codec
Quoted 9 lines · Deepa Guthyappa Madivalara
Add a devicetree binding for the Iris3.9 video encoder and decoder block found on the Qualcomm Mahua SoC. This is a single core derivative, leveraging most of Glymur data with the clks, resets present only for vcodec0 core.
Signed-off-by Deepa Guthyappa Madivalara <[email protected]>--- .../devicetree/bindings/media/qcom,mahua-iris.yaml | 200 +++++++++++++++++++++ 1 file changed, 200 insertions(+)
I have impression that there are like 5 different patchsets around Venus/Iris depending on each other or depending on something. Kind of same comment last time.
Best regards,
Krzysztof
Bryan O'Donoghue
maintainerRe: [PATCH v2 1/3] dt-bindings: media: qcom,mahua-iris: Add Mahua video codec
Quoted 11 lines · Krzysztof Kozlowski
Quoted 9 lines · Deepa Guthyappa Madivalara
Add a devicetree binding for the Iris3.9 video encoder and decoder block found on the Qualcomm Mahua SoC. This is a single core derivative, leveraging most of Glymur data with the clks, resets present only for vcodec0 core.
Signed-off-by Deepa Guthyappa Madivalara <[email protected]>--- .../devicetree/bindings/media/qcom,mahua-iris.yaml | 200 +++++++++++++++++++++ 1 file changed, 200 insertions(+)
Quoted 6 lines
I have impression that there are like 5 different patchsets around Venus/Iris depending on each other or depending on something. Kind of same comment last time.
Best regards,
Krzysztof
Everything is blocked until this iommu stuff gets resolved either way.
---
bod
Re: [PATCH v2 1/3] dt-bindings: media: qcom,mahua-iris: Add Mahua video codec
In reply to Deepa Guthyappa MadivalaraQuoted 88 lines · Deepa Guthyappa Madivalara
Add a devicetree binding for the Iris3.9 video encoder and decoder block found on the Qualcomm Mahua SoC. This is a single core derivative, leveraging most of Glymur data with the clks, resets present only for vcodec0 core.
Signed-off-by Deepa Guthyappa Madivalara <[email protected]>--- .../devicetree/bindings/media/qcom,mahua-iris.yaml | 200 +++++++++++++++++++++ 1 file changed, 200 insertions(+)Documentation/devicetree/bindings/media/qcom,mahua-iris.yaml new file +72
-0@@ -0,0 +1,200 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,mahua-iris.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Mahua SoC Iris video encoder and decoder + +maintainers: + - Vikash Garodia <[email protected]> + +description: + The Iris video processing unit on Qualcomm Mahua SoC is a video encode and + decode accelerator. + +properties: + compatible: + const: qcom,mahua-iris + + clocks: + maxItems: 6 + + clock-names: + items: + - const: core_iface + - const: core + - const: vcodec0_core + - const: vcodec0_iface + - const: core_freerun + - const: vcodec0_core_freerun + + dma-coherent: true + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: cpu-cfg + - const: video-mem + + non-pixel: + type: object + properties: + iommus: + maxItems: 3 + + operating-points-v2: true + opp-table: + type: object + + power-domains: + maxItems: 4 + + power-domain-names: + items: + - const: venus + - const: vcodec0 + - const: mxc + - const: mmcx + + resets: + maxItems: 4 + + reset-names: + items: + - const: core_bus + - const: vcodec0_bus + - const: core + - const: vcodec0_core + +required:
Documentation/devicetree/bindings/media/qcom,mahua-iris.yaml line 82
Quoted 10 lines
Documentation/devicetree/bindings/media/qcom,mahua-iris.yaml new file +10
-0+ - clocks + - clock-names + - compatible + - dma-coherent + - interconnects + - interconnect-names + - power-domains + - power-domain-names + - resets + - reset-names
clocks, clock-names and power-domain can be dropped from required list as this can be already present in required list in qcom,venus-common.yaml which this schema is $ref.
Quoted 119 lines
Documentation/devicetree/bindings/media/qcom,mahua-iris.yaml new file +118
-0+ +allOf: + - $ref: qcom,venus-common.yaml# + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/power/qcom,rpmhpd.h> + + video-codec@aa00000 { + compatible = "qcom,mahua-iris"; + reg = <0x0aa00000 0xf0000>; + + clocks = <&gcc_video_axi0c_clk>, + <&videocc_mvs0c_clk>, + <&videocc_mvs0_clk>, + <&gcc_video_axi0_clk>, + <&videocc_mvs0c_freerun_clk>, + <&videocc_mvs0_freerun_clk>; + clock-names = "core_iface", + "core", + "vcodec0_core", + "vcodec0_iface", + "core_freerun", + "vcodec0_core_freerun"; + + dma-coherent; + + interconnects = <&hsc_noc_master_appss_proc &config_noc_slave_venus_cfg>, + <&mmss_noc_master_video &mc_virt_slave_ebi1>; + interconnect-names = "cpu-cfg", + "video-mem"; + + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; + + memory-region = <&video_mem>; + + operating-points-v2 = <&iris_opp_table>; + + power-domains = <&videocc_mvs0c_gdsc>, + <&videocc_mvs0_gdsc>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>; + power-domain-names = "venus", + "vcodec0", + "mxc", + "mmcx"; + + resets = <&gcc_video_axi0c_clk_ares>, + <&gcc_video_axi0_clk_ares>, + <&videocc_mvs0c_freerun_clk_ares>, + <&videocc_mvs0_freerun_clk_ares>; + reset-names = "core_bus", + "vcodec0_bus", + "core", + "vcodec0_core"; + + #address-cells = <1>; + #size-cells = <1>; + dma-ranges = <0x0 0x0 0xffe00000>; + + non-pixel { + iommus = <&apps_smmu 0x1940 0x0000>, + <&apps_smmu 0x1944 0x0000>, + <&apps_smmu 0x19e0 0x0000>; + iommu-ranges = <0x25800000 0xda600000>; + }; + + pixel { + iommus = <&apps_smmu 0x1943 0x0000>; + }; + + video-firmware { + iommus = <&apps_smmu 0x19e2 0x0000>; + }; + + iris_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-240000000 { + opp-hz = /bits/ 64 <240000000 360000000>; + required-opps = <&rpmhpd_opp_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-338000000 { + opp-hz = /bits/ 64 <338000000 507000000>; + required-opps = <&rpmhpd_opp_svs>, + <&rpmhpd_opp_svs>; + }; + + opp-366000000 { + opp-hz = /bits/ 64 <366000000 549000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-444000000 { + opp-hz = /bits/ 64 <444000000 666000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_nom>; + }; + + opp-533333334 { + opp-hz = /bits/ 64 <533333334 800000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_turbo>; + }; + + opp-655000000 { + opp-hz = /bits/ 64 <655000000 982000000>; + required-opps = <&rpmhpd_opp_nom>, + <&rpmhpd_opp_turbo_l1>; + }; + }; + };
Re: [PATCH v2 1/3] dt-bindings: media: qcom,mahua-iris: Add Mahua video codec
Quoted 94 lines · Vishnu Reddy
Quoted 93 lines · Deepa Guthyappa Madivalara
Add a devicetree binding for the Iris3.9 video encoder and decoder block found on the Qualcomm Mahua SoC. This is a single core derivative, leveraging most of Glymur data with the clks, resets present only for vcodec0 core.
Signed-off-by Deepa Guthyappa Madivalara <[email protected]>--- .../devicetree/bindings/media/qcom,mahua-iris.yaml | 200 +++++++++++++++++++++ 1 file changed, 200 insertions(+)Documentation/devicetree/bindings/media/qcom,mahua-iris.yaml new file +77
-0@@ -0,0 +1,200 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,mahua-iris.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Mahua SoC Iris video encoder and decoder + +maintainers: + - Vikash Garodia <[email protected]> + +description: + The Iris video processing unit on Qualcomm Mahua SoC is a video encode and + decode accelerator. + +properties: + compatible: + const: qcom,mahua-iris + + clocks: + maxItems: 6 + + clock-names: + items: + - const: core_iface + - const: core + - const: vcodec0_core + - const: vcodec0_iface + - const: core_freerun + - const: vcodec0_core_freerun + + dma-coherent: true + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: cpu-cfg + - const: video-mem + + non-pixel: + type: object + properties: + iommus: + maxItems: 3 + + operating-points-v2: true + opp-table: + type: object + + power-domains: + maxItems: 4 + + power-domain-names: + items: + - const: venus + - const: vcodec0 + - const: mxc + - const: mmcx + + resets: + maxItems: 4 + + reset-names: + items: + - const: core_bus + - const: vcodec0_bus + - const: core + - const: vcodec0_core + +required: + - clocks + - clock-names + - compatible + - dma-coherent + - interconnects
Quoted 8 lines
Documentation/devicetree/bindings/media/qcom,mahua-iris.yaml line 82
Quoted 5 lines
Documentation/devicetree/bindings/media/qcom,mahua-iris.yaml new file +5
-0+ - interconnect-names + - power-domains + - power-domain-names + - resets + - reset-namesclocks, clock-names and power-domain can be dropped from required list as this can be already present in required list in qcom,venus-common.yaml which this schema is $ref.
I would prefer to keep this for clarity and consistency with other bindings. Let me know if this a must remove.
Quoted 119 lines
Quoted 119 lines
Documentation/devicetree/bindings/media/qcom,mahua-iris.yaml new file +118
-0+ +allOf: + - $ref: qcom,venus-common.yaml# + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/power/qcom,rpmhpd.h> + + video-codec@aa00000 { + compatible = "qcom,mahua-iris"; + reg = <0x0aa00000 0xf0000>; + + clocks = <&gcc_video_axi0c_clk>, + <&videocc_mvs0c_clk>, + <&videocc_mvs0_clk>, + <&gcc_video_axi0_clk>, + <&videocc_mvs0c_freerun_clk>, + <&videocc_mvs0_freerun_clk>; + clock-names = "core_iface", + "core", + "vcodec0_core", + "vcodec0_iface", + "core_freerun", + "vcodec0_core_freerun"; + + dma-coherent; + + interconnects = <&hsc_noc_master_appss_proc &config_noc_slave_venus_cfg>, + <&mmss_noc_master_video &mc_virt_slave_ebi1>; + interconnect-names = "cpu-cfg", + "video-mem"; + + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; + + memory-region = <&video_mem>; + + operating-points-v2 = <&iris_opp_table>; + + power-domains = <&videocc_mvs0c_gdsc>, + <&videocc_mvs0_gdsc>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>; + power-domain-names = "venus", + "vcodec0", + "mxc", + "mmcx"; + + resets = <&gcc_video_axi0c_clk_ares>, + <&gcc_video_axi0_clk_ares>, + <&videocc_mvs0c_freerun_clk_ares>, + <&videocc_mvs0_freerun_clk_ares>; + reset-names = "core_bus", + "vcodec0_bus", + "core", + "vcodec0_core"; + + #address-cells = <1>; + #size-cells = <1>; + dma-ranges = <0x0 0x0 0xffe00000>; + + non-pixel { + iommus = <&apps_smmu 0x1940 0x0000>, + <&apps_smmu 0x1944 0x0000>, + <&apps_smmu 0x19e0 0x0000>; + iommu-ranges = <0x25800000 0xda600000>; + }; + + pixel { + iommus = <&apps_smmu 0x1943 0x0000>; + }; + + video-firmware { + iommus = <&apps_smmu 0x19e2 0x0000>; + }; + + iris_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-240000000 { + opp-hz = /bits/ 64 <240000000 360000000>; + required-opps = <&rpmhpd_opp_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-338000000 { + opp-hz = /bits/ 64 <338000000 507000000>; + required-opps = <&rpmhpd_opp_svs>, + <&rpmhpd_opp_svs>; + }; + + opp-366000000 { + opp-hz = /bits/ 64 <366000000 549000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-444000000 { + opp-hz = /bits/ 64 <444000000 666000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_nom>; + }; + + opp-533333334 { + opp-hz = /bits/ 64 <533333334 800000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_turbo>; + }; + + opp-655000000 { + opp-hz = /bits/ 64 <655000000 982000000>; + required-opps = <&rpmhpd_opp_nom>, + <&rpmhpd_opp_turbo_l1>; + }; + }; + };
PATCH v2 2/3 media: iris: add mahua platform data and enable qcom,mahua-iris
In reply to Deepa Guthyappa MadivalaraAdd qcom,mahua-iris compatible to initialize the hardware and necessary Mahua platform data describing the needed clock resets and powerdomain tables only for one core, vcodec0. Most of the data is leveraged from Glymur as they are the same Iris variant. Firmware, vpu ops, buffer sizes are the same as for Glymur.
--- drivers/media/platform/qcom/iris/Makefile | 1 + .../platform/qcom/iris/iris_platform_common.h | 1 + .../media/platform/qcom/iris/iris_platform_mahua.c | 44 ++++++++++++++++++++++ .../media/platform/qcom/iris/iris_platform_mahua.h | 14 +++++++ .../media/platform/qcom/iris/iris_platform_vpu3x.c | 33 ++++++++++++++++ drivers/media/platform/qcom/iris/iris_probe.c | 4 ++ drivers/media/platform/qcom/iris/iris_vpu3x.c | 10 +++++ 7 files changed, 107 insertions(+)
drivers/media/platform/qcom/iris/Makefile +1 -0
@@ -13,6 +13,7 @@ qcom-iris-objs += iris_buffer.o \ iris_hfi_gen2_response.o \ iris_hfi_queue.o \ iris_platform_glymur.o \ + iris_platform_mahua.o \ iris_platform_vpu2.o \ iris_platform_vpu3x.o \ iris_platform_vpu_ar50lt.o \
drivers/media/platform/qcom/iris/iris_platform_common.h +1 -0
@@ -67,6 +67,7 @@ extern const struct platform_inst_slice_caps iris_vpu2_vpu3x_slice_caps;extern const struct platform_inst_slice_caps iris_ar50lt_slice_caps;extern const struct iris_platform_data glymur_data; +extern const struct iris_platform_data mahua_data;extern const struct iris_platform_data milos_data;extern const struct iris_platform_data qcm2290_data;extern const struct iris_platform_data qcs8300_data;
drivers/media/platform/qcom/iris/iris_platform_mahua.c new file +44 -0
44 lines not on this page · raw message
drivers/media/platform/qcom/iris/iris_platform_mahua.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. +*/ + +#ifndef __IRIS_PLATFORM_MAHUA_H__ +#define __IRIS_PLATFORM_MAHUA_H__ + +extern const struct iris_power_domain_data iris_mahua_ctrl_data; +extern const struct iris_power_domain_data iris_mahua_vcodec_data[1 ]; +extern const char *const iris_mahua_clk_reset_table[4 ]; +extern const char *const iris_mahua_opp_clk_table[2 ]; + +#endif /* __IRIS_PLATFORM_MAHUA_H__ */
drivers/media/platform/qcom/iris/iris_platform_vpu3x.c +33 -0
@@ -13,6 +13,7 @@#include "iris_vpu_common.h" #include "iris_platform_glymur.h" +#include "iris_platform_mahua.h" #include "iris_platform_qcs8300.h" #include "iris_platform_sm8550.h" #include "iris_platform_sm8650.h"
@@ -120,6 +121,38 @@ const struct iris_platform_data glymur_data = { .max_core_mbps = ((8192 * 4320) / 256) * 60, }; +/* +* Shares most of Glymur data except, num_cores +*/ +const struct iris_platform_data mahua_data = { + .firmware_desc_gen2 = &iris_vpu36_p4_s7_gen2_desc, + .vpu_ops = &iris_vpu36_ops, + .icc_tbl = iris_icc_info_vpu3x, + .icc_tbl_size =ARRAY_SIZE (iris_icc_info_vpu3x), + .clk_rst_tbl = iris_mahua_clk_reset_table, + .clk_rst_tbl_size =ARRAY_SIZE (iris_mahua_clk_reset_table), + .bw_tbl_dec = iris_bw_table_dec_vpu3x, + .bw_tbl_dec_size =ARRAY_SIZE (iris_bw_table_dec_vpu3x), + .ctrl_data = &iris_mahua_ctrl_data, + .vcodec_data = iris_mahua_vcodec_data, + .opp_pd_tbl = iris_opp_pd_table_vpu3x, + .opp_pd_tbl_size =ARRAY_SIZE (iris_opp_pd_table_vpu3x), + .opp_clk_tbl = iris_mahua_opp_clk_table, +/* Upper bound of DMA address range */ + .dma_mask =0xffe00000 -1 , + .inst_iris_fmts = iris_fmts_vpu3x_dec, + .inst_iris_fmts_size =ARRAY_SIZE (iris_fmts_vpu3x_dec), + .inst_caps = &platform_inst_cap_sm8550, + .slice_caps = &iris_vpu2_vpu3x_slice_caps, + .tz_cp_config_data = iris_glymur_tz_cp_config, + .tz_cp_config_data_size =ARRAY_SIZE (iris_glymur_tz_cp_config), + .num_vpp_pipe =4 , + .max_session_count =16 , + .num_cores =1 , + .max_core_mbpf =NUM_MBS_8K *2 , + .max_core_mbps = ((7680 *4320 ) /256 ) *60 , +}; +/* * Shares most of SM8550 data except: * - inst_caps to platform_inst_cap_qcs8300
drivers/media/platform/qcom/iris/iris_probe.c +4 -0
@@ -643,6 +643,10 @@ static const struct of_device_id iris_dt_match[] = { .compatible = "qcom,glymur-iris", .data = &glymur_data, }, + { + .compatible = "qcom,mahua-iris", + .data = &mahua_data, + }, { .compatible = "qcom,milos-iris", .data = &milos_data,
drivers/media/platform/qcom/iris/iris_vpu3x.c +10 -0
@@ -365,6 +365,16 @@ static int iris_vpu36_check_core_load(struct iris_inst *inst, bool mbpf) new_load = mbpf ?iris_get_mbpf (inst) :iris_get_mbps (inst); select_core0 = core0_load + new_load <= max_load && core0_session_cnt < max_session_cnt; + +if (platform_data->num_cores ==1 ) { +if (select_core0) { + inst->core_id =IRIS_VCODEC0 ; +return 0 ; + } + +return -ENOMEM ; + } + select_core1 = core1_load + new_load <= max_load && core1_session_cnt < max_session_cnt;if (select_core0 && select_core1)
Signature · 1 line
2.34.1
PATCH v2 3/3 arm64: dts: qcom: mahua: add iris video codec node
In reply to Deepa Guthyappa MadivalaraAdd the iris video codec device node for the mahua SoC, overrriding the fields clocks, power-domains, resets and opp-table reflecting single core.
--- arch/arm64/boot/dts/qcom/mahua.dtsi | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)
arch/arm64/boot/dts/qcom/mahua.dtsi +67 -0
@@ -150,6 +150,73 @@ &hsc_noc { compatible = "qcom,mahua-hscnoc"; }; +&iris { + compatible = "qcom,mahua-iris"; + status = "okay"; + + clocks = <&gcc GCC_VIDEO_AXI0C_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>, + <&gcc GCC_VIDEO_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK>, + <&videocc VIDEO_CC_MVS0_FREERUN_CLK>; + clock-names = "core_iface", "core", "vcodec0_core", + "vcodec0_iface", "core_freerun", + "vcodec0_core_freerun"; + + power-domains = <&videocc VIDEO_CC_MVS0C_GDSC>, + <&videocc VIDEO_CC_MVS0_GDSC>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>; + power-domain-names = "venus", "vcodec0", "mxc", "mmcx"; + + resets = <&gcc GCC_VIDEO_AXI0C_CLK_ARES>, + <&gcc GCC_VIDEO_AXI0_CLK_ARES>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK_ARES>, + <&videocc VIDEO_CC_MVS0_FREERUN_CLK_ARES>; + reset-names = "core_bus", "vcodec0_bus", "core", "vcodec0_core"; + + iris_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-240000000 { + opp-hz = /bits/ 64 <240000000 360000000>; + required-opps = <&rpmhpd_opp_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-338000000 { + opp-hz = /bits/ 64 <338000000 507000000>; + required-opps = <&rpmhpd_opp_svs>, + <&rpmhpd_opp_svs>; + }; + + opp-366000000 { + opp-hz = /bits/ 64 <366000000 549000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-444000000 { + opp-hz = /bits/ 64 <444000000 666000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_nom>; + }; + + opp-533333334 { + opp-hz = /bits/ 64 <533333334 800000000>; + required-opps = <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_turbo>; + }; + + opp-655000000 { + opp-hz = /bits/ 64 <655000000 982000000>; + required-opps = <&rpmhpd_opp_nom>, + <&rpmhpd_opp_turbo_l1>; + }; + }; +}; + &lpass_ag_noc { compatible = "qcom,mahua-lpass-ag-noc", "qcom,glymur-lpass-ag-noc"; };
Signature · 1 line
2.34.1
Re: [PATCH v2 3/3] arm64: dts: qcom: mahua: add iris video codec node
Quoted 5 lines · Deepa Guthyappa Madivalara
Add the iris video codec device node for the mahua SoC, overrriding the fields clocks, power-domains, resets and opp-table reflecting single core.
Signed-off-by Deepa Guthyappa Madivalara <[email protected]>---
The glymur series is not yet merged and can't be because of dependencies, so this patch can't be applied either
Quoted 8 lines
arch/arm64/boot/dts/qcom/mahua.dtsi | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)arch/arm64/boot/dts/qcom/mahua.dtsi +0
-0
arch/arm64/boot/dts/qcom/mahua.dtsi &hsc_noc { · line 155
Quoted 6 lines
arch/arm64/boot/dts/qcom/mahua.dtsi +3
-0@@ -150,6 +150,73 @@ &hsc_noc { compatible = "qcom,mahua-hscnoc"; }; +&iris { + compatible = "qcom,mahua-iris"; + status = "okay";
This is stray
arch/arm64/boot/dts/qcom/mahua.dtsi &hsc_noc { · line 165
Quoted 10 lines
arch/arm64/boot/dts/qcom/mahua.dtsi +10
-0+ + clocks = <&gcc GCC_VIDEO_AXI0C_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>, + <&gcc GCC_VIDEO_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK>, + <&videocc VIDEO_CC_MVS0_FREERUN_CLK>; + clock-names = "core_iface", "core", "vcodec0_core", + "vcodec0_iface", "core_freerun", + "vcodec0_core_freerun";
Please match the style in the glymur submission
Konrad
Quoted 4 lines
arch/arm64/boot/dts/qcom/mahua.dtsi +4
-0+ + power-domains = <&videocc VIDEO_CC_MVS0C_GDSC>, + <&videocc VIDEO_CC_MVS0_GDSC>, + <&rpmhpd RPMHPD_MXC>,
arch/arm64/boot/dts/qcom/mahua.dtsi &hsc_noc { · line 179
Quoted 10 lines
arch/arm64/boot/dts/qcom/mahua.dtsi +10
-0+ <&rpmhpd RPMHPD_MMCX>; + power-domain-names = "venus", "vcodec0", "mxc", "mmcx"; + + resets = <&gcc GCC_VIDEO_AXI0C_CLK_ARES>, + <&gcc GCC_VIDEO_AXI0_CLK_ARES>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK_ARES>, + <&videocc VIDEO_CC_MVS0_FREERUN_CLK_ARES>; + reset-names = "core_bus", "vcodec0_bus", "core", "vcodec0_core"; + + iris_opp_table: opp-table {
You need to delete-node on the Glymur table, otherwise this shadows over that one
Konrad
Re: [PATCH v2 3/3] arm64: dts: qcom: mahua: add iris video codec node
Quoted 20 lines · Konrad Dybcio
Quoted 5 lines · Deepa Guthyappa Madivalara
Add the iris video codec device node for the mahua SoC, overrriding the fields clocks, power-domains, resets and opp-table reflecting single core.
Signed-off-by Deepa Guthyappa Madivalara <[email protected]>---
The glymur series is not yet merged and can't be because of dependencies, so this patch can't be applied either
Quoted 11 lines
arch/arm64/boot/dts/qcom/mahua.dtsi | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)arch/arm64/boot/dts/qcom/mahua.dtsi +0
-0@@ -150,6 +150,73 @@ &hsc_noc { compatible = "qcom,mahua-hscnoc"; };
Quoted 4 lines
arch/arm64/boot/dts/qcom/mahua.dtsi &hsc_noc { · line 155
Quoted 3 lines
arch/arm64/boot/dts/qcom/mahua.dtsi +3
-0+&iris { + compatible = "qcom,mahua-iris"; + status = "okay";This is stray
Removed in v3.
Quoted 14 lines
arch/arm64/boot/dts/qcom/mahua.dtsi &hsc_noc { · line 165
Quoted 12 lines
arch/arm64/boot/dts/qcom/mahua.dtsi +10
-0+ + clocks = <&gcc GCC_VIDEO_AXI0C_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>, + <&gcc GCC_VIDEO_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK>, + <&videocc VIDEO_CC_MVS0_FREERUN_CLK>; + clock-names = "core_iface", "core", "vcodec0_core", + "vcodec0_iface", "core_freerun", + "vcodec0_core_freerun";Please match the style in the glymur submission
Quoted 1 line
Konrad
Updated in v3.
Quoted 17 lines
Quoted 4 lines
arch/arm64/boot/dts/qcom/mahua.dtsi +4
-0+ + power-domains = <&videocc VIDEO_CC_MVS0C_GDSC>, + <&videocc VIDEO_CC_MVS0_GDSC>, + <&rpmhpd RPMHPD_MXC>,arch/arm64/boot/dts/qcom/mahua.dtsi &hsc_noc { · line 179
Quoted 10 lines
arch/arm64/boot/dts/qcom/mahua.dtsi +10
-0+ <&rpmhpd RPMHPD_MMCX>; + power-domain-names = "venus", "vcodec0", "mxc", "mmcx"; + + resets = <&gcc GCC_VIDEO_AXI0C_CLK_ARES>, + <&gcc GCC_VIDEO_AXI0_CLK_ARES>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK_ARES>, + <&videocc VIDEO_CC_MVS0_FREERUN_CLK_ARES>; + reset-names = "core_bus", "vcodec0_bus", "core", "vcodec0_core"; + + iris_opp_table: opp-table {You need to delete-node on the Glymur table, otherwise this shadows over that one
Quoted 1 line
Konrad
Understood, updated in v3.