diff --git a/arch/risc-v/src/mpfs/Kconfig b/arch/risc-v/src/mpfs/Kconfig index c84284c533..290332d1d5 100644 --- a/arch/risc-v/src/mpfs/Kconfig +++ b/arch/risc-v/src/mpfs/Kconfig @@ -52,7 +52,8 @@ config MPFS_BOARD_PMP default n ---help--- If true, the board must provide "mpfs_board_pmp_setup" for PMP - configuration. If false, set ALL memory accessible for every + configuration and "mpfs_board_pmp_error" for PMP error handling. + If false, set ALL memory accessible for every configured HART. Only the bootloader should do this. config MPFS_OPENSBI diff --git a/arch/risc-v/src/mpfs/mpfs_entrypoints.c b/arch/risc-v/src/mpfs/mpfs_entrypoints.c index 2480253f78..52c8415e4c 100644 --- a/arch/risc-v/src/mpfs/mpfs_entrypoints.c +++ b/arch/risc-v/src/mpfs/mpfs_entrypoints.c @@ -107,6 +107,7 @@ void mpfs_jump_to_app(void) "la sp, g_mpfs_boot_stacks\n" /* Stack area base */ "add sp, sp, t0\n" /* Set stack pointer */ "call mpfs_board_pmp_setup\n" /* Run PMP configuration */ + "bne a0, x0, mpfs_board_pmp_error\n" /* If ret != 0, jump to errhan */ "csrr a0, mhartid\n" /* Restore hartid */ #else "li t0, -1\n" /* Open the whole SoC */