summaryrefslogtreecommitdiff
path: root/plat/common
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-12-14 00:18:21 +0000
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2019-01-04 10:43:17 +0000
commit09d40e0e08283a249e7dce0e106c07c5141f9b7e (patch)
tree46e7af7b5be2738948b359b2a07078e4cf1bbec1 /plat/common
parentf5478dedf9e096d9539362b38ceb096b940ba3e2 (diff)
Sanitise includes across codebase
Enforce full include path for includes. Deprecate old paths. The following folders inside include/lib have been left unchanged: - include/lib/cpus/${ARCH} - include/lib/el3_runtime/${ARCH} The reason for this change is that having a global namespace for includes isn't a good idea. It defeats one of the advantages of having folders and it introduces problems that are sometimes subtle (because you may not know the header you are actually including if there are two of them). For example, this patch had to be created because two headers were called the same way: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform to avoid collision."). More recently, this patch has had similar problems: 46f9b2c3a282 ("drivers: add tzc380 support"). This problem was introduced in commit 4ecca33988b9 ("Move include and source files to logical locations"). At that time, there weren't too many headers so it wasn't a real issue. However, time has shown that this creates problems. Platforms that want to preserve the way they include headers may add the removed paths to PLAT_INCLUDES, but this is discouraged. Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'plat/common')
-rw-r--r--plat/common/aarch32/crash_console_helpers.S2
-rw-r--r--plat/common/aarch32/plat_common.c4
-rw-r--r--plat/common/aarch32/plat_sp_min_common.c4
-rw-r--r--plat/common/aarch64/crash_console_helpers.S2
-rw-r--r--plat/common/aarch64/plat_common.c11
-rw-r--r--plat/common/aarch64/platform_helpers.S2
-rw-r--r--plat/common/plat_bl1_common.c12
-rw-r--r--plat/common/plat_bl_common.c13
-rw-r--r--plat/common/plat_gicv2.c10
-rw-r--r--plat/common/plat_gicv3.c16
-rw-r--r--plat/common/plat_log_common.c4
-rw-r--r--plat/common/plat_psci_common.c9
-rw-r--r--plat/common/plat_spm_rd.c13
-rw-r--r--plat/common/plat_spm_sp.c6
-rw-r--r--plat/common/tbbr/plat_tbbr.c9
15 files changed, 66 insertions, 51 deletions
diff --git a/plat/common/aarch32/crash_console_helpers.S b/plat/common/aarch32/crash_console_helpers.S
index fc37c08f..c9ad12cc 100644
--- a/plat/common/aarch32/crash_console_helpers.S
+++ b/plat/common/aarch32/crash_console_helpers.S
@@ -10,7 +10,7 @@
*/
#include <asm_macros.S>
-#include <console.h>
+#include <drivers/console.h>
.globl plat_crash_console_init
.globl plat_crash_console_putc
diff --git a/plat/common/aarch32/plat_common.c b/plat/common/aarch32/plat_common.c
index 16c2b5c9..2c1a8fa0 100644
--- a/plat/common/aarch32/plat_common.c
+++ b/plat/common/aarch32/plat_common.c
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <platform.h>
-#include <xlat_mmu_helpers.h>
+#include <lib/xlat_tables/xlat_mmu_helpers.h>
+#include <plat/common/platform.h>
/*
* The following platform setup functions are weakly defined. They
diff --git a/plat/common/aarch32/plat_sp_min_common.c b/plat/common/aarch32/plat_sp_min_common.c
index f1b1e9c9..3bc84b1a 100644
--- a/plat/common/aarch32/plat_sp_min_common.c
+++ b/plat/common/aarch32/plat_sp_min_common.c
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <console.h>
-#include <platform.h>
+#include <drivers/console.h>
+#include <plat/common/platform.h>
#include <platform_sp_min.h>
/*
diff --git a/plat/common/aarch64/crash_console_helpers.S b/plat/common/aarch64/crash_console_helpers.S
index 8f8ca112..491a99d3 100644
--- a/plat/common/aarch64/crash_console_helpers.S
+++ b/plat/common/aarch64/crash_console_helpers.S
@@ -10,7 +10,7 @@
*/
#include <asm_macros.S>
-#include <console.h>
+#include <drivers/console.h>
.globl plat_crash_console_init
.globl plat_crash_console_putc
diff --git a/plat/common/aarch64/plat_common.c b/plat/common/aarch64/plat_common.c
index e6f5f204..1424c789 100644
--- a/plat/common/aarch64/plat_common.c
+++ b/plat/common/aarch64/plat_common.c
@@ -4,14 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <console.h>
-#include <platform.h>
+
+#include <arch_helpers.h>
+#include <drivers/console.h>
#if RAS_EXTENSION
-#include <ras.h>
+#include <lib/extensions/ras.h>
#endif
-#include <xlat_mmu_helpers.h>
+#include <lib/xlat_tables/xlat_mmu_helpers.h>
+#include <plat/common/platform.h>
/*
* The following platform setup functions are weakly defined. They
diff --git a/plat/common/aarch64/platform_helpers.S b/plat/common/aarch64/platform_helpers.S
index 89523194..b5788fba 100644
--- a/plat/common/aarch64/platform_helpers.S
+++ b/plat/common/aarch64/platform_helpers.S
@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
-#include <console.h>
+#include <drivers/console.h>
#include <platform_def.h>
.weak plat_report_exception
diff --git a/plat/common/plat_bl1_common.c b/plat/common/plat_bl1_common.c
index 824f9e55..5733781a 100644
--- a/plat/common/plat_bl1_common.c
+++ b/plat/common/plat_bl1_common.c
@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <bl1.h>
-#include <debug.h>
#include <errno.h>
-#include <platform.h>
+
#include <platform_def.h>
+#include <arch_helpers.h>
+#include <bl1/bl1.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
+
/*
* The following platform functions are weakly defined. They
* are default implementations that allow BL1 to compile in
diff --git a/plat/common/plat_bl_common.c b/plat/common/plat_bl_common.c
index 4cf1cc57..2357edfa 100644
--- a/plat/common/plat_bl_common.c
+++ b/plat/common/plat_bl_common.c
@@ -4,16 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
#include <assert.h>
-#include <bl_common.h>
-#include <debug.h>
#include <errno.h>
+
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <common/debug.h>
#if TRUSTED_BOARD_BOOT
-#include <mbedtls_config.h>
+#include <drivers/auth/mbedtls/mbedtls_config.h>
#endif
-#include <platform.h>
-#include <xlat_tables_compat.h>
+#include <lib/xlat_tables/xlat_tables_compat.h>
+#include <plat/common/platform.h>
/*
* The following platform functions are weakly defined. The Platforms
diff --git a/plat/common/plat_gicv2.c b/plat/common/plat_gicv2.c
index 4b668737..4c76f1bd 100644
--- a/plat/common/plat_gicv2.c
+++ b/plat/common/plat_gicv2.c
@@ -3,13 +3,15 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
#include <assert.h>
-#include <gic_common.h>
-#include <gicv2.h>
-#include <interrupt_mgmt.h>
-#include <platform.h>
#include <stdbool.h>
+#include <bl31/interrupt_mgmt.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gicv2.h>
+#include <plat/common/platform.h>
+
/*
* The following platform GIC functions are weakly defined. They
* provide typical implementations that may be re-used by multiple
diff --git a/plat/common/plat_gicv3.c b/plat/common/plat_gicv3.c
index f8277fe5..f5ed6fc9 100644
--- a/plat/common/plat_gicv3.c
+++ b/plat/common/plat_gicv3.c
@@ -3,16 +3,18 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch_helpers.h>
+
#include <assert.h>
-#include <bl_common.h>
-#include <cassert.h>
-#include <gic_common.h>
-#include <gicv3.h>
-#include <interrupt_mgmt.h>
-#include <platform.h>
#include <stdbool.h>
+#include <arch_helpers.h>
+#include <common/bl_common.h>
+#include <bl31/interrupt_mgmt.h>
+#include <drivers/arm/gic_common.h>
+#include <drivers/arm/gicv3.h>
+#include <lib/cassert.h>
+#include <plat/common/platform.h>
+
#ifdef IMAGE_BL31
/*
diff --git a/plat/common/plat_log_common.c b/plat/common/plat_log_common.c
index c757c6bf..66b9758b 100644
--- a/plat/common/plat_log_common.c
+++ b/plat/common/plat_log_common.c
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <debug.h>
-#include <platform.h>
+#include <common/debug.h>
+#include <plat/common/platform.h>
/* Allow platforms to override the log prefix string */
#pragma weak plat_log_get_prefix
diff --git a/plat/common/plat_psci_common.c b/plat/common/plat_psci_common.c
index fab3c770..1a29d9ca 100644
--- a/plat/common/plat_psci_common.c
+++ b/plat/common/plat_psci_common.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <arch.h>
#include <assert.h>
-#include <platform.h>
-#include <pmf.h>
-#include <psci.h>
+
+#include <arch.h>
+#include <lib/pmf/pmf.h>
+#include <lib/psci/psci.h>
+#include <plat/common/platform.h>
#if ENABLE_PSCI_STAT && ENABLE_PMF
#pragma weak plat_psci_stat_accounting_start
diff --git a/plat/common/plat_spm_rd.c b/plat/common/plat_spm_rd.c
index 69b9a23f..0c72cb7a 100644
--- a/plat/common/plat_spm_rd.c
+++ b/plat/common/plat_spm_rd.c
@@ -5,13 +5,16 @@
*/
#include <assert.h>
-#include <debug.h>
-#include <fdt_wrappers.h>
+#include <string.h>
+
#include <libfdt.h>
+
#include <platform_def.h>
-#include <sp_res_desc.h>
-#include <string.h>
-#include <object_pool.h>
+
+#include <common/debug.h>
+#include <common/fdt_wrappers.h>
+#include <lib/object_pool.h>
+#include <services/sp_res_desc.h>
/*******************************************************************************
* Resource pool
diff --git a/plat/common/plat_spm_sp.c b/plat/common/plat_spm_sp.c
index 7b7fbd98..ce482799 100644
--- a/plat/common/plat_spm_sp.c
+++ b/plat/common/plat_spm_sp.c
@@ -5,9 +5,11 @@
*/
#include <assert.h>
-#include <debug.h>
+
#include <platform_def.h>
-#include <sptool.h>
+
+#include <common/debug.h>
+#include <tools_share/sptool.h>
static unsigned int sp_next;
diff --git a/plat/common/tbbr/plat_tbbr.c b/plat/common/tbbr/plat_tbbr.c
index f5a4f315..12ab0a9e 100644
--- a/plat/common/tbbr/plat_tbbr.c
+++ b/plat/common/tbbr/plat_tbbr.c
@@ -5,14 +5,15 @@
*/
#include <assert.h>
-#include <auth/auth_mod.h>
-#include <platform.h>
+#include <string.h>
+
+#include <drivers/auth/auth_mod.h>
+#include <plat/common/platform.h>
#if USE_TBBR_DEFS
-#include <tbbr_oid.h>
+#include <tools_share/tbbr_oid.h>
#else
#include <platform_oid.h>
#endif
-#include <string.h>
/*
* Store a new non-volatile counter value. This implementation