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/plat/common/aarch32/crash_console_helpers.S b/plat/common/aarch32/crash_console_helpers.S
index fc37c08..c9ad12c 100644
--- a/plat/common/aarch32/crash_console_helpers.S
+++ b/plat/common/aarch32/crash_console_helpers.S
@@ -10,7 +10,7 @@
  */
 
 #include <asm_macros.S>
-#include <console.h>
+#include <drivers/console.h>
 
 	.globl	plat_crash_console_init
 	.globl	plat_crash_console_putc
diff --git a/plat/common/aarch32/plat_common.c b/plat/common/aarch32/plat_common.c
index 16c2b5c..2c1a8fa 100644
--- a/plat/common/aarch32/plat_common.c
+++ b/plat/common/aarch32/plat_common.c
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <platform.h>
-#include <xlat_mmu_helpers.h>
+#include <lib/xlat_tables/xlat_mmu_helpers.h>
+#include <plat/common/platform.h>
 
 /*
  * The following platform setup functions are weakly defined. They
diff --git a/plat/common/aarch32/plat_sp_min_common.c b/plat/common/aarch32/plat_sp_min_common.c
index f1b1e9c..3bc84b1 100644
--- a/plat/common/aarch32/plat_sp_min_common.c
+++ b/plat/common/aarch32/plat_sp_min_common.c
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <console.h>
-#include <platform.h>
+#include <drivers/console.h>
+#include <plat/common/platform.h>
 #include <platform_sp_min.h>
 
 /*
diff --git a/plat/common/aarch64/crash_console_helpers.S b/plat/common/aarch64/crash_console_helpers.S
index 8f8ca11..491a99d 100644
--- a/plat/common/aarch64/crash_console_helpers.S
+++ b/plat/common/aarch64/crash_console_helpers.S
@@ -10,7 +10,7 @@
  */
 
 #include <asm_macros.S>
-#include <console.h>
+#include <drivers/console.h>
 
 	.globl	plat_crash_console_init
 	.globl	plat_crash_console_putc
diff --git a/plat/common/aarch64/plat_common.c b/plat/common/aarch64/plat_common.c
index e6f5f20..1424c78 100644
--- a/plat/common/aarch64/plat_common.c
+++ b/plat/common/aarch64/plat_common.c
@@ -4,14 +4,15 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <console.h>
-#include <platform.h>
+
+#include <arch_helpers.h>
+#include <drivers/console.h>
 #if RAS_EXTENSION
-#include <ras.h>
+#include <lib/extensions/ras.h>
 #endif
-#include <xlat_mmu_helpers.h>
+#include <lib/xlat_tables/xlat_mmu_helpers.h>
+#include <plat/common/platform.h>
 
 /*
  * The following platform setup functions are weakly defined. They
diff --git a/plat/common/aarch64/platform_helpers.S b/plat/common/aarch64/platform_helpers.S
index 8952319..b5788fb 100644
--- a/plat/common/aarch64/platform_helpers.S
+++ b/plat/common/aarch64/platform_helpers.S
@@ -6,7 +6,7 @@
 
 #include <arch.h>
 #include <asm_macros.S>
-#include <console.h>
+#include <drivers/console.h>
 #include <platform_def.h>
 
 	.weak	plat_report_exception
diff --git a/plat/common/plat_bl1_common.c b/plat/common/plat_bl1_common.c
index 824f9e5..5733781 100644
--- a/plat/common/plat_bl1_common.c
+++ b/plat/common/plat_bl1_common.c
@@ -4,15 +4,17 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <bl_common.h>
-#include <bl1.h>
-#include <debug.h>
 #include <errno.h>
-#include <platform.h>
+
 #include <platform_def.h>
 
+#include <arch_helpers.h>
+#include <bl1/bl1.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
 /*
  * The following platform functions are weakly defined. They
  * are default implementations that allow BL1 to compile in
diff --git a/plat/common/plat_bl_common.c b/plat/common/plat_bl_common.c
index 4cf1cc5..2357edf 100644
--- a/plat/common/plat_bl_common.c
+++ b/plat/common/plat_bl_common.c
@@ -4,16 +4,17 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
 #include <errno.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
 #if TRUSTED_BOARD_BOOT
-#include <mbedtls_config.h>
+#include <drivers/auth/mbedtls/mbedtls_config.h>
 #endif
-#include <platform.h>
-#include <xlat_tables_compat.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
+#include <plat/common/platform.h>
 
 /*
  * The following platform functions are weakly defined. The Platforms
diff --git a/plat/common/plat_gicv2.c b/plat/common/plat_gicv2.c
index 4b66873..4c76f1b 100644
--- a/plat/common/plat_gicv2.c
+++ b/plat/common/plat_gicv2.c
@@ -3,13 +3,15 @@
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
+
 #include <assert.h>
-#include <gic_common.h>
-#include <gicv2.h>
-#include <interrupt_mgmt.h>
-#include <platform.h>
 #include <stdbool.h>
 
+#include <bl31/interrupt_mgmt.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gicv2.h>
+#include <plat/common/platform.h>
+
 /*
  * The following platform GIC functions are weakly defined. They
  * provide typical implementations that may be re-used by multiple
diff --git a/plat/common/plat_gicv3.c b/plat/common/plat_gicv3.c
index f8277fe..f5ed6fc 100644
--- a/plat/common/plat_gicv3.c
+++ b/plat/common/plat_gicv3.c
@@ -3,16 +3,18 @@
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
-#include <arch_helpers.h>
+
 #include <assert.h>
-#include <bl_common.h>
-#include <cassert.h>
-#include <gic_common.h>
-#include <gicv3.h>
-#include <interrupt_mgmt.h>
-#include <platform.h>
 #include <stdbool.h>
 
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <bl31/interrupt_mgmt.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/cassert.h>
+#include <plat/common/platform.h>
+
 #ifdef IMAGE_BL31
 
 /*
diff --git a/plat/common/plat_log_common.c b/plat/common/plat_log_common.c
index c757c6b..66b9758 100644
--- a/plat/common/plat_log_common.c
+++ b/plat/common/plat_log_common.c
@@ -4,8 +4,8 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <debug.h>
-#include <platform.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
 
 /* Allow platforms to override the log prefix string */
 #pragma weak plat_log_get_prefix
diff --git a/plat/common/plat_psci_common.c b/plat/common/plat_psci_common.c
index fab3c77..1a29d9c 100644
--- a/plat/common/plat_psci_common.c
+++ b/plat/common/plat_psci_common.c
@@ -4,11 +4,12 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch.h>
 #include <assert.h>
-#include <platform.h>
-#include <pmf.h>
-#include <psci.h>
+
+#include <arch.h>
+#include <lib/pmf/pmf.h>
+#include <lib/psci/psci.h>
+#include <plat/common/platform.h>
 
 #if ENABLE_PSCI_STAT && ENABLE_PMF
 #pragma weak plat_psci_stat_accounting_start
diff --git a/plat/common/plat_spm_rd.c b/plat/common/plat_spm_rd.c
index 69b9a23..0c72cb7 100644
--- a/plat/common/plat_spm_rd.c
+++ b/plat/common/plat_spm_rd.c
@@ -5,13 +5,16 @@
  */
 
 #include <assert.h>
-#include <debug.h>
-#include <fdt_wrappers.h>
+#include <string.h>
+
 #include <libfdt.h>
+
 #include <platform_def.h>
-#include <sp_res_desc.h>
-#include <string.h>
-#include <object_pool.h>
+
+#include <common/debug.h>
+#include <common/fdt_wrappers.h>
+#include <lib/object_pool.h>
+#include <services/sp_res_desc.h>
 
 /*******************************************************************************
  * Resource pool
diff --git a/plat/common/plat_spm_sp.c b/plat/common/plat_spm_sp.c
index 7b7fbd9..ce48279 100644
--- a/plat/common/plat_spm_sp.c
+++ b/plat/common/plat_spm_sp.c
@@ -5,9 +5,11 @@
  */
 
 #include <assert.h>
-#include <debug.h>
+
 #include <platform_def.h>
-#include <sptool.h>
+
+#include <common/debug.h>
+#include <tools_share/sptool.h>
 
 static unsigned int sp_next;
 
diff --git a/plat/common/tbbr/plat_tbbr.c b/plat/common/tbbr/plat_tbbr.c
index f5a4f31..12ab0a9 100644
--- a/plat/common/tbbr/plat_tbbr.c
+++ b/plat/common/tbbr/plat_tbbr.c
@@ -5,14 +5,15 @@
  */
 
 #include <assert.h>
-#include <auth/auth_mod.h>
-#include <platform.h>
+#include <string.h>
+
+#include <drivers/auth/auth_mod.h>
+#include <plat/common/platform.h>
 #if USE_TBBR_DEFS
-#include <tbbr_oid.h>
+#include <tools_share/tbbr_oid.h>
 #else
 #include <platform_oid.h>
 #endif
-#include <string.h>
 
 /*
  * Store a new non-volatile counter value. This implementation