[v3,6/7] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU for video engine

Message ID 20260712030011.3778169-7-wens@kernel.org (mailing list archive)
State New
Headers
Series arm64: allwinner: h616: Support Video Engine |

Commit Message

Chen-Yu Tsai July 12, 2026, 3 a.m. UTC
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(-)
  

Comments

sashiko-bot@kernel.org July 12, 2026, 3:09 a.m. UTC | #1
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>;
>  		};
  

Patch

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 {