Sanitise includes across codebase

Enforce full include path for includes. Deprecate old paths.

The following folders inside include/lib have been left unchanged:

- include/lib/cpus/${ARCH}
- include/lib/el3_runtime/${ARCH}

The reason for this change is that having a global namespace for
includes isn't a good idea. It defeats one of the advantages of having
folders and it introduces problems that are sometimes subtle (because
you may not know the header you are actually including if there are two
of them).

For example, this patch had to be created because two headers were
called the same way: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform
to avoid collision."). More recently, this patch has had similar
problems: 46f9b2c3a282 ("drivers: add tzc380 support").

This problem was introduced in commit 4ecca33988b9 ("Move include and
source files to logical locations"). At that time, there weren't too
many headers so it wasn't a real issue. However, time has shown that
this creates problems.

Platforms that want to preserve the way they include headers may add the
removed paths to PLAT_INCLUDES, but this is discouraged.

Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
diff --git a/bl32/sp_min/aarch32/entrypoint.S b/bl32/sp_min/aarch32/entrypoint.S
index d6853cc..2ffef6a 100644
--- a/bl32/sp_min/aarch32/entrypoint.S
+++ b/bl32/sp_min/aarch32/entrypoint.S
@@ -6,13 +6,13 @@
 
 #include <arch.h>
 #include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/runtime_svc.h>
 #include <context.h>
 #include <el3_common_macros.S>
-#include <runtime_svc.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
 #include <smccc_helpers.h>
 #include <smccc_macros.S>
-#include <xlat_tables_defs.h>
 
 	.globl	sp_min_vector_table
 	.globl	sp_min_entrypoint
diff --git a/bl32/sp_min/sp_min.ld.S b/bl32/sp_min/sp_min.ld.S
index ce6c954..ba9d342 100644
--- a/bl32/sp_min/sp_min.ld.S
+++ b/bl32/sp_min/sp_min.ld.S
@@ -5,7 +5,8 @@
  */
 
 #include <platform_def.h>
-#include <xlat_tables_defs.h>
+
+#include <lib/xlat_tables/xlat_tables_defs.h>
 
 OUTPUT_FORMAT(elf32-littlearm)
 OUTPUT_ARCH(arm)
@@ -62,7 +63,7 @@
 
         /* Place pubsub sections for events */
         . = ALIGN(8);
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
 
         . = ALIGN(PAGE_SIZE);
         __RODATA_END__ = .;
@@ -91,7 +92,7 @@
 
         /* Place pubsub sections for events */
         . = ALIGN(8);
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
 
         *(.vectors)
         __RO_END_UNALIGNED__ = .;
diff --git a/bl32/sp_min/sp_min_main.c b/bl32/sp_min/sp_min_main.c
index a12a83b..3cb1990 100644
--- a/bl32/sp_min/sp_min_main.c
+++ b/bl32/sp_min/sp_min_main.c
@@ -4,26 +4,28 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <platform_def.h>
+
 #include <arch.h>
 #include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
 #include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
-#include <platform_def.h>
+#include <drivers/console.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/psci/psci.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
 #include <platform_sp_min.h>
-#include <psci.h>
-#include <runtime_svc.h>
+#include <services/std_svc.h>
 #include <smccc_helpers.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <std_svc.h>
-#include <stdint.h>
-#include <string.h>
-#include <utils.h>
+
 #include "sp_min_private.h"
 
 /* Pointers to per-core cpu contexts */
diff --git a/bl32/tsp/aarch64/tsp_entrypoint.S b/bl32/tsp/aarch64/tsp_entrypoint.S
index 5d9da85..48f6981 100644
--- a/bl32/tsp/aarch64/tsp_entrypoint.S
+++ b/bl32/tsp/aarch64/tsp_entrypoint.S
@@ -6,8 +6,9 @@
 
 #include <arch.h>
 #include <asm_macros.S>
-#include <tsp.h>
-#include <xlat_tables_defs.h>
+#include <bl32/tsp/tsp.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+
 #include "../tsp_private.h"
 
 
diff --git a/bl32/tsp/aarch64/tsp_exceptions.S b/bl32/tsp/aarch64/tsp_exceptions.S
index 48e358a..ad4b648 100644
--- a/bl32/tsp/aarch64/tsp_exceptions.S
+++ b/bl32/tsp/aarch64/tsp_exceptions.S
@@ -6,9 +6,8 @@
 
 #include <arch.h>
 #include <asm_macros.S>
-#include <bl_common.h>
-#include <tsp.h>
-
+#include <bl32/tsp/tsp.h>
+#include <common/bl_common.h>
 
 	/* ----------------------------------------------------
 	 * The caller-saved registers x0-x18 and LR are saved
diff --git a/bl32/tsp/aarch64/tsp_request.S b/bl32/tsp/aarch64/tsp_request.S
index 2261f87..5ad16da 100644
--- a/bl32/tsp/aarch64/tsp_request.S
+++ b/bl32/tsp/aarch64/tsp_request.S
@@ -5,7 +5,7 @@
  */
 
 #include <asm_macros.S>
-#include <tsp.h>
+#include <bl32/tsp/tsp.h>
 
 	.globl tsp_get_magic
 
diff --git a/bl32/tsp/tsp.ld.S b/bl32/tsp/tsp.ld.S
index 97b12ce..e9a1df1 100644
--- a/bl32/tsp/tsp.ld.S
+++ b/bl32/tsp/tsp.ld.S
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include <lib/xlat_tables/xlat_tables_defs.h>
 #include <platform_def.h>
-#include <xlat_tables_defs.h>
 
 OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
 OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
diff --git a/bl32/tsp/tsp_interrupt.c b/bl32/tsp/tsp_interrupt.c
index f501338..4e500b3 100644
--- a/bl32/tsp/tsp_interrupt.c
+++ b/bl32/tsp/tsp_interrupt.c
@@ -4,12 +4,15 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <debug.h>
-#include <platform.h>
+
 #include <platform_def.h>
-#include <tsp.h>
+
+#include <arch_helpers.h>
+#include <bl32/tsp/tsp.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
 #include "tsp_private.h"
 
 /*******************************************************************************
diff --git a/bl32/tsp/tsp_main.c b/bl32/tsp/tsp_main.c
index e41b51e..24efa61 100644
--- a/bl32/tsp/tsp_main.c
+++ b/bl32/tsp/tsp_main.c
@@ -4,14 +4,16 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
-#include <bl_common.h>
-#include <debug.h>
-#include <platform.h>
 #include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <bl32/tsp/tsp.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/spinlock.h>
+#include <plat/common/platform.h>
 #include <platform_tsp.h>
-#include <spinlock.h>
-#include <tsp.h>
+
 #include "tsp_private.h"
 
 
diff --git a/bl32/tsp/tsp_private.h b/bl32/tsp/tsp_private.h
index b697fa4..e39f291 100644
--- a/bl32/tsp/tsp_private.h
+++ b/bl32/tsp/tsp_private.h
@@ -22,12 +22,13 @@
 
 #ifndef __ASSEMBLY__
 
-#include <cassert.h>
-#include <platform_def.h> /* For CACHE_WRITEBACK_GRANULE */
-#include <spinlock.h>
 #include <stdint.h>
-#include <tsp.h>
+
+#include <platform_def.h> /* For CACHE_WRITEBACK_GRANULE */
 
+#include <bl32/tsp/tsp.h>
+#include <lib/cassert.h>
+#include <lib/spinlock.h>
 
 typedef struct work_statistics {
 	/* Number of s-el1 interrupts on this cpu */
diff --git a/bl32/tsp/tsp_timer.c b/bl32/tsp/tsp_timer.c
index ebe7f0d..3592863 100644
--- a/bl32/tsp/tsp_timer.c
+++ b/bl32/tsp/tsp_timer.c
@@ -3,9 +3,12 @@
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
-#include <arch_helpers.h>
+
 #include <assert.h>
-#include <platform.h>
+
+#include <arch_helpers.h>
+#include <plat/common/platform.h>
+
 #include "tsp_private.h"
 
 /*******************************************************************************