]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
rockchip: rk3576: Allow pmu sram access for non-secure masters
authorJonas Karlman <jonas@kwiboo.se>
Thu, 8 Jan 2026 13:32:29 +0000 (13:32 +0000)
committerTom Rini <trini@konsulko.com>
Tue, 10 Mar 2026 16:07:02 +0000 (10:07 -0600)
The firewall block access to pmu sram for non-secure masters by default
after reset (0xffffbfff).

Change the pmu lookup configuration to match the default lookup config
for ddr and system sram (0xffff3fff) to allow loading TF-A using DMA.

Mainline TF-A will re-configure the firewall to use an even less
restrictive lookup (0xbffe3ff0), so this change is not expected to have
any real security implication.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Tested-by: Alexey Charkov <alchark@gmail.com> # UFS
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/mach-rockchip/rk3576/rk3576.c

index a1e8a7572fa4fad77a13870f01b15ce3aeca0a06..c17ba418ced5856f6d8c8eb2572a4ca2ca49ebae 100644 (file)
@@ -26,6 +26,9 @@
 #define SYS_SGRF_SOC_CON15     0x005C
 #define SYS_SGRF_SOC_CON20     0x0070
 
+#define FW_PMU1SGRF_BASE       0x26003000
+#define PMU1SGRF_SLV_LOOKUP0   0x80
+
 #define FW_SYS_SGRF_BASE       0x26005000
 #define SGRF_DOMAIN_CON1       0x4
 #define SGRF_DOMAIN_CON2       0x8
@@ -140,6 +143,9 @@ int arch_cpu_init(void)
        if (!IS_ENABLED(CONFIG_SPL_BUILD))
                return 0;
 
+       /* Allow pmu sram access for non-secure masters */
+       writel(0xffff3fff, FW_PMU1SGRF_BASE + PMU1SGRF_SLV_LOOKUP0);
+
        /* Set the emmc to access ddr memory */
        val = readl(FW_SYS_SGRF_BASE + SGRF_DOMAIN_CON2);
        writel(val | 0x7, FW_SYS_SGRF_BASE + SGRF_DOMAIN_CON2);