Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

risc-v/mpfs: Add error handling for PMP conf #263

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arch/risc-v/src/mpfs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions arch/risc-v/src/mpfs/mpfs_entrypoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Loading