2021-01-07 13:44:16

by Paul Kocialkowski

[permalink] [raw]
Subject: [PATCH 0/5] Rockchip PX30 RGA and VPU support

This series adds the required bits for RGA and VPU support on the
Rockchip PX30 SoC.

Cheers,

Paul

Paul Kocialkowski (5):
dt-bindings: media: rockchip-rga: Add PX30 compatible
arm64: dts: rockchip: Add RGA support to the PX30
dt-bindings: media: rockchip-vpu: Add PX30 compatible
arm64: dts: rockchip: Add VPU support for the PX30
media: hantro: Add support for the Rockchip PX30

.../bindings/media/rockchip-rga.yaml | 4 ++-
.../bindings/media/rockchip-vpu.yaml | 25 +++++++++-----
arch/arm64/boot/dts/rockchip/px30.dtsi | 34 +++++++++++++++++++
drivers/staging/media/hantro/hantro_drv.c | 5 +--
drivers/staging/media/hantro/hantro_hw.h | 1 +
drivers/staging/media/hantro/rk3399_vpu_hw.c | 21 ++++++++++++
6 files changed, 79 insertions(+), 11 deletions(-)

--
2.30.0


2021-01-07 13:44:20

by Paul Kocialkowski

[permalink] [raw]
Subject: [PATCH 3/5] dt-bindings: media: rockchip-vpu: Add PX30 compatible

The Rockchip PX30 SoC has a Hantro VPU that features a decoder (VDPU2)
and an encoder (VEPU2). It is similar to the RK3399's VPU but takes an
extra clock (SCLK).

Signed-off-by: Paul Kocialkowski <[email protected]>
---
.../bindings/media/rockchip-vpu.yaml | 25 +++++++++++++------
1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
index c81dbc3e8960..c446b9ead21b 100644
--- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
+++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
@@ -15,10 +15,13 @@ description:

properties:
compatible:
- enum:
- - rockchip,rk3288-vpu
- - rockchip,rk3328-vpu
- - rockchip,rk3399-vpu
+ oneOf:
+ - const: rockchip,rk3288-vpu
+ - const: rockchip,rk3328-vpu
+ - const: rockchip,rk3399-vpu
+ - items:
+ - const: rockchip,px30-vpu
+ - const: rockchip,rk3399-vpu

reg:
maxItems: 1
@@ -35,12 +38,18 @@ properties:
- const: vdpu

clocks:
- maxItems: 2
+ minItems: 2
+ maxItems: 3

clock-names:
- items:
- - const: aclk
- - const: hclk
+ oneOf:
+ - items:
+ - const: aclk
+ - const: hclk
+ - items:
+ - const: aclk
+ - const: hclk
+ - const: sclk

power-domains:
maxItems: 1
--
2.30.0

2021-01-07 13:44:38

by Paul Kocialkowski

[permalink] [raw]
Subject: [PATCH 4/5] arm64: dts: rockchip: Add VPU support for the PX30

The PX30 has a VPU (both decoder and encoder) with a dedicated IOMMU.
Describe these two entities in device-tree.

Signed-off-by: Paul Kocialkowski <[email protected]>
---
arch/arm64/boot/dts/rockchip/px30.dtsi | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi
index e056d1c32cc8..4322302a2685 100644
--- a/arch/arm64/boot/dts/rockchip/px30.dtsi
+++ b/arch/arm64/boot/dts/rockchip/px30.dtsi
@@ -986,6 +986,29 @@ gpu: gpu@ff400000 {
status = "disabled";
};

+ vpu: video-codec@ff442000 {
+ compatible = "rockchip,px30-vpu", "rockchip,rk3399-vpu";
+ reg = <0x0 0xff442000 0x0 0x800>;
+ interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "vepu", "vdpu";
+ clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>, <&cru SCLK_CORE_VPU>;
+ clock-names = "aclk", "hclk", "sclk";
+ iommus = <&vpu_mmu>;
+ power-domains = <&power PX30_PD_VPU>;
+ };
+
+ vpu_mmu: iommu@ff442800 {
+ compatible = "rockchip,iommu";
+ reg = <0x0 0xff442800 0x0 0x100>;
+ interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "vpu_mmu";
+ clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
+ clock-names = "aclk", "iface";
+ #iommu-cells = <0>;
+ power-domains = <&power PX30_PD_VPU>;
+ };
+
dsi: dsi@ff450000 {
compatible = "rockchip,px30-mipi-dsi";
reg = <0x0 0xff450000 0x0 0x10000>;
--
2.30.0

2021-01-07 14:57:58

by Philipp Zabel

[permalink] [raw]
Subject: Re: [PATCH 3/5] dt-bindings: media: rockchip-vpu: Add PX30 compatible

Hi Paul,

On Thu, 2021-01-07 at 14:40 +0100, Paul Kocialkowski wrote:
> The Rockchip PX30 SoC has a Hantro VPU that features a decoder (VDPU2)
> and an encoder (VEPU2). It is similar to the RK3399's VPU but takes an
> extra clock (SCLK).
>
> Signed-off-by: Paul Kocialkowski <[email protected]>
> ---
> .../bindings/media/rockchip-vpu.yaml | 25 +++++++++++++------
> 1 file changed, 17 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> index c81dbc3e8960..c446b9ead21b 100644
> --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> @@ -15,10 +15,13 @@ description:
>
> properties:
> compatible:
> - enum:
> - - rockchip,rk3288-vpu
> - - rockchip,rk3328-vpu
> - - rockchip,rk3399-vpu
> + oneOf:
> + - const: rockchip,rk3288-vpu
> + - const: rockchip,rk3328-vpu
> + - const: rockchip,rk3399-vpu
> + - items:
> + - const: rockchip,px30-vpu
> + - const: rockchip,rk3399-vpu
>
> reg:
> maxItems: 1
> @@ -35,12 +38,18 @@ properties:
> - const: vdpu
>
> clocks:
> - maxItems: 2
> + minItems: 2
> + maxItems: 3
>
> clock-names:
> - items:
> - - const: aclk
> - - const: hclk
> + oneOf:
> + - items:
> + - const: aclk
> + - const: hclk
> + - items:
> + - const: aclk
> + - const: hclk
> + - const: sclk

You could make this:

clock-names:
minItems: 2
items:
- const: aclk
- const: hclk
- const: sclk

And then:

allOf:
- if:
properties:
compatible:
contains:
const: rockchip,px30-vpu
then:
properties:
clock-names:
minItems: 3

to make sure each variant has the correct clocks set.

regards
Philipp

2021-01-07 15:49:18

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 3/5] dt-bindings: media: rockchip-vpu: Add PX30 compatible

On Thu, 07 Jan 2021 14:40:59 +0100, Paul Kocialkowski wrote:
> The Rockchip PX30 SoC has a Hantro VPU that features a decoder (VDPU2)
> and an encoder (VEPU2). It is similar to the RK3399's VPU but takes an
> extra clock (SCLK).
>
> Signed-off-by: Paul Kocialkowski <[email protected]>
> ---
> .../bindings/media/rockchip-vpu.yaml | 25 +++++++++++++------
> 1 file changed, 17 insertions(+), 8 deletions(-)
>

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:
./Documentation/devicetree/bindings/media/rockchip-vpu.yaml:23:9: [warning] wrong indentation: expected 10 but found 8 (indentation)
./Documentation/devicetree/bindings/media/rockchip-vpu.yaml:47:9: [warning] wrong indentation: expected 10 but found 8 (indentation)
./Documentation/devicetree/bindings/media/rockchip-vpu.yaml:50:9: [warning] wrong indentation: expected 10 but found 8 (indentation)

dtschema/dtc warnings/errors:

See https://patchwork.ozlabs.org/patch/1423300

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.

2021-01-12 09:03:38

by Paul Kocialkowski

[permalink] [raw]
Subject: Re: [PATCH 3/5] dt-bindings: media: rockchip-vpu: Add PX30 compatible

Hi Philipp,

On Thu 07 Jan 21, 15:55, Philipp Zabel wrote:
> Hi Paul,
>
> On Thu, 2021-01-07 at 14:40 +0100, Paul Kocialkowski wrote:
> > The Rockchip PX30 SoC has a Hantro VPU that features a decoder (VDPU2)
> > and an encoder (VEPU2). It is similar to the RK3399's VPU but takes an
> > extra clock (SCLK).
> >
> > Signed-off-by: Paul Kocialkowski <[email protected]>
> > ---
> > .../bindings/media/rockchip-vpu.yaml | 25 +++++++++++++------
> > 1 file changed, 17 insertions(+), 8 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> > index c81dbc3e8960..c446b9ead21b 100644
> > --- a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> > +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> > @@ -15,10 +15,13 @@ description:
> >
> > properties:
> > compatible:
> > - enum:
> > - - rockchip,rk3288-vpu
> > - - rockchip,rk3328-vpu
> > - - rockchip,rk3399-vpu
> > + oneOf:
> > + - const: rockchip,rk3288-vpu
> > + - const: rockchip,rk3328-vpu
> > + - const: rockchip,rk3399-vpu
> > + - items:
> > + - const: rockchip,px30-vpu
> > + - const: rockchip,rk3399-vpu
> >
> > reg:
> > maxItems: 1
> > @@ -35,12 +38,18 @@ properties:
> > - const: vdpu
> >
> > clocks:
> > - maxItems: 2
> > + minItems: 2
> > + maxItems: 3
> >
> > clock-names:
> > - items:
> > - - const: aclk
> > - - const: hclk
> > + oneOf:
> > + - items:
> > + - const: aclk
> > + - const: hclk
> > + - items:
> > + - const: aclk
> > + - const: hclk
> > + - const: sclk
>
> You could make this:
>
> clock-names:
> minItems: 2
> items:
> - const: aclk
> - const: hclk
> - const: sclk
>
> And then:
>
> allOf:
> - if:
> properties:
> compatible:
> contains:
> const: rockchip,px30-vpu
> then:
> properties:
> clock-names:
> minItems: 3
>
> to make sure each variant has the correct clocks set.

Thanks for the suggestion! That's a finer grain that my proposal.

Rob, is there a preference for how this case should be handled?
Here, we want to specify an extra clock for the PX30 case.

Cheers,

Paul

--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com


Attachments:
(No filename) (2.51 kB)
signature.asc (499.00 B)
Download all attachments

2021-06-21 03:00:03

by Ezequiel Garcia

[permalink] [raw]
Subject: Re: [PATCH 0/5] Rockchip PX30 RGA and VPU support

Hi Paul,

On Thu, 2021-01-07 at 14:40 +0100, Paul Kocialkowski wrote:
> This series adds the required bits for RGA and VPU support on the
> Rockchip PX30 SoC.
>

Do you plan to resend this series?

Alex recently renamed [1] things so some tweaking will be needed,
but it shouldn't be complicated.

[1] https://lore.kernel.org/linux-media/[email protected]/

It would be great to have support RK3326 and PX30 :)

Kindly,
Ezequiel



Subject: Re: [PATCH 0/5] Rockchip PX30 RGA and VPU support

Hi all

On Mon, Jun 21, 2021 at 5:00 AM Ezequiel Garcia <[email protected]> wrote:
>
> Hi Paul,
>
> On Thu, 2021-01-07 at 14:40 +0100, Paul Kocialkowski wrote:
> > This series adds the required bits for RGA and VPU support on the
> > Rockchip PX30 SoC.
> >
>
> Do you plan to resend this series?
>
> Alex recently renamed [1] things so some tweaking will be needed,
> but it shouldn't be complicated.
>
> [1] https://lore.kernel.org/linux-media/[email protected]/
>
> It would be great to have support RK3326 and PX30 :)

I can re-spin and test it, but I don't find the whole thread

Michael

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



--
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
[email protected]
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
[email protected]
http://www.amarulasolutions.com