]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
caam: don't write memory at 0 on PPC
authorMichael Walle <mwalle@kernel.org>
Wed, 6 May 2026 12:34:11 +0000 (14:34 +0200)
committerPeng Fan <peng.fan@nxp.com>
Fri, 15 May 2026 11:28:29 +0000 (19:28 +0800)
For non-secure boot environments pamu_init() isn't called but the CAAM
will still call sec_config_pamu_table() -> config_pamu() which then uses
an uninitialized ppaact variable. In fact, that variable is initialized
with 0, so the config_pamu() will happily assume the structure is there
and will operate on that memory. Call pamu_init() in the non-secure boot
case, too.

Signed-off-by: Michael Walle <mwalle@kernel.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/powerpc/cpu/mpc85xx/cpu_init.c

index 739d14f8002d62070b05fba373557347e42f33ef..414782c835fe4bbf5e867d9c675c5def3223b44f 100644 (file)
 #ifdef CONFIG_FSL_CAAM
 #include <fsl_sec.h>
 #endif
-#if defined(CONFIG_NXP_ESBC) && defined(CONFIG_FSL_CORENET)
+#if defined(CONFIG_FSL_CORENET)
 #include <asm/fsl_pamu.h>
+#if defined(CONFIG_NXP_ESBC)
 #include <fsl_secboot_err.h>
 #endif
+#endif
 #ifdef CONFIG_SYS_QE_FMAN_FW_IN_NAND
 #include <nand.h>
 #include <errno.h>
@@ -899,6 +901,8 @@ int cpu_init_r(void)
 #if defined(CONFIG_NXP_ESBC) && defined(CONFIG_FSL_CORENET)
        if (pamu_init() < 0)
                fsl_secboot_handle_error(ERROR_ESBC_PAMU_INIT);
+#elif defined(CONFIG_FSL_CORENET)
+       pamu_init();
 #endif
 
 #ifdef CONFIG_FSL_CAAM