[PATCH 02/10] caam: don't write memory at 0 on PPC

Peng Fan peng.fan at oss.nxp.com
Wed May 6 05:39:08 CEST 2026


On Wed, Apr 29, 2026 at 02:17:16PM +0200, Michael Walle wrote:
>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 at kernel.org>
>---
> arch/powerpc/cpu/mpc85xx/cpu_init.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c
>index 739d14f8002..478ab648948 100644
>--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
>+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
>@@ -41,8 +41,8 @@
> #ifdef CONFIG_FSL_CAAM
> #include <fsl_sec.h>
> #endif
>-#if defined(CONFIG_NXP_ESBC) && defined(CONFIG_FSL_CORENET)
> #include <asm/fsl_pamu.h>
>+#if defined(CONFIG_NXP_ESBC) && defined(CONFIG_FSL_CORENET)
> #include <fsl_secboot_err.h>
> #endif
> #ifdef CONFIG_SYS_QE_FMAN_FW_IN_NAND
>@@ -899,6 +899,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);
>+#else
>+	pamu_init();
> #endif
> 
> #ifdef CONFIG_FSL_CAAM

Seems this patch causes build error:
   powerpc:  +   qemu-ppce500
+powerpc-linux-ld: arch/powerpc/cpu/mpc85xx/cpu_init.o: in function `cpu_init_r':
+arch/powerpc/cpu/mpc85xx/cpu_init.c:903:(.text.cpu_init_r+0x18): undefined reference to `pamu_init'
+make[1]: *** [Makefile:2109: u-boot] Error 1
+make: *** [Makefile:189: __sub-make] Error 2
    0    0    1 /1              qemu-ppce500

Regards
Peng
>-- 
>2.47.3
>
>


More information about the U-Boot mailing list