Skip to content

Commit

Permalink
boot/zephyr: Load image to RAM on single loader
Browse files Browse the repository at this point in the history
Now that's possible to load image to RAM on single loaders, add support
on Zephyr port for that.

Signed-off-by: Ederson de Souza <[email protected]>
Signed-off-by: Tom Burdick <[email protected]>
  • Loading branch information
edersondisouza authored and teburd committed Sep 30, 2024
1 parent f74ddaa commit 025235f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions boot/zephyr/single_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,29 @@ boot_go(struct boot_rsp *rsp)
if (rc != 0)
goto out;

#ifdef MCUBOOT_RAM_LOAD
static struct boot_loader_state state;
state.imgs[0][0].hdr = _hdr;

rc = boot_load_image_to_sram(&state);
if (rc != 0)
goto out;
#endif

#ifdef MCUBOOT_VALIDATE_PRIMARY_SLOT
FIH_CALL(boot_image_validate, fih_rc, _fa_p, &_hdr);
if (FIH_NOT_EQ(fih_rc, FIH_SUCCESS)) {
#ifdef MCUBOOT_RAM_LOAD
boot_remove_image_from_sram(&state);
#endif
goto out;
}
#elif defined(MCUBOOT_VALIDATE_PRIMARY_SLOT_ONCE)
FIH_CALL(boot_image_validate_once, fih_rc, _fa_p, &_hdr);
if (FIH_NOT_EQ(fih_rc, FIH_SUCCESS)) {
#ifdef MCUBOOT_RAM_LOAD
boot_remove_image_from_sram(&state);
#endif
goto out;
}
#else
Expand Down

0 comments on commit 025235f

Please sign in to comment.