Platform: Add new CMSIS Flash driver for Musca

- This patch replaces the former emulated and temporary CMSIS flash
driver (for Musca-A) with a new one which is based on the qspi_ip6514e
flash controller driver and library of the MT25QL flash memory device.
- Integrates the flash driver with MCUBoot and SST service
- The usage of the driver is limited when running from flash.
The erase functions and the flash command (STIG) based implementation
of the ARM_Flash_ProgramData() cannot be used and the initialization
has to be modified to use the default parameters instead of the
optimal.

Change-Id: Ida01cd327d197f0f1bd1adf913ea19aae9662ff3
Signed-off-by: David Vincze <david.vincze@arm.com>
diff --git a/bl2/ext/mcuboot/bl2_main.c b/bl2/ext/mcuboot/bl2_main.c
index c556816..52dece2 100644
--- a/bl2/ext/mcuboot/bl2_main.c
+++ b/bl2/ext/mcuboot/bl2_main.c
@@ -101,6 +101,7 @@
 
     /* Initialize Flash driver */
     FLASH_DEV_NAME.Initialize(NULL);
+
     rc = boot_go(&rsp);
     if (rc != 0) {
         BOOT_LOG_ERR("Unable to find bootable image");
diff --git a/bl2/ext/mcuboot/bootutil/src/loader.c b/bl2/ext/mcuboot/bootutil/src/loader.c
index 154cd7e..3a187be 100644
--- a/bl2/ext/mcuboot/bootutil/src/loader.c
+++ b/bl2/ext/mcuboot/bootutil/src/loader.c
@@ -280,7 +280,11 @@
 
     if ((hdr->ih_magic != IMAGE_MAGIC || boot_image_check(hdr, fap) != 0)) {
         if (slot != 0) {
-            flash_area_erase(fap, 0, fap->fa_size);
+            rc = flash_area_erase(fap, 0, fap->fa_size);
+            if(rc != 0) {
+                flash_area_close(fap);
+                return BOOT_EFLASH;
+            }
             /* Image in slot 1 is invalid. Erase the image and
              * continue booting from slot 0.
              */