Boot: introduce CMSIS flash interface and driver

Replace legacy flash interface and driver with
CMSIS compliant version:
 -- remove legacy flash interface
 -- add CMSIS compliant version

Change-Id: I8798d191d8f806500621f76c3c3f62d75aceb7cb
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
diff --git a/bl2/ext/mcuboot/include/target.h b/bl2/ext/mcuboot/include/target.h
index 6f85e5b..47d5a84 100644
--- a/bl2/ext/mcuboot/include/target.h
+++ b/bl2/ext/mcuboot/include/target.h
@@ -1,15 +1,52 @@
 /*
  *  Copyright (C) 2017, Linaro Ltd
+ *  Copyright (c) 2018, Arm Limited.
+ *
  *  SPDX-License-Identifier: Apache-2.0
  */
 
 #ifndef H_TARGETS_TARGET_
 #define H_TARGETS_TARGET_
 
-#if defined(MCUBOOT_TARGET_CONFIG)
-#include MCUBOOT_TARGET_CONFIG
-#else
-#error "Board is currently not supported by bootloader"
+/* Target specific defines: flash partitions; flash driver name, etc.
+ * Comes from: platform/ext/target/<BOARD>/<SUBSYSTEM>/partition
+ */
+#include "flash_layout.h"
+
+#ifndef FLASH_BASE_ADDRESS
+#error "FLASH_BASE_ADDRESS must be defined by the target"
+#endif
+
+#ifndef FLASH_AREA_IMAGE_SECTOR_SIZE
+#error "FLASH_AREA_IMAGE_SECTOR_SIZE must be defined by the target"
+#endif
+
+#ifndef FLASH_AREA_IMAGE_0_OFFSET
+#error "FLASH_AREA_IMAGE_0_OFFSET must be defined by the target"
+#endif
+
+#ifndef FLASH_AREA_IMAGE_0_SIZE
+#error "FLASH_AREA_IMAGE_0_SIZE must be defined by the target"
+#endif
+
+#ifndef FLASH_AREA_IMAGE_1_OFFSET
+#error "FLASH_AREA_IMAGE_1_OFFSET must be defined by the target"
+#endif
+
+#ifndef FLASH_AREA_IMAGE_1_SIZE
+#error "FLASH_AREA_IMAGE_1_SIZE must be defined by the target"
+#endif
+
+#ifndef FLASH_AREA_IMAGE_SCRATCH_OFFSET
+#error "FLASH_AREA_IMAGE_SCRATCH_OFFSET must be defined by the target"
+#endif
+
+#ifndef FLASH_AREA_IMAGE_SCRATCH_SIZE
+#error "FLASH_AREA_IMAGE_SCRATCH_SIZE must be defined by the target"
+#endif
+
+#ifndef FLASH_DEV_NAME
+#error "BL2 supports CMSIS flash interface and device name must be specified"
 #endif
 
 #endif