Report recoverable errors as warnings

At present many recoverable failures are reported as errors. This patch
modifies all such failures to be reported as warnings instead.

Change-Id: I5141653c82498defcada9b90fdf7498ba496b2f2
diff --git a/common/bl_common.c b/common/bl_common.c
index fb86ac5..9afae95 100644
--- a/common/bl_common.c
+++ b/common/bl_common.c
@@ -278,7 +278,7 @@
 	/* Obtain a reference to the image by querying the platform layer */
 	io_result = plat_get_image_source(image_name, &dev_handle, &image_spec);
 	if (io_result != IO_SUCCESS) {
-		ERROR("Failed to obtain reference to image '%s' (%i)\n",
+		WARN("Failed to obtain reference to image '%s' (%i)\n",
 			image_name, io_result);
 		return 0;
 	}
@@ -286,7 +286,7 @@
 	/* Attempt to access the image */
 	io_result = io_open(dev_handle, image_spec, &image_handle);
 	if (io_result != IO_SUCCESS) {
-		ERROR("Failed to access image '%s' (%i)\n",
+		WARN("Failed to access image '%s' (%i)\n",
 			image_name, io_result);
 		return 0;
 	}
@@ -294,14 +294,14 @@
 	/* Find the size of the image */
 	io_result = io_size(image_handle, &image_size);
 	if ((io_result != IO_SUCCESS) || (image_size == 0)) {
-		ERROR("Failed to determine the size of the image '%s' file (%i)\n",
+		WARN("Failed to determine the size of the image '%s' file (%i)\n",
 			image_name, io_result);
 		goto fail;
 	}
 
 	/* See if we have enough space */
 	if (image_size > mem_layout->free_size) {
-		ERROR("ERROR: Cannot load '%s' file: Not enough space.\n",
+		WARN("Cannot load '%s' file: Not enough space.\n",
 			image_name);
 		dump_load_info(0, image_size, mem_layout);
 		goto fail;
@@ -320,7 +320,7 @@
 	  assert(image_base <= temp_image_base);
 
 	  if (image_base < mem_layout->free_base) {
-		ERROR("Cannot load '%s' file: Not enough space.\n",
+		WARN("Cannot load '%s' file: Not enough space.\n",
 			image_name);
 		dump_load_info(image_base, image_size, mem_layout);
 		goto fail;
@@ -341,7 +341,7 @@
 	  /* Page align base address and check whether the image still fits */
 	  if (image_base + image_size >
 	      mem_layout->free_base + mem_layout->free_size) {
-		  ERROR("Cannot load '%s' file: Not enough space.\n",
+		  WARN("Cannot load '%s' file: Not enough space.\n",
 			  image_name);
 		  dump_load_info(image_base, image_size, mem_layout);
 		  goto fail;
@@ -406,7 +406,7 @@
 		if ((image_base < mem_layout->free_base) ||
 		    (image_base + image_size >
 		       mem_layout->free_base + mem_layout->free_size)) {
-			ERROR("Cannot load '%s' file: Not enough space.\n",
+			WARN("Cannot load '%s' file: Not enough space.\n",
 				image_name);
 			dump_load_info(image_base, image_size, mem_layout);
 			goto fail;
@@ -414,7 +414,7 @@
 
 		/* Check whether the fixed load address is page-aligned. */
 		if (!is_page_aligned(image_base)) {
-			ERROR("Cannot load '%s' file at unaligned address 0x%lx\n",
+			WARN("Cannot load '%s' file at unaligned address 0x%lx\n",
 				image_name, fixed_addr);
 			goto fail;
 		}
@@ -465,7 +465,7 @@
 	/* TODO: Consider whether to try to recover/retry a partially successful read */
 	io_result = io_read(image_handle, (void *)image_base, image_size, &bytes_read);
 	if ((io_result != IO_SUCCESS) || (bytes_read < image_size)) {
-		ERROR("Failed to load '%s' file (%i)\n", image_name, io_result);
+		WARN("Failed to load '%s' file (%i)\n", image_name, io_result);
 		goto fail;
 	}
 
diff --git a/drivers/io/io_fip.c b/drivers/io/io_fip.c
index 8a95708..3725372 100644
--- a/drivers/io/io_fip.c
+++ b/drivers/io/io_fip.c
@@ -184,7 +184,7 @@
 	result = plat_get_image_source(image_name, &backend_dev_handle,
 				       &backend_image_spec);
 	if (result != IO_SUCCESS) {
-		ERROR("Failed to obtain reference to image '%s' (%i)\n",
+		WARN("Failed to obtain reference to image '%s' (%i)\n",
 			image_name, result);
 		result = IO_FAIL;
 		goto fip_dev_init_exit;
@@ -194,7 +194,7 @@
 	result = io_open(backend_dev_handle, backend_image_spec,
 			 &backend_handle);
 	if (result != IO_SUCCESS) {
-		ERROR("Failed to access image '%s' (%i)\n", image_name, result);
+		WARN("Failed to access image '%s' (%i)\n", image_name, result);
 		result = IO_FAIL;
 		goto fip_dev_init_exit;
 	}
@@ -202,7 +202,7 @@
 	result = io_read(backend_handle, &header, sizeof(header), &bytes_read);
 	if (result == IO_SUCCESS) {
 		if (!is_valid_header(&header)) {
-			ERROR("Firmware Image Package header check failed.\n");
+			WARN("Firmware Image Package header check failed.\n");
 			result = IO_FAIL;
 		} else {
 			INFO("FIP header looks OK.\n");
@@ -249,7 +249,7 @@
 	 * than one open file at a time if needed.
 	 */
 	if (current_file.entry.offset_address != 0) {
-		ERROR("fip_file_open : Only one open file at a time.\n");
+		WARN("fip_file_open : Only one open file at a time.\n");
 		return IO_RESOURCES_EXHAUSTED;
 	}
 
@@ -257,7 +257,7 @@
 	result = io_open(backend_dev_handle, backend_image_spec,
 			 &backend_handle);
 	if (result != IO_SUCCESS) {
-		ERROR("Failed to open Firmware Image Package (%i)\n", result);
+		WARN("Failed to open Firmware Image Package (%i)\n", result);
 		result = IO_FAIL;
 		goto fip_file_open_exit;
 	}
@@ -265,7 +265,7 @@
 	/* Seek past the FIP header into the Table of Contents */
 	result = io_seek(backend_handle, IO_SEEK_SET, sizeof(fip_toc_header));
 	if (result != IO_SUCCESS) {
-		ERROR("fip_file_open: failed to seek\n");
+		WARN("fip_file_open: failed to seek\n");
 		result = IO_FAIL;
 		goto fip_file_open_close;
 	}
@@ -284,7 +284,7 @@
 				break;
 			}
 		} else {
-			ERROR("Failed to read FIP (%i)\n", result);
+			WARN("Failed to read FIP (%i)\n", result);
 			goto fip_file_open_close;
 		}
 	} while (compare_uuids(&current_file.entry.uuid, &uuid_null) != 0);
@@ -341,7 +341,7 @@
 	result = io_open(backend_dev_handle, backend_image_spec,
 			 &backend_handle);
 	if (result != IO_SUCCESS) {
-		ERROR("Failed to open FIP (%i)\n", result);
+		WARN("Failed to open FIP (%i)\n", result);
 		result = IO_FAIL;
 		goto fip_file_read_exit;
 	}
@@ -352,7 +352,7 @@
 	file_offset = fp->entry.offset_address + fp->file_pos;
 	result = io_seek(backend_handle, IO_SEEK_SET, file_offset);
 	if (result != IO_SUCCESS) {
-		ERROR("fip_file_read: failed to seek\n");
+		WARN("fip_file_read: failed to seek\n");
 		result = IO_FAIL;
 		goto fip_file_read_close;
 	}
@@ -360,7 +360,7 @@
 	result = io_read(backend_handle, buffer, length, &bytes_read);
 	if (result != IO_SUCCESS) {
 		/* We cannot read our data. Fail. */
-		ERROR("Failed to read payload (%i)\n", result);
+		WARN("Failed to read payload (%i)\n", result);
 		result = IO_FAIL;
 		goto fip_file_read_close;
 	} else {
diff --git a/drivers/io/io_memmap.c b/drivers/io/io_memmap.c
index 0809973..40b8e9a 100644
--- a/drivers/io/io_memmap.c
+++ b/drivers/io/io_memmap.c
@@ -137,7 +137,7 @@
 		entity->info = (uintptr_t)&current_file;
 		result = IO_SUCCESS;
 	} else {
-		ERROR("A Memmap device is already active. Close first.\n");
+		WARN("A Memmap device is already active. Close first.\n");
 		result = IO_RESOURCES_EXHAUSTED;
 	}
 
diff --git a/plat/fvp/plat_io_storage.c b/plat/fvp/plat_io_storage.c
index 768c3c5..359af7d 100644
--- a/plat/fvp/plat_io_storage.c
+++ b/plat/fvp/plat_io_storage.c
@@ -234,7 +234,7 @@
 	int result = IO_FAIL;
 	void *local_image_spec = &bl33_file_spec;
 
-	INFO("Loading BL33 (UEFI)\n");
+	INFO("Loading BL33 (Normal world firmware)\n");
 	/* FIP first then fall back to semi-hosting */
 	result = open_fip(local_image_spec);
 	if (result == IO_SUCCESS) {