Skip to content

Commit b7254d1

Browse files
galaknvlsianpu
authored andcommitted
zephyr: Change DT_FLASH_AREA_ macros to FLASH_AREA_
As we replace the legacy DT_FLASH_ support use the new FLASH_AREA_ macros. Signed-off-by: Kumar Gala <[email protected]>
1 parent 5657d00 commit b7254d1

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

boot/zephyr/include/sysflash/sysflash.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,32 @@
1313
* running in single image mode.
1414
*/
1515
#define FLASH_AREA_IMAGE_PRIMARY(x) (((x) == 0) ? \
16-
DT_FLASH_AREA_IMAGE_0_ID : \
17-
DT_FLASH_AREA_IMAGE_0_ID)
16+
FLASH_AREA_ID(image_0) : \
17+
FLASH_AREA_ID(image_0))
1818
#define FLASH_AREA_IMAGE_SECONDARY(x) (((x) == 0) ? \
19-
DT_FLASH_AREA_IMAGE_1_ID : \
20-
DT_FLASH_AREA_IMAGE_1_ID)
19+
FLASH_AREA_ID(image_1) : \
20+
FLASH_AREA_ID(image_1))
2121
#elif (MCUBOOT_IMAGE_NUMBER == 2)
2222
/* MCUBoot currently supports only up to 2 updateable firmware images.
2323
* If the number of the current image is greater than MCUBOOT_IMAGE_NUMBER - 1
2424
* then a dummy value will be assigned to the flash area macros.
2525
*/
2626
#define FLASH_AREA_IMAGE_PRIMARY(x) (((x) == 0) ? \
27-
DT_FLASH_AREA_IMAGE_0_ID : \
27+
FLASH_AREA_ID(image_0) : \
2828
((x) == 1) ? \
29-
DT_FLASH_AREA_IMAGE_2_ID : \
29+
FLASH_AREA_ID(image_2) : \
3030
255)
3131
#define FLASH_AREA_IMAGE_SECONDARY(x) (((x) == 0) ? \
32-
DT_FLASH_AREA_IMAGE_1_ID : \
32+
FLASH_AREA_ID(image_1) : \
3333
((x) == 1) ? \
34-
DT_FLASH_AREA_IMAGE_3_ID : \
34+
FLASH_AREA_ID(image_3) : \
3535
255)
3636
#else
3737
#error "Image slot and flash area mapping is not defined"
3838
#endif
3939

4040
#if !defined(CONFIG_BOOT_SWAP_USING_MOVE)
41-
#define FLASH_AREA_IMAGE_SCRATCH DT_FLASH_AREA_IMAGE_SCRATCH_ID
41+
#define FLASH_AREA_IMAGE_SCRATCH FLASH_AREA_ID(image_scratch)
4242
#endif
4343

4444
#endif /* __SYSFLASH_H__ */

boot/zephyr/include/target.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* everything we need.
2121
*/
2222
#include <soc.h>
23+
#include <storage/flash_map.h>
2324

2425
#define FLASH_ALIGN FLASH_WRITE_BLOCK_SIZE
2526

@@ -35,12 +36,9 @@
3536
#if (!defined(CONFIG_XTENSA) && !defined(DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL)) || \
3637
(defined(CONFIG_XTENSA) && !defined(JEDEC_SPI_NOR_0_LABEL)) || \
3738
!defined(FLASH_ALIGN) || \
38-
!defined(DT_FLASH_AREA_IMAGE_0_OFFSET) || \
39-
!defined(DT_FLASH_AREA_IMAGE_0_SIZE) || \
40-
!defined(DT_FLASH_AREA_IMAGE_1_OFFSET) || \
41-
!defined(DT_FLASH_AREA_IMAGE_1_SIZE) || \
42-
(!defined(CONFIG_BOOT_SWAP_USING_MOVE) && !defined(DT_FLASH_AREA_IMAGE_SCRATCH_OFFSET)) || \
43-
(!defined(CONFIG_BOOT_SWAP_USING_MOVE) && !defined(DT_FLASH_AREA_IMAGE_SCRATCH_SIZE))
39+
!(FLASH_AREA_LABEL_EXISTS(image_0)) || \
40+
!(FLASH_AREA_LABEL_EXISTS(image_1)) || \
41+
(!defined(CONFIG_BOOT_SWAP_USING_MOVE) && !(FLASH_AREA_LABEL_EXISTS(image_scratch)))
4442
#error "Target support is incomplete; cannot build mcuboot."
4543
#endif
4644

0 commit comments

Comments
 (0)