]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
soc: sunxi: sram: Add H616 SRAM regions
authorChen-Yu Tsai <wens@kernel.org>
Tue, 24 Mar 2026 16:43:54 +0000 (00:43 +0800)
committerChen-Yu Tsai <wens@kernel.org>
Mon, 27 Apr 2026 15:25:35 +0000 (23:25 +0800)
The Allwinner H616 has two switchable peripheral SRAM regions:

- The VE SRAM is a 2 MB dedicated SRAM for the Video Engine. CPU access
  to this region is enabled by default. CPU access can be disabled,
  after which reads will show the same stale value for all addresses,
  while writes are ignored.

  The mux value for this region is different from previous generations.

- The SRAM C region is an alias of the first 128 KB of VE SRAM, plus 64
  KB of DE SRAM. The latter is otherwise unaccessible from the CPU. When
  CPU access is disabled, the whole region reads as zero, while writes
  are ignored.

  The mux value for this region is the same as on the A64 and H6.

Add data for the VE SRAM. The register values were taken from the BSP
vendor kernel.

Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://patch.msgid.link/20260324164357.1607247-7-wens@kernel.org
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
drivers/soc/sunxi/sunxi_sram.c

index 4d81897179e7bbd38c70160dc8aa6a788ec45b95..2ccaeacf8c7068eb89103ef9380e913779919fd9 100644 (file)
@@ -83,6 +83,12 @@ static struct sunxi_sram_desc sun50i_a64_sram_c = {
                                  SUNXI_SRAM_MAP(0, 1, "de2")),
 };
 
+static struct sunxi_sram_desc sun50i_h616_ve_sram = {
+       .data   = SUNXI_SRAM_DATA("VE", 0x0, 0, 1,
+                                 SUNXI_SRAM_MAP(1, 0, "cpu"),
+                                 SUNXI_SRAM_MAP(0, 1, "ve")),
+};
+
 static const struct of_device_id sunxi_sram_dt_ids[] = {
        {
                .compatible     = "allwinner,sun4i-a10-sram-a3-a4",
@@ -100,6 +106,10 @@ static const struct of_device_id sunxi_sram_dt_ids[] = {
                .compatible     = "allwinner,sun50i-a64-sram-c",
                .data           = &sun50i_a64_sram_c.data,
        },
+       {
+               .compatible     = "allwinner,sun50i-h616-ve-sram",
+               .data           = &sun50i_h616_ve_sram.data,
+       },
        {}
 };