Reduce deep nesting of header files

Reduce the number of header files included from other header
files as much as possible without splitting the files. Use forward
declarations where possible. This allows removal of some unnecessary
"#ifndef __ASSEMBLY__" statements.

Also, review the .c and .S files for which header files really need
including and reorder the #include statements alphabetically.

Fixes ARM-software/tf-issues#31

Change-Id: Iec92fb976334c77453e010b60bcf56f3be72bd3e
diff --git a/lib/aarch64/cache_helpers.S b/lib/aarch64/cache_helpers.S
index 2696d90..2649ad0 100644
--- a/lib/aarch64/cache_helpers.S
+++ b/lib/aarch64/cache_helpers.S
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <arch_helpers.h>
+#include <arch.h>
 #include <asm_macros.S>
 
 	.globl	dcisw
diff --git a/lib/aarch64/misc_helpers.S b/lib/aarch64/misc_helpers.S
index e3b4ab5..e7b2331 100644
--- a/lib/aarch64/misc_helpers.S
+++ b/lib/aarch64/misc_helpers.S
@@ -28,8 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <arch_helpers.h>
-#include <runtime_svc.h>
+#include <arch.h>
 #include <asm_macros.S>
 
 	.globl	enable_irq
diff --git a/lib/aarch64/sysreg_helpers.S b/lib/aarch64/sysreg_helpers.S
index 8e816f0..61468f9 100644
--- a/lib/aarch64/sysreg_helpers.S
+++ b/lib/aarch64/sysreg_helpers.S
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <arch_helpers.h>
+#include <arch.h>
 #include <asm_macros.S>
 
 	.globl	read_vbar_el1
diff --git a/lib/aarch64/tlb_helpers.S b/lib/aarch64/tlb_helpers.S
index 4244974..ec1558b 100644
--- a/lib/aarch64/tlb_helpers.S
+++ b/lib/aarch64/tlb_helpers.S
@@ -28,7 +28,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <arch_helpers.h>
 #include <asm_macros.S>
 
 	.globl	tlbialle1
diff --git a/lib/aarch64/xlat_helpers.c b/lib/aarch64/xlat_helpers.c
index 87d24ec..d401ffc 100644
--- a/lib/aarch64/xlat_helpers.c
+++ b/lib/aarch64/xlat_helpers.c
@@ -28,9 +28,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <string.h>
-#include <assert.h>
 #include <arch.h>
+#include <assert.h>
 
 /*******************************************************************************
  * Helper to create a level 1/2 table descriptor which points to a level 2/3
diff --git a/lib/io_storage.c b/lib/io_storage.c
index c3b94bb..01ca1c6 100644
--- a/lib/io_storage.c
+++ b/lib/io_storage.c
@@ -28,11 +28,10 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-
-#include <stddef.h>
 #include <assert.h>
-#include <io_storage.h>
 #include <io_driver.h>
+#include <io_storage.h>
+#include <stddef.h>
 
 
 #define MAX_DEVICES(plat_data)						\
diff --git a/lib/locks/bakery/bakery_lock.c b/lib/locks/bakery/bakery_lock.c
index 3cb9248..6d4ab87 100644
--- a/lib/locks/bakery/bakery_lock.c
+++ b/lib/locks/bakery/bakery_lock.c
@@ -28,11 +28,10 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <assert.h>
-#include <string.h>
-
-#include <bakery_lock.h>
 #include <arch_helpers.h>
+#include <assert.h>
+#include <bakery_lock.h>
+#include <string.h>
 
 /*
  * Functions in this file implement Bakery Algorithm for mutual exclusion.
diff --git a/lib/semihosting/semihosting.c b/lib/semihosting/semihosting.c
index 3232cd5..1bce377 100644
--- a/lib/semihosting/semihosting.c
+++ b/lib/semihosting/semihosting.c
@@ -29,10 +29,9 @@
  */
 
 #include <assert.h>
-#include <string.h>
 #include <errno.h>
-#include <stdio.h>
 #include <semihosting.h>
+#include <string.h>
 
 #ifndef SEMIHOSTING_SUPPORTED
 #define SEMIHOSTING_SUPPORTED  1