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/lib/psci/aarch32/psci_helpers.S b/lib/psci/aarch32/psci_helpers.S
index 63d7e70..5cc192e 100644
--- a/lib/psci/aarch32/psci_helpers.S
+++ b/lib/psci/aarch32/psci_helpers.S
@@ -5,8 +5,8 @@
  */
 
 #include <asm_macros.S>
+#include <lib/psci/psci.h>
 #include <platform_def.h>
-#include <psci.h>
 
 	.globl	psci_do_pwrdown_cache_maintenance
 	.globl	psci_do_pwrup_cache_maintenance
diff --git a/lib/psci/aarch64/psci_helpers.S b/lib/psci/aarch64/psci_helpers.S
index 88db1c9..add968a 100644
--- a/lib/psci/aarch64/psci_helpers.S
+++ b/lib/psci/aarch64/psci_helpers.S
@@ -6,8 +6,8 @@
 
 #include <asm_macros.S>
 #include <assert_macros.S>
+#include <lib/psci/psci.h>
 #include <platform_def.h>
-#include <psci.h>
 
 	.globl	psci_do_pwrdown_cache_maintenance
 	.globl	psci_do_pwrup_cache_maintenance
diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c
index 97aeb83..2928c33 100644
--- a/lib/psci/psci_common.c
+++ b/lib/psci/psci_common.c
@@ -4,16 +4,18 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include <assert.h>
+#include <string.h>
+
 #include <arch.h>
 #include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
 #include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
-#include <string.h>
-#include <utils.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
 #include "psci_private.h"
 
 /*
diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c
index b4a25fb..5c0e952 100644
--- a/lib/psci/psci_main.c
+++ b/lib/psci/psci_main.c
@@ -4,16 +4,18 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch.h>
-#include <arch_helpers.h>
-#include <arm_arch_svc.h>
 #include <assert.h>
-#include <debug.h>
-#include <platform.h>
-#include <pmf.h>
-#include <runtime_instr.h>
-#include <smccc.h>
 #include <string.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/pmf/pmf.h>
+#include <lib/runtime_instr.h>
+#include <lib/smccc.h>
+#include <plat/common/platform.h>
+#include <services/arm_arch_svc.h>
+
 #include "psci_private.h"
 
 /*******************************************************************************
diff --git a/lib/psci/psci_mem_protect.c b/lib/psci/psci_mem_protect.c
index 857146b..481051f 100644
--- a/lib/psci/psci_mem_protect.c
+++ b/lib/psci/psci_mem_protect.c
@@ -6,7 +6,9 @@
 
 #include <assert.h>
 #include <limits.h>
-#include <utils.h>
+
+#include <lib/utils.h>
+
 #include "psci_private.h"
 
 u_register_t psci_mem_protect(unsigned int enable)
diff --git a/lib/psci/psci_off.c b/lib/psci/psci_off.c
index 944f8bf..ac03e05 100644
--- a/lib/psci/psci_off.c
+++ b/lib/psci/psci_off.c
@@ -4,14 +4,16 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch.h>
-#include <arch_helpers.h>
 #include <assert.h>
-#include <debug.h>
-#include <platform.h>
-#include <pmf.h>
-#include <runtime_instr.h>
 #include <string.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/pmf/pmf.h>
+#include <lib/runtime_instr.h>
+#include <plat/common/platform.h>
+
 #include "psci_private.h"
 
 /******************************************************************************
diff --git a/lib/psci/psci_on.c b/lib/psci/psci_on.c
index f38900c..aa6b324 100644
--- a/lib/psci/psci_on.c
+++ b/lib/psci/psci_on.c
@@ -4,15 +4,17 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch.h>
-#include <arch_helpers.h>
 #include <assert.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
-#include <pubsub_events.h>
 #include <stddef.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <plat/common/platform.h>
+
 #include "psci_private.h"
 
 /*
diff --git a/lib/psci/psci_private.h b/lib/psci/psci_private.h
index 82b951d..68ec7fb 100644
--- a/lib/psci/psci_private.h
+++ b/lib/psci/psci_private.h
@@ -7,14 +7,15 @@
 #ifndef PSCI_PRIVATE_H
 #define PSCI_PRIVATE_H
 
+#include <stdbool.h>
+
 #include <arch.h>
 #include <arch_helpers.h>
-#include <bakery_lock.h>
-#include <bl_common.h>
-#include <cpu_data.h>
-#include <psci.h>
-#include <spinlock.h>
-#include <stdbool.h>
+#include <common/bl_common.h>
+#include <lib/bakery_lock.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/psci/psci.h>
+#include <lib/spinlock.h>
 
 /*
  * The PSCI capability which are provided by the generic code but does not
diff --git a/lib/psci/psci_setup.c b/lib/psci/psci_setup.c
index 6b3081e..b9467d3 100644
--- a/lib/psci/psci_setup.c
+++ b/lib/psci/psci_setup.c
@@ -4,15 +4,17 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include <assert.h>
+#include <stddef.h>
+
 #include <arch.h>
 #include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
 #include <context.h>
-#include <context_mgmt.h>
-#include <errata_report.h>
-#include <platform.h>
-#include <stddef.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/cpus/errata_report.h>
+#include <plat/common/platform.h>
+
 #include "psci_private.h"
 
 /*******************************************************************************
diff --git a/lib/psci/psci_stat.c b/lib/psci/psci_stat.c
index 6f6a7d4..772a184 100644
--- a/lib/psci/psci_stat.c
+++ b/lib/psci/psci_stat.c
@@ -5,9 +5,12 @@
  */
 
 #include <assert.h>
-#include <debug.h>
-#include <platform.h>
+
 #include <platform_def.h>
+
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
 #include "psci_private.h"
 
 #ifndef PLAT_MAX_PWR_LVL_STATES
diff --git a/lib/psci/psci_suspend.c b/lib/psci/psci_suspend.c
index e00819d..8a752c1 100644
--- a/lib/psci/psci_suspend.c
+++ b/lib/psci/psci_suspend.c
@@ -4,19 +4,21 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include <assert.h>
+#include <stddef.h>
+
 #include <arch.h>
 #include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
 #include <context.h>
-#include <context_mgmt.h>
-#include <cpu_data.h>
-#include <debug.h>
-#include <platform.h>
-#include <pmf.h>
-#include <pubsub_events.h>
-#include <runtime_instr.h>
-#include <stddef.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <lib/pmf/pmf.h>
+#include <lib/runtime_instr.h>
+#include <plat/common/platform.h>
+
 #include "psci_private.h"
 
 /*******************************************************************************
diff --git a/lib/psci/psci_system_off.c b/lib/psci/psci_system_off.c
index 7cac4e9..141d69e 100644
--- a/lib/psci/psci_system_off.c
+++ b/lib/psci/psci_system_off.c
@@ -4,12 +4,14 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <console.h>
-#include <debug.h>
-#include <platform.h>
 #include <stddef.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <plat/common/platform.h>
+
 #include "psci_private.h"
 
 void __dead2 psci_system_off(void)