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,17 +4,19 @@ ...@@ -4,17 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h>
#include <errno.h>
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <assert.h> #include <common/bl_common.h>
#include <bl_common.h> #include <common/debug.h>
#include <context_mgmt.h> #include <common/runtime_svc.h>
#include <debug.h>
#include <denver.h> #include <denver.h>
#include <errno.h> #include <lib/el3_runtime/context_mgmt.h>
#include <mce.h> #include <mce.h>
#include <memctrl.h> #include <memctrl.h>
#include <runtime_svc.h>
#include <t18x_ari.h> #include <t18x_ari.h>
#include <tegra_private.h> #include <tegra_private.h>
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h> #include <common/bl_common.h>
#include <smmu.h> #include <smmu.h>
#include <tegra_def.h> #include <tegra_def.h>
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
#include <arch.h> #include <arch.h>
#include <asm_macros.S> #include <asm_macros.S>
#include <common_def.h>
#include <memctrl_v2.h> #include <memctrl_v2.h>
#include <plat/common/common_def.h>
#include <tegra_def.h> #include <tegra_def.h>
#define TEGRA186_SMMU_CTX_SIZE 0x420 #define TEGRA186_SMMU_CTX_SIZE 0x420
......
...@@ -4,16 +4,19 @@ ...@@ -4,16 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <delay_timer.h>
#include <flowctrl.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include <flowctrl.h>
#include <pmc.h> #include <pmc.h>
#include <psci.h>
#include <tegra_def.h> #include <tegra_def.h>
#include <tegra_private.h> #include <tegra_private.h>
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h> #include <common/debug.h>
#include <mmio.h> #include <lib/mmio.h>
#include <pmc.h> #include <pmc.h>
#include <tegra_def.h> #include <tegra_def.h>
......
...@@ -5,11 +5,12 @@ ...@@ -5,11 +5,12 @@
*/ */
#include <arch_helpers.h> #include <arch_helpers.h>
#include <bl_common.h> #include <common/bl_common.h>
#include <console.h> #include <drivers/console.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <tegra_def.h> #include <tegra_def.h>
#include <tegra_private.h> #include <tegra_private.h>
#include <xlat_tables_v2.h>
/******************************************************************************* /*******************************************************************************
* The Tegra power domain tree has a single system level power domain i.e. a * The Tegra power domain tree has a single system level power domain i.e. a
......
...@@ -3,11 +3,15 @@ ...@@ -3,11 +3,15 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <console.h>
#include <debug.h>
#include <libfdt.h>
#include <psci.h>
#include <string.h> #include <string.h>
#include <libfdt.h>
#include <common/debug.h>
#include <drivers/console.h>
#include <lib/psci/psci.h>
#include "qemu_private.h" #include "qemu_private.h"
static int append_psci_compatible(void *fdt, int offs, const char *str) static int append_psci_compatible(void *fdt, int offs, const char *str)
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <arch.h> #include <arch.h>
#include <common_def.h> #include <common/tbbr/tbbr_img_def.h>
#include <tbbr_img_def.h> #include <lib/utils_def.h>
#include <utils_def.h> #include <plat/common/common_def.h>
/* Special value used to verify platform parameters from BL2 to BL3-1 */ /* Special value used to verify platform parameters from BL2 to BL3-1 */
#define QEMU_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL #define QEMU_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL
......
...@@ -4,11 +4,14 @@ ...@@ -4,11 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <platform_def.h> #include <platform_def.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include "qemu_private.h" #include "qemu_private.h"
/* Data structure which holds the extents of the trusted SRAM for BL1*/ /* Data structure which holds the extents of the trusted SRAM for BL1*/
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <desc_image_load.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <common/desc_image_load.h>
#include <plat/common/platform.h>
/******************************************************************************* /*******************************************************************************
* Following descriptor provides BL image/ep information that gets used * Following descriptor provides BL image/ep information that gets used
* by BL2 to load the images and also subset of this information is * by BL2 to load the images and also subset of this information is
......
...@@ -3,17 +3,22 @@ ...@@ -3,17 +3,22 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <bl_common.h> #include <string.h>
#include <debug.h>
#include <desc_image_load.h>
#include <optee_utils.h>
#include <libfdt.h> #include <libfdt.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <string.h>
#include <utils.h> #include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <common/desc_image_load.h>
#include <lib/optee_utils.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include "qemu_private.h" #include "qemu_private.h"
......
...@@ -5,11 +5,14 @@ ...@@ -5,11 +5,14 @@
*/ */
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <gic_common.h>
#include <gicv2.h>
#include <platform_def.h> #include <platform_def.h>
#include <platform.h>
#include <common/bl_common.h>
#include <drivers/arm/gic_common.h>
#include <drivers/arm/gicv2.h>
#include <plat/common/platform.h>
#include "qemu_private.h" #include "qemu_private.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 <bl_common.h>
#include <platform_def.h> #include <platform_def.h>
#include <xlat_tables_v2.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include "qemu_private.h" #include "qemu_private.h"
......
...@@ -3,10 +3,12 @@ ...@@ -3,10 +3,12 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <console.h>
#include <pl011.h>
#include <platform_def.h> #include <platform_def.h>
#include <drivers/console.h>
#include <drivers/arm/pl011.h>
#if MULTI_CONSOLE_API #if MULTI_CONSOLE_API
static console_pl011_t console; static console_pl011_t console;
#endif /* MULTI_CONSOLE_API */ #endif /* MULTI_CONSOLE_API */
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <desc_image_load.h> #include <common/desc_image_load.h>
/******************************************************************************* /*******************************************************************************
* This function is a wrapper of a common function which flushes the data * This function is a wrapper of a common function which flushes the data
......
...@@ -5,18 +5,20 @@ ...@@ -5,18 +5,20 @@
*/ */
#include <assert.h> #include <assert.h>
#include <bl_common.h> /* For ARRAY_SIZE */
#include <debug.h>
#include <firmware_image_package.h>
#include <io_driver.h>
#include <io_fip.h>
#include <io_memmap.h>
#include <io_semihosting.h>
#include <io_storage.h>
#include <platform_def.h>
#include <semihosting.h>
#include <string.h> #include <string.h>
#include <platform_def.h>
#include <common/bl_common.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_semihosting.h>
#include <drivers/io/io_storage.h>
#include <lib/semihosting.h>
#include <tools_share/firmware_image_package.h>
/* Semihosting filenames */ /* Semihosting filenames */
#define BL2_IMAGE_NAME "bl2.bin" #define BL2_IMAGE_NAME "bl2.bin"
#define BL31_IMAGE_NAME "bl31.bin" #define BL31_IMAGE_NAME "bl31.bin"
......
...@@ -4,13 +4,15 @@ ...@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <gicv2.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <psci.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/arm/gicv2.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
/* /*
* The secure entry point to be used on warm reset. * The secure entry point to be used on warm reset.
......
...@@ -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,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <platform.h> #include <plat/common/platform.h>
extern char qemu_rotpk_hash[], qemu_rotpk_hash_end[]; extern char qemu_rotpk_hash[], qemu_rotpk_hash_end[];
......
...@@ -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 <assert.h> #include <assert.h>
#include <bl_common.h>
#include <console.h>
#include <debug.h>
#include <gic_common.h>
#include <gicv2.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h>
#include <string.h> #include <string.h>
#include <xlat_tables.h>
#include <platform_def.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/arm/gic_common.h>
#include <drivers/arm/gicv2.h>
#include <drivers/console.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/platform.h>
#include "../qemu_private.h" #include "../qemu_private.h"
#if RESET_TO_SP_MIN #if RESET_TO_SP_MIN
......
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