Add VPU support for RK3128
cover Add VPU support for RK3128
Similar to most Rockchip SoCs RK312x have hantro G1 based decoder and a hantro H1 based encoder with attached iommu.
The existing drivers can be used as-is.
Fluster scores:
- FFmpeg:
- H.264: 127/135
- VP8: 59/61
- GStreamer:
- H.264: 129/135
- VP8: 59/61
Alex Bee (3):
dt-bindings: media: rockchip,vpu: Document RK3128 compatible
soc: rockchip: grf: Set RK3128's vpu main clock
ARM: dts: rockchip: Add vpu nodes for RK3128
.../bindings/media/rockchip-vpu.yaml | 4 +++- arch/arm/boot/dts/rockchip/rk3128.dtsi | 24 +++++++++++++++++++ drivers/soc/rockchip/grf.c | 2 ++ 3 files changed, 29 insertions(+), 1 deletion(-)
Signature · 1 line
2.45.0
PATCH 1/3 dt-bindings: media: rockchip,vpu: Document RK3128 compatible
The integration for this SoC is similar to RK3066/RK3188.
Document it's compatible.
--- Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/media/rockchip-vpu.yaml +3 -1
@@ -26,7 +26,9 @@ properties: - rockchip,rk3568-vpu - rockchip,rk3588-av1-vpu - items: - - const: rockchip,rk3188-vpu + - enum: + - rockchip,rk3128-vpu + - rockchip,rk3188-vpu - const: rockchip,rk3066-vpu - items: - const: rockchip,rk3228-vpu
Signature · 1 line
2.45.0
Re: [PATCH 1/3] dt-bindings: media: rockchip,vpu: Document RK3128 compatible
Quoted 5 lines · Alex Bee
The integration for this SoC is similar to RK3066/RK3188.
Document it's compatible.
Signed-off-by Alex Bee <[email protected]>
Best regards,
Krzysztof
Re: [PATCH 1/3] dt-bindings: media: rockchip,vpu: Document RK3128 compatible
In reply to Alex BeeAm Donnerstag, 23. Mai 2024, 20:56:31 CEST schrieb Alex Bee:
Quoted 5 lines
The integration for this SoC is similar to RK3066/RK3188.
Document it's compatible.
Signed-off-by Alex Bee <[email protected]>
Media people, can you apply this patch alone from the series?
Thanks
Heiko
Quoted 20 lines
--- Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/media/rockchip-vpu.yaml +3
-1@@ -26,7 +26,9 @@ properties: - rockchip,rk3568-vpu - rockchip,rk3588-av1-vpu - items: - - const: rockchip,rk3188-vpu + - enum: + - rockchip,rk3128-vpu + - rockchip,rk3188-vpu - const: rockchip,rk3066-vpu - items: - const: rockchip,rk3228-vpu
Re: [PATCH 1/3] dt-bindings: media: rockchip,vpu: Document RK3128 compatible
Hey Heiko,
Quoted 10 lines · Heiko Stübner
Am Donnerstag, 23. Mai 2024, 20:56:31 CEST schrieb Alex Bee:
Quoted 5 lines
The integration for this SoC is similar to RK3066/RK3188.
Document it's compatible.
Signed-off-by Alex Bee <[email protected]>Reviewed-by Heiko Stuebner <[email protected]>Media people, can you apply this patch alone from the series?
Yes, will do got this on my list already :).
Quoted 3 lines
Thanks
Heiko
Regards,
Sebastian
Quoted 26 lines
Quoted 21 lines
--- Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/media/rockchip-vpu.yaml +3
-1@@ -26,7 +26,9 @@ properties: - rockchip,rk3568-vpu - rockchip,rk3588-av1-vpu - items: - - const: rockchip,rk3188-vpu + - enum: + - rockchip,rk3128-vpu + - rockchip,rk3188-vpu - const: rockchip,rk3066-vpu - items: - const: rockchip,rk3228-vpu
Re: [PATCH 1/3] dt-bindings: media: rockchip,vpu: Document RK3128 compatible
Hi,
Am 28.05.24 um 10:37 schrieb Sebastian Fricke:
Quoted 8 lines
Hey Heiko,
Quoted 5 lines · Heiko Stübner
Am Donnerstag, 23. Mai 2024, 20:56:31 CEST schrieb Alex Bee:
Quoted 4 lines
The integration for this SoC is similar to RK3066/RK3188.
Document it's compatible.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Alex Bee <[email protected]>Reviewed-by Heiko Stuebner <[email protected]>Media people, can you apply this patch alone from the series?
Yes, will do got this on my list already :).
is there anything holding you back from applying this? It's really only the bindings which go though the media tree (i.e. this patch) and it has been acked and reviewed some weeks ago. It'd be great if we could add the vpu to the SoC DT before 6.11 merge window opens but the addition depends on the compatible to be documented. Please let me know if there's anything left to do for me.
Alex
Quoted 33 lines
Quoted 3 lines
Thanks
HeikoRegards,
SebastianQuoted 26 lines
Quoted 21 lines
---
Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/media/rockchip-vpu.yaml +0
-0@@ -26,7 +26,9 @@ properties:- rockchip,rk3568-vpu
- rockchip,rk3588-av1-vpu
- items:
- - const: rockchip,rk3188-vpu
+ - enum:
+ - rockchip,rk3128-vpu
+ - rockchip,rk3188-vpu
- const: rockchip,rk3066-vpu
- items:
- const: rockchip,rk3228-vpu
Heiko Stübner
maintainerRe: [PATCH 1/3] dt-bindings: media: rockchip,vpu: Document RK3128 compatible
In reply to Sebastian FrickeHey,
Am Dienstag, 28. Mai 2024, 10:37:47 CEST schrieb Sebastian Fricke:
Quoted 6 lines · Heiko Stübner
Quoted 5 lines
Am Donnerstag, 23. Mai 2024, 20:56:31 CEST schrieb Alex Bee:
Quoted 4 lines
The integration for this SoC is similar to RK3066/RK3188.
Document it's compatible.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Alex Bee <[email protected]>Reviewed-by Heiko Stuebner <[email protected]>Media people, can you apply this patch alone from the series?
Yes, will do got this on my list already :).
as I'm going through my list of "waiting for ..." patches, is this still on the radar?
As far as I can tell, it didn't make it into 6.11-rc1, but 6.12 would be nice :-)
Thanks a lot
Heiko
Quoted 26 lines
Quoted 25 lines
Quoted 20 lines
--- Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/media/rockchip-vpu.yaml +3
-1@@ -26,7 +26,9 @@ properties: - rockchip,rk3568-vpu - rockchip,rk3588-av1-vpu - items: - - const: rockchip,rk3188-vpu + - enum: + - rockchip,rk3128-vpu + - rockchip,rk3188-vpu - const: rockchip,rk3066-vpu - items: - const: rockchip,rk3228-vpu
PATCH 2/3 soc: rockchip: grf: Set RK3128's vpu main clock
In reply to Alex BeeRK3128 has a setting in GRF which selects whether the vpu attached iommu uses the AXI clock of the decoder (vdpu) or the encoder (vepu). The default is vepu but some part of the vendor firmware sets it to vdpu.
In order to be independent on whether any of those vendor firmware blobs is used to boot the SoC reset "vpu main clock" setting to it's default value.
--- drivers/soc/rockchip/grf.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/soc/rockchip/grf.c +2 -0
@@ -41,9 +41,11 @@ static const struct rockchip_grf_info rk3036_grf __initconst = { };#define RK3128_GRF_SOC_CON0 0x140 +#define RK3128_GRF_SOC_CON1 0x144static const struct rockchip_grf_value rk3128_defaults[]__initconst = { {"jtag switching" ,RK3128_GRF_SOC_CON0 ,HIWORD_UPDATE (0 ,1 ,8 ) }, + {"vpu main clock" ,RK3128_GRF_SOC_CON1 ,HIWORD_UPDATE (0 ,1 ,10 ) }, };static const struct rockchip_grf_info rk3128_grf__initconst = {
Signature · 1 line
2.45.0
PATCH 3/3 ARM: dts: rockchip: Add vpu nodes for RK3128
In reply to Alex BeeAdd nodes for the vpu and it's attached iommu which are both part of the RK3128_PD_VIDEO powerdomain.
--- arch/arm/boot/dts/rockchip/rk3128.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
arch/arm/boot/dts/rockchip/rk3128.dtsi +24 -0
@@ -252,6 +252,30 @@ power-domain@RK3128_PD_GPU { }; }; + vpu: video-codec@10106000 { + compatible = "rockchip,rk3128-vpu", "rockchip,rk3066-vpu"; + reg = <0x10106000 0x800>; + interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "vepu", "vdpu"; + clocks = <&cru ACLK_VDPU>, <&cru HCLK_VDPU>, + <&cru ACLK_VEPU>, <&cru HCLK_VEPU>; + clock-names = "aclk_vdpu", "hclk_vdpu", + "aclk_vepu", "hclk_vepu"; + iommus = <&vpu_mmu>; + power-domains = <&power RK3128_PD_VIDEO>; + }; + + vpu_mmu: iommu@10106800 { + compatible = "rockchip,iommu"; + reg = <0x10106800 0x100>; + interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_VEPU>, <&cru HCLK_VDPU>; + clock-names = "aclk", "iface"; + power-domains = <&power RK3128_PD_VIDEO>; + #iommu-cells = <0>; + }; + vop: vop@1010e000 { compatible = "rockchip,rk3126-vop"; reg = <0x1010e000 0x300>;
Signature · 1 line
2.45.0
Re: (subset) [PATCH 0/3] Add VPU support for RK3128
In reply to Alex BeeQuoted 13 lines · Alex Bee
Similar to most Rockchip SoCs RK312x have hantro G1 based decoder and a hantro H1 based encoder with attached iommu.
The existing drivers can be used as-is.
Fluster scores:
- FFmpeg:
- H.264: 127/135
- VP8: 59/61
- GStreamer:
- H.264: 129/135
- VP8: 59/61
Quoted 1 line
[...]
Applied, thanks!
[2/3] soc: rockchip: grf: Set RK3128's vpu main clock
commit: b465223129f951d110e633a305085bd8430d7df0
Best regards,
Signature · 1 line
Heiko Stuebner <[email protected]>
Re: (subset) [PATCH 0/3] Add VPU support for RK3128
Hi Heiko
Am 28.05.24 um 17:09 schrieb Heiko Stuebner:
Quoted 14 lines · Alex Bee
Quoted 13 lines
Similar to most Rockchip SoCs RK312x have hantro G1 based decoder and a hantro H1 based encoder with attached iommu.
The existing drivers can be used as-is.
Fluster scores:
- FFmpeg:
- H.264: 127/135
- VP8: 59/61
- GStreamer:
- H.264: 129/135
- VP8: 59/61
Quoted 5 lines
Quoted 1 line
[...]
Applied, thanks!
[2/3] soc: rockchip: grf: Set RK3128's vpu main clock
commit: b465223129f951d110e633a305085bd8430d7df0
I just noticed this patch didn't make it in 6.11-rc1. While it's not really important for this patch as the media mainainters didn't manage to apply the vpu bindings patch for 6.11 anyways, it looks like all commits of your v6.11-armsoc/drivers aren't merged. I still haven't fully understand how the SoC tree *really* works, but I couldn't find a PR for this branch [0].
Alex
[0]
https://patchwork.kernel.org/project/linux-soc/list/?submitter=24481&state=*
Quoted 1 line
Best regards,
Heiko Stübner
maintainerRe: (subset) [PATCH 0/3] Add VPU support for RK3128
Am Sonntag, 4. August 2024, 18:42:13 CEST schrieb Alex Bee:
Quoted 20 lines
Hi Heiko
Am 28.05.24 um 17:09 schrieb Heiko Stuebner:
Quoted 17 lines · Alex Bee
Quoted 13 lines
Similar to most Rockchip SoCs RK312x have hantro G1 based decoder and a hantro H1 based encoder with attached iommu.
The existing drivers can be used as-is.
Fluster scores:
- FFmpeg:
- H.264: 127/135
- VP8: 59/61
- GStreamer:
- H.264: 129/135
- VP8: 59/61Quoted 1 line
[...]
Applied, thanks!
Quoted 7 lines
Quoted 2 lines
[2/3] soc: rockchip: grf: Set RK3128's vpu main clock
commit: b465223129f951d110e633a305085bd8430d7df0I just noticed this patch didn't make it in 6.11-rc1. While it's not really important for this patch as the media mainainters didn't manage to apply the vpu bindings patch for 6.11 anyways, it looks like all commits of your v6.11-armsoc/drivers aren't merged. I still haven't fully understand how the SoC tree *really* works, but I couldn't find a PR for this branch [0].
That was me actually forgetting that branch :-( .
With the rk3128 vpu-binding getting merged today, I just moved that onwards to 6.12 too. I guess this time I shouln't forget ;-)
Heiko
Re: (subset) [PATCH 0/3] Add VPU support for RK3128
In reply to Alex BeeQuoted 13 lines · Alex Bee
Similar to most Rockchip SoCs RK312x have hantro G1 based decoder and a hantro H1 based encoder with attached iommu.
The existing drivers can be used as-is.
Fluster scores:
- FFmpeg:
- H.264: 127/135
- VP8: 59/61
- GStreamer:
- H.264: 129/135
- VP8: 59/61
Quoted 1 line
[...]
Applied, thanks!
[3/3] ARM: dts: rockchip: Add vpu nodes for RK3128
commit: fc5aa1ba77c78c17d2c1ddb94e7aca3f4f32efcf
Best regards,
Signature · 1 line
Heiko Stuebner <[email protected]>