dfu: replace FLASH_ALIGN with FLASH_WRITE_BLOCK_SIZE

Use the define generated by the DTS instead of using the FLASH_ALIGN
alias. The latter is an internal mcuboot name. We shouldn't need it in
Zephyr itself.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
This commit is contained in:
Marti Bolivar 2017-09-24 16:23:24 -07:00 committed by Anas Nashif
commit 313b20d648
3 changed files with 4 additions and 4 deletions

View file

@ -27,7 +27,6 @@
/* For IMG_MANAGER */
#if defined(CONFIG_SOC_FLASH_NRF5)
#define FLASH_DRIVER_NAME CONFIG_SOC_FLASH_NRF5_DEV_NAME
#define FLASH_ALIGN FLASH_WRITE_BLOCK_SIZE
#endif
#endif /* _NORDICSEMI_NRF52_SOC_H_ */

View file

@ -43,7 +43,7 @@
#define BOOT_FLAG_IMAGE_OK 0
#define BOOT_FLAG_COPY_DONE 1
#define FLASH_MIN_WRITE_SIZE FLASH_ALIGN
#define FLASH_MIN_WRITE_SIZE FLASH_WRITE_BLOCK_SIZE
#define FLASH_BANK0_OFFSET FLASH_AREA_IMAGE_0_OFFSET
/* FLASH_AREA_IMAGE_XX_YY values used below are auto-generated thanks to DT */

View file

@ -18,8 +18,9 @@
#include <board.h>
#include <dfu/flash_img.h>
BUILD_ASSERT_MSG((CONFIG_IMG_BLOCK_BUF_SIZE % FLASH_ALIGN == 0),
"CONFIG_IMG_BLOCK_BUF_SIZE is not multiple of FLASH_ALIGN");
BUILD_ASSERT_MSG((CONFIG_IMG_BLOCK_BUF_SIZE % FLASH_WRITE_BLOCK_SIZE == 0),
"CONFIG_IMG_BLOCK_BUF_SIZE is not a multiple of "
"FLASH_WRITE_BLOCK_SIZE");
static bool flash_verify(struct device *dev, off_t offset,
u8_t *data, size_t len)