aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/aarch64/misc_helpers.S2
-rw-r--r--lib/coreboot/coreboot.mk2
-rw-r--r--lib/coreboot/coreboot_table.c11
-rw-r--r--lib/cpus/aarch32/cortex_a53.S3
-rw-r--r--lib/cpus/aarch32/cortex_a57.S2
-rw-r--r--lib/cpus/aarch32/cortex_a72.S2
-rw-r--r--lib/cpus/aarch32/cpu_helpers.S2
-rw-r--r--lib/cpus/aarch64/cortex_a35.S2
-rw-r--r--lib/cpus/aarch64/cortex_a53.S6
-rw-r--r--lib/cpus/aarch64/cortex_a55.S2
-rw-r--r--lib/cpus/aarch64/cortex_a57.S4
-rw-r--r--lib/cpus/aarch64/cortex_a73.S2
-rw-r--r--lib/cpus/aarch64/cortex_a75_pubsub.c2
-rw-r--r--lib/cpus/aarch64/cortex_a76.S4
-rw-r--r--lib/cpus/aarch64/cortex_ares_pubsub.c2
-rw-r--r--lib/cpus/aarch64/cortex_deimos.S2
-rw-r--r--lib/cpus/aarch64/cortex_helios.S4
-rw-r--r--lib/cpus/aarch64/cpu_helpers.S6
-rw-r--r--lib/cpus/aarch64/cpuamu.c4
-rw-r--r--lib/cpus/aarch64/dsu_helpers.S2
-rw-r--r--lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S2
-rw-r--r--lib/cpus/aarch64/wa_cve_2017_5715_mmu.S2
-rw-r--r--lib/cpus/errata_report.c13
-rw-r--r--lib/el3_runtime/aarch32/context_mgmt.c20
-rw-r--r--lib/el3_runtime/aarch32/cpu_data.S2
-rw-r--r--lib/el3_runtime/aarch64/context_mgmt.c30
-rw-r--r--lib/el3_runtime/aarch64/cpu_data.S2
-rw-r--r--lib/el3_runtime/cpu_data_array.c5
-rw-r--r--lib/extensions/amu/aarch32/amu.c11
-rw-r--r--lib/extensions/amu/aarch64/amu.c13
-rw-r--r--lib/extensions/mpam/mpam.c5
-rw-r--r--lib/extensions/ras/ras_common.c15
-rw-r--r--lib/extensions/ras/std_err_record.c5
-rw-r--r--lib/extensions/spe/spe.c7
-rw-r--r--lib/extensions/sve/sve.c7
-rw-r--r--lib/libc/abort.c3
-rw-r--r--lib/libc/assert.c7
-rw-r--r--lib/libc/printf.c4
-rw-r--r--lib/libc/putchar.c3
-rw-r--r--lib/libc/snprintf.c5
-rw-r--r--lib/locks/bakery/bakery_lock_coherent.c9
-rw-r--r--lib/locks/bakery/bakery_lock_normal.c11
-rw-r--r--lib/optee/optee_utils.c9
-rw-r--r--lib/pmf/pmf_main.c14
-rw-r--r--lib/pmf/pmf_smc.c8
-rw-r--r--lib/psci/aarch32/psci_helpers.S2
-rw-r--r--lib/psci/aarch64/psci_helpers.S2
-rw-r--r--lib/psci/psci_common.c16
-rw-r--r--lib/psci/psci_main.c18
-rw-r--r--lib/psci/psci_mem_protect.c4
-rw-r--r--lib/psci/psci_off.c14
-rw-r--r--lib/psci/psci_on.c16
-rw-r--r--lib/psci/psci_private.h13
-rw-r--r--lib/psci/psci_setup.c14
-rw-r--r--lib/psci/psci_stat.c7
-rw-r--r--lib/psci/psci_suspend.c22
-rw-r--r--lib/psci/psci_system_off.c10
-rw-r--r--lib/romlib/romlib.ld.S2
-rw-r--r--lib/semihosting/semihosting.c3
-rw-r--r--lib/stack_protector/stack_protector.c6
-rw-r--r--lib/utils/mem_region.c3
-rw-r--r--lib/xlat_tables/aarch32/xlat_tables.c13
-rw-r--r--lib/xlat_tables/aarch64/xlat_tables.c19
-rw-r--r--lib/xlat_tables/xlat_tables_common.c19
-rw-r--r--lib/xlat_tables/xlat_tables_private.h5
-rw-r--r--lib/xlat_tables_v2/aarch32/enable_mmu.S2
-rw-r--r--lib/xlat_tables_v2/aarch32/xlat_tables_arch.c15
-rw-r--r--lib/xlat_tables_v2/aarch64/enable_mmu.S2
-rw-r--r--lib/xlat_tables_v2/aarch64/xlat_tables_arch.c12
-rw-r--r--lib/xlat_tables_v2/xlat_tables_context.c8
-rw-r--r--lib/xlat_tables_v2/xlat_tables_core.c14
-rw-r--r--lib/xlat_tables_v2/xlat_tables_private.h6
-rw-r--r--lib/xlat_tables_v2/xlat_tables_utils.c14
-rw-r--r--lib/zlib/tf_gunzip.c5
74 files changed, 319 insertions, 245 deletions
diff --git a/lib/aarch64/misc_helpers.S b/lib/aarch64/misc_helpers.S
index 8920f7297..9aac8cfb9 100644
--- a/lib/aarch64/misc_helpers.S
+++ b/lib/aarch64/misc_helpers.S
@@ -7,7 +7,7 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
-#include <xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
#if !ERROR_DEPRECATED
.globl get_afflvl_shift
diff --git a/lib/coreboot/coreboot.mk b/lib/coreboot/coreboot.mk
index bbaa33294..420182350 100644
--- a/lib/coreboot/coreboot.mk
+++ b/lib/coreboot/coreboot.mk
@@ -19,6 +19,4 @@ BL31_SOURCES += $(addprefix lib/coreboot/, \
BL31_SOURCES += drivers/coreboot/cbmem_console/${ARCH}/cbmem_console.S
-INCLUDES += -Iinclude/drivers/coreboot
-
endif # COREBOOT
diff --git a/lib/coreboot/coreboot_table.c b/lib/coreboot/coreboot_table.c
index 64f8879e4..63bdc6359 100644
--- a/lib/coreboot/coreboot_table.c
+++ b/lib/coreboot/coreboot_table.c
@@ -5,12 +5,13 @@
*/
#include <assert.h>
-#include <cbmem_console.h>
-#include <coreboot.h>
-#include <debug.h>
-#include <mmio.h>
#include <string.h>
-#include <xlat_tables_v2.h>
+
+#include <drivers/coreboot/cbmem_console.h>
+#include <common/debug.h>
+#include <lib/coreboot.h>
+#include <lib/mmio.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
/*
* Structures describing coreboot's in-memory descriptor tables. See
diff --git a/lib/cpus/aarch32/cortex_a53.S b/lib/cpus/aarch32/cortex_a53.S
index 1647e169f..4975ec60d 100644
--- a/lib/cpus/aarch32/cortex_a53.S
+++ b/lib/cpus/aarch32/cortex_a53.S
@@ -3,12 +3,13 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
+#include <common/debug.h>
#include <cortex_a53.h>
#include <cpu_macros.S>
-#include <debug.h>
#if A53_DISABLE_NON_TEMPORAL_HINT
#undef ERRATA_A53_836870
diff --git a/lib/cpus/aarch32/cortex_a57.S b/lib/cpus/aarch32/cortex_a57.S
index dff86be76..04942d309 100644
--- a/lib/cpus/aarch32/cortex_a57.S
+++ b/lib/cpus/aarch32/cortex_a57.S
@@ -6,9 +6,9 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
+#include <common/debug.h>
#include <cortex_a57.h>
#include <cpu_macros.S>
-#include <debug.h>
/* ---------------------------------------------
* Disable intra-cluster coherency
diff --git a/lib/cpus/aarch32/cortex_a72.S b/lib/cpus/aarch32/cortex_a72.S
index 3bc3388bc..ff2b0e66e 100644
--- a/lib/cpus/aarch32/cortex_a72.S
+++ b/lib/cpus/aarch32/cortex_a72.S
@@ -6,9 +6,9 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
+#include <common/debug.h>
#include <cortex_a72.h>
#include <cpu_macros.S>
-#include <debug.h>
/* ---------------------------------------------
* Disable all types of L2 prefetches.
diff --git a/lib/cpus/aarch32/cpu_helpers.S b/lib/cpus/aarch32/cpu_helpers.S
index ddc080842..f84cd0dfa 100644
--- a/lib/cpus/aarch32/cpu_helpers.S
+++ b/lib/cpus/aarch32/cpu_helpers.S
@@ -7,8 +7,8 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
-#include <cpu_data.h>
#include <cpu_macros.S>
+#include <lib/el3_runtime/cpu_data.h>
#if defined(IMAGE_BL1) || defined(IMAGE_BL32) || (defined(IMAGE_BL2) && BL2_AT_EL3)
/*
diff --git a/lib/cpus/aarch64/cortex_a35.S b/lib/cpus/aarch64/cortex_a35.S
index 2e0d63161..96e5dd383 100644
--- a/lib/cpus/aarch64/cortex_a35.S
+++ b/lib/cpus/aarch64/cortex_a35.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_a35.h>
#include <cpu_macros.S>
#include <plat_macros.S>
diff --git a/lib/cpus/aarch64/cortex_a53.S b/lib/cpus/aarch64/cortex_a53.S
index 108509f1f..332bad75f 100644
--- a/lib/cpus/aarch64/cortex_a53.S
+++ b/lib/cpus/aarch64/cortex_a53.S
@@ -5,11 +5,11 @@
*/
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <cortex_a53.h>
#include <cpu_macros.S>
-#include <debug.h>
-#include <errata_report.h>
+#include <lib/cpus/errata_report.h>
#include <plat_macros.S>
#if A53_DISABLE_NON_TEMPORAL_HINT
diff --git a/lib/cpus/aarch64/cortex_a55.S b/lib/cpus/aarch64/cortex_a55.S
index 4e9bd9f6f..b347e299c 100644
--- a/lib/cpus/aarch64/cortex_a55.S
+++ b/lib/cpus/aarch64/cortex_a55.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_a55.h>
#include <cpu_macros.S>
#include <plat_macros.S>
diff --git a/lib/cpus/aarch64/cortex_a57.S b/lib/cpus/aarch64/cortex_a57.S
index 8e6044551..a86267166 100644
--- a/lib/cpus/aarch64/cortex_a57.S
+++ b/lib/cpus/aarch64/cortex_a57.S
@@ -6,10 +6,10 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <cortex_a57.h>
#include <cpu_macros.S>
-#include <debug.h>
#include <plat_macros.S>
/* ---------------------------------------------
diff --git a/lib/cpus/aarch64/cortex_a73.S b/lib/cpus/aarch64/cortex_a73.S
index b79656135..772b0be79 100644
--- a/lib/cpus/aarch64/cortex_a73.S
+++ b/lib/cpus/aarch64/cortex_a73.S
@@ -5,7 +5,7 @@
*/
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_a73.h>
#include <cpu_macros.S>
#include <plat_macros.S>
diff --git a/lib/cpus/aarch64/cortex_a75_pubsub.c b/lib/cpus/aarch64/cortex_a75_pubsub.c
index f4ca48606..bd2c6974e 100644
--- a/lib/cpus/aarch64/cortex_a75_pubsub.c
+++ b/lib/cpus/aarch64/cortex_a75_pubsub.c
@@ -6,7 +6,7 @@
#include <cortex_a75.h>
#include <cpuamu.h>
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
static void *cortex_a75_context_save(const void *arg)
{
diff --git a/lib/cpus/aarch64/cortex_a76.S b/lib/cpus/aarch64/cortex_a76.S
index 4def14373..27db74e41 100644
--- a/lib/cpus/aarch64/cortex_a76.S
+++ b/lib/cpus/aarch64/cortex_a76.S
@@ -5,13 +5,13 @@
*/
#include <arch.h>
-#include <arm_arch_svc.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <context.h>
#include <cortex_a76.h>
#include <cpu_macros.S>
#include <plat_macros.S>
+#include <services/arm_arch_svc.h>
#if !DYNAMIC_WORKAROUND_CVE_2018_3639
#error Cortex A76 requires DYNAMIC_WORKAROUND_CVE_2018_3639=1
diff --git a/lib/cpus/aarch64/cortex_ares_pubsub.c b/lib/cpus/aarch64/cortex_ares_pubsub.c
index 9566223f2..4a4f33386 100644
--- a/lib/cpus/aarch64/cortex_ares_pubsub.c
+++ b/lib/cpus/aarch64/cortex_ares_pubsub.c
@@ -6,7 +6,7 @@
#include <cortex_ares.h>
#include <cpuamu.h>
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
static void *cortex_ares_context_save(const void *arg)
{
diff --git a/lib/cpus/aarch64/cortex_deimos.S b/lib/cpus/aarch64/cortex_deimos.S
index cad906f65..0e72fba5a 100644
--- a/lib/cpus/aarch64/cortex_deimos.S
+++ b/lib/cpus/aarch64/cortex_deimos.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <cortex_deimos.h>
#include <cpu_macros.S>
#include <plat_macros.S>
diff --git a/lib/cpus/aarch64/cortex_helios.S b/lib/cpus/aarch64/cortex_helios.S
index 4812ac47c..7d3d7e45c 100644
--- a/lib/cpus/aarch64/cortex_helios.S
+++ b/lib/cpus/aarch64/cortex_helios.S
@@ -5,10 +5,10 @@
*/
#include <arch.h>
#include <asm_macros.S>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <cortex_helios.h>
#include <cpu_macros.S>
-#include <debug.h>
#include <plat_macros.S>
func cortex_helios_cpu_pwr_dwn
diff --git a/lib/cpus/aarch64/cpu_helpers.S b/lib/cpus/aarch64/cpu_helpers.S
index 69ece8fff..74d7bb240 100644
--- a/lib/cpus/aarch64/cpu_helpers.S
+++ b/lib/cpus/aarch64/cpu_helpers.S
@@ -7,10 +7,10 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
-#include <cpu_data.h>
+#include <common/debug.h>
#include <cpu_macros.S>
-#include <debug.h>
-#include <errata_report.h>
+#include <lib/cpus/errata_report.h>
+#include <lib/el3_runtime/cpu_data.h>
/* Reset fn is needed in BL at reset vector */
#if defined(IMAGE_BL1) || defined(IMAGE_BL31) || (defined(IMAGE_BL2) && BL2_AT_EL3)
diff --git a/lib/cpus/aarch64/cpuamu.c b/lib/cpus/aarch64/cpuamu.c
index 5ad5bf839..3a2fa819f 100644
--- a/lib/cpus/aarch64/cpuamu.c
+++ b/lib/cpus/aarch64/cpuamu.c
@@ -5,8 +5,8 @@
*/
#include <cpuamu.h>
-#include <platform.h>
-#include <pubsub_events.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <plat/common/platform.h>
#define CPUAMU_NR_COUNTERS 5U
diff --git a/lib/cpus/aarch64/dsu_helpers.S b/lib/cpus/aarch64/dsu_helpers.S
index 152a3da26..eb84daacf 100644
--- a/lib/cpus/aarch64/dsu_helpers.S
+++ b/lib/cpus/aarch64/dsu_helpers.S
@@ -6,7 +6,7 @@
#include <asm_macros.S>
#include <dsu_def.h>
-#include <errata_report.h>
+#include <lib/cpus/errata_report.h>
/* -----------------------------------------------------------------------
* DSU erratum 936184 check function
diff --git a/lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S b/lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S
index c613ebdf6..c9a954496 100644
--- a/lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S
+++ b/lib/cpus/aarch64/wa_cve_2017_5715_bpiall.S
@@ -5,9 +5,9 @@
*/
#include <arch.h>
-#include <arm_arch_svc.h>
#include <asm_macros.S>
#include <context.h>
+#include <services/arm_arch_svc.h>
.globl wa_cve_2017_5715_bpiall_vbar
diff --git a/lib/cpus/aarch64/wa_cve_2017_5715_mmu.S b/lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
index d7b6e26e4..9277cc624 100644
--- a/lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
+++ b/lib/cpus/aarch64/wa_cve_2017_5715_mmu.S
@@ -5,9 +5,9 @@
*/
#include <arch.h>
-#include <arm_arch_svc.h>
#include <asm_macros.S>
#include <context.h>
+#include <services/arm_arch_svc.h>
.globl wa_cve_2017_5715_mmu_vbar
diff --git a/lib/cpus/errata_report.c b/lib/cpus/errata_report.c
index 42603cb6d..aeb356005 100644
--- a/lib/cpus/errata_report.c
+++ b/lib/cpus/errata_report.c
@@ -6,14 +6,15 @@
/* Runtime firmware routines to report errata status for the current CPU. */
-#include <arch_helpers.h>
#include <assert.h>
-#include <cpu_data.h>
-#include <debug.h>
-#include <errata_report.h>
-#include <spinlock.h>
#include <stdbool.h>
-#include <utils.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/cpus/errata_report.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/spinlock.h>
+#include <lib/utils.h>
#ifdef IMAGE_BL1
# define BL_STRING "BL1"
diff --git a/lib/el3_runtime/aarch32/context_mgmt.c b/lib/el3_runtime/aarch32/context_mgmt.c
index ad0a1206d..a4702fcc6 100644
--- a/lib/el3_runtime/aarch32/context_mgmt.c
+++ b/lib/el3_runtime/aarch32/context_mgmt.c
@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <amu.h>
+#include <assert.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <platform_def.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <platform.h>
-#include <platform_def.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/extensions/amu.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
#include <smccc_helpers.h>
-#include <stdbool.h>
-#include <string.h>
-#include <utils.h>
/*******************************************************************************
* Context management library initialisation routine. This library is used by
diff --git a/lib/el3_runtime/aarch32/cpu_data.S b/lib/el3_runtime/aarch32/cpu_data.S
index 68d64151f..bdad2c145 100644
--- a/lib/el3_runtime/aarch32/cpu_data.S
+++ b/lib/el3_runtime/aarch32/cpu_data.S
@@ -5,7 +5,7 @@
*/
#include <asm_macros.S>
-#include <cpu_data.h>
+#include <lib/el3_runtime/cpu_data.h>
.globl _cpu_data
.globl _cpu_data_by_index
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c
index 39c27d0ec..8a5764ce2 100644
--- a/lib/el3_runtime/aarch64/context_mgmt.c
+++ b/lib/el3_runtime/aarch64/context_mgmt.c
@@ -4,24 +4,26 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <amu.h>
+#include <assert.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <platform_def.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <bl31/interrupt_mgmt.h>
+#include <common/bl_common.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <interrupt_mgmt.h>
-#include <mpam.h>
-#include <platform.h>
-#include <platform_def.h>
-#include <pubsub_events.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <lib/extensions/amu.h>
+#include <lib/extensions/mpam.h>
+#include <lib/extensions/spe.h>
+#include <lib/extensions/sve.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
#include <smccc_helpers.h>
-#include <spe.h>
-#include <stdbool.h>
-#include <string.h>
-#include <sve.h>
-#include <utils.h>
/*******************************************************************************
diff --git a/lib/el3_runtime/aarch64/cpu_data.S b/lib/el3_runtime/aarch64/cpu_data.S
index 96be0813c..2edf22559 100644
--- a/lib/el3_runtime/aarch64/cpu_data.S
+++ b/lib/el3_runtime/aarch64/cpu_data.S
@@ -5,7 +5,7 @@
*/
#include <asm_macros.S>
-#include <cpu_data.h>
+#include <lib/el3_runtime/cpu_data.h>
.globl init_cpu_data_ptr
.globl _cpu_data_by_index
diff --git a/lib/el3_runtime/cpu_data_array.c b/lib/el3_runtime/cpu_data_array.c
index 10b1a7c5b..13d464c97 100644
--- a/lib/el3_runtime/cpu_data_array.c
+++ b/lib/el3_runtime/cpu_data_array.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <cassert.h>
-#include <cpu_data.h>
#include <platform_def.h>
+#include <lib/cassert.h>
+#include <lib/el3_runtime/cpu_data.h>
+
/* The per_cpu_ptr_cache_t space allocation */
cpu_data_t percpu_data[PLATFORM_CORE_COUNT];
diff --git a/lib/extensions/amu/aarch32/amu.c b/lib/extensions/amu/aarch32/amu.c
index 585d908f7..82d2e1864 100644
--- a/lib/extensions/amu/aarch32/amu.c
+++ b/lib/extensions/amu/aarch32/amu.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <amu.h>
-#include <amu_private.h>
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <platform.h>
-#include <pubsub_events.h>
-#include <stdbool.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <lib/extensions/amu.h>
+#include <lib/extensions/amu_private.h>
+#include <plat/common/platform.h>
#define AMU_GROUP0_NR_COUNTERS 4
diff --git a/lib/extensions/amu/aarch64/amu.c b/lib/extensions/amu/aarch64/amu.c
index 1564e8402..85f7007aa 100644
--- a/lib/extensions/amu/aarch64/amu.c
+++ b/lib/extensions/amu/aarch64/amu.c
@@ -4,15 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <amu.h>
-#include <amu_private.h>
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <platform.h>
-#include <pubsub_events.h>
#include <stdbool.h>
+#include <arch.h>
+#include <arch_helpers.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <lib/extensions/amu.h>
+#include <lib/extensions/amu_private.h>
+#include <plat/common/platform.h>
+
#define AMU_GROUP0_NR_COUNTERS 4
struct amu_ctx {
diff --git a/lib/extensions/mpam/mpam.c b/lib/extensions/mpam/mpam.c
index d57bb470b..016670790 100644
--- a/lib/extensions/mpam/mpam.c
+++ b/lib/extensions/mpam/mpam.c
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <mpam.h>
-#include <stdbool.h>
+#include <lib/extensions/mpam.h>
bool mpam_supported(void)
{
diff --git a/lib/extensions/ras/ras_common.c b/lib/extensions/ras/ras_common.c
index f39e5f5f1..be8beceeb 100644
--- a/lib/extensions/ras/ras_common.c
+++ b/lib/extensions/ras/ras_common.c
@@ -4,15 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
-#include <debug.h>
-#include <ea_handle.h>
-#include <ehf.h>
-#include <platform.h>
-#include <ras.h>
-#include <ras_arch.h>
#include <stdbool.h>
+#include <arch_helpers.h>
+#include <bl31/ea_handle.h>
+#include <bl31/ehf.h>
+#include <common/debug.h>
+#include <lib/extensions/ras.h>
+#include <lib/extensions/ras_arch.h>
+#include <plat/common/platform.h>
+
#ifndef PLAT_RAS_PRI
# error Platform must define RAS priority value
#endif
diff --git a/lib/extensions/ras/std_err_record.c b/lib/extensions/ras/std_err_record.c
index 9fdfd6b60..c03fbbe43 100644
--- a/lib/extensions/ras/std_err_record.c
+++ b/lib/extensions/ras/std_err_record.c
@@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <ras_arch.h>
-#include <utils_def.h>
+
+#include <lib/extensions/ras_arch.h>
+#include <lib/utils_def.h>
/*
* Probe for error in memory-mapped registers containing error records
diff --git a/lib/extensions/spe/spe.c b/lib/extensions/spe/spe.c
index e5df015b0..78876c66b 100644
--- a/lib/extensions/spe/spe.c
+++ b/lib/extensions/spe/spe.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <pubsub.h>
-#include <spe.h>
-#include <stdbool.h>
+#include <lib/el3_runtime/pubsub.h>
+#include <lib/extensions/spe.h>
static inline void psb_csync(void)
{
diff --git a/lib/extensions/sve/sve.c b/lib/extensions/sve/sve.c
index e031bf61b..fa4ac7758 100644
--- a/lib/extensions/sve/sve.c
+++ b/lib/extensions/sve/sve.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <pubsub.h>
-#include <stdbool.h>
-#include <sve.h>
+#include <lib/el3_runtime/pubsub.h>
+#include <lib/extensions/sve.h>
bool sve_supported(void)
{
diff --git a/lib/libc/abort.c b/lib/libc/abort.c
index c9d16cccc..432b1d075 100644
--- a/lib/libc/abort.c
+++ b/lib/libc/abort.c
@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
#include <stdlib.h>
+#include <common/debug.h>
+
void abort(void)
{
ERROR("ABORT\n");
diff --git a/lib/libc/assert.c b/lib/libc/assert.c
index 8fa8f7212..60f1a8660 100644
--- a/lib/libc/assert.c
+++ b/lib/libc/assert.c
@@ -6,11 +6,12 @@
#include <assert.h>
#include <cdefs.h>
-#include <console.h>
-#include <debug.h>
-#include <platform.h>
#include <stdio.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <plat/common/platform.h>
+
/*
* Only print the output if PLAT_LOG_LEVEL_ASSERT is higher or equal to
* LOG_LEVEL_INFO, which is the default value for builds with DEBUG=1.
diff --git a/lib/libc/printf.c b/lib/libc/printf.c
index d50876d75..2715a72d4 100644
--- a/lib/libc/printf.c
+++ b/lib/libc/printf.c
@@ -3,12 +3,14 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <assert.h>
-#include <debug.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
+#include <common/debug.h>
+
#define get_num_va_args(_args, _lcount) \
(((_lcount) > 1) ? va_arg(_args, long long int) : \
(((_lcount) == 1) ? va_arg(_args, long int) : \
diff --git a/lib/libc/putchar.c b/lib/libc/putchar.c
index 0beb625b2..037e28ac4 100644
--- a/lib/libc/putchar.c
+++ b/lib/libc/putchar.c
@@ -5,7 +5,8 @@
*/
#include <stdio.h>
-#include <console.h>
+
+#include <drivers/console.h>
int putchar(int c)
{
diff --git a/lib/libc/snprintf.c b/lib/libc/snprintf.c
index 66a2fa2f5..38ad1c71a 100644
--- a/lib/libc/snprintf.c
+++ b/lib/libc/snprintf.c
@@ -5,10 +5,11 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
#include <stdarg.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
static void string_print(char **s, size_t n, size_t *chars_printed,
const char *str)
{
diff --git a/lib/locks/bakery/bakery_lock_coherent.c b/lib/locks/bakery/bakery_lock_coherent.c
index 8e86790ab..1634e3af6 100644
--- a/lib/locks/bakery/bakery_lock_coherent.c
+++ b/lib/locks/bakery/bakery_lock_coherent.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bakery_lock.h>
-#include <cpu_data.h>
-#include <platform.h>
#include <string.h>
+#include <arch_helpers.h>
+#include <lib/bakery_lock.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <plat/common/platform.h>
+
/*
* Functions in this file implement Bakery Algorithm for mutual exclusion with the
* bakery lock data structures in coherent memory.
diff --git a/lib/locks/bakery/bakery_lock_normal.c b/lib/locks/bakery/bakery_lock_normal.c
index beae63c72..867da929a 100644
--- a/lib/locks/bakery/bakery_lock_normal.c
+++ b/lib/locks/bakery/bakery_lock_normal.c
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bakery_lock.h>
-#include <cpu_data.h>
-#include <platform.h>
#include <string.h>
-#include <utils_def.h>
+
+#include <arch_helpers.h>
+#include <lib/bakery_lock.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/utils_def.h>
+#include <plat/common/platform.h>
/*
* Functions in this file implement Bakery Algorithm for mutual exclusion with the
diff --git a/lib/optee/optee_utils.c b/lib/optee/optee_utils.c
index 34d095b0d..f7392fda8 100644
--- a/lib/optee/optee_utils.c
+++ b/lib/optee/optee_utils.c
@@ -4,12 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <desc_image_load.h>
#include <errno.h>
-#include <optee_utils.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <common/desc_image_load.h>
+#include <lib/optee_utils.h>
/*
* load_addr_hi and load_addr_lo: image load address.
diff --git a/lib/pmf/pmf_main.c b/lib/pmf/pmf_main.c
index fe7bb7423..131a05578 100644
--- a/lib/pmf/pmf_main.c
+++ b/lib/pmf/pmf_main.c
@@ -3,15 +3,17 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
+
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <platform.h>
-#include <pmf.h>
#include <string.h>
-#include <utils_def.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/pmf/pmf.h>
+#include <lib/utils_def.h>
+#include <plat/common/platform.h>
/*******************************************************************************
* The 'pmf_svc_descs' array holds the PMF service descriptors exported by
diff --git a/lib/pmf/pmf_smc.c b/lib/pmf/pmf_smc.c
index 4c5b14f93..6d7950299 100644
--- a/lib/pmf/pmf_smc.c
+++ b/lib/pmf/pmf_smc.c
@@ -3,10 +3,12 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
-#include <pmf.h>
+
+#include <common/debug.h>
+#include <lib/pmf/pmf.h>
+#include <plat/common/platform.h>
#include <smccc_helpers.h>
/*
diff --git a/lib/psci/aarch32/psci_helpers.S b/lib/psci/aarch32/psci_helpers.S
index 63d7e7088..5cc192e66 100644
--- a/lib/psci/aarch32/psci_helpers.S
+++ b/lib/psci/aarch32/psci_helpers.S
@@ -5,8 +5,8 @@
*/
#include <asm_macros.S>
+#include <lib/psci/psci.h>
#include <platform_def.h>
-#include <psci.h>
.globl psci_do_pwrdown_cache_maintenance
.globl psci_do_pwrup_cache_maintenance
diff --git a/lib/psci/aarch64/psci_helpers.S b/lib/psci/aarch64/psci_helpers.S
index 88db1c968..add968a7b 100644
--- a/lib/psci/aarch64/psci_helpers.S
+++ b/lib/psci/aarch64/psci_helpers.S
@@ -6,8 +6,8 @@
#include <asm_macros.S>
#include <assert_macros.S>
+#include <lib/psci/psci.h>
#include <platform_def.h>
-#include <psci.h>
.globl psci_do_pwrdown_cache_maintenance
.globl psci_do_pwrup_cache_maintenance
diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c
index 97aeb8323..2928c33e5 100644
--- a/lib/psci/psci_common.c
+++ b/lib/psci/psci_common.c
@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <string.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
-#include <string.h>
-#include <utils.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/utils.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
/*
diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c
index b4a25fb0a..5c0e952a9 100644
--- a/lib/psci/psci_main.c
+++ b/lib/psci/psci_main.c
@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
-#include <arm_arch_svc.h>
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
-#include <pmf.h>
-#include <runtime_instr.h>
-#include <smccc.h>
#include <string.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/pmf/pmf.h>
+#include <lib/runtime_instr.h>
+#include <lib/smccc.h>
+#include <plat/common/platform.h>
+#include <services/arm_arch_svc.h>
+
#include "psci_private.h"
/*******************************************************************************
diff --git a/lib/psci/psci_mem_protect.c b/lib/psci/psci_mem_protect.c
index 857146b67..481051f95 100644
--- a/lib/psci/psci_mem_protect.c
+++ b/lib/psci/psci_mem_protect.c
@@ -6,7 +6,9 @@
#include <assert.h>
#include <limits.h>
-#include <utils.h>
+
+#include <lib/utils.h>
+
#include "psci_private.h"
u_register_t psci_mem_protect(unsigned int enable)
diff --git a/lib/psci/psci_off.c b/lib/psci/psci_off.c
index 944f8bff9..ac03e0596 100644
--- a/lib/psci/psci_off.c
+++ b/lib/psci/psci_off.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
-#include <pmf.h>
-#include <runtime_instr.h>
#include <string.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/pmf/pmf.h>
+#include <lib/runtime_instr.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
/******************************************************************************
diff --git a/lib/psci/psci_on.c b/lib/psci/psci_on.c
index f38900cf5..aa6b324ed 100644
--- a/lib/psci/psci_on.c
+++ b/lib/psci/psci_on.c
@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <context_mgmt.h>
-#include <debug.h>
-#include <platform.h>
-#include <pubsub_events.h>
#include <stddef.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
/*
diff --git a/lib/psci/psci_private.h b/lib/psci/psci_private.h
index 82b951db6..68ec7fb66 100644
--- a/lib/psci/psci_private.h
+++ b/lib/psci/psci_private.h
@@ -7,14 +7,15 @@
#ifndef PSCI_PRIVATE_H
#define PSCI_PRIVATE_H
+#include <stdbool.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <bakery_lock.h>
-#include <bl_common.h>
-#include <cpu_data.h>
-#include <psci.h>
-#include <spinlock.h>
-#include <stdbool.h>
+#include <common/bl_common.h>
+#include <lib/bakery_lock.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/psci/psci.h>
+#include <lib/spinlock.h>
/*
* The PSCI capability which are provided by the generic code but does not
diff --git a/lib/psci/psci_setup.c b/lib/psci/psci_setup.c
index 6b3081eb5..b9467d3e0 100644
--- a/lib/psci/psci_setup.c
+++ b/lib/psci/psci_setup.c
@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <stddef.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <errata_report.h>
-#include <platform.h>
-#include <stddef.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/cpus/errata_report.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
/*******************************************************************************
diff --git a/lib/psci/psci_stat.c b/lib/psci/psci_stat.c
index 6f6a7d4f8..772a1840a 100644
--- a/lib/psci/psci_stat.c
+++ b/lib/psci/psci_stat.c
@@ -5,9 +5,12 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <platform.h>
+
#include <platform_def.h>
+
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
#ifndef PLAT_MAX_PWR_LVL_STATES
diff --git a/lib/psci/psci_suspend.c b/lib/psci/psci_suspend.c
index e00819de7..8a752c1a1 100644
--- a/lib/psci/psci_suspend.c
+++ b/lib/psci/psci_suspend.c
@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <assert.h>
+#include <stddef.h>
+
#include <arch.h>
#include <arch_helpers.h>
-#include <assert.h>
-#include <bl_common.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#include <context.h>
-#include <context_mgmt.h>
-#include <cpu_data.h>
-#include <debug.h>
-#include <platform.h>
-#include <pmf.h>
-#include <pubsub_events.h>
-#include <runtime_instr.h>
-#include <stddef.h>
+#include <lib/el3_runtime/context_mgmt.h>
+#include <lib/el3_runtime/cpu_data.h>
+#include <lib/el3_runtime/pubsub_events.h>
+#include <lib/pmf/pmf.h>
+#include <lib/runtime_instr.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
/*******************************************************************************
diff --git a/lib/psci/psci_system_off.c b/lib/psci/psci_system_off.c
index 7cac4e937..141d69ef2 100644
--- a/lib/psci/psci_system_off.c
+++ b/lib/psci/psci_system_off.c
@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <console.h>
-#include <debug.h>
-#include <platform.h>
#include <stddef.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <drivers/console.h>
+#include <plat/common/platform.h>
+
#include "psci_private.h"
void __dead2 psci_system_off(void)
diff --git a/lib/romlib/romlib.ld.S b/lib/romlib/romlib.ld.S
index 8f0bc62bc..2aac4adf6 100644
--- a/lib/romlib/romlib.ld.S
+++ b/lib/romlib/romlib.ld.S
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <lib/xlat_tables/xlat_tables_defs.h>
#include <platform_def.h>
-#include <xlat_tables_defs.h>
MEMORY {
ROM (rx): ORIGIN = ROMLIB_RO_BASE, LENGTH = ROMLIB_RO_LIMIT - ROMLIB_RO_BASE
diff --git a/lib/semihosting/semihosting.c b/lib/semihosting/semihosting.c
index 2ba43f343..ee48dbc1f 100644
--- a/lib/semihosting/semihosting.c
+++ b/lib/semihosting/semihosting.c
@@ -6,9 +6,10 @@
#include <assert.h>
#include <errno.h>
-#include <semihosting.h>
#include <string.h>
+#include <lib/semihosting.h>
+
#ifndef SEMIHOSTING_SUPPORTED
#define SEMIHOSTING_SUPPORTED 1
#endif
diff --git a/lib/stack_protector/stack_protector.c b/lib/stack_protector/stack_protector.c
index fba5e1ffa..3ff74fc8a 100644
--- a/lib/stack_protector/stack_protector.c
+++ b/lib/stack_protector/stack_protector.c
@@ -3,10 +3,12 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <platform.h>
+
#include <stdint.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
/*
* Canary value used by the compiler runtime checks to detect stack corruption.
*
diff --git a/lib/utils/mem_region.c b/lib/utils/mem_region.c
index a5c3c6170..662f6a05a 100644
--- a/lib/utils/mem_region.c
+++ b/lib/utils/mem_region.c
@@ -5,7 +5,8 @@
*/
#include <assert.h>
-#include <utils.h>
+
+#include <lib/utils.h>
/*
* All the regions defined in mem_region_t must have the following properties
diff --git a/lib/xlat_tables/aarch32/xlat_tables.c b/lib/xlat_tables/aarch32/xlat_tables.c
index 55957031f..468a9e7dd 100644
--- a/lib/xlat_tables/aarch32/xlat_tables.c
+++ b/lib/xlat_tables/aarch32/xlat_tables.c
@@ -4,13 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
+
#include <platform_def.h>
-#include <utils.h>
-#include <xlat_tables_arch.h>
-#include <xlat_tables.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables_arch.h>
+#include <lib/xlat_tables/xlat_tables.h>
+
#include "../xlat_tables_private.h"
#if (ARM_ARCH_MAJOR == 7) && !defined(ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING)
diff --git a/lib/xlat_tables/aarch64/xlat_tables.c b/lib/xlat_tables/aarch64/xlat_tables.c
index 4afdeed06..71f491a21 100644
--- a/lib/xlat_tables/aarch64/xlat_tables.c
+++ b/lib/xlat_tables/aarch64/xlat_tables.c
@@ -4,16 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <common_def.h>
-#include <platform_def.h>
#include <stdint.h>
-#include <utils.h>
-#include <xlat_tables.h>
-#include <xlat_tables_arch.h>
+
+#include <platform_def.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables.h>
+#include <lib/xlat_tables/xlat_tables_arch.h>
+#include <plat/common/common_def.h>
+
#include "../xlat_tables_private.h"
#define XLAT_TABLE_LEVEL_BASE \
diff --git a/lib/xlat_tables/xlat_tables_common.c b/lib/xlat_tables/xlat_tables_common.c
index 2ee77c7ae..23fe3f0b4 100644
--- a/lib/xlat_tables/xlat_tables_common.c
+++ b/lib/xlat_tables/xlat_tables_common.c
@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <cassert.h>
-#include <common_def.h>
-#include <debug.h>
-#include <platform_def.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
-#include <utils.h>
-#include <xlat_tables.h>
+
+#include <platform_def.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/cassert.h>
+#include <lib/utils.h>
+#include <lib/xlat_tables/xlat_tables.h>
+#include <plat/common/common_def.h>
+
#include "xlat_tables_private.h"
#if LOG_LEVEL >= LOG_LEVEL_VERBOSE
diff --git a/lib/xlat_tables/xlat_tables_private.h b/lib/xlat_tables/xlat_tables_private.h
index fad967ebf..4390f34ea 100644
--- a/lib/xlat_tables/xlat_tables_private.h
+++ b/lib/xlat_tables/xlat_tables_private.h
@@ -7,9 +7,10 @@
#ifndef XLAT_TABLES_PRIVATE_H
#define XLAT_TABLES_PRIVATE_H
-#include <cassert.h>
#include <platform_def.h>
-#include <xlat_tables_arch.h>
+
+#include <lib/cassert.h>
+#include <lib/xlat_tables/xlat_tables_arch.h>
#if HW_ASSISTED_COHERENCY
#error xlat tables v2 must be used with HW_ASSISTED_COHERENCY
diff --git a/lib/xlat_tables_v2/aarch32/enable_mmu.S b/lib/xlat_tables_v2/aarch32/enable_mmu.S
index 4a4ac30f5..f2fff36c2 100644
--- a/lib/xlat_tables_v2/aarch32/enable_mmu.S
+++ b/lib/xlat_tables_v2/aarch32/enable_mmu.S
@@ -6,7 +6,7 @@
#include <asm_macros.S>
#include <assert_macros.S>
-#include <xlat_tables_v2.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
.global enable_mmu_direct_svc_mon
.global enable_mmu_direct_hyp
diff --git a/lib/xlat_tables_v2/aarch32/xlat_tables_arch.c b/lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
index 66938e5f1..349b6c4d5 100644
--- a/lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
+++ b/lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
@@ -4,14 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <cassert.h>
-#include <platform_def.h>
#include <stdbool.h>
-#include <utils_def.h>
-#include <xlat_tables_v2.h>
+
+#include <platform_def.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <lib/cassert.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
+
#include "../xlat_tables_private.h"
#if (ARM_ARCH_MAJOR == 7) && !defined(ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING)
diff --git a/lib/xlat_tables_v2/aarch64/enable_mmu.S b/lib/xlat_tables_v2/aarch64/enable_mmu.S
index 504c03c15..07e7be1ec 100644
--- a/lib/xlat_tables_v2/aarch64/enable_mmu.S
+++ b/lib/xlat_tables_v2/aarch64/enable_mmu.S
@@ -6,7 +6,7 @@
#include <asm_macros.S>
#include <assert_macros.S>
-#include <xlat_tables_v2.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
.global enable_mmu_direct_el1
.global enable_mmu_direct_el2
diff --git a/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c b/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
index 269adc7ef..a803d8357 100644
--- a/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
+++ b/lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
-#include <arch_helpers.h>
#include <assert.h>
-#include <cassert.h>
#include <stdbool.h>
#include <stdint.h>
-#include <utils_def.h>
-#include <xlat_tables_v2.h>
+
+#include <arch.h>
+#include <arch_helpers.h>
+#include <lib/cassert.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
+
#include "../xlat_tables_private.h"
/*
diff --git a/lib/xlat_tables_v2/xlat_tables_context.c b/lib/xlat_tables_v2/xlat_tables_context.c
index b887427a2..bf3ae1e7d 100644
--- a/lib/xlat_tables_v2/xlat_tables_context.c
+++ b/lib/xlat_tables_v2/xlat_tables_context.c
@@ -5,10 +5,12 @@
*/
#include <assert.h>
-#include <debug.h>
+
#include <platform_def.h>
-#include <xlat_tables_defs.h>
-#include <xlat_tables_v2.h>
+
+#include <common/debug.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
#include "xlat_tables_private.h"
diff --git a/lib/xlat_tables_v2/xlat_tables_core.c b/lib/xlat_tables_v2/xlat_tables_core.c
index 53fc874d8..c49554f1f 100644
--- a/lib/xlat_tables_v2/xlat_tables_core.c
+++ b/lib/xlat_tables_v2/xlat_tables_core.c
@@ -4,17 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <platform_def.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
-#include <utils_def.h>
-#include <xlat_tables_defs.h>
-#include <xlat_tables_v2.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
#include "xlat_tables_private.h"
diff --git a/lib/xlat_tables_v2/xlat_tables_private.h b/lib/xlat_tables_v2/xlat_tables_private.h
index 528996a29..fc709554b 100644
--- a/lib/xlat_tables_v2/xlat_tables_private.h
+++ b/lib/xlat_tables_v2/xlat_tables_private.h
@@ -7,9 +7,11 @@
#ifndef XLAT_TABLES_PRIVATE_H
#define XLAT_TABLES_PRIVATE_H
-#include <platform_def.h>
#include <stdbool.h>
-#include <xlat_tables_defs.h>
+
+#include <platform_def.h>
+
+#include <lib/xlat_tables/xlat_tables_defs.h>
#if PLAT_XLAT_TABLES_DYNAMIC
/*
diff --git a/lib/xlat_tables_v2/xlat_tables_utils.c b/lib/xlat_tables_v2/xlat_tables_utils.c
index 41c01aee7..f5848a255 100644
--- a/lib/xlat_tables_v2/xlat_tables_utils.c
+++ b/lib/xlat_tables_v2/xlat_tables_utils.c
@@ -4,17 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <debug.h>
#include <errno.h>
-#include <platform_def.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
-#include <utils_def.h>
-#include <xlat_tables_defs.h>
-#include <xlat_tables_v2.h>
+
+#include <platform_def.h>
+
+#include <arch_helpers.h>
+#include <common/debug.h>
+#include <lib/utils_def.h>
+#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <lib/xlat_tables/xlat_tables_v2.h>
#include "xlat_tables_private.h"
diff --git a/lib/zlib/tf_gunzip.c b/lib/zlib/tf_gunzip.c
index 574d871b0..fd56dfc7c 100644
--- a/lib/zlib/tf_gunzip.c
+++ b/lib/zlib/tf_gunzip.c
@@ -5,11 +5,12 @@
*/
#include <assert.h>
-#include <debug.h>
#include <errno.h>
#include <string.h>
+
+#include <common/debug.h>
+#include <lib/utils.h>
#include <tf_gunzip.h>
-#include <utils.h>
#include "zutil.h"