Skip to contentSkip to conversation

Rockchip RK3328 VDEC support

PATCH Applied Christopher Obbard 4 participants 7 messages Apr 25, 2022 – Apr 30, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover Rockchip RK3328 VDEC support

This series adds VDEC support for the Rockchip RK3328 SoC which uses the staging rkvdec driver.

Testing was performed using both v4l-compliance and (mainline) gstreamer using the fluster framework:

    $ v4l2-compliance -m0
    v4l2-compliance 1.22.1, 64 bits, 64-bit time_t
    ...
    Grand Total for rkvdec device /dev/media0: 54, Succeeded: 54, Failed: 0, Warnings: 0
    $ python3 fluster.py run -j1 -ts JVT-AVC_V1 -d GStreamer-H.264-V4L2SL-Gst1.0
    ...
    Ran 111/135 tests successfully               in 392.885 secs
    $ python3 fluster.py run -j1 -ts VP9-TEST-VECTORS -d GStreamer-VP9-V4L2SL-Gst1.0
    ...
    Ran 206/303 tests successfully               in 1170.120 secs

Changes in v3:
- Finally fix mistable in dt-binding compatible documentation

Changes in v2:
- Fix mistake in dt-binding compatible documentation
- Remove unused reset nodes from devicetree
- Improve some commit messages
- Check all dts files against dtbs_check
- Collect review tags on unchanged patches

Christopher Obbard (3):
media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible
arm64: dts: rockchip: Rename vdec_mmu node for RK3328
arm64: dts: rockchip: Add vdec support for RK3328

 .../bindings/media/rockchip,vdec.yaml         |  3 +++
 arch/arm64/boot/dts/rockchip/rk3328.dtsi      | 22 +++++++++++++++++--
 2 files changed, 23 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v3 1/3 media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible

Document the RK3328 compatible for rockchip-vdec. The driver shares the same base functionality as the RK3399 hardware so make sure that the RK3399 compatible is also included in the device tree.

---
 Documentation/devicetree/bindings/media/rockchip,vdec.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/media/rockchip,vdec.yaml +3 -1
index 089f11d21b25..3bcfb8e12333 100644
@@ -18,7 +18,9 @@ properties:
     oneOf:
       - const: rockchip,rk3399-vdec
       - items:
-          - const: rockchip,rk3228-vdec
+          - enum:
+              - rockchip,rk3228-vdec
+              - rockchip,rk3328-vdec
           - const: rockchip,rk3399-vdec
 
   reg:
Signature · 1 line
2.34.1
Acked-by on v3 1/3
#2 lore raw

Re: [PATCH v3 1/3] media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible

Quoted 5 lines · Christopher Obbard

Document the RK3328 compatible for rockchip-vdec. The driver shares the same base functionality as the RK3399 hardware so make sure that the RK3399 compatible is also included in the device tree.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH v3 1/3] media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible

In reply to Christopher Obbard
Quoted 5 lines · Christopher Obbard

Document the RK3328 compatible for rockchip-vdec. The driver shares the same base functionality as the RK3399 hardware so make sure that the RK3399 compatible is also included in the device tree.

I'm merging this bindings change in the media subsystem, so the other two patches can be be merged for 5.19 by whoever maintains those dts files.

Regards,

Hans

Quoted 19 lines
---
 Documentation/devicetree/bindings/media/rockchip,vdec.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/media/rockchip,vdec.yaml +3 -1
index 089f11d21b25..3bcfb8e12333 100644
@@ -18,7 +18,9 @@ properties:
     oneOf:
       - const: rockchip,rk3399-vdec
       - items:
-          - const: rockchip,rk3228-vdec
+          - enum:
+              - rockchip,rk3228-vdec
+              - rockchip,rk3328-vdec
           - const: rockchip,rk3399-vdec
 
   reg:
#4 lore raw

PATCH v3 2/3 arm64: dts: rockchip: Rename vdec_mmu node for RK3328

In reply to Christopher Obbard

All other rockchip devices which have vdec nodes do not have an rk prefix. Remove the prefix from the (currently unused) rkvdec_mmu node for consistency with other devices.

---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3328.dtsi +1 -1
index b822533dc7f1..f8ef149fedad 100644
@@ -660,7 +660,7 @@ vpu_mmu: iommu@ff350800 {
 		power-domains = <&power RK3328_PD_VPU>;
 	};
 
-	rkvdec_mmu: iommu@ff360480 {
+	vdec_mmu: iommu@ff360480 {
 		compatible = "rockchip,iommu";
 		reg = <0x0 0xff360480 0x0 0x40>, <0x0 0xff3604c0 0x0 0x40>;
 		interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.34.1
#5 lore raw

PATCH v3 3/3 arm64: dts: rockchip: Add vdec support for RK3328

In reply to Christopher Obbard

The RK3328 has an vdec device with dedicated iommu. Describe the vdec device, the required power-domains and enable the iommu in the devicetree.

---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3328.dtsi +19 -1
index f8ef149fedad..49ae15708a0b 100644
@@ -306,6 +306,10 @@ power-domain@RK3328_PD_HEVC {
 			};
 			power-domain@RK3328_PD_VIDEO {
 				reg = <RK3328_PD_VIDEO>;
+				clocks = <&cru ACLK_RKVDEC>,
+					 <&cru HCLK_RKVDEC>,
+					 <&cru SCLK_VDEC_CABAC>,
+					 <&cru SCLK_VDEC_CORE>;
 				#power-domain-cells = <0>;
 			};
 			power-domain@RK3328_PD_VPU {
@@ -660,6 +664,20 @@ vpu_mmu: iommu@ff350800 {
 		power-domains = <&power RK3328_PD_VPU>;
 	};
 
+	vdec: video-codec@ff360000 {
+		compatible = "rockchip,rk3328-vdec", "rockchip,rk3399-vdec";
+		reg = <0x0 0xff360000 0x0 0x400>;
+		interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>,
+			 <&cru SCLK_VDEC_CABAC>, <&cru SCLK_VDEC_CORE>;
+		clock-names = "axi", "ahb", "cabac", "core";
+		assigned-clocks = <&cru ACLK_RKVDEC>, <&cru SCLK_VDEC_CABAC>,
+				  <&cru SCLK_VDEC_CORE>;
+		assigned-clock-rates = <400000000>, <400000000>, <300000000>;
+		iommus = <&vdec_mmu>;
+		power-domains = <&power RK3328_PD_VIDEO>;
+	};
+
 	vdec_mmu: iommu@ff360480 {
 		compatible = "rockchip,iommu";
 		reg = <0x0 0xff360480 0x0 0x40>, <0x0 0xff3604c0 0x0 0x40>;
@@ -667,7 +685,7 @@ vdec_mmu: iommu@ff360480 {
 		clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>;
 		clock-names = "aclk", "iface";
 		#iommu-cells = <0>;
-		status = "disabled";
+		power-domains = <&power RK3328_PD_VIDEO>;
 	};
 
 	vop: vop@ff370000 {
Signature · 1 line
2.34.1
maintainer Applied
#6 lore raw

Re: (subset) [PATCH v3 0/3] Rockchip RK3328 VDEC support

In reply to Christopher Obbard
Quoted 6 lines · Christopher Obbard

This series adds VDEC support for the Rockchip RK3328 SoC which uses the staging rkvdec driver.

Testing was performed using both v4l-compliance and (mainline) gstreamer using the fluster framework:

Quoted 6 lines
    $ v4l2-compliance -m0
    v4l2-compliance 1.22.1, 64 bits, 64-bit time_t
    ...
    Grand Total for rkvdec device /dev/media0: 54, Succeeded: 54, Failed: 0, Warnings: 0

[...]

Applied, thanks!

[2/3] arm64: dts: rockchip: Rename vdec_mmu node for RK3328

      commit: a2fe0f97fd4a5e482123fc207a48bde844b161a1
[3/3] arm64: dts: rockchip: Add vdec support for RK3328
      commit: 17408c9b119de4edef9ea57ade7e97d4a1b8b632

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>