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

[nrf fromtree] zephyr: Add CONFIG_MCUBOOT_CLEANUP_RAM #380

Merged
merged 19 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
43151fa
Revert "[nrf noup] boot: zephyr: Add experimental selection to compre…
de-nordic Nov 21, 2024
f6d017a
Revert "[nrf noup] boot: zephyr: Kconfig update nrf54l15dk symbol for…
de-nordic Nov 21, 2024
db7fcbe
Revert "[nrf noup] Fix KMU breaking non-KMU builds of MCUboot"
de-nordic Nov 21, 2024
88f5059
Revert "[nrf noup] zephyr: Fix compressed chunk size mismatch"
de-nordic Nov 21, 2024
a5fe259
Revert "[nrf noup] bootutil: Add support for KMU stored ED25519 signa…
de-nordic Nov 21, 2024
5eea14b
Revert "[nrf noup] boot/zephyr/Kconfig: conditionally disable BOOT_MA…
de-nordic Nov 21, 2024
ab96abf
Revert "[nrf noup] bootutil: PureEdDSA using ED25519"
de-nordic Nov 21, 2024
412ba35
Revert "[nrf noup] bootutil: Enable hash calculation directly on stor…
de-nordic Nov 21, 2024
bebc92f
Revert "[nrf noup] bootutil: Provide support for SHA512 with ED25519"
de-nordic Nov 21, 2024
435fa18
Revert "[nrf noup] PSA configuration required changes"
de-nordic Nov 21, 2024
7aaf49c
[nrf fromtree] zephyr: Add CONFIG_MCUBOOT_CLEANUP_RAM
de-nordic Nov 20, 2024
70377df
[nrf noup] PSA configuration required changes
de-nordic Jul 24, 2024
c21a497
[nrf noup] bootutil: Provide support for SHA512 with ED25519
de-nordic Aug 2, 2024
6f0fe12
[nrf noup] bootutil: Enable hash calculation directly on storage
de-nordic Sep 5, 2024
1daa655
[nrf noup] bootutil: PureEdDSA using ED25519
de-nordic Sep 6, 2024
9bdb275
[nrf noup] boot/zephyr/Kconfig: conditionally disable BOOT_MAX_IMG_SE…
nvlsianpu Sep 19, 2024
3f11138
[nrf noup] bootutil: Add support for KMU stored ED25519 signature key
de-nordic Sep 20, 2024
186efb3
[nrf noup] zephyr: Fix compressed chunk size mismatch
nordicjm Oct 25, 2024
69453e4
[nrf noup] boot: zephyr: Add experimental selection to compression
nordicjm Nov 7, 2024
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
6 changes: 6 additions & 0 deletions boot/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ config MCUBOOT_CLEANUP_ARM_CORE
start-up code which can cause a module fault and potentially make the
module irrecoverable.

config MCUBOOT_CLEANUP_RAM
bool "Perform RAM cleanup"
depends on CPU_CORTEX_M4 || CPU_CORTEX_M33
help
Sets contents of memory to 0 before jumping to application.

# Disable MBEDTLS from being selected if NRF_SECURITY is enabled, and use default NRF_SECURITY
# configuration file for MBEDTLS
config MBEDTLS
Expand Down
27 changes: 27 additions & 0 deletions boot/zephyr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,34 @@ static void do_boot(struct boot_rsp *rsp)
__set_CONTROL(0x00); /* application will configures core on its own */
__ISB();
#endif
#if CONFIG_MCUBOOT_CLEANUP_RAM
__asm__ volatile (
/* vt->reset -> r0 */
" mov r0, %0\n"
/* base to write -> r1 */
" mov r1, %1\n"
/* size to write -> r2 */
" mov r2, %2\n"
/* value to write -> r3 */
" mov r3, %3\n"
"clear:\n"
" str r3, [r1]\n"
" add r1, r1, #4\n"
" sub r2, r2, #4\n"
" cbz r2, out\n"
" b clear\n"
"out:\n"
" dsb\n"
/* jump to reset vector of an app */
" bx r0\n"
:
: "r" (vt->reset), "i" (CONFIG_SRAM_BASE_ADDRESS),
"i" (CONFIG_SRAM_SIZE * 1024), "i" (0)
: "r0", "r1", "r2", "r3", "memory"
);
#else
((void (*)(void))vt->reset)();
#endif
}

#elif defined(CONFIG_XTENSA) || defined(CONFIG_RISCV)
Expand Down