2024-05-23 18:56:50

by Alex Bee

[permalink] [raw]
Subject: [PATCH 0/3] 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(-)

--
2.45.0



2024-05-23 18:56:58

by Alex Bee

[permalink] [raw]
Subject: [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.

Signed-off-by: Alex Bee <[email protected]>
---
Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
index c57e1f488895..d1b47b14ca57 100644
--- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
+++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
@@ -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
--
2.45.0


2024-05-23 18:57:11

by Alex Bee

[permalink] [raw]
Subject: [PATCH 2/3] soc: rockchip: grf: Set RK3128's vpu main clock

RK3128 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.

Signed-off-by: Alex Bee <[email protected]>
---
drivers/soc/rockchip/grf.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c
index 5fd62046b28a..df64de3d3040 100644
--- a/drivers/soc/rockchip/grf.c
+++ b/drivers/soc/rockchip/grf.c
@@ -41,9 +41,11 @@ static const struct rockchip_grf_info rk3036_grf __initconst = {
};

#define RK3128_GRF_SOC_CON0 0x140
+#define RK3128_GRF_SOC_CON1 0x144

static 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 = {
--
2.45.0


2024-05-23 18:57:25

by Alex Bee

[permalink] [raw]
Subject: [PATCH 3/3] ARM: dts: rockchip: Add vpu nodes for RK3128

Add nodes for the vpu and it's attached iommu which are both part of the
RK3128_PD_VIDEO powerdomain.

Signed-off-by: Alex Bee <[email protected]>
---
arch/arm/boot/dts/rockchip/rk3128.dtsi | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi
index fb98873fd94e..c11f55677841 100644
--- a/arch/arm/boot/dts/rockchip/rk3128.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi
@@ -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>;
--
2.45.0


2024-05-23 20:34:46

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: media: rockchip,vpu: Document RK3128 compatible

On 23/05/2024 20:56, Alex Bee wrote:
> The integration for this SoC is similar to RK3066/RK3188.
>
> Document it's compatible.
>
> Signed-off-by: Alex Bee <[email protected]>

Acked-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof


2024-05-28 08:19:29

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: media: rockchip,vpu: Document RK3128 compatible

Am Donnerstag, 23. Mai 2024, 20:56:31 CEST schrieb Alex Bee:
> 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?

Thanks
Heiko

> ---
> Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> index c57e1f488895..d1b47b14ca57 100644
> --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> @@ -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
>





2024-05-28 08:39:19

by [email protected]

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: media: rockchip,vpu: Document RK3128 compatible

Hey Heiko,

On 28.05.2024 10:19, Heiko Stübner wrote:
>Am Donnerstag, 23. Mai 2024, 20:56:31 CEST schrieb Alex Bee:
>> 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 :).

>
>Thanks
>Heiko

Regards,
Sebastian

>
>> ---
>> Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>> index c57e1f488895..d1b47b14ca57 100644
>> --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>> +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>> @@ -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
>>
>
>
>
>
>

2024-05-28 15:11:01

by Heiko Stuebner

[permalink] [raw]
Subject: Re: (subset) [PATCH 0/3] Add VPU support for RK3128

On Thu, 23 May 2024 20:56:30 +0200, Alex Bee wrote:
> 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
>
> [...]

Applied, thanks!

[2/3] soc: rockchip: grf: Set RK3128's vpu main clock
commit: b465223129f951d110e633a305085bd8430d7df0

Best regards,
--
Heiko Stuebner <[email protected]>

2024-06-10 14:01:26

by Alex Bee

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: media: rockchip,vpu: Document RK3128 compatible

Hi,

Am 28.05.24 um 10:37 schrieb Sebastian Fricke:
> Hey Heiko,
>
> On 28.05.2024 10:19, Heiko Stübner wrote:
>> Am Donnerstag, 23. Mai 2024, 20:56:31 CEST schrieb Alex Bee:
>>> 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 :).
>
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
>>
>> Thanks
>> Heiko
>
> Regards,
> Sebastian
>
>>
>>> ---
>>>  Documentation/devicetree/bindings/media/rockchip-vpu.yaml | 4 +++-
>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git
>>> a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>>> b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>>> index c57e1f488895..d1b47b14ca57 100644
>>> --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>>> +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>>> @@ -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
>>>
>>
>>
>>
>>
>>