Skip to contentSkip to conversation

Rockchip RK3328 VDEC support

PATCH Superseded Christopher Obbard 2 participants 6 messages Apr 25, 2022

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 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 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 v2 1/3 media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible

Document the RK3328 compatible for rockchip-vdec.

---
 Documentation/devicetree/bindings/media/rockchip,vdec.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/rockchip,vdec.yaml +3 -0
index 089f11d21b25..ce06835e8d61 100644
@@ -20,6 +20,9 @@ properties:
       - items:
           - const: rockchip,rk3228-vdec
           - const: rockchip,rk3399-vdec
+      - items:
+          - const: rockchip,rk3328-vdec
+          - const: rockchip,rk3399-vdec
 
   reg:
     maxItems: 1
Signature · 1 line
2.34.1
#2 lore raw

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

Quoted 12 lines · Christopher Obbard

Document the RK3328 compatible for rockchip-vdec.

---
 Documentation/devicetree/bindings/media/rockchip,vdec.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/rockchip,vdec.yaml +0 -0
index 089f11d21b25..ce06835e8d61 100644

Documentation/devicetree/bindings/media/rockchip,vdec.yaml properties: · line 25

Quoted 6 lines
Documentation/devicetree/bindings/media/rockchip,vdec.yaml +3 -0
@@ -20,6 +20,9 @@ properties:
       - items:
           - const: rockchip,rk3228-vdec
           - const: rockchip,rk3399-vdec
+      - items:
+          - const: rockchip,rk3328-vdec
+          - const: rockchip,rk3399-vdec

This should be rather an enum with rk3228, so:
- enum
- rockchip,rk3228-vdec
- rockchip,rk3328-vdec
- const: rockchip,rk3399-vdec

Best regards,
Krzysztof

#3 lore raw

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

Quoted 18 lines · Krzysztof Kozlowski
Quoted 17 lines · Christopher Obbard

Document the RK3328 compatible for rockchip-vdec.

---
  Documentation/devicetree/bindings/media/rockchip,vdec.yaml | 3 +++
  1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/media/rockchip,vdec.yaml +2 -0
index 089f11d21b25..ce06835e8d61 100644
@@ -20,6 +20,9 @@ properties:
        - items:
            - const: rockchip,rk3228-vdec
            - const: rockchip,rk3399-vdec
+      - items:
+          - const: rockchip,rk3328-vdec
Quoted 8 lines

Documentation/devicetree/bindings/media/rockchip,vdec.yaml properties: · line 25

Quoted 1 line
Documentation/devicetree/bindings/media/rockchip,vdec.yaml +1 -0
+          - const: rockchip,rk3399-vdec

This should be rather an enum with rk3228, so:
- enum
- rockchip,rk3228-vdec
- rockchip,rk3328-vdec
- const: rockchip,rk3399-vdec

Thanks for your patience with reviewing the series. I sent v3 which should finally solve this now.

Cheers!

Chris

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#4 lore raw

PATCH v2 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 v2 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