aboutsummaryrefslogtreecommitdiff
path: root/plat/arm
diff options
context:
space:
mode:
Diffstat (limited to 'plat/arm')
-rw-r--r--plat/arm/board/common/aarch32/board_arm_helpers.S3
-rw-r--r--plat/arm/board/common/aarch64/board_arm_helpers.S3
-rw-r--r--plat/arm/board/common/board_arm_trusted_boot.c16
-rw-r--r--plat/arm/board/common/board_common.mk3
-rw-r--r--plat/arm/board/fvp/aarch64/fvp_helpers.S4
-rw-r--r--plat/arm/board/fvp/aarch64/fvp_ras.c2
-rw-r--r--plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c6
-rw-r--r--plat/arm/board/fvp/fvp_bl1_setup.c7
-rw-r--r--plat/arm/board/fvp/fvp_bl2_setup.c9
-rw-r--r--plat/arm/board/fvp/fvp_bl2u_setup.c3
-rw-r--r--plat/arm/board/fvp/fvp_bl31_setup.c5
-rw-r--r--plat/arm/board/fvp/fvp_common.c20
-rw-r--r--plat/arm/board/fvp/fvp_def.h2
-rw-r--r--plat/arm/board/fvp/fvp_io_storage.c14
-rw-r--r--plat/arm/board/fvp/fvp_pm.c19
-rw-r--r--plat/arm/board/fvp/fvp_stack_protector.c5
-rw-r--r--plat/arm/board/fvp/fvp_topology.c10
-rw-r--r--plat/arm/board/fvp/fvp_trusted_boot.c5
-rw-r--r--plat/arm/board/fvp/include/platform_def.h8
-rw-r--r--plat/arm/board/juno/aarch32/juno_helpers.S2
-rw-r--r--plat/arm/board/juno/aarch64/juno_helpers.S2
-rw-r--r--plat/arm/board/juno/include/platform_def.h11
-rw-r--r--plat/arm/board/juno/juno_bl1_setup.c12
-rw-r--r--plat/arm/board/juno/juno_bl2_setup.c6
-rw-r--r--plat/arm/board/juno/juno_def.h2
-rw-r--r--plat/arm/board/juno/juno_err.c6
-rw-r--r--plat/arm/board/juno/juno_security.c8
-rw-r--r--plat/arm/board/juno/juno_stack_protector.c5
-rw-r--r--plat/arm/board/juno/juno_topology.c3
-rw-r--r--plat/arm/board/juno/juno_trng.c6
-rw-r--r--plat/arm/board/n1sdp/n1sdp_bl31_setup.c3
-rw-r--r--plat/arm/board/n1sdp/n1sdp_plat.c10
-rw-r--r--plat/arm/board/sgi575/include/platform_def.h3
-rw-r--r--plat/arm/board/sgi575/sgi575_plat.c2
-rw-r--r--plat/arm/board/sgi575/sgi575_security.c5
-rw-r--r--plat/arm/board/sgiclarka/include/platform_def.h3
-rw-r--r--plat/arm/board/sgiclarka/sgiclarka_plat.c2
-rw-r--r--plat/arm/board/sgiclarka/sgiclarka_security.c5
-rw-r--r--plat/arm/board/sgiclarkh/include/platform_def.h3
-rw-r--r--plat/arm/board/sgiclarkh/sgiclarkh_plat.c2
-rw-r--r--plat/arm/board/sgiclarkh/sgiclarkh_security.c5
-rw-r--r--plat/arm/common/aarch32/arm_bl2_mem_params_desc.c6
-rw-r--r--plat/arm/common/aarch64/arm_bl2_mem_params_desc.c6
-rw-r--r--plat/arm/common/aarch64/arm_ehf.c3
-rw-r--r--plat/arm/common/aarch64/arm_sdei.c5
-rw-r--r--plat/arm/common/arm_bl1_fwu.c15
-rw-r--r--plat/arm/common/arm_bl1_setup.c19
-rw-r--r--plat/arm/common/arm_bl2_el3_setup.c9
-rw-r--r--plat/arm/common/arm_bl2_setup.c25
-rw-r--r--plat/arm/common/arm_bl2u_setup.c15
-rw-r--r--plat/arm/common/arm_bl31_setup.c20
-rw-r--r--plat/arm/common/arm_cci.c8
-rw-r--r--plat/arm/common/arm_ccn.c6
-rw-r--r--plat/arm/common/arm_common.c20
-rw-r--r--plat/arm/common/arm_console.c12
-rw-r--r--plat/arm/common/arm_dyn_cfg.c20
-rw-r--r--plat/arm/common/arm_dyn_cfg_helpers.c9
-rw-r--r--plat/arm/common/arm_err.c17
-rw-r--r--plat/arm/common/arm_gicv2.c8
-rw-r--r--plat/arm/common/arm_gicv3.c12
-rw-r--r--plat/arm/common/arm_image_load.c8
-rw-r--r--plat/arm/common/arm_io_storage.c24
-rw-r--r--plat/arm/common/arm_nor_psci_mem_protect.c14
-rw-r--r--plat/arm/common/arm_pm.c13
-rw-r--r--plat/arm/common/arm_sip_svc.c13
-rw-r--r--plat/arm/common/arm_topology.c4
-rw-r--r--plat/arm/common/arm_tzc400.c9
-rw-r--r--plat/arm/common/arm_tzc_dmc500.c11
-rw-r--r--plat/arm/common/execution_state_switch.c16
-rw-r--r--plat/arm/common/sp_min/arm_sp_min_setup.c19
-rw-r--r--plat/arm/common/tsp/arm_tsp_setup.c17
-rw-r--r--plat/arm/css/common/css_bl1_setup.c7
-rw-r--r--plat/arm/css/common/css_bl2_setup.c13
-rw-r--r--plat/arm/css/common/css_bl2u_setup.c8
-rw-r--r--plat/arm/css/common/css_pm.c16
-rw-r--r--plat/arm/css/common/css_topology.c6
-rw-r--r--plat/arm/css/drivers/mhu/css_mhu.c12
-rw-r--r--plat/arm/css/drivers/mhu/css_mhu_doorbell.c4
-rw-r--r--plat/arm/css/drivers/mhu/css_mhu_doorbell.h3
-rw-r--r--plat/arm/css/drivers/scmi/scmi.h7
-rw-r--r--plat/arm/css/drivers/scmi/scmi_ap_core_proto.c6
-rw-r--r--plat/arm/css/drivers/scmi/scmi_common.c7
-rw-r--r--plat/arm/css/drivers/scmi/scmi_pwr_dmn_proto.c6
-rw-r--r--plat/arm/css/drivers/scmi/scmi_sys_pwr_proto.c6
-rw-r--r--plat/arm/css/drivers/scp/css_bom_bootloader.c11
-rw-r--r--plat/arm/css/drivers/scp/css_pm_scmi.c11
-rw-r--r--plat/arm/css/drivers/scp/css_pm_scpi.c7
-rw-r--r--plat/arm/css/drivers/scp/css_scp.h6
-rw-r--r--plat/arm/css/drivers/scp/css_sds.c13
-rw-r--r--plat/arm/css/drivers/scpi/css_scpi.c13
-rw-r--r--plat/arm/css/drivers/sds/sds.c7
-rw-r--r--plat/arm/css/sgi/include/sgi_base_platform_def.h7
-rw-r--r--plat/arm/css/sgi/sgi_bl31_setup.c8
-rw-r--r--plat/arm/css/sgi/sgi_image_load.c10
-rw-r--r--plat/arm/css/sgi/sgi_interconnect.c2
-rw-r--r--plat/arm/css/sgi/sgi_plat.c17
-rw-r--r--plat/arm/css/sgi/sgi_ras.c20
-rw-r--r--plat/arm/css/sgm/include/sgm_base_platform_def.h7
-rw-r--r--plat/arm/css/sgm/include/sgm_plat_config.h4
-rw-r--r--plat/arm/css/sgm/sgm_bl1_setup.c5
-rw-r--r--plat/arm/css/sgm/sgm_bl31_setup.c6
-rw-r--r--plat/arm/css/sgm/sgm_mmap_config.c8
-rw-r--r--plat/arm/css/sgm/sgm_plat_config.c9
-rw-r--r--plat/arm/css/sgm/sgm_security.c5
-rw-r--r--plat/arm/soc/common/soc_css_security.c8
105 files changed, 548 insertions, 370 deletions
diff --git a/plat/arm/board/common/aarch32/board_arm_helpers.S b/plat/arm/board/common/aarch32/board_arm_helpers.S
index d64da292ad..320bfb3c34 100644
--- a/plat/arm/board/common/aarch32/board_arm_helpers.S
+++ b/plat/arm/board/common/aarch32/board_arm_helpers.S
@@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <v2m_def.h>
.globl plat_report_exception
diff --git a/plat/arm/board/common/aarch64/board_arm_helpers.S b/plat/arm/board/common/aarch64/board_arm_helpers.S
index 4385e62ba8..5a905244f4 100644
--- a/plat/arm/board/common/aarch64/board_arm_helpers.S
+++ b/plat/arm/board/common/aarch64/board_arm_helpers.S
@@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <v2m_def.h>
.globl plat_report_exception
diff --git a/plat/arm/board/common/board_arm_trusted_boot.c b/plat/arm/board/common/board_arm_trusted_boot.c
index 6c03c91b5d..64ca3c36d8 100644
--- a/plat/arm/board/common/board_arm_trusted_boot.c
+++ b/plat/arm/board/common/board_arm_trusted_boot.c
@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_def.h>
#include <assert.h>
-#include <cassert.h>
-#include <platform.h>
#include <stdint.h>
#include <string.h>
-#include <tbbr_oid.h>
+
+#include <lib/cassert.h>
+#include <plat/common/platform.h>
+#include <tools_share/tbbr_oid.h>
+
+#include <arm_def.h>
/* SHA256 algorithm */
#define SHA256_BYTES 32
@@ -180,9 +182,9 @@ int plat_set_nv_ctr(void *cookie, unsigned int nv_ctr)
}
#else /* ARM_CRYPTOCELL_INTEG */
-#include <nvm.h>
-#include <nvm_otp.h>
-#include <sbrom_bsv_api.h>
+#include <drivers/arm/cryptocell/nvm.h>
+#include <drivers/arm/cryptocell/nvm_otp.h>
+#include <drivers/arm/cryptocell/sbrom_bsv_api.h>
CASSERT(HASH_RESULT_SIZE_IN_BYTES == SHA256_BYTES,
assert_mismatch_in_hash_result_size);
diff --git a/plat/arm/board/common/board_common.mk b/plat/arm/board/common/board_common.mk
index 2556fc04af..487aad7399 100644
--- a/plat/arm/board/common/board_common.mk
+++ b/plat/arm/board/common/board_common.mk
@@ -4,8 +4,7 @@
# SPDX-License-Identifier: BSD-3-Clause
#
-PLAT_INCLUDES += -Iinclude/drivers/cfi/ \
- -Iinclude/plat/arm/board/common/
+PLAT_INCLUDES += -Iinclude/plat/arm/board/common/
PLAT_BL_COMMON_SOURCES += drivers/arm/pl011/${ARCH}/pl011_console.S \
plat/arm/board/common/${ARCH}/board_arm_helpers.S
diff --git a/plat/arm/board/fvp/aarch64/fvp_helpers.S b/plat/arm/board/fvp/aarch64/fvp_helpers.S
index abc3ceb00f..0f905151b4 100644
--- a/plat/arm/board/fvp/aarch64/fvp_helpers.S
+++ b/plat/arm/board/fvp/aarch64/fvp_helpers.S
@@ -6,8 +6,8 @@
#include <arch.h>
#include <asm_macros.S>
-#include <gicv2.h>
-#include <gicv3.h>
+#include <drivers/arm/gicv2.h>
+#include <drivers/arm/gicv3.h>
#include <platform_def.h>
#include <v2m_def.h>
#include "../drivers/pwrc/fvp_pwrc.h"
diff --git a/plat/arm/board/fvp/aarch64/fvp_ras.c b/plat/arm/board/fvp/aarch64/fvp_ras.c
index fb80a8a0b9..759f6d0d86 100644
--- a/plat/arm/board/fvp/aarch64/fvp_ras.c
+++ b/plat/arm/board/fvp/aarch64/fvp_ras.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <ras.h>
+#include <lib/extensions/ras.h>
struct ras_interrupt fvp_ras_interrupts[] = {
};
diff --git a/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c b/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c
index b17446c10c..c48bb07a3a 100644
--- a/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c
+++ b/plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c
@@ -4,9 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bakery_lock.h>
-#include <mmio.h>
+#include <lib/bakery_lock.h>
+#include <lib/mmio.h>
+
#include <plat_arm.h>
+
#include "../../fvp_def.h"
#include "../../fvp_private.h"
#include "fvp_pwrc.h"
diff --git a/plat/arm/board/fvp/fvp_bl1_setup.c b/plat/arm/board/fvp/fvp_bl1_setup.c
index 4b2a340b0c..d6e82f50d9 100644
--- a/plat/arm/board/fvp/fvp_bl1_setup.c
+++ b/plat/arm/board/fvp/fvp_bl1_setup.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <common/tbbr/tbbr_img_def.h>
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
-#include <tbbr_img_def.h>
-#include "fvp_private.h"
+#include "fvp_private.h"
/*******************************************************************************
* Perform any BL1 specific platform actions.
diff --git a/plat/arm/board/fvp/fvp_bl2_setup.c b/plat/arm/board/fvp/fvp_bl2_setup.c
index 0a3b67d399..13e74fd9a3 100644
--- a/plat/arm/board/fvp/fvp_bl2_setup.c
+++ b/plat/arm/board/fvp/fvp_bl2_setup.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <generic_delay_timer.h>
-#include <mmio.h>
+#include <drivers/arm/sp804_delay_timer.h>
+#include <drivers/generic_delay_timer.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
-#include <sp804_delay_timer.h>
#include <v2m_def.h>
#include "fvp_def.h"
#include "fvp_private.h"
diff --git a/plat/arm/board/fvp/fvp_bl2u_setup.c b/plat/arm/board/fvp/fvp_bl2u_setup.c
index b9ab3f36e8..c51e287f61 100644
--- a/plat/arm/board/fvp/fvp_bl2u_setup.c
+++ b/plat/arm/board/fvp/fvp_bl2u_setup.c
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
#include "fvp_def.h"
#include "fvp_private.h"
diff --git a/plat/arm/board/fvp/fvp_bl31_setup.c b/plat/arm/board/fvp/fvp_bl31_setup.c
index 1c8804f10a..5f2121c528 100644
--- a/plat/arm/board/fvp/fvp_bl31_setup.c
+++ b/plat/arm/board/fvp/fvp_bl31_setup.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <drivers/arm/smmu_v3.h>
+#include <plat/common/platform.h>
+
#include <arm_config.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <smmu_v3.h>
#include "fvp_private.h"
void __init bl31_early_platform_setup2(u_register_t arg0,
diff --git a/plat/arm/board/fvp/fvp_common.c b/plat/arm/board/fvp/fvp_common.c
index f36b637ef1..31a61de4e7 100644
--- a/plat/arm/board/fvp/fvp_common.c
+++ b/plat/arm/board/fvp/fvp_common.c
@@ -4,20 +4,22 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+
+#include <common/debug.h>
+#include <drivers/arm/cci.h>
+#include <drivers/arm/ccn.h>
+#include <drivers/arm/gicv2.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
+#include <plat/common/platform.h>
+#include <services/secure_partition.h>
+
#include <arm_config.h>
#include <arm_def.h>
#include <arm_spm_def.h>
-#include <assert.h>
-#include <cci.h>
-#include <ccn.h>
-#include <debug.h>
-#include <gicv2.h>
-#include <mmio.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <secure_partition.h>
#include <v2m_def.h>
-#include <xlat_tables_compat.h>
#include "../fvp_def.h"
#include "fvp_private.h"
diff --git a/plat/arm/board/fvp/fvp_def.h b/plat/arm/board/fvp/fvp_def.h
index a8ed9d324a..1b9f84b001 100644
--- a/plat/arm/board/fvp/fvp_def.h
+++ b/plat/arm/board/fvp/fvp_def.h
@@ -7,7 +7,7 @@
#ifndef FVP_DEF_H
#define FVP_DEF_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
#ifndef FVP_CLUSTER_COUNT
#define FVP_CLUSTER_COUNT 2
diff --git a/plat/arm/board/fvp/fvp_io_storage.c b/plat/arm/board/fvp/fvp_io_storage.c
index 11c7c3bcde..e186b30838 100644
--- a/plat/arm/board/fvp/fvp_io_storage.c
+++ b/plat/arm/board/fvp/fvp_io_storage.c
@@ -5,13 +5,15 @@
*/
#include <assert.h>
-#include <common_def.h>
-#include <debug.h>
-#include <io_driver.h>
-#include <io_semihosting.h>
-#include <io_storage.h>
+
+#include <common/debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_semihosting.h>
+#include <drivers/io/io_storage.h>
+#include <lib/semihosting.h>
+#include <plat/common/common_def.h>
+
#include <plat_arm.h>
-#include <semihosting.h> /* For FOPEN_MODE_... */
/* Semihosting filenames */
#define BL2_IMAGE_NAME "bl2.bin"
diff --git a/plat/arm/board/fvp/fvp_pm.c b/plat/arm/board/fvp/fvp_pm.c
index 78d3025559..7da246bd60 100644
--- a/plat/arm/board/fvp/fvp_pm.c
+++ b/plat/arm/board/fvp/fvp_pm.c
@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <arm_config.h>
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <gicv3.h>
-#include <mmio.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/extensions/spe.h>
+#include <lib/mmio.h>
+#include <lib/psci/psci.h>
+#include <plat/common/platform.h>
+
+#include <arm_config.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <psci.h>
-#include <spe.h>
#include <v2m_def.h>
+
#include "../../../../drivers/arm/gic/v3/gicv3_private.h"
#include "drivers/pwrc/fvp_pwrc.h"
#include "fvp_def.h"
diff --git a/plat/arm/board/fvp/fvp_stack_protector.c b/plat/arm/board/fvp/fvp_stack_protector.c
index 1e8e3010ff..e940a12914 100644
--- a/plat/arm/board/fvp/fvp_stack_protector.c
+++ b/plat/arm/board/fvp/fvp_stack_protector.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <platform.h>
#include <stdint.h>
+#include <arch_helpers.h>
+#include <plat/common/platform.h>
+
#define RANDOM_CANARY_VALUE ((u_register_t) 3288484550995823360ULL)
u_register_t plat_get_stack_protector_canary(void)
diff --git a/plat/arm/board/fvp/fvp_topology.c b/plat/arm/board/fvp/fvp_topology.c
index e21b9d28c7..3384a2f704 100644
--- a/plat/arm/board/fvp/fvp_topology.c
+++ b/plat/arm/board/fvp/fvp_topology.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch.h>
-#include <arm_config.h>
-#include <cassert.h>
+#include <lib/cassert.h>
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
+#include <arm_config.h>
#include "drivers/pwrc/fvp_pwrc.h"
/* The FVP power domain tree descriptor */
diff --git a/plat/arm/board/fvp/fvp_trusted_boot.c b/plat/arm/board/fvp/fvp_trusted_boot.c
index 39be4a6e7e..c18bfb2137 100644
--- a/plat/arm/board/fvp/fvp_trusted_boot.c
+++ b/plat/arm/board/fvp/fvp_trusted_boot.c
@@ -7,8 +7,9 @@
#include <assert.h>
#include <stdint.h>
#include <string.h>
-#include <platform.h>
-#include <tbbr_oid.h>
+
+#include <plat/common/platform.h>
+#include <tools_share/tbbr_oid.h>
#include "fvp_def.h"
diff --git a/plat/arm/board/fvp/include/platform_def.h b/plat/arm/board/fvp/include/platform_def.h
index 3097f909bb..ca4bd53996 100644
--- a/plat/arm/board/fvp/include/platform_def.h
+++ b/plat/arm/board/fvp/include/platform_def.h
@@ -18,12 +18,14 @@
# endif
#endif /* AARCH32 */
+#include <drivers/arm/tzc400.h>
+#include <lib/utils_def.h>
+#include <plat/common/common_def.h>
+
#include <arm_def.h>
#include <arm_spm_def.h>
-#include <common_def.h>
-#include <tzc400.h>
-#include <utils_def.h>
#include <v2m_def.h>
+
#include "../fvp_def.h"
/* Required platform porting definitions */
diff --git a/plat/arm/board/juno/aarch32/juno_helpers.S b/plat/arm/board/juno/aarch32/juno_helpers.S
index 1bc4e309a8..080a8ddcc5 100644
--- a/plat/arm/board/juno/aarch32/juno_helpers.S
+++ b/plat/arm/board/juno/aarch32/juno_helpers.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_a53.h>
#include <cortex_a57.h>
#include <cortex_a72.h>
diff --git a/plat/arm/board/juno/aarch64/juno_helpers.S b/plat/arm/board/juno/aarch64/juno_helpers.S
index edcfc74491..373f2fc893 100644
--- a/plat/arm/board/juno/aarch64/juno_helpers.S
+++ b/plat/arm/board/juno/aarch64/juno_helpers.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_a53.h>
#include <cortex_a57.h>
#include <cortex_a72.h>
diff --git a/plat/arm/board/juno/include/platform_def.h b/plat/arm/board/juno/include/platform_def.h
index 8098bc3feb..ed82879afc 100644
--- a/plat/arm/board/juno/include/platform_def.h
+++ b/plat/arm/board/juno/include/platform_def.h
@@ -19,15 +19,16 @@
#endif /* AARCH32 */
+#include <drivers/arm/tzc400.h>
+#if TRUSTED_BOARD_BOOT
+#include <drivers/auth/mbedtls/mbedtls_config.h>
+#endif
+#include <plat/common/common_def.h>
+
#include <arm_def.h>
#include <board_css_def.h>
-#include <common_def.h>
#include <css_def.h>
-#if TRUSTED_BOARD_BOOT
-#include <mbedtls_config.h>
-#endif
#include <soc_css_def.h>
-#include <tzc400.h>
#include <v2m_def.h>
#include "../juno_def.h"
diff --git a/plat/arm/board/juno/juno_bl1_setup.c b/plat/arm/board/juno/juno_bl1_setup.c
index 3dd2a227c1..e751ab69c3 100644
--- a/plat/arm/board/juno/juno_bl1_setup.c
+++ b/plat/arm/board/juno/juno_bl1_setup.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <debug.h>
#include <errno.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/tbbr/tbbr_img_def.h>
+#include <drivers/arm/sp805.h>
+#include <plat/common/platform.h>
+
#include <plat_arm.h>
-#include <platform.h>
#include <sds.h>
-#include <sp805.h>
-#include <tbbr_img_def.h>
#include <v2m_def.h>
void juno_reset_to_aarch32_state(void);
diff --git a/plat/arm/board/juno/juno_bl2_setup.c b/plat/arm/board/juno/juno_bl2_setup.c
index 1f483d63da..56f05eb185 100644
--- a/plat/arm/board/juno/juno_bl2_setup.c
+++ b/plat/arm/board/juno/juno_bl2_setup.c
@@ -5,8 +5,10 @@
*/
#include <assert.h>
-#include <bl_common.h>
-#include <desc_image_load.h>
+
+#include <common/bl_common.h>
+#include <common/desc_image_load.h>
+
#include <plat_arm.h>
#if JUNO_AARCH32_EL3_RUNTIME
diff --git a/plat/arm/board/juno/juno_def.h b/plat/arm/board/juno/juno_def.h
index 5301886fb8..7a8bedf5ab 100644
--- a/plat/arm/board/juno/juno_def.h
+++ b/plat/arm/board/juno/juno_def.h
@@ -7,7 +7,7 @@
#ifndef JUNO_DEF_H
#define JUNO_DEF_H
-#include <utils_def.h>
+#include <lib/utils_def.h>
/*******************************************************************************
* Juno memory map related constants
diff --git a/plat/arm/board/juno/juno_err.c b/plat/arm/board/juno/juno_err.c
index dd8e27881d..69daa1ae0e 100644
--- a/plat/arm/board/juno/juno_err.c
+++ b/plat/arm/board/juno/juno_err.c
@@ -4,9 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <errno.h>
-#include <platform.h>
+
+#include <arch_helpers.h>
+#include <plat/common/platform.h>
+
#include <v2m_def.h>
/*
diff --git a/plat/arm/board/juno/juno_security.c b/plat/arm/board/juno/juno_security.c
index b6cfe7817d..b0df837912 100644
--- a/plat/arm/board/juno/juno_security.c
+++ b/plat/arm/board/juno/juno_security.c
@@ -4,12 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <mmio.h>
-#include <nic_400.h>
+#include <common/debug.h>
+#include <drivers/arm/nic_400.h>
+#include <lib/mmio.h>
+
#include <plat_arm.h>
#include <soc_css.h>
-
#include "juno_def.h"
#include "juno_tzmp1_def.h"
diff --git a/plat/arm/board/juno/juno_stack_protector.c b/plat/arm/board/juno/juno_stack_protector.c
index ec0b1fbee9..ff05b5d468 100644
--- a/plat/arm/board/juno/juno_stack_protector.c
+++ b/plat/arm/board/juno/juno_stack_protector.c
@@ -5,8 +5,9 @@
*/
#include <arch_helpers.h>
-#include <debug.h>
-#include <utils.h>
+#include <common/debug.h>
+#include <lib/utils.h>
+
#include "juno_decl.h"
#include "juno_def.h"
diff --git a/plat/arm/board/juno/juno_topology.c b/plat/arm/board/juno/juno_topology.c
index c8a7598244..51b99aca7f 100644
--- a/plat/arm/board/juno/juno_topology.c
+++ b/plat/arm/board/juno/juno_topology.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <plat/common/platform.h>
+
#include <arm_def.h>
#include <css_pm.h>
#include <plat_arm.h>
-#include <platform.h>
#include "juno_def.h"
#include "../../css/drivers/scmi/scmi.h"
#include "../../css/drivers/mhu/css_mhu_doorbell.h"
diff --git a/plat/arm/board/juno/juno_trng.c b/plat/arm/board/juno/juno_trng.c
index d9ad1d4eb9..505fb02667 100644
--- a/plat/arm/board/juno/juno_trng.c
+++ b/plat/arm/board/juno/juno_trng.c
@@ -5,9 +5,11 @@
*/
#include <assert.h>
-#include <mmio.h>
#include <string.h>
-#include <utils_def.h>
+
+#include <lib/mmio.h>
+#include <lib/utils_def.h>
+
#include "juno_decl.h"
#include "juno_def.h"
diff --git a/plat/arm/board/n1sdp/n1sdp_bl31_setup.c b/plat/arm/board/n1sdp/n1sdp_bl31_setup.c
index cdd0b63da7..d044b7ccf3 100644
--- a/plat/arm/board/n1sdp/n1sdp_bl31_setup.c
+++ b/plat/arm/board/n1sdp/n1sdp_bl31_setup.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include "../../css/drivers/scmi/scmi.h"
#include "../../css/drivers/mhu/css_mhu_doorbell.h"
#include <plat_arm.h>
-#include <platform_def.h>
static scmi_channel_plat_info_t n1sdp_scmi_plat_info = {
.scmi_mbx_mem = N1SDP_SCMI_PAYLOAD_BASE,
diff --git a/plat/arm/board/n1sdp/n1sdp_plat.c b/plat/arm/board/n1sdp/n1sdp_plat.c
index 8c057c55eb..5aaa7376a4 100644
--- a/plat/arm/board/n1sdp/n1sdp_plat.c
+++ b/plat/arm/board/n1sdp/n1sdp_plat.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <bl_common.h>
-#include <debug.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
/*
* Table of regions to map using the MMU.
diff --git a/plat/arm/board/sgi575/include/platform_def.h b/plat/arm/board/sgi575/include/platform_def.h
index 16e2898de0..6aea522f0d 100644
--- a/plat/arm/board/sgi575/include/platform_def.h
+++ b/plat/arm/board/sgi575/include/platform_def.h
@@ -7,8 +7,9 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
+#include <lib/utils_def.h>
+
#include <sgi_base_platform_def.h>
-#include <utils_def.h>
#define PLAT_ARM_CLUSTER_COUNT 2
#define CSS_SGI_MAX_CPUS_PER_CLUSTER 4
diff --git a/plat/arm/board/sgi575/sgi575_plat.c b/plat/arm/board/sgi575/sgi575_plat.c
index a8ca916d98..d1a1fbf46f 100644
--- a/plat/arm/board/sgi575/sgi575_plat.c
+++ b/plat/arm/board/sgi575/sgi575_plat.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <platform.h>
+#include <plat/common/platform.h>
unsigned int plat_arm_sgi_get_platform_id(void)
{
diff --git a/plat/arm/board/sgi575/sgi575_security.c b/plat/arm/board/sgi575/sgi575_security.c
index 7ccc59a7bc..8417e10084 100644
--- a/plat/arm/board/sgi575/sgi575_security.c
+++ b/plat/arm/board/sgi575/sgi575_security.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
#include <platform_def.h>
-#include <tzc_dmc620.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc_dmc620.h>
uintptr_t sgi575_dmc_base[] = {
SGI575_DMC620_BASE0,
diff --git a/plat/arm/board/sgiclarka/include/platform_def.h b/plat/arm/board/sgiclarka/include/platform_def.h
index 39907e8bc7..d2cdb49744 100644
--- a/plat/arm/board/sgiclarka/include/platform_def.h
+++ b/plat/arm/board/sgiclarka/include/platform_def.h
@@ -7,8 +7,9 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
+#include <lib/utils_def.h>
+
#include <sgi_base_platform_def.h>
-#include <utils_def.h>
#define PLAT_ARM_CLUSTER_COUNT 2
#define CSS_SGI_MAX_CPUS_PER_CLUSTER 4
diff --git a/plat/arm/board/sgiclarka/sgiclarka_plat.c b/plat/arm/board/sgiclarka/sgiclarka_plat.c
index 3df2da666f..3b7e5ee4e4 100644
--- a/plat/arm/board/sgiclarka/sgiclarka_plat.c
+++ b/plat/arm/board/sgiclarka/sgiclarka_plat.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <platform.h>
+#include <plat/common/platform.h>
unsigned int plat_arm_sgi_get_platform_id(void)
{
diff --git a/plat/arm/board/sgiclarka/sgiclarka_security.c b/plat/arm/board/sgiclarka/sgiclarka_security.c
index 29cd754744..c455111d10 100644
--- a/plat/arm/board/sgiclarka/sgiclarka_security.c
+++ b/plat/arm/board/sgiclarka/sgiclarka_security.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
#include <platform_def.h>
-#include <tzc_dmc620.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc_dmc620.h>
uintptr_t sgiclarka_dmc_base[] = {
SGICLARKA_DMC620_BASE0,
diff --git a/plat/arm/board/sgiclarkh/include/platform_def.h b/plat/arm/board/sgiclarkh/include/platform_def.h
index 544ad90f32..fe8907bee6 100644
--- a/plat/arm/board/sgiclarkh/include/platform_def.h
+++ b/plat/arm/board/sgiclarkh/include/platform_def.h
@@ -7,8 +7,9 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
+#include <lib/utils_def.h>
+
#include <sgi_base_platform_def.h>
-#include <utils_def.h>
#define PLAT_ARM_CLUSTER_COUNT 2
#define CSS_SGI_MAX_CPUS_PER_CLUSTER 8
diff --git a/plat/arm/board/sgiclarkh/sgiclarkh_plat.c b/plat/arm/board/sgiclarkh/sgiclarkh_plat.c
index 437592dbd7..a1b8d621d6 100644
--- a/plat/arm/board/sgiclarkh/sgiclarkh_plat.c
+++ b/plat/arm/board/sgiclarkh/sgiclarkh_plat.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <platform.h>
+#include <plat/common/platform.h>
unsigned int plat_arm_sgi_get_platform_id(void)
{
diff --git a/plat/arm/board/sgiclarkh/sgiclarkh_security.c b/plat/arm/board/sgiclarkh/sgiclarkh_security.c
index 5ae0b82844..aaf9691ced 100644
--- a/plat/arm/board/sgiclarkh/sgiclarkh_security.c
+++ b/plat/arm/board/sgiclarkh/sgiclarkh_security.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
#include <platform_def.h>
-#include <tzc_dmc620.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc_dmc620.h>
uintptr_t sgiclarkh_dmc_base[] = {
SGICLARKH_DMC620_BASE0,
diff --git a/plat/arm/common/aarch32/arm_bl2_mem_params_desc.c b/plat/arm/common/aarch32/arm_bl2_mem_params_desc.c
index 890f2c960d..e23dd258b2 100644
--- a/plat/arm/common/aarch32/arm_bl2_mem_params_desc.c
+++ b/plat/arm/common/aarch32/arm_bl2_mem_params_desc.c
@@ -4,11 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <desc_image_load.h>
-#include <platform.h>
#include <platform_def.h>
+#include <common/bl_common.h>
+#include <common/desc_image_load.h>
+#include <plat/common/platform.h>
/*******************************************************************************
* Following descriptor provides BL image/ep information that gets used
diff --git a/plat/arm/common/aarch64/arm_bl2_mem_params_desc.c b/plat/arm/common/aarch64/arm_bl2_mem_params_desc.c
index 8e6d00d056..c0f42f3108 100644
--- a/plat/arm/common/aarch64/arm_bl2_mem_params_desc.c
+++ b/plat/arm/common/aarch64/arm_bl2_mem_params_desc.c
@@ -4,11 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <bl_common.h>
-#include <desc_image_load.h>
-#include <platform.h>
#include <platform_def.h>
+#include <common/bl_common.h>
+#include <common/desc_image_load.h>
+#include <plat/common/platform.h>
/*******************************************************************************
* Following descriptor provides BL image/ep information that gets used
diff --git a/plat/arm/common/aarch64/arm_ehf.c b/plat/arm/common/aarch64/arm_ehf.c
index f313851852..4ae992c95e 100644
--- a/plat/arm/common/aarch64/arm_ehf.c
+++ b/plat/arm/common/aarch64/arm_ehf.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <ehf.h>
#include <platform_def.h>
+#include <bl31/ehf.h>
+
/*
* Enumeration of priority levels on ARM platforms.
*/
diff --git a/plat/arm/common/aarch64/arm_sdei.c b/plat/arm/common/aarch64/arm_sdei.c
index 687b21d43b..493134b6a1 100644
--- a/plat/arm/common/aarch64/arm_sdei.c
+++ b/plat/arm/common/aarch64/arm_sdei.c
@@ -6,9 +6,10 @@
/* SDEI configuration for ARM platforms */
-#include <ehf.h>
#include <platform_def.h>
-#include <sdei.h>
+
+#include <bl31/ehf.h>
+#include <services/sdei.h>
/* Private event mappings */
static sdei_ev_map_t arm_sdei_private[] = {
diff --git a/plat/arm/common/arm_bl1_fwu.c b/plat/arm/common/arm_bl1_fwu.c
index f2be47792b..cd92aa8ed0 100644
--- a/plat/arm/common/arm_bl1_fwu.c
+++ b/plat/arm/common/arm_bl1_fwu.c
@@ -5,14 +5,17 @@
*/
#include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
#include <errno.h>
-#include <plat_arm.h>
-#include <platform.h>
+
#include <platform_def.h>
-#include <tbbr_img_desc.h>
-#include <utils.h>
+
+#include <bl1/tbbr/tbbr_img_desc.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
+#include <plat_arm.h>
/* Struct to keep track of usable memory */
typedef struct bl1_mem_info {
diff --git a/plat/arm/common/arm_bl1_setup.c b/plat/arm/common/arm_bl1_setup.c
index f760e18dce..e28211cfa7 100644
--- a/plat/arm/common/arm_bl1_setup.c
+++ b/plat/arm/common/arm_bl1_setup.c
@@ -4,17 +4,20 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+
+#include <platform_def.h>
+
#include <arch.h>
+#include <bl1/bl1.h>
+#include <common/bl_common.h>
+#include <drivers/arm/sp805.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <assert.h>
-#include <bl1.h>
-#include <bl_common.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <sp805.h>
-#include <utils.h>
-#include <xlat_tables_compat.h>
#include "../../../bl1/bl1_private.h"
diff --git a/plat/arm/common/arm_bl2_el3_setup.c b/plat/arm/common/arm_bl2_el3_setup.c
index 4f5e6a9e6e..0c1f63ed41 100644
--- a/plat/arm/common/arm_bl2_el3_setup.c
+++ b/plat/arm/common/arm_bl2_el3_setup.c
@@ -3,11 +3,14 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_def.h>
+
#include <assert.h>
-#include <generic_delay_timer.h>
+
+#include <drivers/generic_delay_timer.h>
+#include <plat/common/platform.h>
+
+#include <arm_def.h>
#include <plat_arm.h>
-#include <platform.h>
#pragma weak bl2_el3_early_platform_setup
#pragma weak bl2_el3_plat_arch_setup
diff --git a/plat/arm/common/arm_bl2_setup.c b/plat/arm/common/arm_bl2_setup.c
index 628a50def4..9319004eae 100644
--- a/plat/arm/common/arm_bl2_setup.c
+++ b/plat/arm/common/arm_bl2_setup.c
@@ -4,21 +4,24 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <arm_def.h>
#include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
-#include <desc_image_load.h>
-#include <generic_delay_timer.h>
+#include <string.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <common/desc_image_load.h>
+#include <drivers/generic_delay_timer.h>
#ifdef SPD_opteed
-#include <optee_utils.h>
+#include <lib/optee_utils.h>
#endif
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
+#include <arm_def.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <string.h>
-#include <utils.h>
/* Data structure which holds the extents of the trusted SRAM for BL2 */
static meminfo_t bl2_tzram_layout __aligned(CACHE_WRITEBACK_GRANULE);
diff --git a/plat/arm/common/arm_bl2u_setup.c b/plat/arm/common/arm_bl2u_setup.c
index 3848aa065d..0dc66e647e 100644
--- a/plat/arm/common/arm_bl2u_setup.c
+++ b/plat/arm/common/arm_bl2u_setup.c
@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <string.h>
+
+#include <platform_def.h>
+
#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <drivers/generic_delay_timer.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <assert.h>
-#include <bl_common.h>
-#include <generic_delay_timer.h>
#include <plat_arm.h>
-#include <platform_def.h>
-#include <platform.h>
-#include <string.h>
/* Weak definitions may be overridden in specific ARM standard platform */
#pragma weak bl2u_platform_setup
diff --git a/plat/arm/common/arm_bl31_setup.c b/plat/arm/common/arm_bl31_setup.c
index 1b05f46e90..41151c2c82 100644
--- a/plat/arm/common/arm_bl31_setup.c
+++ b/plat/arm/common/arm_bl31_setup.c
@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+
#include <arch.h>
#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <lib/extensions/ras.h>
+#include <lib/mmio.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
-#include <mmio.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <ras.h>
-#include <utils.h>
-#include <xlat_tables_compat.h>
/*
* Placeholder variables for copying the arguments that have been passed to
diff --git a/plat/arm/common/arm_cci.c b/plat/arm/common/arm_cci.c
index 6505b9174f..7ee997e296 100644
--- a/plat/arm/common/arm_cci.c
+++ b/plat/arm/common/arm_cci.c
@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch.h>
-#include <cci.h>
+#include <drivers/arm/cci.h>
+#include <lib/utils.h>
+
#include <plat_arm.h>
-#include <platform_def.h>
-#include <utils.h>
static const int cci_map[] = {
PLAT_ARM_CCI_CLUSTER0_SL_IFACE_IX,
diff --git a/plat/arm/common/arm_ccn.c b/plat/arm/common/arm_ccn.c
index ddf3286d79..6aa56f217d 100644
--- a/plat/arm/common/arm_ccn.c
+++ b/plat/arm/common/arm_ccn.c
@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch.h>
-#include <ccn.h>
+#include <drivers/arm/ccn.h>
+
#include <plat_arm.h>
-#include <platform_def.h>
static const unsigned char master_to_rn_id_map[] = {
PLAT_ARM_CLUSTER_TO_CCN_ID_MAP
diff --git a/plat/arm/common/arm_common.c b/plat/arm/common/arm_common.c
index 56ad8aeeb1..4cd2ce3d6b 100644
--- a/plat/arm/common/arm_common.c
+++ b/plat/arm/common/arm_common.c
@@ -3,17 +3,21 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
+#include <assert.h>
+
+#include <platform_def.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <debug.h>
-#include <mmio.h>
+#include <common/debug.h>
+#include <common/romlib.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
+#include <plat/common/platform.h>
+#include <services/secure_partition.h>
+
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <romlib.h>
-#include <secure_partition.h>
-#include <xlat_tables_compat.h>
/* Weak definitions may be overridden in specific ARM standard platform */
#pragma weak plat_get_ns_image_entrypoint
diff --git a/plat/arm/common/arm_console.c b/plat/arm/common/arm_console.c
index bd3dca17f6..29cb378275 100644
--- a/plat/arm/common/arm_console.c
+++ b/plat/arm/common/arm_console.c
@@ -3,13 +3,17 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <assert.h>
-#include <console.h>
-#include <debug.h>
-#include <pl011.h>
-#include <plat_arm.h>
+
#include <platform_def.h>
+#include <common/debug.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/console.h>
+
+#include <plat_arm.h>
+
/*******************************************************************************
* Functions that set up the console
******************************************************************************/
diff --git a/plat/arm/common/arm_dyn_cfg.c b/plat/arm/common/arm_dyn_cfg.c
index c2a4bb1e65..6c6dc568ca 100644
--- a/plat/arm/common/arm_dyn_cfg.c
+++ b/plat/arm/common/arm_dyn_cfg.c
@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_dyn_cfg_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <desc_image_load.h>
+#include <string.h>
+
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <common/desc_image_load.h>
+#include <common/tbbr/tbbr_img_def.h>
#if TRUSTED_BOARD_BOOT
-#include <mbedtls_config.h>
+#include <drivers/auth/mbedtls/mbedtls_config.h>
#endif
-#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <string.h>
-#include <tbbr_img_def.h>
+#include <plat/common/platform.h>
+#include <arm_dyn_cfg_helpers.h>
+#include <plat_arm.h>
/* Variable to store the address to TB_FW_CONFIG passed from BL1 */
static void *tb_fw_cfg_dtb;
diff --git a/plat/arm/common/arm_dyn_cfg_helpers.c b/plat/arm/common/arm_dyn_cfg_helpers.c
index d12d09c7f2..bf2f15643d 100644
--- a/plat/arm/common/arm_dyn_cfg_helpers.c
+++ b/plat/arm/common/arm_dyn_cfg_helpers.c
@@ -4,11 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_dyn_cfg_helpers.h>
#include <assert.h>
-#include <desc_image_load.h>
-#include <fdt_wrappers.h>
+
#include <libfdt.h>
+
+#include <common/desc_image_load.h>
+#include <common/fdt_wrappers.h>
+
+#include <arm_dyn_cfg_helpers.h>
#include <plat_arm.h>
#define DTB_PROP_MBEDTLS_HEAP_ADDR "mbedtls_heap_addr"
diff --git a/plat/arm/common/arm_err.c b/plat/arm/common/arm_err.c
index aa65f4f338..8650d48a7d 100644
--- a/plat/arm/common/arm_err.c
+++ b/plat/arm/common/arm_err.c
@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <console.h>
-#include <debug.h>
#include <errno.h>
-#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
#include <stdint.h>
-#include <v2m_flash.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/cfi/v2m_flash.h>
+#include <drivers/console.h>
+#include <plat/common/platform.h>
+
+#include <plat_arm.h>
#pragma weak plat_arm_error_handler
diff --git a/plat/arm/common/arm_gicv2.c b/plat/arm/common/arm_gicv2.c
index 5644c60404..fc848c1987 100644
--- a/plat/arm/common/arm_gicv2.c
+++ b/plat/arm/common/arm_gicv2.c
@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <gicv2.h>
-#include <plat_arm.h>
-#include <platform.h>
#include <platform_def.h>
+#include <drivers/arm/gicv2.h>
+#include <plat/common/platform.h>
+
+#include <plat_arm.h>
+
/******************************************************************************
* The following functions are defined as weak to allow a platform to override
* the way the GICv2 driver is initialised and used.
diff --git a/plat/arm/common/arm_gicv3.c b/plat/arm/common/arm_gicv3.c
index a43bff3d48..0f6690a0b9 100644
--- a/plat/arm/common/arm_gicv3.c
+++ b/plat/arm/common/arm_gicv3.c
@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
+#include <common/interrupt_props.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <gicv3.h>
-#include <interrupt_props.h>
#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <utils.h>
/******************************************************************************
* The following functions are defined as weak to allow a platform to override
diff --git a/plat/arm/common/arm_image_load.c b/plat/arm/common/arm_image_load.c
index 4f86efdf92..791f05ed70 100644
--- a/plat/arm/common/arm_image_load.c
+++ b/plat/arm/common/arm_image_load.c
@@ -4,12 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <common/bl_common.h>
+#include <common/desc_image_load.h>
+#include <plat/common/platform.h>
+
#include <arm_def.h>
-#include <bl_common.h>
-#include <desc_image_load.h>
#include <plat_arm.h>
-#include <platform.h>
-
#pragma weak plat_flush_next_bl_params
#pragma weak plat_get_bl_image_load_info
diff --git a/plat/arm/common/arm_io_storage.c b/plat/arm/common/arm_io_storage.c
index cd58e4564a..d7c5cac246 100644
--- a/plat/arm/common/arm_io_storage.c
+++ b/plat/arm/common/arm_io_storage.c
@@ -3,18 +3,22 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <assert.h>
-#include <debug.h>
-#include <firmware_image_package.h>
-#include <io_driver.h>
-#include <io_fip.h>
-#include <io_memmap.h>
-#include <io_storage.h>
-#include <plat_arm.h>
-#include <platform.h>
-#include <platform_def.h>
#include <string.h>
-#include <utils.h>
+
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_fip.h>
+#include <drivers/io/io_memmap.h>
+#include <drivers/io/io_storage.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+#include <tools_share/firmware_image_package.h>
+
+#include <plat_arm.h>
/* IO devices */
static const io_dev_connector_t *fip_dev_con;
diff --git a/plat/arm/common/arm_nor_psci_mem_protect.c b/plat/arm/common/arm_nor_psci_mem_protect.c
index 2a46b95d62..4ae57e5344 100644
--- a/plat/arm/common/arm_nor_psci_mem_protect.c
+++ b/plat/arm/common/arm_nor_psci_mem_protect.c
@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <mmio.h>
-#include <plat_arm.h>
#include <platform_def.h>
-#include <psci.h>
-#include <utils.h>
-#include <v2m_flash.h>
+
+#include <common/debug.h>
+#include <drivers/cfi/v2m_flash.h>
+#include <lib/psci/psci.h>
+#include <lib/mmio.h>
+#include <lib/utils.h>
+
+#include <plat_arm.h>
/*
* DRAM1 is used also to load the NS boot loader. For this reason we
diff --git a/plat/arm/common/arm_pm.c b/plat/arm/common/arm_pm.c
index 3be1b5d393..acfd908995 100644
--- a/plat/arm/common/arm_pm.c
+++ b/plat/arm/common/arm_pm.c
@@ -4,14 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <arm_def.h>
#include <assert.h>
#include <errno.h>
-#include <plat_arm.h>
-#include <platform.h>
+
#include <platform_def.h>
-#include <psci.h>
+
+#include <arch_helpers.h>
+#include <lib/psci/psci.h>
+#include <plat/common/platform.h>
+
+#include <arm_def.h>
+#include <plat_arm.h>
/* Allow ARM Standard platforms to override these functions */
#pragma weak plat_arm_program_trusted_mailbox
diff --git a/plat/arm/common/arm_sip_svc.c b/plat/arm/common/arm_sip_svc.c
index e482a89456..6b0f7e7be8 100644
--- a/plat/arm/common/arm_sip_svc.c
+++ b/plat/arm/common/arm_sip_svc.c
@@ -4,14 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_sip_svc.h>
-#include <debug.h>
-#include <plat_arm.h>
-#include <pmf.h>
-#include <runtime_svc.h>
#include <stdint.h>
-#include <uuid.h>
+#include <common/debug.h>
+#include <common/runtime_svc.h>
+#include <lib/pmf/pmf.h>
+#include <tools_share/uuid.h>
+
+#include <arm_sip_svc.h>
+#include <plat_arm.h>
/* ARM SiP Service UUID */
DEFINE_SVC_UUID2(arm_sip_svc_uid,
diff --git a/plat/arm/common/arm_topology.c b/plat/arm/common/arm_topology.c
index b0ad4d1c6a..6986e52b03 100644
--- a/plat/arm/common/arm_topology.c
+++ b/plat/arm/common/arm_topology.c
@@ -4,9 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
#include <arch.h>
+
#include <plat_arm.h>
-#include <platform_def.h>
/*******************************************************************************
* This function validates an MPIDR by checking whether it falls within the
diff --git a/plat/arm/common/arm_tzc400.c b/plat/arm/common/arm_tzc400.c
index 2ae084c7bc..0346fa1845 100644
--- a/plat/arm/common/arm_tzc400.c
+++ b/plat/arm/common/arm_tzc400.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <platform_def.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc400.h>
+
#include <arm_def.h>
#include <arm_spm_def.h>
-#include <debug.h>
#include <plat_arm.h>
-#include <platform_def.h>
-#include <tzc400.h>
-
/* Weak definitions may be overridden in specific ARM standard platform */
#pragma weak plat_arm_security_setup
diff --git a/plat/arm/common/arm_tzc_dmc500.c b/plat/arm/common/arm_tzc_dmc500.c
index 6bd771b0e5..bea3867d37 100644
--- a/plat/arm/common/arm_tzc_dmc500.c
+++ b/plat/arm/common/arm_tzc_dmc500.c
@@ -4,12 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_def.h>
#include <assert.h>
-#include <debug.h>
-#include <plat_arm.h>
+
#include <platform_def.h>
-#include <tzc_dmc500.h>
+
+#include <common/debug.h>
+#include <drivers/arm/tzc_dmc500.h>
+
+#include <arm_def.h>
+#include <plat_arm.h>
/*******************************************************************************
* Initialize the DMC500-TrustZone Controller for ARM standard platforms.
diff --git a/plat/arm/common/execution_state_switch.c b/plat/arm/common/execution_state_switch.c
index 8fa864d66b..e3134102dd 100644
--- a/plat/arm/common/execution_state_switch.c
+++ b/plat/arm/common/execution_state_switch.c
@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+#include <string.h>
+
#include <arch_helpers.h>
-#include <arm_sip_svc.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <plat_arm.h>
-#include <psci.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/psci/psci.h>
+#include <lib/utils.h>
#include <smccc_helpers.h>
-#include <stdbool.h>
-#include <string.h>
-#include <utils.h>
+
+#include <arm_sip_svc.h>
+#include <plat_arm.h>
/*
* Handle SMC from a lower exception level to switch its execution state
diff --git a/plat/arm/common/sp_min/arm_sp_min_setup.c b/plat/arm/common/sp_min/arm_sp_min_setup.c
index ca427d58a4..967b551e4e 100644
--- a/plat/arm/common/sp_min/arm_sp_min_setup.c
+++ b/plat/arm/common/sp_min/arm_sp_min_setup.c
@@ -5,15 +5,18 @@
*/
#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
-#include <mmio.h>
-#include <pl011.h>
-#include <plat_arm.h>
-#include <platform.h>
+
#include <platform_def.h>
-#include <platform_sp_min.h>
+
+#include <bl32/sp_min/platform_sp_min.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/console.h>
+#include <lib/mmio.h>
+#include <plat/common/platform.h>
+
+#include <plat_arm.h>
static entry_point_info_t bl33_image_ep_info;
diff --git a/plat/arm/common/tsp/arm_tsp_setup.c b/plat/arm/common/tsp/arm_tsp_setup.c
index 3cf88251f1..a3d2f7157c 100644
--- a/plat/arm/common/tsp/arm_tsp_setup.c
+++ b/plat/arm/common/tsp/arm_tsp_setup.c
@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arm_def.h>
#include <assert.h>
-#include <bl_common.h>
-#include <console.h>
-#include <debug.h>
-#include <pl011.h>
-#include <plat_arm.h>
+
#include <platform_def.h>
-#include <platform_tsp.h>
+
+#include <bl32/tsp/platform_tsp.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <drivers/arm/pl011.h>
+#include <drivers/console.h>
+
+#include <arm_def.h>
+#include <plat_arm.h>
#define BL32_END (unsigned long)(&__BL32_END__)
diff --git a/plat/arm/css/common/css_bl1_setup.c b/plat/arm/css/common/css_bl1_setup.c
index b1b275c6e7..ae0f01133f 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 e41b1ca0aa..c1c7868b8b 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 4ceb5cda7c..564e98f705 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 4735a9dcca..8a156e675d 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 d1f1c98f4b..8ac2232308 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 7b33317566..e13818f299 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 54f3e057d7..b3203c2a75 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 cb75ed050a..ecee56361f 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 28dfc9ac6a..df259f76d8 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 1438cba46d..e495dccb0a 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 b34178ec35..1b4ecb239c 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 90c5d6bc7b..f315621314 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 f6da394168..03c3c063d8 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 5268510dbd..27c9e1d50f 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 1397fd80cc..bd6b595320 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 123d54f4e5..f53ac30158 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 84c1487d31..f3c08c52f3 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 561e97b2e4..c152abca08 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 2ed5760118..42bf3b8e00 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 e2fac54f37..3eeb0dc4df 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 8705d63b10..ad7ab81d95 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 b1aa089b45..617a62b775 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 e078bd2af0..1ed219d653 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 074f8a2745..e86c760d16 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 710430bb76..79f3e5b55d 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 ac4610d216..a6a32d150d 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 2178f069a5..e3fa3f30e6 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 79e6b5c6a6..29b98d49eb 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 dc3d71dd45..8b7c5dabbe 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 952572e3ad..7967cb59c4 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 6800ac3cf7..a4df9ab19a 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 e977e618bc..2a43487f1a 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 7f9806001f..548ec7bd59 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;
diff --git a/plat/arm/soc/common/soc_css_security.c b/plat/arm/soc/common/soc_css_security.c
index f2296796c6..bbc5dcdc55 100644
--- a/plat/arm/soc/common/soc_css_security.c
+++ b/plat/arm/soc/common/soc_css_security.c
@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <board_css_def.h>
-#include <mmio.h>
-#include <nic_400.h>
#include <platform_def.h>
+
+#include <drivers/arm/nic_400.h>
+#include <lib/mmio.h>
+
+#include <board_css_def.h>
#include <soc_css.h>
#include <soc_css_def.h>