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/arm/css/common/css_bl1_setup.c b/plat/arm/css/common/css_bl1_setup.c
index b1b275c..ae0f011 100644
--- a/plat/arm/css/common/css_bl1_setup.c
+++ b/plat/arm/css/common/css_bl1_setup.c
@@ -4,10 +4,11 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <bl_common.h>
-#include <debug.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
 #include <plat_arm.h>
-#include <platform.h>
 #include <soc_css.h>
 
 void bl1_platform_setup(void)
diff --git a/plat/arm/css/common/css_bl2_setup.c b/plat/arm/css/common/css_bl2_setup.c
index e41b1ca..c1c7868 100644
--- a/plat/arm/css/common/css_bl2_setup.c
+++ b/plat/arm/css/common/css_bl2_setup.c
@@ -4,13 +4,16 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <bl_common.h>
+#include <string.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/mmio.h>
+#include <lib/utils.h>
+
 #include <css_def.h>
-#include <debug.h>
-#include <mmio.h>
 #include <plat_arm.h>
-#include <string.h>
-#include <utils.h>
+
 #include "../drivers/scp/css_scp.h"
 
 /* Weak definition may be overridden in specific CSS based platform */
diff --git a/plat/arm/css/common/css_bl2u_setup.c b/plat/arm/css/common/css_bl2u_setup.c
index 4ceb5cd..564e98f 100644
--- a/plat/arm/css/common/css_bl2u_setup.c
+++ b/plat/arm/css/common/css_bl2u_setup.c
@@ -4,10 +4,12 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <bl_common.h>
-#include <debug.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
 #include <plat_arm.h>
-#include <platform.h>
+
 #include "../drivers/scp/css_scp.h"
 
 /* Weak definition may be overridden in specific CSS based platform */
diff --git a/plat/arm/css/common/css_pm.c b/plat/arm/css/common/css_pm.c
index 4735a9d..8a156e6 100644
--- a/plat/arm/css/common/css_pm.c
+++ b/plat/arm/css/common/css_pm.c
@@ -4,15 +4,19 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <cassert.h>
-#include <css_pm.h>
-#include <debug.h>
 #include <errno.h>
-#include <plat_arm.h>
-#include <platform.h>
+
 #include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/cassert.h>
+#include <plat/common/platform.h>
+
+#include <css_pm.h>
+#include <plat_arm.h>
+
 #include "../drivers/scp/css_scp.h"
 
 /* Allow CSS platforms to override `plat_arm_psci_pm_ops` */
diff --git a/plat/arm/css/common/css_topology.c b/plat/arm/css/common/css_topology.c
index d1f1c98..8ac2232 100644
--- a/plat/arm/css/common/css_topology.c
+++ b/plat/arm/css/common/css_topology.c
@@ -4,10 +4,12 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <plat_arm.h>
-#include <platform.h>
 #include <assert.h>
 
+#include <plat/common/platform.h>
+
+#include <plat_arm.h>
+
 #if ARM_PLAT_MT
 #pragma weak plat_arm_get_cpu_pe_count
 #endif
diff --git a/plat/arm/css/drivers/mhu/css_mhu.c b/plat/arm/css/drivers/mhu/css_mhu.c
index 7b33317..e13818f 100644
--- a/plat/arm/css/drivers/mhu/css_mhu.c
+++ b/plat/arm/css/drivers/mhu/css_mhu.c
@@ -4,13 +4,17 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <bakery_lock.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <lib/bakery_lock.h>
+#include <lib/mmio.h>
+
 #include <css_def.h>
-#include <mmio.h>
 #include <plat_arm.h>
-#include <platform_def.h>
+
 #include "css_mhu.h"
 
 /* SCP MHU secure channel registers */
diff --git a/plat/arm/css/drivers/mhu/css_mhu_doorbell.c b/plat/arm/css/drivers/mhu/css_mhu_doorbell.c
index 54f3e05..b3203c2 100644
--- a/plat/arm/css/drivers/mhu/css_mhu_doorbell.c
+++ b/plat/arm/css/drivers/mhu/css_mhu_doorbell.c
@@ -4,8 +4,10 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <platform_def.h>
+
+#include <arch_helpers.h>
+
 #include "css_mhu_doorbell.h"
 #include "../scmi/scmi.h"
 
diff --git a/plat/arm/css/drivers/mhu/css_mhu_doorbell.h b/plat/arm/css/drivers/mhu/css_mhu_doorbell.h
index cb75ed0..ecee563 100644
--- a/plat/arm/css/drivers/mhu/css_mhu_doorbell.h
+++ b/plat/arm/css/drivers/mhu/css_mhu_doorbell.h
@@ -7,9 +7,10 @@
 #ifndef CSS_MHU_DOORBELL_H
 #define CSS_MHU_DOORBELL_H
 
-#include <mmio.h>
 #include <stdint.h>
 
+#include <lib/mmio.h>
+
 /* MHUv2 Base Address */
 #define MHUV2_BASE_ADDR		PLAT_CSS_MHU_BASE
 
diff --git a/plat/arm/css/drivers/scmi/scmi.h b/plat/arm/css/drivers/scmi/scmi.h
index 28dfc9a..df259f7 100644
--- a/plat/arm/css/drivers/scmi/scmi.h
+++ b/plat/arm/css/drivers/scmi/scmi.h
@@ -7,11 +7,12 @@
 #ifndef SCMI_H
 #define SCMI_H
 
-#include <bakery_lock.h>
-#include <psci.h>
 #include <stddef.h>
 #include <stdint.h>
-#include <spinlock.h>
+
+#include <lib/bakery_lock.h>
+#include <lib/psci/psci.h>
+#include <lib/spinlock.h>
 
 /* Supported SCMI Protocol Versions */
 #define SCMI_AP_CORE_PROTO_VER			MAKE_SCMI_VERSION(1, 0)
diff --git a/plat/arm/css/drivers/scmi/scmi_ap_core_proto.c b/plat/arm/css/drivers/scmi/scmi_ap_core_proto.c
index 1438cba..e495dcc 100644
--- a/plat/arm/css/drivers/scmi/scmi_ap_core_proto.c
+++ b/plat/arm/css/drivers/scmi/scmi_ap_core_proto.c
@@ -4,9 +4,11 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <debug.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+
 #include "scmi.h"
 #include "scmi_private.h"
 
diff --git a/plat/arm/css/drivers/scmi/scmi_common.c b/plat/arm/css/drivers/scmi/scmi_common.c
index b34178e..1b4ecb2 100644
--- a/plat/arm/css/drivers/scmi/scmi_common.c
+++ b/plat/arm/css/drivers/scmi/scmi_common.c
@@ -4,13 +4,14 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <debug.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+
 #include "scmi.h"
 #include "scmi_private.h"
 
-
 #if HW_ASSISTED_COHERENCY
 #define scmi_lock_init(lock)
 #define scmi_lock_get(lock)		spin_lock(lock)
diff --git a/plat/arm/css/drivers/scmi/scmi_pwr_dmn_proto.c b/plat/arm/css/drivers/scmi/scmi_pwr_dmn_proto.c
index 90c5d6b..f315621 100644
--- a/plat/arm/css/drivers/scmi/scmi_pwr_dmn_proto.c
+++ b/plat/arm/css/drivers/scmi/scmi_pwr_dmn_proto.c
@@ -4,9 +4,11 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <debug.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+
 #include "scmi.h"
 #include "scmi_private.h"
 
diff --git a/plat/arm/css/drivers/scmi/scmi_sys_pwr_proto.c b/plat/arm/css/drivers/scmi/scmi_sys_pwr_proto.c
index f6da394..03c3c06 100644
--- a/plat/arm/css/drivers/scmi/scmi_sys_pwr_proto.c
+++ b/plat/arm/css/drivers/scmi/scmi_sys_pwr_proto.c
@@ -4,9 +4,11 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <debug.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+
 #include "scmi.h"
 #include "scmi_private.h"
 
diff --git a/plat/arm/css/drivers/scp/css_bom_bootloader.c b/plat/arm/css/drivers/scp/css_bom_bootloader.c
index 5268510..27c9e1d 100644
--- a/plat/arm/css/drivers/scp/css_bom_bootloader.c
+++ b/plat/arm/css/drivers/scp/css_bom_bootloader.c
@@ -4,12 +4,15 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <css_def.h>
-#include <debug.h>
-#include <platform.h>
 #include <stdint.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
+#include <css_def.h>
+
 #include "../mhu/css_mhu.h"
 #include "../scpi/css_scpi.h"
 #include "css_scp.h"
diff --git a/plat/arm/css/drivers/scp/css_pm_scmi.c b/plat/arm/css/drivers/scp/css_pm_scmi.c
index 1397fd8..bd6b595 100644
--- a/plat/arm/css/drivers/scp/css_pm_scmi.c
+++ b/plat/arm/css/drivers/scp/css_pm_scmi.c
@@ -4,14 +4,17 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
+#include <string.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
 #include <css_def.h>
 #include <css_pm.h>
-#include <debug.h>
 #include <plat_arm.h>
-#include <platform.h>
-#include <string.h>
+
 #include "../scmi/scmi.h"
 #include "css_scp.h"
 
diff --git a/plat/arm/css/drivers/scp/css_pm_scpi.c b/plat/arm/css/drivers/scp/css_pm_scpi.c
index 123d54f..f53ac30 100644
--- a/plat/arm/css/drivers/scp/css_pm_scpi.c
+++ b/plat/arm/css/drivers/scp/css_pm_scpi.c
@@ -4,11 +4,14 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+
 #include <css_pm.h>
-#include <debug.h>
 #include <plat_arm.h>
+
 #include "../scpi/css_scpi.h"
 #include "css_scp.h"
 
diff --git a/plat/arm/css/drivers/scp/css_scp.h b/plat/arm/css/drivers/scp/css_scp.h
index 84c1487..f3c08c5 100644
--- a/plat/arm/css/drivers/scp/css_scp.h
+++ b/plat/arm/css/drivers/scp/css_scp.h
@@ -7,10 +7,12 @@
 #ifndef CSS_SCP_H
 #define CSS_SCP_H
 
-#include <cassert.h>
-#include <platform_def.h>
 #include <stdint.h>
 
+#include <platform_def.h>
+
+#include <lib/cassert.h>
+
 /* Forward declarations */
 struct psci_power_state;
 
diff --git a/plat/arm/css/drivers/scp/css_sds.c b/plat/arm/css/drivers/scp/css_sds.c
index 561e97b..c152abc 100644
--- a/plat/arm/css/drivers/scp/css_sds.c
+++ b/plat/arm/css/drivers/scp/css_sds.c
@@ -4,13 +4,16 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <css_def.h>
-#include <debug.h>
-#include <delay_timer.h>
-#include <platform.h>
 #include <stdint.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/delay_timer.h>
+#include <plat/common/platform.h>
+
+#include <css_def.h>
+
 #include "css_scp.h"
 #include "../sds/sds.h"
 
diff --git a/plat/arm/css/drivers/scpi/css_scpi.c b/plat/arm/css/drivers/scpi/css_scpi.c
index 2ed5760..42bf3b8 100644
--- a/plat/arm/css/drivers/scpi/css_scpi.c
+++ b/plat/arm/css/drivers/scpi/css_scpi.c
@@ -4,13 +4,16 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <css_def.h>
-#include <debug.h>
-#include <platform.h>
 #include <string.h>
-#include <utils.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
+#include <css_def.h>
+
 #include "../mhu/css_mhu.h"
 #include "css_scpi.h"
 
diff --git a/plat/arm/css/drivers/sds/sds.c b/plat/arm/css/drivers/sds/sds.c
index e2fac54..3eeb0dc 100644
--- a/plat/arm/css/drivers/sds/sds.c
+++ b/plat/arm/css/drivers/sds/sds.c
@@ -4,13 +4,14 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
 #include <assert.h>
-#include <debug.h>
-#include <css_def.h>
 #include <stdint.h>
 #include <string.h>
 
+#include <arch_helpers.h>
+#include <common/debug.h>
+
+#include <css_def.h>
 #include "sds.h"
 #include "sds_private.h"
 
diff --git a/plat/arm/css/sgi/include/sgi_base_platform_def.h b/plat/arm/css/sgi/include/sgi_base_platform_def.h
index 8705d63..ad7ab81 100644
--- a/plat/arm/css/sgi/include/sgi_base_platform_def.h
+++ b/plat/arm/css/sgi/include/sgi_base_platform_def.h
@@ -7,15 +7,16 @@
 #ifndef SGI_BASE_PLATFORM_DEF_H
 #define SGI_BASE_PLATFORM_DEF_H
 
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <plat/common/common_def.h>
+
 #include <arm_def.h>
 #include <arm_spm_def.h>
 #include <board_css_def.h>
-#include <common_def.h>
 #include <css_def.h>
 #include <soc_css_def.h>
-#include <utils_def.h>
 #include <v2m_def.h>
-#include <xlat_tables_defs.h>
 
 #define PLATFORM_CORE_COUNT		(PLAT_ARM_CLUSTER_COUNT *	\
 					CSS_SGI_MAX_CPUS_PER_CLUSTER * \
diff --git a/plat/arm/css/sgi/sgi_bl31_setup.c b/plat/arm/css/sgi/sgi_bl31_setup.c
index b1aa089..617a62b 100644
--- a/plat/arm/css/sgi/sgi_bl31_setup.c
+++ b/plat/arm/css/sgi/sgi_bl31_setup.c
@@ -5,12 +5,16 @@
  */
 
 #include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
+
 #include <libfdt.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+
 #include <plat_arm.h>
 #include <sgi_ras.h>
 #include <sgi_variant.h>
+
 #include "../../css/drivers/scmi/scmi.h"
 #include "../../css/drivers/mhu/css_mhu_doorbell.h"
 
diff --git a/plat/arm/css/sgi/sgi_image_load.c b/plat/arm/css/sgi/sgi_image_load.c
index e078bd2..1ed219d 100644
--- a/plat/arm/css/sgi/sgi_image_load.c
+++ b/plat/arm/css/sgi/sgi_image_load.c
@@ -4,11 +4,13 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arch_helpers.h>
-#include <debug.h>
-#include <desc_image_load.h>
 #include <libfdt.h>
-#include <platform.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <common/desc_image_load.h>
+#include <plat/common/platform.h>
+
 #include <sgi_variant.h>
 
 /*******************************************************************************
diff --git a/plat/arm/css/sgi/sgi_interconnect.c b/plat/arm/css/sgi/sgi_interconnect.c
index 074f8a2..e86c760 100644
--- a/plat/arm/css/sgi/sgi_interconnect.c
+++ b/plat/arm/css/sgi/sgi_interconnect.c
@@ -5,7 +5,7 @@
  */
 
 #include <arch_helpers.h>
-#include <debug.h>
+#include <common/debug.h>
 
 /*
  * For SGI575 which support FCM (with automatic interconnect enter/exit),
diff --git a/plat/arm/css/sgi/sgi_plat.c b/plat/arm/css/sgi/sgi_plat.c
index 710430b..79f3e5b 100644
--- a/plat/arm/css/sgi/sgi_plat.c
+++ b/plat/arm/css/sgi/sgi_plat.c
@@ -4,16 +4,19 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include <assert.h>
+
+#include <platform_def.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/arm/ccn.h>
+#include <plat/common/platform.h>
+#include <services/secure_partition.h>
+
 #include <arm_def.h>
 #include <arm_spm_def.h>
-#include <assert.h>
-#include <bl_common.h>
-#include <ccn.h>
-#include <debug.h>
 #include <plat_arm.h>
-#include <platform_def.h>
-#include <platform.h>
-#include <secure_partition.h>
 #include "../../../../bl1/bl1_private.h"
 
 #if USE_COHERENT_MEM
diff --git a/plat/arm/css/sgi/sgi_ras.c b/plat/arm/css/sgi/sgi_ras.c
index ac4610d..a6a32d1 100644
--- a/plat/arm/css/sgi/sgi_ras.c
+++ b/plat/arm/css/sgi/sgi_ras.c
@@ -4,18 +4,20 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <arm_spm_def.h>
 #include <assert.h>
-#include <context_mgmt.h>
-#include <interrupt_mgmt.h>
-#include <mm_svc.h>
-#include <ras.h>
-#include <sgi_ras.h>
-#include <platform.h>
-#include <spm_svc.h>
-#include <sdei.h>
 #include <string.h>
 
+#include <bl31/interrupt_mgmt.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/extensions/ras.h>
+#include <plat/common/platform.h>
+#include <services/mm_svc.h>
+#include <services/sdei.h>
+#include <services/spm_svc.h>
+
+#include <arm_spm_def.h>
+#include <sgi_ras.h>
+
 static int sgi_ras_intr_handler(const struct err_record_info *err_rec,
 				int probe_data,
 				const struct err_handler_data *const data);
diff --git a/plat/arm/css/sgm/include/sgm_base_platform_def.h b/plat/arm/css/sgm/include/sgm_base_platform_def.h
index 2178f06..e3fa3f3 100644
--- a/plat/arm/css/sgm/include/sgm_base_platform_def.h
+++ b/plat/arm/css/sgm/include/sgm_base_platform_def.h
@@ -7,13 +7,14 @@
 #ifndef SGM_BASE_PLATFORM_DEF_H
 #define SGM_BASE_PLATFORM_DEF_H
 
+#include <drivers/arm/tzc400.h>
+#include <drivers/arm/tzc_common.h>
+#include <plat/common/common_def.h>
+
 #include <arm_def.h>
 #include <board_css_def.h>
-#include <common_def.h>
 #include <css_def.h>
 #include <soc_css_def.h>
-#include <tzc400.h>
-#include <tzc_common.h>
 #include <v2m_def.h>
 
 /* CPU topology */
diff --git a/plat/arm/css/sgm/include/sgm_plat_config.h b/plat/arm/css/sgm/include/sgm_plat_config.h
index 79e6b5c..29b98d4 100644
--- a/plat/arm/css/sgm/include/sgm_plat_config.h
+++ b/plat/arm/css/sgm/include/sgm_plat_config.h
@@ -7,8 +7,8 @@
 #ifndef SGM_PLAT_CONFIG_H
 #define SGM_PLAT_CONFIG_H
 
-#include <ccn.h>
-#include <gicv3.h>
+#include <drivers/arm/ccn.h>
+#include <drivers/arm/gicv3.h>
 
 /* The type of interconnect */
 typedef enum {
diff --git a/plat/arm/css/sgm/sgm_bl1_setup.c b/plat/arm/css/sgm/sgm_bl1_setup.c
index dc3d71d..8b7c5da 100644
--- a/plat/arm/css/sgm/sgm_bl1_setup.c
+++ b/plat/arm/css/sgm/sgm_bl1_setup.c
@@ -4,8 +4,9 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <bl_common.h>
-#include <debug.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+
 #include <plat_arm.h>
 #include <sgm_plat_config.h>
 #include <soc_css.h>
diff --git a/plat/arm/css/sgm/sgm_bl31_setup.c b/plat/arm/css/sgm/sgm_bl31_setup.c
index 952572e..7967cb5 100644
--- a/plat/arm/css/sgm/sgm_bl31_setup.c
+++ b/plat/arm/css/sgm/sgm_bl31_setup.c
@@ -4,10 +4,12 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <bl_common.h>
-#include <debug.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+
 #include <plat_arm.h>
 #include <sgm_plat_config.h>
+
 #include "../../css/drivers/scmi/scmi.h"
 #include "../../css/drivers/mhu/css_mhu_doorbell.h"
 
diff --git a/plat/arm/css/sgm/sgm_mmap_config.c b/plat/arm/css/sgm/sgm_mmap_config.c
index 6800ac3..a4df9ab 100644
--- a/plat/arm/css/sgm/sgm_mmap_config.c
+++ b/plat/arm/css/sgm/sgm_mmap_config.c
@@ -4,11 +4,13 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include <platform_def.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+
 #include <arm_def.h>
-#include <bl_common.h>
-#include <debug.h>
 #include <plat_arm.h>
-#include <platform_def.h>
 #include <sgm_variant.h>
 
 /*
diff --git a/plat/arm/css/sgm/sgm_plat_config.c b/plat/arm/css/sgm/sgm_plat_config.c
index e977e61..2a43487 100644
--- a/plat/arm/css/sgm/sgm_plat_config.c
+++ b/plat/arm/css/sgm/sgm_plat_config.c
@@ -5,12 +5,15 @@
  */
 
 #include <assert.h>
-#include <debug.h>
-#include <plat_arm.h>
+#include <string.h>
+
 #include <platform_def.h>
+
+#include <common/debug.h>
+
+#include <plat_arm.h>
 #include <sgm_plat_config.h>
 #include <sgm_variant.h>
-#include <string.h>
 
 static css_plat_config_t *css_plat_info;
 
diff --git a/plat/arm/css/sgm/sgm_security.c b/plat/arm/css/sgm/sgm_security.c
index 7f98060..548ec7b 100644
--- a/plat/arm/css/sgm/sgm_security.c
+++ b/plat/arm/css/sgm/sgm_security.c
@@ -4,11 +4,12 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#include <debug.h>
+#include <common/debug.h>
+#include <drivers/arm/tzc_dmc500.h>
+
 #include <plat_arm.h>
 #include <sgm_variant.h>
 #include <soc_css.h>
-#include <tzc_dmc500.h>
 
 /* Is populated with the DMC-500 controllers base addresses */
 static tzc_dmc500_driver_data_t plat_driver_data;