Platform: Move data_width_byte variable from RAM to Flash

If the const variable is defined as local variable, then it
is stored in Flash and loaded to RAM(stack) when it runs.
If it is defined as file static, its runtime address will be
allocated in Flash. So copy to RAM is avoided and Flash cost
remains the same.

Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
Change-Id: I701a6cf01abc5a6d587aa7c263dec0a221487e5c
diff --git a/bl2/src/flash_map.c b/bl2/src/flash_map.c
index 51f3272..1197af5 100644
--- a/bl2/src/flash_map.c
+++ b/bl2/src/flash_map.c
@@ -30,6 +30,13 @@
 extern const struct flash_area flash_map[];
 extern const int flash_map_entry_num;
 
+/* Valid entries for data item width */
+static const uint32_t data_width_byte[] = {
+    sizeof(uint8_t),
+    sizeof(uint16_t),
+    sizeof(uint32_t),
+};
+
 /*
  * Check the target address in the flash_area_xxx operation.
  */
@@ -99,12 +106,6 @@
     uint8_t data_width, i = 0, j;
     int ret = 0;
 
-    /* Valid entries for data item width */
-    const uint32_t data_width_byte[] = {
-        sizeof(uint8_t),
-        sizeof(uint16_t),
-        sizeof(uint32_t),
-    };
     ARM_FLASH_CAPABILITIES DriverCapabilities;
 
     BOOT_LOG_DBG("read area=%d, off=%#x, len=%#x", area->fa_id, off, len);
@@ -191,12 +192,6 @@
 #else
     uint8_t len_padding[FLASH_PROGRAM_UNIT - 1];
 #endif
-    /* Valid entries for data item width */
-    const uint32_t data_width_byte[] = {
-        sizeof(uint8_t),
-        sizeof(uint16_t),
-        sizeof(uint32_t),
-    };
     ARM_FLASH_CAPABILITIES DriverCapabilities;
     uint8_t data_width;
     /* The PROGRAM_UNIT aligned value of `off` */