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/marvell/a8k/a70x0/board/dram_port.c b/plat/marvell/a8k/a70x0/board/dram_port.c
index c670258..4fca7e3 100644
--- a/plat/marvell/a8k/a70x0/board/dram_port.c
+++ b/plat/marvell/a8k/a70x0/board/dram_port.c
@@ -6,7 +6,8 @@
  */
 
 #include <arch_helpers.h>
-#include <debug.h>
+#include <common/debug.h>
+
 #include <mv_ddr_if.h>
 #include <plat_marvell.h>
 
diff --git a/plat/marvell/a8k/a70x0_amc/board/dram_port.c b/plat/marvell/a8k/a70x0_amc/board/dram_port.c
index ab1df46..aecf6c5 100644
--- a/plat/marvell/a8k/a70x0_amc/board/dram_port.c
+++ b/plat/marvell/a8k/a70x0_amc/board/dram_port.c
@@ -6,7 +6,8 @@
  */
 
 #include <arch_helpers.h>
-#include <debug.h>
+#include <common/debug.h>
+
 #include <mv_ddr_if.h>
 #include <plat_marvell.h>
 
diff --git a/plat/marvell/a8k/a80x0/board/dram_port.c b/plat/marvell/a8k/a80x0/board/dram_port.c
index a99bf7c..02f4ffb 100644
--- a/plat/marvell/a8k/a80x0/board/dram_port.c
+++ b/plat/marvell/a8k/a80x0/board/dram_port.c
@@ -6,9 +6,10 @@
  */
 
 #include <arch_helpers.h>
-#include <debug.h>
-#include <mentor/mi2cv.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <drivers/mentor/mi2cv.h>
+#include <lib/mmio.h>
+
 #include <mv_ddr_if.h>
 #include <mvebu_def.h>
 #include <plat_marvell.h>
diff --git a/plat/marvell/a8k/a80x0_mcbin/board/dram_port.c b/plat/marvell/a8k/a80x0_mcbin/board/dram_port.c
index fa222ee..2580852 100644
--- a/plat/marvell/a8k/a80x0_mcbin/board/dram_port.c
+++ b/plat/marvell/a8k/a80x0_mcbin/board/dram_port.c
@@ -6,9 +6,10 @@
  */
 
 #include <arch_helpers.h>
-#include <debug.h>
-#include <mentor/mi2cv.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <drivers/mentor/mi2cv.h>
+#include <lib/mmio.h>
+
 #include <mv_ddr_if.h>
 #include <mvebu_def.h>
 #include <plat_marvell.h>
diff --git a/plat/marvell/a8k/a80x0_mcbin/board/marvell_plat_config.c b/plat/marvell/a8k/a80x0_mcbin/board/marvell_plat_config.c
index 384d0f5..fa4e144 100644
--- a/plat/marvell/a8k/a80x0_mcbin/board/marvell_plat_config.c
+++ b/plat/marvell/a8k/a80x0_mcbin/board/marvell_plat_config.c
@@ -5,9 +5,10 @@
  * https://spdx.org/licenses
  */
 
+#include <drivers/delay_timer.h>
+#include <lib/mmio.h>
+
 #include <armada_common.h>
-#include <delay_timer.h>
-#include <mmio.h>
 
 /*
  * If bootrom is currently at BLE there's no need to include the memory
diff --git a/plat/marvell/a8k/common/a8k_common.mk b/plat/marvell/a8k/common/a8k_common.mk
index e350d6a..efb05b8 100644
--- a/plat/marvell/a8k/common/a8k_common.mk
+++ b/plat/marvell/a8k/common/a8k_common.mk
@@ -50,8 +50,6 @@
 PLAT_INCLUDES		:=	-I$(PLAT_FAMILY_BASE)/$(PLAT)		\
 				-I$(PLAT_COMMON_BASE)/include		\
 				-I$(PLAT_INCLUDE_BASE)/common		\
-				-Iinclude/drivers/marvell		\
-				-Iinclude/drivers/marvell/mochi		\
 				$(ATF_INCLUDES)
 
 PLAT_BL_COMMON_SOURCES	:=	$(PLAT_COMMON_BASE)/aarch64/a8k_common.c \
diff --git a/plat/marvell/a8k/common/aarch64/plat_arch_config.c b/plat/marvell/a8k/common/aarch64/plat_arch_config.c
index 8667331..06dc841 100644
--- a/plat/marvell/a8k/common/aarch64/plat_arch_config.c
+++ b/plat/marvell/a8k/common/aarch64/plat_arch_config.c
@@ -5,12 +5,11 @@
  * https://spdx.org/licenses
  */
 
-#include <platform.h>
 #include <arch_helpers.h>
-#include <mmio.h>
-#include <debug.h>
-#include <cache_llc.h>
-
+#include <common/debug.h>
+#include <drivers/marvell/cache_llc.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
 
 #define CCU_HTC_ASET			(MVEBU_CCU_BASE(MVEBU_AP0) + 0x264)
 #define MVEBU_IO_AFFINITY		(0xF00)
diff --git a/plat/marvell/a8k/common/ble/ble.mk b/plat/marvell/a8k/common/ble/ble.mk
index 5f24ced..ed4ff3a 100644
--- a/plat/marvell/a8k/common/ble/ble.mk
+++ b/plat/marvell/a8k/common/ble/ble.mk
@@ -13,12 +13,12 @@
 BLE_SOURCES		+= 	$(BLE_PATH)/ble_main.c				\
 				$(BLE_PATH)/ble_mem.S				\
 				drivers/delay_timer/delay_timer.c		\
+				$(PLAT_MARVELL)/common/aarch64/marvell_helpers.S \
 				$(PLAT_MARVELL)/common/plat_delay_timer.c	\
 				$(PLAT_MARVELL)/common/marvell_console.c
 
 PLAT_INCLUDES		+= 	-I$(MV_DDR_PATH) \
 				-I$(CURDIR)/include/ \
-				-I$(CURDIR)/include/drivers \
 				-I$(CURDIR)/include/lib \
 				-I$(CURDIR)/include/lib/libc \
 				-I$(CURDIR)/include/lib/libc/aarch64 \
diff --git a/plat/marvell/a8k/common/ble/ble_main.c b/plat/marvell/a8k/common/ble/ble_main.c
index b04e8b7..5b3acec 100644
--- a/plat/marvell/a8k/common/ble/ble_main.c
+++ b/plat/marvell/a8k/common/ble/ble_main.c
@@ -5,14 +5,17 @@
  * https://spdx.org/licenses
  */
 
+#include <string.h>
+
+#include <platform_def.h>
+
 #include <arch_helpers.h>
-#include <debug.h>
-#include <console.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+
 #include <marvell_plat_priv.h>
 #include <marvell_pm.h>
-#include <platform_def.h>
 #include <plat_marvell.h>
-#include <string.h>
 
 #define BR_FLAG_SILENT		0x1
 #define SKIP_IMAGE_CODE		0xDEADB002
diff --git a/plat/marvell/a8k/common/include/platform_def.h b/plat/marvell/a8k/common/include/platform_def.h
index 4c3e7a9..3f6154e 100644
--- a/plat/marvell/a8k/common/include/platform_def.h
+++ b/plat/marvell/a8k/common/include/platform_def.h
@@ -8,14 +8,16 @@
 #ifndef PLATFORM_DEF_H
 #define PLATFORM_DEF_H
 
-#include <board_marvell_def.h>
-#include <gic_common.h>
-#include <interrupt_props.h>
-#include <mvebu_def.h>
 #ifndef __ASSEMBLY__
 #include <stdio.h>
 #endif /* __ASSEMBLY__ */
 
+#include <common/interrupt_props.h>
+#include <drivers/arm/gic_common.h>
+
+#include <board_marvell_def.h>
+#include <mvebu_def.h>
+
 /*
  * Most platform porting definitions provided by included headers
  */
diff --git a/plat/marvell/a8k/common/mss/mss_bl2_setup.c b/plat/marvell/a8k/common/mss/mss_bl2_setup.c
index 973c56d..728ee54 100644
--- a/plat/marvell/a8k/common/mss/mss_bl2_setup.c
+++ b/plat/marvell/a8k/common/mss/mss_bl2_setup.c
@@ -5,14 +5,16 @@
  * https://spdx.org/licenses
  */
 
+#include <platform_def.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/marvell/ccu.h>
+#include <drivers/marvell/mochi/cp110_setup.h>
+#include <lib/mmio.h>
+
 #include <armada_common.h>
-#include <bl_common.h>
-#include <ccu.h>
-#include <cp110_setup.h>
-#include <debug.h>
 #include <marvell_plat_priv.h> /* timer functionality */
-#include <mmio.h>
-#include <platform_def.h>
 
 #include "mss_scp_bootloader.h"
 
diff --git a/plat/marvell/a8k/common/mss/mss_pm_ipc.c b/plat/marvell/a8k/common/mss/mss_pm_ipc.c
index d1297b0..a070583 100644
--- a/plat/marvell/a8k/common/mss/mss_pm_ipc.c
+++ b/plat/marvell/a8k/common/mss/mss_pm_ipc.c
@@ -5,11 +5,12 @@
  * https://spdx.org/licenses
  */
 
-#include <debug.h>
-#include <mmio.h>
-#include <psci.h>
 #include <string.h>
 
+#include <common/debug.h>
+#include <lib/psci/psci.h>
+#include <lib/mmio.h>
+
 #include <mss_pm_ipc.h>
 
 /*
diff --git a/plat/marvell/a8k/common/plat_bl1_setup.c b/plat/marvell/a8k/common/plat_bl1_setup.c
index 5d85102..f9521c8 100644
--- a/plat/marvell/a8k/common/plat_bl1_setup.c
+++ b/plat/marvell/a8k/common/plat_bl1_setup.c
@@ -5,7 +5,8 @@
  * https://spdx.org/licenses
  */
 
-#include <mmio.h>
+#include <lib/mmio.h>
+
 #include <plat_marvell.h>
 
 void marvell_bl1_setup_mpps(void)
diff --git a/plat/marvell/a8k/common/plat_bl31_setup.c b/plat/marvell/a8k/common/plat_bl31_setup.c
index 6dfbcbb..98b3966 100644
--- a/plat/marvell/a8k/common/plat_bl31_setup.c
+++ b/plat/marvell/a8k/common/plat_bl31_setup.c
@@ -5,17 +5,17 @@
  * https://spdx.org/licenses
  */
 
+#include <common/debug.h>
+#include <drivers/marvell/mci.h>
+#include <drivers/marvell/mochi/ap_setup.h>
+#include <drivers/marvell/mochi/cp110_setup.h>
+#include <lib/mmio.h>
+
 #include <armada_common.h>
-#include <ap_setup.h>
-#include <cp110_setup.h>
-#include <debug.h>
 #include <marvell_plat_priv.h>
 #include <marvell_pm.h>
 #include <mc_trustzone/mc_trustzone.h>
-#include <mmio.h>
-#include <mci.h>
 #include <plat_marvell.h>
-
 #include <mss_ipc_drv.h>
 #include <mss_mem.h>
 
diff --git a/plat/marvell/a8k/common/plat_ble_setup.c b/plat/marvell/a8k/common/plat_ble_setup.c
index dbadeb7..0590cc0 100644
--- a/plat/marvell/a8k/common/plat_ble_setup.c
+++ b/plat/marvell/a8k/common/plat_ble_setup.c
@@ -5,17 +5,18 @@
  * https://spdx.org/licenses
  */
 
-#include <ap_setup.h>
+#include <common/debug.h>
+#include <drivers/marvell/ap807_clocks_init.h>
+#include <drivers/marvell/aro.h>
+#include <drivers/marvell/ccu.h>
+#include <drivers/marvell/io_win.h>
+#include <drivers/marvell/mochi/ap_setup.h>
+#include <drivers/marvell/mochi/cp110_setup.h>
+
 #include <armada_common.h>
-#include <aro.h>
-#include <ccu.h>
-#include <cp110_setup.h>
-#include <debug.h>
-#include <io_win.h>
 #include <mv_ddr_if.h>
 #include <mvebu_def.h>
 #include <plat_marvell.h>
-#include "ap807_clocks_init.h"
 
 /* Register for skip image use */
 #define SCRATCH_PAD_REG2		0xF06F00A8
diff --git a/plat/marvell/a8k/common/plat_pm.c b/plat/marvell/a8k/common/plat_pm.c
index 2854416..e2575b1 100644
--- a/plat/marvell/a8k/common/plat_pm.c
+++ b/plat/marvell/a8k/common/plat_pm.c
@@ -5,19 +5,21 @@
  * https://spdx.org/licenses
  */
 
-#include <armada_common.h>
 #include <assert.h>
-#include <bakery_lock.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <cache_llc.h>
-#include <console.h>
-#include <gicv2.h>
+
+#include <common/debug.h>
+#include <drivers/arm/gicv2.h>
+#include <drivers/console.h>
+#include <drivers/delay_timer.h>
+#include <drivers/marvell/cache_llc.h>
+#include <lib/bakery_lock.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
+#include <armada_common.h>
 #include <marvell_pm.h>
-#include <mmio.h>
 #include <mss_pm_ipc.h>
 #include <plat_marvell.h>
-#include <platform.h>
 #include <plat_pm_trace.h>
 
 #define MVEBU_PRIVATE_UID_REG		0x30
diff --git a/plat/marvell/a8k/common/plat_pm_trace.c b/plat/marvell/a8k/common/plat_pm_trace.c
index 683e56f..f589ff3 100644
--- a/plat/marvell/a8k/common/plat_pm_trace.c
+++ b/plat/marvell/a8k/common/plat_pm_trace.c
@@ -5,9 +5,10 @@
  * https://spdx.org/licenses
  */
 
-#include <mmio.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
 #include <mss_mem.h>
-#include <platform.h>
 #include <plat_pm_trace.h>
 
 #ifdef PM_TRACE_ENABLE
diff --git a/plat/marvell/a8k/common/plat_thermal.c b/plat/marvell/a8k/common/plat_thermal.c
index 02fe820..a2fc0d0 100644
--- a/plat/marvell/a8k/common/plat_thermal.c
+++ b/plat/marvell/a8k/common/plat_thermal.c
@@ -5,11 +5,12 @@
  * https://spdx.org/licenses
  */
 
-#include <debug.h>
-#include <delay_timer.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <drivers/marvell/thermal.h>
+#include <lib/mmio.h>
+
 #include <mvebu_def.h>
-#include <thermal.h>
 
 #define THERMAL_TIMEOUT					1200