[PATCH 0/5] ARM: dts: sun8i: r40: Enable video decoder

86 views
Skip to first unread message

Jernej Skrabec

unread,
Aug 25, 2020, 1:35:35 PM8/25/20
to mri...@kernel.org, we...@csie.org, paul.koc...@bootlin.com, mch...@kernel.org, rob...@kernel.org, gre...@linuxfoundation.org, linux...@vger.kernel.org, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, de...@driverdev.osuosl.org, linux...@googlegroups.com
Allwinner R40 SoC contains video engine very similar to that in A33.

First two patches add system controller nodes and the rest of them
add support for Cedrus VPU.

Please take a look.

Best regards,
Jernej

Jernej Skrabec (5):
dt-bindings: sram: allwinner,sun4i-a10-system-control: Add R40
compatibles
ARM: dts: sun8i: r40: Add node for system controller
dt-bindings: media: allwinner,sun4i-a10-video-engine: Add R40
compatible
media: cedrus: Add support for R40
ARM: dts: sun8i: r40: Add video engine node

.../allwinner,sun4i-a10-video-engine.yaml | 1 +
.../allwinner,sun4i-a10-system-control.yaml | 6 ++++
arch/arm/boot/dts/sun8i-r40.dtsi | 34 +++++++++++++++++++
drivers/staging/media/sunxi/cedrus/cedrus.c | 9 +++++
4 files changed, 50 insertions(+)

--
2.28.0

Jernej Skrabec

unread,
Aug 25, 2020, 1:35:37 PM8/25/20
to mri...@kernel.org, we...@csie.org, paul.koc...@bootlin.com, mch...@kernel.org, rob...@kernel.org, gre...@linuxfoundation.org, linux...@vger.kernel.org, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, de...@driverdev.osuosl.org, linux...@googlegroups.com
Allwinner R40 has system controller similar to that in A10.

Add compatibles for system controller and sram c1 region.

Signed-off-by: Jernej Skrabec <jernej....@siol.net>
---
.../bindings/sram/allwinner,sun4i-a10-system-control.yaml | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
index f5825935fd22..6ebcbc153691 100644
--- a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
+++ b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
@@ -33,6 +33,9 @@ properties:
- const: allwinner,sun4i-a10-system-control
- const: allwinner,sun8i-a23-system-control
- const: allwinner,sun8i-h3-system-control
+ - items:
+ - const: allwinner,sun8i-r40-system-control
+ - const: allwinner,sun4i-a10-system-control
- const: allwinner,sun50i-a64-sram-controller
deprecated: true
- const: allwinner,sun50i-a64-system-control
@@ -86,6 +89,9 @@ patternProperties:
- items:
- const: allwinner,sun8i-h3-sram-c1
- const: allwinner,sun4i-a10-sram-c1
+ - items:
+ - const: allwinner,sun8i-r40-sram-c1
+ - const: allwinner,sun4i-a10-sram-c1
- items:
- const: allwinner,sun50i-a64-sram-c1
- const: allwinner,sun4i-a10-sram-c1
--
2.28.0

Jernej Skrabec

unread,
Aug 25, 2020, 1:35:39 PM8/25/20
to mri...@kernel.org, we...@csie.org, paul.koc...@bootlin.com, mch...@kernel.org, rob...@kernel.org, gre...@linuxfoundation.org, linux...@vger.kernel.org, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, de...@driverdev.osuosl.org, linux...@googlegroups.com
Allwinner R40 has system controller and SRAM C1 region similar to that
in A10.

Add nodes for them.

Signed-off-by: Jernej Skrabec <jernej....@siol.net>
---
arch/arm/boot/dts/sun8i-r40.dtsi | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index dff9a3dc1fba..0c7526365896 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -190,6 +190,29 @@ mixer1_out_tcon_top: endpoint {
};
};

+ syscon: system-control@1c00000 {
+ compatible = "allwinner,sun8i-r40-system-control",
+ "allwinner,sun4i-a10-system-control";
+ reg = <0x01c00000 0x30>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ sram_c: sram@1d00000 {
+ compatible = "mmio-sram";
+ reg = <0x01d00000 0xd0000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0 0x01d00000 0xd0000>;
+
+ ve_sram: sram-section@0 {
+ compatible = "allwinner,sun8i-r40-sram-c1",
+ "allwinner,sun4i-a10-sram-c1";
+ reg = <0x000000 0x80000>;
+ };
+ };
+ };
+
nmi_intc: interrupt-controller@1c00030 {
compatible = "allwinner,sun7i-a20-sc-nmi";
interrupt-controller;
--
2.28.0

Jernej Skrabec

unread,
Aug 25, 2020, 1:35:42 PM8/25/20
to mri...@kernel.org, we...@csie.org, paul.koc...@bootlin.com, mch...@kernel.org, rob...@kernel.org, gre...@linuxfoundation.org, linux...@vger.kernel.org, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, de...@driverdev.osuosl.org, linux...@googlegroups.com
Allwinner R40 SoC contains video engine. Add compatible for it.

Signed-off-by: Jernej Skrabec <jernej....@siol.net>
---
.../bindings/media/allwinner,sun4i-a10-video-engine.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
index 4cc1a670c986..0d58bbcd24d3 100644
--- a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
+++ b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
@@ -18,6 +18,7 @@ properties:
- allwinner,sun7i-a20-video-engine
- allwinner,sun8i-a33-video-engine
- allwinner,sun8i-h3-video-engine
+ - allwinner,sun8i-r40-video-engine
- allwinner,sun50i-a64-video-engine
- allwinner,sun50i-h5-video-engine
- allwinner,sun50i-h6-video-engine
--
2.28.0

Jernej Skrabec

unread,
Aug 25, 2020, 1:35:43 PM8/25/20
to mri...@kernel.org, we...@csie.org, paul.koc...@bootlin.com, mch...@kernel.org, rob...@kernel.org, gre...@linuxfoundation.org, linux...@vger.kernel.org, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, de...@driverdev.osuosl.org, linux...@googlegroups.com
Video engine in R40 is very similar to that in A33 but it runs on lower
speed, at least according to OS images released by board designer.

Signed-off-by: Jernej Skrabec <jernej....@siol.net>
---
drivers/staging/media/sunxi/cedrus/cedrus.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
index bc27f9430eeb..83a654a618be 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -496,6 +496,11 @@ static const struct cedrus_variant sun8i_h3_cedrus_variant = {
.mod_rate = 402000000,
};

+static const struct cedrus_variant sun8i_r40_cedrus_variant = {
+ .capabilities = CEDRUS_CAPABILITY_UNTILED,
+ .mod_rate = 297000000,
+};
+
static const struct cedrus_variant sun50i_a64_cedrus_variant = {
.capabilities = CEDRUS_CAPABILITY_UNTILED |
CEDRUS_CAPABILITY_H265_DEC,
@@ -536,6 +541,10 @@ static const struct of_device_id cedrus_dt_match[] = {
.compatible = "allwinner,sun8i-h3-video-engine",
.data = &sun8i_h3_cedrus_variant,
},
+ {
+ .compatible = "allwinner,sun8i-r40-video-engine",
+ .data = &sun8i_r40_cedrus_variant,
+ },
{
.compatible = "allwinner,sun50i-a64-video-engine",
.data = &sun50i_a64_cedrus_variant,
--
2.28.0

Jernej Skrabec

unread,
Aug 25, 2020, 1:35:46 PM8/25/20
to mri...@kernel.org, we...@csie.org, paul.koc...@bootlin.com, mch...@kernel.org, rob...@kernel.org, gre...@linuxfoundation.org, linux...@vger.kernel.org, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, de...@driverdev.osuosl.org, linux...@googlegroups.com
Allwinner R40 SoC has a video engine.

Add a node for it.

Signed-off-by: Jernej Skrabec <jernej....@siol.net>
---
arch/arm/boot/dts/sun8i-r40.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index 0c7526365896..7907569e7b5c 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -273,6 +273,17 @@ csi0: csi@1c09000 {
status = "disabled";
};

+ video-codec@1c0e000 {
+ compatible = "allwinner,sun8i-r40-video-engine";
+ reg = <0x01c0e000 0x1000>;
+ clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
+ <&ccu CLK_DRAM_VE>;
+ clock-names = "ahb", "mod", "ram";
+ resets = <&ccu RST_BUS_VE>;
+ interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
+ allwinner,sram = <&ve_sram 1>;
+ };
+
mmc0: mmc@1c0f000 {
compatible = "allwinner,sun8i-r40-mmc",
"allwinner,sun50i-a64-mmc";
--
2.28.0

JuanEsf

unread,
Sep 4, 2020, 9:29:40 AM9/4/20
to linux-sunxi
Hello everyone, I want to make an observation.
In the SoC R40 user manual at:
- Chapter 3. System
- 3.1. Memory Mapping

I can't find the registration address:
reg = <0x01c0e000 0x1000>;

But this is the following:
VE 0x01D00000 - 0x01DFFFFF 1024K

Jernej Škrabec

unread,
Sep 4, 2020, 10:24:59 AM9/4/20
to linux-sunxi, juan...@gmail.com
Dne petek, 04. september 2020 ob 15:29:40 CEST je JuanEsf napisal(a):
> Hello everyone, I want to make an observation.
> In the SoC R40 user manual at:
> - Chapter 3. System
> - 3.1. Memory Mapping
>
> I can't find the registration address:
> reg = <0x01c0e000 0x1000>;
>
> But this is the following:
> VE 0x01D00000 - 0x01DFFFFF 1024K

User manual is wrong. Check BSP Linux source.

Best regards,
Jernej

Hans Verkuil

unread,
Sep 17, 2020, 4:33:56 AM9/17/20
to Maxime Ripard, Jernej Skrabec, we...@csie.org, paul.koc...@bootlin.com, mch...@kernel.org, rob...@kernel.org, gre...@linuxfoundation.org, linux...@vger.kernel.org, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, de...@driverdev.osuosl.org, linux...@googlegroups.com
Hi Maxime,

On 27/08/2020 17:19, Maxime Ripard wrote:
> On Tue, Aug 25, 2020 at 07:35:18PM +0200, Jernej Skrabec wrote:
>> Allwinner R40 SoC contains video engine very similar to that in A33.
>>
>> First two patches add system controller nodes and the rest of them
>> add support for Cedrus VPU.
>>
>> Please take a look.
>
> Applied all 5 patches, thanks

Just to confirm: you've taken patches 3 and 4 as well? If so, then I can mark them as
done in patchwork.

Regards,

Hans

Maxime Ripard

unread,
Sep 17, 2020, 12:37:14 PM9/17/20
to Hans Verkuil, Jernej Skrabec, we...@csie.org, paul.koc...@bootlin.com, mch...@kernel.org, rob...@kernel.org, gre...@linuxfoundation.org, linux...@vger.kernel.org, devic...@vger.kernel.org, linux-ar...@lists.infradead.org, linux-...@vger.kernel.org, de...@driverdev.osuosl.org, linux...@googlegroups.com
Uh... Yeah, I did, but they were definitely not mine to take... I'm
sorry, I'll drop them and you can merge totally merge them :)

Maxime
signature.asc
Reply all
Reply to author
Forward
0 new messages