Skip to content

Commit 3a82b6f

Browse files
de-nordicnvlsianpu
authored andcommitted
zephyr: Switch to using FIXED_PARTITION_ macros
The FLASH_AREA_ macros, which have been using DTS node label property to identify partitions, have been replaced with FIXED_PARTITION_ macros that use DTS node label to identify partitions. Signed-off-by: Dominik Ermel <[email protected]> Signed-off-by: Andrzej Puzdrowski <[email protected]>
1 parent e00f24b commit 3a82b6f

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

boot/zephyr/include/sysflash/sysflash.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,38 @@
1515
* running in single image mode.
1616
*/
1717
#define FLASH_AREA_IMAGE_PRIMARY(x) (((x) == 0) ? \
18-
FLASH_AREA_ID(image_0) : \
19-
FLASH_AREA_ID(image_0))
18+
FIXED_PARTITION_ID(slot0_partition) : \
19+
FIXED_PARTITION_ID(slot0_partition))
2020
#define FLASH_AREA_IMAGE_SECONDARY(x) (((x) == 0) ? \
21-
FLASH_AREA_ID(image_1) : \
22-
FLASH_AREA_ID(image_1))
21+
FIXED_PARTITION_ID(slot1_partition) : \
22+
FIXED_PARTITION_ID(slot1_partition))
2323
#elif (MCUBOOT_IMAGE_NUMBER == 2)
2424
/* MCUBoot currently supports only up to 2 updateable firmware images.
2525
* If the number of the current image is greater than MCUBOOT_IMAGE_NUMBER - 1
2626
* then a dummy value will be assigned to the flash area macros.
2727
*/
2828
#define FLASH_AREA_IMAGE_PRIMARY(x) (((x) == 0) ? \
29-
FLASH_AREA_ID(image_0) : \
29+
FIXED_PARTITION_ID(slot0_partition) : \
3030
((x) == 1) ? \
31-
FLASH_AREA_ID(image_2) : \
31+
FIXED_PARTITION_ID(slot2_partition) : \
3232
255)
3333
#define FLASH_AREA_IMAGE_SECONDARY(x) (((x) == 0) ? \
34-
FLASH_AREA_ID(image_1) : \
34+
FIXED_PARTITION_ID(slot1_partition) : \
3535
((x) == 1) ? \
36-
FLASH_AREA_ID(image_3) : \
36+
FIXED_PARTITION_ID(slot3_partition) : \
3737
255)
3838
#else
3939
#error "Image slot and flash area mapping is not defined"
4040
#endif
4141

4242
#if !defined(CONFIG_BOOT_SWAP_USING_MOVE)
43-
#define FLASH_AREA_IMAGE_SCRATCH FLASH_AREA_ID(image_scratch)
43+
#define FLASH_AREA_IMAGE_SCRATCH FIXED_PARTITION_ID(scratch_partition)
4444
#endif
4545

4646
#else /* CONFIG_SINGLE_APPLICATION_SLOT */
4747

48-
#define FLASH_AREA_IMAGE_PRIMARY(x) FLASH_AREA_ID(image_0)
49-
#define FLASH_AREA_IMAGE_SECONDARY(x) FLASH_AREA_ID(image_0)
48+
#define FLASH_AREA_IMAGE_PRIMARY(x) FIXED_PARTITION_ID(slot0_partition)
49+
#define FLASH_AREA_IMAGE_SECONDARY(x) FIXED_PARTITION_ID(slot0_partition)
5050
/* NOTE: Scratch parition is not used by single image DFU but some of
5151
* functions in common files reference it, so the definitions has been
5252
* provided to allow compilation of common units.

boot/zephyr/include/target.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
#if (!defined(CONFIG_XTENSA) && !DT_HAS_CHOSEN(zephyr_flash_controller)) || \
3434
(defined(CONFIG_XTENSA) && !DT_NODE_EXISTS(DT_INST(0, jedec_spi_nor))) || \
3535
!defined(FLASH_ALIGN) || \
36-
!(FLASH_AREA_LABEL_EXISTS(image_0)) || \
37-
!(FLASH_AREA_LABEL_EXISTS(image_1) || CONFIG_SINGLE_APPLICATION_SLOT) || \
38-
(defined(CONFIG_BOOT_SWAP_USING_SCRATCH) && !FLASH_AREA_LABEL_EXISTS(image_scratch))
36+
!(FIXED_PARTITION_EXISTS(slot0_partition)) || \
37+
!(FIXED_PARTITION_EXISTS(slot1_partition) || CONFIG_SINGLE_APPLICATION_SLOT) || \
38+
(defined(CONFIG_BOOT_SWAP_USING_SCRATCH) && !FIXED_PARTITION_EXISTS(scratch_partition))
3939
#error "Target support is incomplete; cannot build mcuboot."
4040
#endif
4141

42-
#if (MCUBOOT_IMAGE_NUMBER == 2) && (!(FLASH_AREA_LABEL_EXISTS(image_2)) || \
43-
!(FLASH_AREA_LABEL_EXISTS(image_3)))
42+
#if (MCUBOOT_IMAGE_NUMBER == 2) && (!(FIXED_PARTITION_EXISTS(slot2_partition)) || \
43+
!(FIXED_PARTITION_EXISTS(slot3_partition)))
4444
#error "Target support is incomplete; cannot build mcuboot."
4545
#endif
4646

0 commit comments

Comments
 (0)