Build: Make possible to overwrite BL2 sources

This commit introduces two cmake flags to let a platform overwrite BL2
related implementations created by the TF-M project.
- Setting DEFAULT_MCUBOOT_FLASH_MAP to OFF makes possible for a
  platform to create custom flash map.
- Setting DEFAULT_MCUBOOT_SECURITY_COUNTER to OFF makes possible for a
  platform to use custom security counter mapping.

Change-Id: Ib1955e63e78dd5a5a7dff67a49dab1d5d1a06fc1
Signed-off-by: Mark Horvath <mark.horvath@arm.com>
Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
diff --git a/bl2/ext/mcuboot/include/target.h b/bl2/ext/mcuboot/include/target.h
index 9ead129..a32dbf2 100644
--- a/bl2/ext/mcuboot/include/target.h
+++ b/bl2/ext/mcuboot/include/target.h
@@ -1,6 +1,6 @@
 /*
  *  Copyright (C) 2017, Linaro Ltd
- *  Copyright (c) 2018-2020, Arm Limited.
+ *  Copyright (c) 2018-2021, Arm Limited.
  *
  *  SPDX-License-Identifier: Apache-2.0
  */
@@ -19,6 +19,9 @@
  */
 #include "flash_layout.h"
 
+#ifdef DEFAULT_MCUBOOT_FLASH_MAP
+/* No need to check the platform defines if custom flash map is used */
+
 #ifndef FLASH_BASE_ADDRESS
 #error "FLASH_BASE_ADDRESS must be defined by the target"
 #endif
@@ -118,4 +121,6 @@
 #error "MCUBOOT_MAX_IMG_SECTORS must be defined by the target"
 #endif
 
+#endif /* DEFAULT_MCUBOOT_FLASH_MAP */
+
 #endif /* H_TARGETS_TARGET_ */