Devicetree
 help / color / mirror / Atom feed
* [PATCH v3 0/7] arm64: allwinner: h616: Support Video Engine
@ 2026-07-12  3:00 Chen-Yu Tsai
  2026-07-12  3:00 ` [PATCH v3 1/7] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6 Chen-Yu Tsai
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Chen-Yu Tsai @ 2026-07-12  3:00 UTC (permalink / raw)
  To: Maxime Ripard, Paul Kocialkowski, Mauro Carvalho Chehab,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Greg Kroah-Hartman, linux-media, linux-staging, devicetree,
	linux-sunxi, linux-arm-kernel, linux-kernel

Hi folks,


This is v3 of my Allwinner H616 Cedrus series. The series is ready to be
merged.

Changes since v2:
- Dropped "drivers:" from cedrus driver patch subject

Changes since v1:
- Fixed IOMMU ports on H616 (patch 7)
- Updated comment about VP9 on H616


This series adds support for the Cedar video engine found in the
Allwinner H616 SoC. On the way, it also fixes some issues with the
DT representation for the Allwinner H6 SoC.

Patch 1 fixes the video engine's number of IOMMU endpoints on the
H6 in the DT binding.

Patch 2 fixes the video engine's number of SRAM regions on the
H6 in the DT binding.

Patch 3 adds a new compatible for the H616's video engine.

Patch 4 adds the new compatible for the H616's video engine to the
cedrus driver.

Patch 5 adds the video engine's missing SRAM region to the H6 dtsi.

Patch 6 adds the video engine's missing IOMMU endpoint to the H6 dtsi.

Patch 7 adds a device node for the video engine to the H616 dtsi.


Patches 1-4 should go through the media tree, while patches 5-7 will go
through the soc tree via the sunxi tree.


Please have a look.


Thanks
ChenYu


Chen-Yu Tsai (6):
  dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6
  dt-bindings: media: sun4i-a10-video-engine: Fix SRAM count for H6
  dt-bindings: media: sun4i-a10-video-engine: Add H616 compatible
  staging: media: sunxi: cedrus: add H616 variant
  arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video
    engine
  arm64: dts: allwinner: sun50i-h6: Add missing IOMMU for video engine

Jernej Skrabec (1):
  arm64: dts: allwinner: sun50i-h616: Add video engine

 .../allwinner,sun4i-a10-video-engine.yaml     | 45 ++++++++++++++++++-
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi  |  4 +-
 .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 12 +++++
 drivers/staging/media/sunxi/cedrus/cedrus.c   |  4 ++
 4 files changed, 61 insertions(+), 4 deletions(-)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3 1/7] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6
  2026-07-12  3:00 [PATCH v3 0/7] arm64: allwinner: h616: Support Video Engine Chen-Yu Tsai
@ 2026-07-12  3:00 ` Chen-Yu Tsai
  2026-07-12  3:08   ` sashiko-bot
  2026-07-12  3:00 ` [PATCH v3 2/7] dt-bindings: media: sun4i-a10-video-engine: Fix SRAM " Chen-Yu Tsai
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Chen-Yu Tsai @ 2026-07-12  3:00 UTC (permalink / raw)
  To: Maxime Ripard, Paul Kocialkowski, Mauro Carvalho Chehab,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Greg Kroah-Hartman, linux-media, linux-staging, devicetree,
	linux-sunxi, linux-arm-kernel, linux-kernel, Jernej Skrabec

On the H6 SoC, the Video Engine has two memory ports, thus two IOMMU
connections. The secondary one that is missing is likely used for
reading reference frames. The newer H616 is the same. On the other
hand, the D1 only has one memory port.

Add the missing IOMMU connection for the Video Engine.

Fixes: 62a8ccf3a248 ("arm64: dts: allwinner: h6: Fix Cedrus IOMMU usage")
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 .../allwinner,sun4i-a10-video-engine.yaml     | 21 ++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

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 01f2afa023f0..932043d7f0cc 100644
--- a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
+++ b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
@@ -55,7 +55,10 @@ properties:
     description: Phandle to the device SRAM
 
   iommus:
-    maxItems: 1
+    minItems: 1
+    items:
+      - description: VE port on IOMMU
+      - description: VE_R port on IOMMU
 
   memory-region:
     maxItems: 1
@@ -82,6 +85,22 @@ required:
   - resets
   - allwinner,sram
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - allwinner,sun50i-h6-video-engine
+    then:
+      properties:
+        iommus:
+          minItems: 2
+    else:
+      properties:
+        iommus:
+          maxItems: 1
+
 additionalProperties: false
 
 examples:
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 2/7] dt-bindings: media: sun4i-a10-video-engine: Fix SRAM count for H6
  2026-07-12  3:00 [PATCH v3 0/7] arm64: allwinner: h616: Support Video Engine Chen-Yu Tsai
  2026-07-12  3:00 ` [PATCH v3 1/7] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6 Chen-Yu Tsai
@ 2026-07-12  3:00 ` Chen-Yu Tsai
  2026-07-12  3:08   ` sashiko-bot
  2026-07-12  3:00 ` [PATCH v3 3/7] dt-bindings: media: sun4i-a10-video-engine: Add H616 compatible Chen-Yu Tsai
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Chen-Yu Tsai @ 2026-07-12  3:00 UTC (permalink / raw)
  To: Maxime Ripard, Paul Kocialkowski, Mauro Carvalho Chehab,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Greg Kroah-Hartman, linux-media, linux-staging, devicetree,
	linux-sunxi, linux-arm-kernel, linux-kernel, Jernej Skrabec

On the H6, the SRAM C region includes an alias of part of the VE SRAM
used by the video engine. This region should also be claimed so that no
access happens through the alias window.

Add a second SRAM region phandle to the video engine for the H6.

Acked-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 .../allwinner,sun4i-a10-video-engine.yaml     | 21 ++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

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 932043d7f0cc..818d815d4732 100644
--- a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
+++ b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
@@ -48,11 +48,15 @@ properties:
 
   allwinner,sram:
     $ref: /schemas/types.yaml#/definitions/phandle-array
+    minItems: 1
     items:
       - items:
           - description: phandle to SRAM
           - description: register value for device
-    description: Phandle to the device SRAM
+      - items:
+          - description: phandle to SRAM alias
+          - description: register value for device
+    description: Phandle to the device SRAM(s)
 
   iommus:
     minItems: 1
@@ -101,6 +105,21 @@ allOf:
         iommus:
           maxItems: 1
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - allwinner,sun50i-h6-video-engine
+    then:
+      properties:
+        allwinner,sram:
+          minItems: 2
+    else:
+      properties:
+        allwinner,sram:
+          maxItems: 1
+
 additionalProperties: false
 
 examples:
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 3/7] dt-bindings: media: sun4i-a10-video-engine: Add H616 compatible
  2026-07-12  3:00 [PATCH v3 0/7] arm64: allwinner: h616: Support Video Engine Chen-Yu Tsai
  2026-07-12  3:00 ` [PATCH v3 1/7] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6 Chen-Yu Tsai
  2026-07-12  3:00 ` [PATCH v3 2/7] dt-bindings: media: sun4i-a10-video-engine: Fix SRAM " Chen-Yu Tsai
@ 2026-07-12  3:00 ` Chen-Yu Tsai
  2026-07-12  3:00 ` [PATCH v3 4/7] staging: media: sunxi: cedrus: add H616 variant Chen-Yu Tsai
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Chen-Yu Tsai @ 2026-07-12  3:00 UTC (permalink / raw)
  To: Maxime Ripard, Paul Kocialkowski, Mauro Carvalho Chehab,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Greg Kroah-Hartman, linux-media, linux-staging, devicetree,
	linux-sunxi, linux-arm-kernel, linux-kernel, Jernej Skrabec

The H616 contains a video engine similar to past SoCs.

Add a new compatible for it.

Acked-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 .../bindings/media/allwinner,sun4i-a10-video-engine.yaml       | 3 +++
 1 file changed, 3 insertions(+)

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 818d815d4732..20c430795134 100644
--- a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
+++ b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
@@ -24,6 +24,7 @@ properties:
       - allwinner,sun50i-a64-video-engine
       - allwinner,sun50i-h5-video-engine
       - allwinner,sun50i-h6-video-engine
+      - allwinner,sun50i-h616-video-engine
 
   reg:
     maxItems: 1
@@ -96,6 +97,7 @@ allOf:
           contains:
             enum:
               - allwinner,sun50i-h6-video-engine
+              - allwinner,sun50i-h616-video-engine
     then:
       properties:
         iommus:
@@ -111,6 +113,7 @@ allOf:
           contains:
             enum:
               - allwinner,sun50i-h6-video-engine
+              - allwinner,sun50i-h616-video-engine
     then:
       properties:
         allwinner,sram:
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 4/7] staging: media: sunxi: cedrus: add H616 variant
  2026-07-12  3:00 [PATCH v3 0/7] arm64: allwinner: h616: Support Video Engine Chen-Yu Tsai
                   ` (2 preceding siblings ...)
  2026-07-12  3:00 ` [PATCH v3 3/7] dt-bindings: media: sun4i-a10-video-engine: Add H616 compatible Chen-Yu Tsai
@ 2026-07-12  3:00 ` Chen-Yu Tsai
  2026-07-12  3:00 ` [PATCH v3 5/7] arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine Chen-Yu Tsai
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Chen-Yu Tsai @ 2026-07-12  3:00 UTC (permalink / raw)
  To: Maxime Ripard, Paul Kocialkowski, Mauro Carvalho Chehab,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Greg Kroah-Hartman, linux-media, linux-staging, devicetree,
	linux-sunxi, linux-arm-kernel, linux-kernel, Jernej Skrabec

The Allwinner H616 SoC has a video engine hardware block like the one
found on previous generations such as the H6. In addition to the
currently supported features of the H6, it also includes a VP9 decoder.
Support for VP9 will be added separately.

Add the compatible for the H616 variant, using the H6 variant data.

Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
Changes since v2:
- Drop "drivers:" from subject

Changes since v1:
- Updated commit message on VP9 decoder status
---
 drivers/staging/media/sunxi/cedrus/cedrus.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
index bbd186b8035b..ac0217976670 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -696,6 +696,10 @@ static const struct of_device_id cedrus_dt_match[] = {
 		.compatible = "allwinner,sun50i-h6-video-engine",
 		.data = &sun50i_h6_cedrus_variant,
 	},
+	{
+		.compatible = "allwinner,sun50i-h616-video-engine",
+		.data = &sun50i_h6_cedrus_variant,
+	},
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, cedrus_dt_match);
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 5/7] arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine
  2026-07-12  3:00 [PATCH v3 0/7] arm64: allwinner: h616: Support Video Engine Chen-Yu Tsai
                   ` (3 preceding siblings ...)
  2026-07-12  3:00 ` [PATCH v3 4/7] staging: media: sunxi: cedrus: add H616 variant Chen-Yu Tsai
@ 2026-07-12  3:00 ` Chen-Yu Tsai
  2026-07-12  3:08   ` sashiko-bot
  2026-07-12  3:00 ` [PATCH v3 6/7] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU " Chen-Yu Tsai
  2026-07-12  3:00 ` [PATCH v3 7/7] arm64: dts: allwinner: sun50i-h616: Add " Chen-Yu Tsai
  6 siblings, 1 reply; 13+ messages in thread
From: Chen-Yu Tsai @ 2026-07-12  3:00 UTC (permalink / raw)
  To: Maxime Ripard, Paul Kocialkowski, Mauro Carvalho Chehab,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Greg Kroah-Hartman, linux-media, linux-staging, devicetree,
	linux-sunxi, linux-arm-kernel, linux-kernel, Jernej Skrabec

The SRAM C region contains a partial alias to the VE SRAM already
referenced by the video engine. To avoid access through this alias
window, the region should also be claimed by the video engine.

Add a reference to the SRAM C region to the video engine node.

Fixes: b542570e5605 ("arm64: dts: allwinner: h6: Add Video Engine node")
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 72ce1a75647b..88c6e3e105c0 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -205,7 +205,7 @@ video-codec@1c0e000 {
 			clock-names = "ahb", "mod", "ram";
 			resets = <&ccu RST_BUS_VE>;
 			interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
-			allwinner,sram = <&ve_sram 1>;
+			allwinner,sram = <&ve_sram 1>, <&de2_sram 1>;
 			iommus = <&iommu 3>;
 		};
 
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 6/7] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU for video engine
  2026-07-12  3:00 [PATCH v3 0/7] arm64: allwinner: h616: Support Video Engine Chen-Yu Tsai
                   ` (4 preceding siblings ...)
  2026-07-12  3:00 ` [PATCH v3 5/7] arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine Chen-Yu Tsai
@ 2026-07-12  3:00 ` Chen-Yu Tsai
  2026-07-12  3:09   ` sashiko-bot
  2026-07-12  3:00 ` [PATCH v3 7/7] arm64: dts: allwinner: sun50i-h616: Add " Chen-Yu Tsai
  6 siblings, 1 reply; 13+ messages in thread
From: Chen-Yu Tsai @ 2026-07-12  3:00 UTC (permalink / raw)
  To: Maxime Ripard, Paul Kocialkowski, Mauro Carvalho Chehab,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Greg Kroah-Hartman, linux-media, linux-staging, devicetree,
	linux-sunxi, linux-arm-kernel, linux-kernel, Jernej Skrabec

The video engine on the H6 actually has two IOMMU ports. The one already
listed is simply named "VE" in the user manual. The missing one is named
"VE_R" and is probably either read-only or used for reference frames.
Either way, it should be listed.

Add a reference to the "VE_R" IOMMU port to the video engine node.

Fixes: 62a8ccf3a248 ("arm64: dts: allwinner: h6: Fix Cedrus IOMMU usage")
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 88c6e3e105c0..48c771223af4 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -206,7 +206,7 @@ video-codec@1c0e000 {
 			resets = <&ccu RST_BUS_VE>;
 			interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
 			allwinner,sram = <&ve_sram 1>, <&de2_sram 1>;
-			iommus = <&iommu 3>;
+			iommus = <&iommu 3>, <&iommu 1>;
 		};
 
 		gpu: gpu@1800000 {
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 7/7] arm64: dts: allwinner: sun50i-h616: Add video engine
  2026-07-12  3:00 [PATCH v3 0/7] arm64: allwinner: h616: Support Video Engine Chen-Yu Tsai
                   ` (5 preceding siblings ...)
  2026-07-12  3:00 ` [PATCH v3 6/7] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU " Chen-Yu Tsai
@ 2026-07-12  3:00 ` Chen-Yu Tsai
  2026-07-12  3:08   ` sashiko-bot
  6 siblings, 1 reply; 13+ messages in thread
From: Chen-Yu Tsai @ 2026-07-12  3:00 UTC (permalink / raw)
  To: Maxime Ripard, Paul Kocialkowski, Mauro Carvalho Chehab,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Jernej Skrabec, Greg Kroah-Hartman, linux-media, linux-staging,
	devicetree, linux-sunxi, linux-arm-kernel, linux-kernel,
	Andre Przywara

From: Jernej Skrabec <jernej.skrabec@gmail.com>

The H616 SoC has a video engine, and two SRAM regions needed by it.

Add the video engine to the dtsi file.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
[wens@kernel.org: Add VE SRAM region and commit message]
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
Changes since v1:
- Corrected second IOMMU port
---
 arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
index 1598e86259ab..c6b3a3f8359a 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
@@ -175,6 +175,18 @@ crypto: crypto@1904000 {
 			resets = <&ccu RST_BUS_CE>;
 		};
 
+		video-codec@1c0e000 {
+			compatible = "allwinner,sun50i-h616-video-engine";
+			reg = <0x01c0e000 0x2000>;
+			clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
+				 <&ccu CLK_MBUS_VE>;
+			clock-names = "ahb", "mod", "ram";
+			resets = <&ccu RST_BUS_VE>;
+			interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
+			iommus = <&iommu 3>, <&iommu 2>;
+			allwinner,sram = <&ve_sram 1>, <&sram_c 1>;
+		};
+
 		syscon: syscon@3000000 {
 			compatible = "allwinner,sun50i-h616-system-control";
 			reg = <0x03000000 0x1000>;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/7] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6
  2026-07-12  3:00 ` [PATCH v3 1/7] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6 Chen-Yu Tsai
@ 2026-07-12  3:08   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-07-12  3:08 UTC (permalink / raw)
  To: Chen-Yu Tsai; +Cc: devicetree, conor+dt, linux-sunxi, robh

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Validation failure: sun50i-h6.dtsi fails dtbs_check due to the new minItems: 2 constraint.
--

--- Patch [1]: [PATCH v3 1/7] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6 ---
commit 17817354e28859038f6eb81e492f4c4b1bc51a02
Author: Chen-Yu Tsai <wens@kernel.org>

dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6

This commit updates the device tree binding for the sun4i-a10-video-engine to
specify that the H6 SoC requires two IOMMU connections. It adds a conditional
schema block enforcing a minimum of two items for the iommus property on H6
devices.

> 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 541325f900a1d..b4c0fabb38211 100644
> --- a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
> +++ b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml

[ ... ]

> @@ -72,6 +75,22 @@ required:
>    - resets
>    - allwinner,sram
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - allwinner,sun50i-h6-video-engine
> +    then:
> +      properties:
> +        iommus:
> +          minItems: 2

[Severity: Low]
Will this strict constraint cause dtbs_check failures for existing device
trees?

Looking at the H6 dtsi file, the video-codec node only provides a single IOMMU
connection:

arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi:video-codec@1c0e000 {
	...
	iommus = <&iommu 3>;
};

Since this commit enforces minItems: 2 without simultaneously updating the
device tree, will it cause make dtbs_check to report validation errors for the
H6 SoC?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260712030011.3778169-1-wens@kernel.org?part=1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 2/7] dt-bindings: media: sun4i-a10-video-engine: Fix SRAM count for H6
  2026-07-12  3:00 ` [PATCH v3 2/7] dt-bindings: media: sun4i-a10-video-engine: Fix SRAM " Chen-Yu Tsai
@ 2026-07-12  3:08   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-07-12  3:08 UTC (permalink / raw)
  To: Chen-Yu Tsai; +Cc: conor+dt, devicetree, linux-sunxi, robh

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Medium] The binding enforces a second SRAM item for the H6 SoC, but the in-tree device tree is not updated, causing validation failures.

Pre-existing issues:
- [High] The device tree binding requires claiming a second SRAM alias for the H6 video engine, but the SRAM driver hardcodes parsing only the first region.
--

--- Patch [2]: [PATCH v3 2/7] dt-bindings: media: sun4i-a10-video-engine: Fix SRAM count for H6 ---
commit b3f1ab3ef227838179ad2332d41536525f39d18a
Author: Chen-Yu Tsai <wens@kernel.org>

dt-bindings: media: sun4i-a10-video-engine: Fix SRAM count for H6

On the H6, the SRAM C region includes an alias of part of the VE SRAM
used by the video engine. This commit adds a second SRAM region phandle
requirement to the video engine for the H6 to claim this alias window.

> 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 b4c0fabb38211..e01588a02628d 100644
> --- a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
> +++ b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
[ ... ]
> @@ -91,6 +95,21 @@ allOf:
>          iommus:
>            maxItems: 1
>  
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - allwinner,sun50i-h6-video-engine
> +    then:
> +      properties:
> +        allwinner,sram:
> +          minItems: 2

[Severity: High]
This is a pre-existing issue, but does adding the DT binding property solve the
hardware aliasing issue without implementing the necessary driver parser changes?

Looking at sunxi_sram_of_parse() in drivers/soc/sunxi/sunxi_sram.c, it
hardcodes index 0 when parsing the 'allwinner,sram' property:

drivers/soc/sunxi/sunxi_sram.c:sunxi_sram_of_parse() {
    ...
    ret = of_parse_phandle_with_fixed_args(node, "allwinner,sram", 1, 0,
    ...
}

When the Cedrus driver probes, it calls sunxi_sram_claim(), which relies on
sunxi_sram_of_parse() and only claims the single region returned, leaving the
alias window unprotected. 

Without claiming the alias window, could another subsystem claim and use the
overlapping SRAM region concurrently, leading to silent memory corruption?

[Severity: Medium]
Will this new constraint cause validation failures (make dtbs_check) for the
existing in-tree device tree?

It appears the H6 device tree node video-codec@1c0e000 in
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi currently only provides a single
SRAM item:

arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi:video-codec@1c0e000 {
    ...
    allwinner,sram = <&ve_sram 1>;
    ...
}

Should the in-tree device tree be updated alongside this binding change to
satisfy the new minItems constraint?

> +    else:
> +      properties:
> +        allwinner,sram:
> +          maxItems: 1

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260712030011.3778169-1-wens@kernel.org?part=2

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 7/7] arm64: dts: allwinner: sun50i-h616: Add video engine
  2026-07-12  3:00 ` [PATCH v3 7/7] arm64: dts: allwinner: sun50i-h616: Add " Chen-Yu Tsai
@ 2026-07-12  3:08   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-07-12  3:08 UTC (permalink / raw)
  To: Chen-Yu Tsai; +Cc: devicetree, robh, linux-sunxi, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The newly added `video-codec` node references an undefined `ve_sram` phandle, causing a device tree compilation error, and a structurally incorrect `sram_c` phandle.
--

--- Patch [7]: [PATCH v3 7/7] arm64: dts: allwinner: sun50i-h616: Add video engine ---
commit 47b5fe1ab74e2eb5363068c14fed457f3e1ad7e1
Author: Jernej Skrabec <jernej.skrabec@gmail.com>

arm64: dts: allwinner: sun50i-h616: Add video engine

This commit adds the video engine node to the sun50i-h616 dtsi file. It
defines the clocks, resets, interrupts, iommus, and SRAM regions required
by the video engine hardware.

> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
> index bf054869e78be..fc912ed80a3e4 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
> @@ -175,6 +175,18 @@ crypto: crypto@1904000 {
>  			resets = <&ccu RST_BUS_CE>;
>  		};
>  
> +		video-codec@1c0e000 {
> +			compatible = "allwinner,sun50i-h616-video-engine";
> +			reg = <0x01c0e000 0x2000>;
> +			clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
> +				 <&ccu CLK_MBUS_VE>;
> +			clock-names = "ahb", "mod", "ram";
> +			resets = <&ccu RST_BUS_VE>;
> +			interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
> +			iommus = <&iommu 3>, <&iommu 2>;
> +			allwinner,sram = <&ve_sram 1>, <&sram_c 1>;

[Severity: Low]
Will this cause a device tree compilation error? The &ve_sram phandle doesn't
appear to be defined, which could prevent the device tree from building.

Also, does the &sram_c phandle reference the parent mmio-sram node instead
of a valid sram-section child node? If it points to the parent,
sunxi_sram_of_parse() might return -EINVAL during driver probe.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260712030011.3778169-1-wens@kernel.org?part=7

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 5/7] arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine
  2026-07-12  3:00 ` [PATCH v3 5/7] arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine Chen-Yu Tsai
@ 2026-07-12  3:08   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-07-12  3:08 UTC (permalink / raw)
  To: Chen-Yu Tsai; +Cc: devicetree, robh, linux-sunxi, conor+dt

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The newly added `<&de2_sram 1>` phandle is silently ignored by the OS because the SRAM driver hardcodes parsing to only the first array element.
- [Medium] Assigning `de2_sram` to the Video Engine creates an unresolvable resource conflict with the Display Engine, guaranteeing a probe failure if the SRAM driver were to parse it.
--

--- Patch [5]: [PATCH v3 5/7] arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine ---
commit dbe16923a66cbda638350c813c16a8b1c65e3b6b
Author: Chen-Yu Tsai <wens@kernel.org>

arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine

The SRAM C region contains a partial alias to the VE SRAM already
referenced by the video engine. To avoid access through this alias
window, the region should also be claimed by the video engine.

Add a reference to the SRAM C region to the video engine node.

> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> index 72ce1a75647bf..88c6e3e105c07 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi

[ ... ]

> @@ -205,7 +205,7 @@ video-codec@1c0e000 {
>  			clock-names = "ahb", "mod", "ram";
>  			resets = <&ccu RST_BUS_VE>;
>  			interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
> -			allwinner,sram = <&ve_sram 1>;
> +			allwinner,sram = <&ve_sram 1>, <&de2_sram 1>;

[Severity: Medium]
Will this second phandle actually be parsed by the OS?

Looking at the driver code in drivers/soc/sunxi/sunxi_sram.c, it seems
the parser hardcodes the index to 0:

drivers/soc/sunxi/sunxi_sram.c:sunxi_sram_of_parse() {
	...
	ret = of_parse_phandle_with_fixed_args(node, "allwinner,sram", 1, 0,
					       &args);
	...
}

Does the driver need to be updated to parse multiple SRAM elements so
this alias window is actually closed?


[Severity: Medium]
If the driver is updated to parse this second element, will it cause a probe
failure due to a resource conflict?

The de2_sram region is already claimed by the Display Engine (bus@1000000).
Looking at sunxi_sram_claim(), the API enforces strict exclusive ownership:

drivers/soc/sunxi/sunxi_sram.c:sunxi_sram_claim() {
	...
	if (sram_desc->claimed) {
		spin_unlock(&sram_lock);
		return -EBUSY;
	}
	...
}

If both the Display Engine and Video Engine try to claim de2_sram, won't the
second device to probe be rejected with -EBUSY?

>  			iommus = <&iommu 3>;
>  		};
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260712030011.3778169-1-wens@kernel.org?part=5

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 6/7] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU for video engine
  2026-07-12  3:00 ` [PATCH v3 6/7] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU " Chen-Yu Tsai
@ 2026-07-12  3:09   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-07-12  3:09 UTC (permalink / raw)
  To: Chen-Yu Tsai; +Cc: devicetree, robh, linux-sunxi, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The second SRAM region (`de2_sram`) added to the `video-codec` node is never claimed by the video engine driver or the SRAM subsystem, failing to fulfill the commit message's goal.
--

--- Patch [6]: [PATCH v3 6/7] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU for video engine ---
commit 92e4c0595ba5187a0f4f259f15e3d844654fec5a
Author: Chen-Yu Tsai <wens@kernel.org>

arm64: dts: allwinner: sun50i-h6: Add missing IOMMU for video engine

The video engine on the H6 actually has two IOMMU ports. The one already
listed is simply named "VE" in the user manual. The missing one is named
"VE_R" and is probably either read-only or used for reference frames.

> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> index 88c6e3e105c07..48c771223af4d 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> @@ -206,7 +206,7 @@ video-codec@1c0e000 {
>  			resets = <&ccu RST_BUS_VE>;
>  			interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
>  			allwinner,sram = <&ve_sram 1>, <&de2_sram 1>;

[Severity: Medium]
Will the second SRAM region (<&de2_sram 1>) be claimed by the video engine
driver or the SRAM subsystem?

Looking at the cedrus driver, it invokes sunxi_sram_claim() exactly once
during probe without handling multiple SRAM alias claims:

drivers/staging/media/sunxi/cedrus/cedrus_hw.c:cedrus_hw_probe() {
    ...
    ret = sunxi_sram_claim(dev->dev);
    ...
}

This calls sunxi_sram_of_parse(), which hardcodes the index to 0, completely
ignoring any subsequent SRAM properties:

drivers/soc/sunxi/sunxi_sram.c:sunxi_sram_of_parse() {
    ...
    ret = of_parse_phandle_with_fixed_args(node, "allwinner,sram", 1, 0,
                                           &args);
    ...
}

Could this leave the SRAM alias window unclaimed?

> -			iommus = <&iommu 3>;
> +			iommus = <&iommu 3>, <&iommu 1>;
>  		};

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260712030011.3778169-1-wens@kernel.org?part=6

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-07-12  3:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-12  3:00 [PATCH v3 0/7] arm64: allwinner: h616: Support Video Engine Chen-Yu Tsai
2026-07-12  3:00 ` [PATCH v3 1/7] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6 Chen-Yu Tsai
2026-07-12  3:08   ` sashiko-bot
2026-07-12  3:00 ` [PATCH v3 2/7] dt-bindings: media: sun4i-a10-video-engine: Fix SRAM " Chen-Yu Tsai
2026-07-12  3:08   ` sashiko-bot
2026-07-12  3:00 ` [PATCH v3 3/7] dt-bindings: media: sun4i-a10-video-engine: Add H616 compatible Chen-Yu Tsai
2026-07-12  3:00 ` [PATCH v3 4/7] staging: media: sunxi: cedrus: add H616 variant Chen-Yu Tsai
2026-07-12  3:00 ` [PATCH v3 5/7] arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine Chen-Yu Tsai
2026-07-12  3:08   ` sashiko-bot
2026-07-12  3:00 ` [PATCH v3 6/7] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU " Chen-Yu Tsai
2026-07-12  3:09   ` sashiko-bot
2026-07-12  3:00 ` [PATCH v3 7/7] arm64: dts: allwinner: sun50i-h616: Add " Chen-Yu Tsai
2026-07-12  3:08   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox