Commit 09d40e0e authored by Antonio Nino Diaz's avatar Antonio Nino Diaz
Browse files

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: e0ea0928 ("Fix gpio includes of mt8173 platform
to avoid collision."). More recently, this patch has had similar
problems: 46f9b2c3 ("drivers: add tzc380 support").

This problem was introduced in commit 4ecca339

 ("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: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
parent f5478ded
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <generic_delay_timer.h> #include <drivers/arm/sp804_delay_timer.h>
#include <mmio.h> #include <drivers/generic_delay_timer.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform.h>
#include <sp804_delay_timer.h>
#include <v2m_def.h> #include <v2m_def.h>
#include "fvp_def.h" #include "fvp_def.h"
#include "fvp_private.h" #include "fvp_private.h"
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <plat/common/platform.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform.h>
#include "fvp_def.h" #include "fvp_def.h"
#include "fvp_private.h" #include "fvp_private.h"
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <drivers/arm/smmu_v3.h>
#include <plat/common/platform.h>
#include <arm_config.h> #include <arm_config.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform.h>
#include <smmu_v3.h>
#include "fvp_private.h" #include "fvp_private.h"
void __init bl31_early_platform_setup2(u_register_t arg0, void __init bl31_early_platform_setup2(u_register_t arg0,
......
...@@ -4,20 +4,22 @@ ...@@ -4,20 +4,22 @@
* SPDX-License-Identifier: BSD-3-Clause * 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_config.h>
#include <arm_def.h> #include <arm_def.h>
#include <arm_spm_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 <plat_arm.h>
#include <platform.h>
#include <secure_partition.h>
#include <v2m_def.h> #include <v2m_def.h>
#include <xlat_tables_compat.h>
#include "../fvp_def.h" #include "../fvp_def.h"
#include "fvp_private.h" #include "fvp_private.h"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef FVP_DEF_H #ifndef FVP_DEF_H
#define FVP_DEF_H #define FVP_DEF_H
#include <utils_def.h> #include <lib/utils_def.h>
#ifndef FVP_CLUSTER_COUNT #ifndef FVP_CLUSTER_COUNT
#define FVP_CLUSTER_COUNT 2 #define FVP_CLUSTER_COUNT 2
......
...@@ -5,13 +5,15 @@ ...@@ -5,13 +5,15 @@
*/ */
#include <assert.h> #include <assert.h>
#include <common_def.h>
#include <debug.h> #include <common/debug.h>
#include <io_driver.h> #include <drivers/io/io_driver.h>
#include <io_semihosting.h> #include <drivers/io/io_semihosting.h>
#include <io_storage.h> #include <drivers/io/io_storage.h>
#include <lib/semihosting.h>
#include <plat/common/common_def.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <semihosting.h> /* For FOPEN_MODE_... */
/* Semihosting filenames */ /* Semihosting filenames */
#define BL2_IMAGE_NAME "bl2.bin" #define BL2_IMAGE_NAME "bl2.bin"
......
...@@ -4,18 +4,21 @@ ...@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <arm_config.h>
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <errno.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 <plat_arm.h>
#include <platform.h>
#include <psci.h>
#include <spe.h>
#include <v2m_def.h> #include <v2m_def.h>
#include "../../../../drivers/arm/gic/v3/gicv3_private.h" #include "../../../../drivers/arm/gic/v3/gicv3_private.h"
#include "drivers/pwrc/fvp_pwrc.h" #include "drivers/pwrc/fvp_pwrc.h"
#include "fvp_def.h" #include "fvp_def.h"
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <platform.h>
#include <stdint.h> #include <stdint.h>
#include <arch_helpers.h>
#include <plat/common/platform.h>
#define RANDOM_CANARY_VALUE ((u_register_t) 3288484550995823360ULL) #define RANDOM_CANARY_VALUE ((u_register_t) 3288484550995823360ULL)
u_register_t plat_get_stack_protector_canary(void) u_register_t plat_get_stack_protector_canary(void)
......
...@@ -4,12 +4,14 @@ ...@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <platform_def.h>
#include <arch.h> #include <arch.h>
#include <arm_config.h> #include <lib/cassert.h>
#include <cassert.h> #include <plat/common/platform.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform.h> #include <arm_config.h>
#include <platform_def.h>
#include "drivers/pwrc/fvp_pwrc.h" #include "drivers/pwrc/fvp_pwrc.h"
/* The FVP power domain tree descriptor */ /* The FVP power domain tree descriptor */
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#include <assert.h> #include <assert.h>
#include <stdint.h> #include <stdint.h>
#include <string.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" #include "fvp_def.h"
......
...@@ -18,12 +18,14 @@ ...@@ -18,12 +18,14 @@
# endif # endif
#endif /* AARCH32 */ #endif /* AARCH32 */
#include <drivers/arm/tzc400.h>
#include <lib/utils_def.h>
#include <plat/common/common_def.h>
#include <arm_def.h> #include <arm_def.h>
#include <arm_spm_def.h> #include <arm_spm_def.h>
#include <common_def.h>
#include <tzc400.h>
#include <utils_def.h>
#include <v2m_def.h> #include <v2m_def.h>
#include "../fvp_def.h" #include "../fvp_def.h"
/* Required platform porting definitions */ /* Required platform porting definitions */
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <arch.h> #include <arch.h>
#include <asm_macros.S> #include <asm_macros.S>
#include <bl_common.h> #include <common/bl_common.h>
#include <cortex_a53.h> #include <cortex_a53.h>
#include <cortex_a57.h> #include <cortex_a57.h>
#include <cortex_a72.h> #include <cortex_a72.h>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <arch.h> #include <arch.h>
#include <asm_macros.S> #include <asm_macros.S>
#include <bl_common.h> #include <common/bl_common.h>
#include <cortex_a53.h> #include <cortex_a53.h>
#include <cortex_a57.h> #include <cortex_a57.h>
#include <cortex_a72.h> #include <cortex_a72.h>
......
...@@ -19,15 +19,16 @@ ...@@ -19,15 +19,16 @@
#endif /* AARCH32 */ #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 <arm_def.h>
#include <board_css_def.h> #include <board_css_def.h>
#include <common_def.h>
#include <css_def.h> #include <css_def.h>
#if TRUSTED_BOARD_BOOT
#include <mbedtls_config.h>
#endif
#include <soc_css_def.h> #include <soc_css_def.h>
#include <tzc400.h>
#include <v2m_def.h> #include <v2m_def.h>
#include "../juno_def.h" #include "../juno_def.h"
......
...@@ -4,14 +4,16 @@ ...@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h>
#include <debug.h>
#include <errno.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 <plat_arm.h>
#include <platform.h>
#include <sds.h> #include <sds.h>
#include <sp805.h>
#include <tbbr_img_def.h>
#include <v2m_def.h> #include <v2m_def.h>
void juno_reset_to_aarch32_state(void); void juno_reset_to_aarch32_state(void);
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
*/ */
#include <assert.h> #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> #include <plat_arm.h>
#if JUNO_AARCH32_EL3_RUNTIME #if JUNO_AARCH32_EL3_RUNTIME
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef JUNO_DEF_H #ifndef JUNO_DEF_H
#define JUNO_DEF_H #define JUNO_DEF_H
#include <utils_def.h> #include <lib/utils_def.h>
/******************************************************************************* /*******************************************************************************
* Juno memory map related constants * Juno memory map related constants
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <errno.h> #include <errno.h>
#include <platform.h>
#include <arch_helpers.h>
#include <plat/common/platform.h>
#include <v2m_def.h> #include <v2m_def.h>
/* /*
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h> #include <common/debug.h>
#include <mmio.h> #include <drivers/arm/nic_400.h>
#include <nic_400.h> #include <lib/mmio.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <soc_css.h> #include <soc_css.h>
#include "juno_def.h" #include "juno_def.h"
#include "juno_tzmp1_def.h" #include "juno_tzmp1_def.h"
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
*/ */
#include <arch_helpers.h> #include <arch_helpers.h>
#include <debug.h> #include <common/debug.h>
#include <utils.h> #include <lib/utils.h>
#include "juno_decl.h" #include "juno_decl.h"
#include "juno_def.h" #include "juno_def.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment