Commit 695e591c authored by David Brown's avatar David Brown Committed by David Brown
Browse files

boot: Warning fixups after dual image XIP/ram-load



This change introduced a few warnings that weren't caught until enabling
simulator builds with these features enabled.  Add some simple
workarounds to avoid the warnings.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent fb40f0c5
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -2242,6 +2242,8 @@ print_loaded_images(struct boot_loader_state *state,
{
    uint32_t active_slot;

    (void)state;

    IMAGES_ITER(BOOT_CURR_IMG(state)) {
        active_slot = slot_usage[BOOT_CURR_IMG(state)].active_slot;

@@ -2354,6 +2356,9 @@ boot_verify_ram_load_address(struct boot_loader_state *state,
    uint32_t img_end_addr;
    uint32_t exec_ram_start;
    uint32_t exec_ram_size;

    (void)state;

#ifdef MULTIPLE_EXECUTABLE_RAM_REGIONS
    int      rc;

@@ -2582,11 +2587,13 @@ static inline int
boot_remove_image_from_sram(struct boot_loader_state *state,
                            struct slot_usage_t slot_usage[])
{
    (void)state;

    BOOT_LOG_INF("Removing image from SRAM at address 0x%x",
                 slot_usage[BOOT_CURR_IMG(state)].img_dst);

    memset((void*)slot_usage[BOOT_CURR_IMG(state)].img_dst, 0,
           slot_usage[BOOT_CURR_IMG(state)].img_sz);
    memset((void*)(IMAGE_RAM_BASE + slot_usage[BOOT_CURR_IMG(state)].img_dst),
           0, slot_usage[BOOT_CURR_IMG(state)].img_sz);

    slot_usage[BOOT_CURR_IMG(state)].img_dst = 0;
    slot_usage[BOOT_CURR_IMG(state)].img_sz = 0;
@@ -2609,6 +2616,8 @@ boot_remove_image_from_flash(struct boot_loader_state *state, uint32_t slot)
    int rc;
    const struct flash_area *fap;

    (void)state;

    BOOT_LOG_INF("Removing image %d slot %d from flash", BOOT_CURR_IMG(state),
                                                         slot);
    area_id = flash_area_id_from_multi_image_slot(BOOT_CURR_IMG(state), slot);
@@ -2917,7 +2926,7 @@ context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp)
{
    struct slot_usage_t slot_usage[BOOT_IMAGE_NUMBER];
    int rc;
    fih_int fih_rc;
    fih_int fih_rc = fih_int_encode(0);

    memset(state, 0, sizeof(struct boot_loader_state));
    memset(slot_usage, 0, sizeof(struct slot_usage_t) * BOOT_IMAGE_NUMBER);