Skip to content

Commit 2b997f2

Browse files
de-nordicjukkar
authored andcommitted
[nrf noup] loader: Use BOOT_SLOT_PRIMARY and BOOT_SLOT_SECONDARY
nrf-squash! [nrf noup] zephyr: Add support for compressed image updates The commit replaces BOOT_PRIMARY_SLOT and BOOT_SECONDARY_SLOT with BOOT_SLOT_PRIMARY and BOOT_SLOT_SECONDARY respectively. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 98b6e78 commit 2b997f2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

boot/bootutil/src/loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@ boot_copy_region(struct boot_loader_state *state,
18321832
#endif
18331833

18341834
#ifdef MCUBOOT_DECOMPRESS_IMAGES
1835-
hdr = boot_img_hdr(state, BOOT_SECONDARY_SLOT);
1835+
hdr = boot_img_hdr(state, BOOT_SLOT_SECONDARY);
18361836

18371837
if (MUST_DECOMPRESS(fap_src, BOOT_CURR_IMG(state), hdr)) {
18381838
/* Use alternative function for compressed images */

boot/zephyr/decompression.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,24 @@ bool boot_is_compressed_header_valid(const struct image_header *hdr, const struc
6464
uint32_t protected_tlvs_size;
6565
uint32_t decompressed_size;
6666

67-
primary_fa_id = flash_area_id_from_multi_image_slot(BOOT_CURR_IMG(state), BOOT_PRIMARY_SLOT);
67+
primary_fa_id = flash_area_id_from_multi_image_slot(BOOT_CURR_IMG(state), BOOT_SLOT_PRIMARY);
6868

6969
if (primary_fa_id == fap->fa_id) {
7070
BOOT_LOG_ERR("Primary slots cannot be compressed, image: %d", BOOT_CURR_IMG(state));
7171
return false;
7272
}
7373

74-
if (BOOT_IMG_AREA(state, BOOT_PRIMARY_SLOT) == NULL) {
74+
if (BOOT_IMG_AREA(state, BOOT_SLOT_PRIMARY) == NULL) {
7575
opened_flash_area = true;
7676
}
7777

78-
rc = flash_area_open(primary_fa_id, &BOOT_IMG_AREA(state, BOOT_PRIMARY_SLOT));
78+
rc = flash_area_open(primary_fa_id, &BOOT_IMG_AREA(state, BOOT_SLOT_PRIMARY));
7979
assert(rc == 0);
8080

81-
size_check = flash_area_get_size(BOOT_IMG_AREA(state, BOOT_PRIMARY_SLOT));
81+
size_check = flash_area_get_size(BOOT_IMG_AREA(state, BOOT_SLOT_PRIMARY));
8282

8383
if (opened_flash_area) {
84-
(void)flash_area_close(BOOT_IMG_AREA(state, BOOT_PRIMARY_SLOT));
84+
(void)flash_area_close(BOOT_IMG_AREA(state, BOOT_SLOT_PRIMARY));
8585
}
8686

8787
rc = bootutil_get_img_decomp_size(hdr, fap, &decompressed_size);
@@ -1100,7 +1100,7 @@ int boot_copy_region_decompress(struct boot_loader_state *state, const struct fl
11001100
uint8_t decryption_block_size = 0;
11011101
#endif
11021102

1103-
hdr = boot_img_hdr(state, BOOT_SECONDARY_SLOT);
1103+
hdr = boot_img_hdr(state, BOOT_SLOT_SECONDARY);
11041104

11051105
#ifdef MCUBOOT_ENC_IMAGES
11061106
rc = bootutil_get_img_decrypted_comp_size(hdr, fap_src, &comp_size);

0 commit comments

Comments
 (0)