dfu: img_util: move flash defines to SoC

mcuboot_constraints.h had FLASH information related to the SoC that
should be maintained as part of the SoC and not in the subsystem. Also
fixed Makefiles to check for IMG_UTIL Kconfig and not MCUBOOT.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2017-09-19 22:08:33 -04:00 committed by Anas Nashif
parent 7126456d2d
commit db4eba64da
5 changed files with 12 additions and 28 deletions

View file

@ -21,7 +21,13 @@
#endif /* !_ASMLANGUAGE */
#define FLASH_PAGE_ERASE_MAX_TIME_US 89700UL
#define FLASH_PAGE_MAX_CNT 256UL
#define FLASH_PAGE_ERASE_MAX_TIME_US 89700UL
#define FLASH_PAGE_MAX_CNT 256UL
/* 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

@ -1,2 +1,2 @@
obj-$(CONFIG_MCUBOOT_IMG_MANAGER) += boot/
obj-$(CONFIG_MCUBOOT_IMG_MANAGER) += img_util/
obj-y += boot/
obj-y += img_util/

View file

@ -13,7 +13,7 @@
#include <init.h>
#include <misc/__assert.h>
#include "boot/mcuboot_constraints.h"
#include <board.h>
#include "mcuboot.h"
/*

View file

@ -1,22 +0,0 @@
/*
* Copyright (c) 2017 Nordic Semiconductor ASA
* Copyright (c) 2016 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
/* Headers target/devboard.h are copies of board headers form mcuboot sources */
/* see <mcuboot>/boot/zephyr/targets/ */
#ifndef __MCUBOOT_CONSTRAINS_H__
#define __MCUBOOT_CONSTRAINS_H__
/* Flash specific configs */
#if defined(CONFIG_SOC_SERIES_NRF52X)
#define FLASH_DRIVER_NAME CONFIG_SOC_FLASH_NRF5_DEV_NAME
#define FLASH_ALIGN 4
#else
#error Unknown SoC family
#endif /* CONFIG_SOC_SERIES_NRF52X */
#endif /* __MCUBOOT_CONSTRAINS_H__ */

View file

@ -15,7 +15,7 @@
#include <string.h>
#include <errno.h>
#include <flash.h>
#include "boot/mcuboot_constraints.h"
#include <board.h>
#include "flash_img.h"
BUILD_ASSERT_MSG((CONFIG_IMG_BLOCK_BUF_SIZE % FLASH_ALIGN == 0),