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
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
*/ */
#include <asm_macros.S> #include <asm_macros.S>
#include <console.h> #include <drivers/console.h>
.globl plat_crash_console_init .globl plat_crash_console_init
.globl plat_crash_console_putc .globl plat_crash_console_putc
......
...@@ -4,14 +4,15 @@ ...@@ -4,14 +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 <console.h>
#include <platform.h> #include <arch_helpers.h>
#include <drivers/console.h>
#if RAS_EXTENSION #if RAS_EXTENSION
#include <ras.h> #include <lib/extensions/ras.h>
#endif #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 * The following platform setup functions are weakly defined. They
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <arch.h> #include <arch.h>
#include <asm_macros.S> #include <asm_macros.S>
#include <console.h> #include <drivers/console.h>
#include <platform_def.h> #include <platform_def.h>
.weak plat_report_exception .weak plat_report_exception
......
...@@ -4,15 +4,17 @@ ...@@ -4,15 +4,17 @@
* 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 <bl1.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <platform.h>
#include <platform_def.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 * The following platform functions are weakly defined. They
* are default implementations that allow BL1 to compile in * are default implementations that allow BL1 to compile in
......
...@@ -4,16 +4,17 @@ ...@@ -4,16 +4,17 @@
* 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 <debug.h>
#include <errno.h> #include <errno.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#if TRUSTED_BOARD_BOOT #if TRUSTED_BOARD_BOOT
#include <mbedtls_config.h> #include <drivers/auth/mbedtls/mbedtls_config.h>
#endif #endif
#include <platform.h> #include <lib/xlat_tables/xlat_tables_compat.h>
#include <xlat_tables_compat.h> #include <plat/common/platform.h>
/* /*
* The following platform functions are weakly defined. The Platforms * The following platform functions are weakly defined. The Platforms
......
...@@ -3,13 +3,15 @@ ...@@ -3,13 +3,15 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h> #include <assert.h>
#include <gic_common.h>
#include <gicv2.h>
#include <interrupt_mgmt.h>
#include <platform.h>
#include <stdbool.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 * The following platform GIC functions are weakly defined. They
* provide typical implementations that may be re-used by multiple * provide typical implementations that may be re-used by multiple
......
...@@ -3,16 +3,18 @@ ...@@ -3,16 +3,18 @@
* *
* 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 <cassert.h>
#include <gic_common.h>
#include <gicv3.h>
#include <interrupt_mgmt.h>
#include <platform.h>
#include <stdbool.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 #ifdef IMAGE_BL31
/* /*
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h> #include <common/debug.h>
#include <platform.h> #include <plat/common/platform.h>
/* Allow platforms to override the log prefix string */ /* Allow platforms to override the log prefix string */
#pragma weak plat_log_get_prefix #pragma weak plat_log_get_prefix
......
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <assert.h> #include <assert.h>
#include <platform.h>
#include <pmf.h> #include <arch.h>
#include <psci.h> #include <lib/pmf/pmf.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#if ENABLE_PSCI_STAT && ENABLE_PMF #if ENABLE_PSCI_STAT && ENABLE_PMF
#pragma weak plat_psci_stat_accounting_start #pragma weak plat_psci_stat_accounting_start
......
...@@ -5,13 +5,16 @@ ...@@ -5,13 +5,16 @@
*/ */
#include <assert.h> #include <assert.h>
#include <debug.h> #include <string.h>
#include <fdt_wrappers.h>
#include <libfdt.h> #include <libfdt.h>
#include <platform_def.h> #include <platform_def.h>
#include <sp_res_desc.h>
#include <string.h> #include <common/debug.h>
#include <object_pool.h> #include <common/fdt_wrappers.h>
#include <lib/object_pool.h>
#include <services/sp_res_desc.h>
/******************************************************************************* /*******************************************************************************
* Resource pool * Resource pool
......
...@@ -5,9 +5,11 @@ ...@@ -5,9 +5,11 @@
*/ */
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <platform_def.h> #include <platform_def.h>
#include <sptool.h>
#include <common/debug.h>
#include <tools_share/sptool.h>
static unsigned int sp_next; static unsigned int sp_next;
......
...@@ -5,14 +5,15 @@ ...@@ -5,14 +5,15 @@
*/ */
#include <assert.h> #include <assert.h>
#include <auth/auth_mod.h> #include <string.h>
#include <platform.h>
#include <drivers/auth/auth_mod.h>
#include <plat/common/platform.h>
#if USE_TBBR_DEFS #if USE_TBBR_DEFS
#include <tbbr_oid.h> #include <tools_share/tbbr_oid.h>
#else #else
#include <platform_oid.h> #include <platform_oid.h>
#endif #endif
#include <string.h>
/* /*
* Store a new non-volatile counter value. This implementation * Store a new non-volatile counter value. This implementation
......
...@@ -4,15 +4,17 @@ ...@@ -4,15 +4,17 @@
* 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 <debug.h> #include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/platform.h>
#include <hikey_def.h> #include <hikey_def.h>
#include <hikey_layout.h> #include <hikey_layout.h>
#include <mmio.h>
#include <platform.h>
#include <xlat_tables.h>
#define MAP_DDR MAP_REGION_FLAT(DDR_BASE, \ #define MAP_DDR MAP_REGION_FLAT(DDR_BASE, \
DDR_SIZE - DDR_SEC_SIZE, \ DDR_SIZE - DDR_SEC_SIZE, \
......
...@@ -4,23 +4,25 @@ ...@@ -4,23 +4,25 @@
* 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 <debug.h>
#include <dw_mmc.h>
#include <errno.h> #include <errno.h>
#include <string.h>
#include <arch_helpers.h>
#include <bl1/tbbr/tbbr_img_desc.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/arm/pl011.h>
#include <drivers/mmc.h>
#include <drivers/synopsys/dw_mmc.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <hi6220.h> #include <hi6220.h>
#include <hikey_def.h> #include <hikey_def.h>
#include <hikey_layout.h> #include <hikey_layout.h>
#include <mmc.h>
#include <mmio.h>
#include <pl011.h>
#include <platform.h>
#include <string.h>
#include <tbbr/tbbr_img_desc.h>
#include "../../bl1/bl1_private.h" #include "../../../bl1/bl1_private.h"
#include "hikey_private.h" #include "hikey_private.h"
/* Data structure which holds the extents of the trusted RAM for BL1 */ /* Data structure which holds the extents of the trusted RAM for BL1 */
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h>
#include <desc_image_load.h>
#include <platform.h>
#include <platform_def.h> /* also includes hikey_def.h and hikey_layout.h*/ #include <platform_def.h> /* also includes hikey_def.h and hikey_layout.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 * Following descriptor provides BL image/ep information that gets used
......
...@@ -4,27 +4,29 @@ ...@@ -4,27 +4,29 @@
* 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 <debug.h>
#include <delay_timer.h>
#include <desc_image_load.h>
#include <dw_mmc.h>
#include <errno.h> #include <errno.h>
#include <hi6220.h> #include <string.h>
#include <hisi_mcu.h>
#include <hisi_sram_map.h> #include <platform_def.h> /* also includes hikey_def.h and hikey_layout.h*/
#include <mmc.h>
#include <mmio.h> #include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <common/desc_image_load.h>
#include <drivers/arm/pl011.h>
#include <drivers/delay_timer.h>
#include <drivers/mmc.h>
#include <drivers/synopsys/dw_mmc.h>
#include <lib/mmio.h>
#ifdef SPD_opteed #ifdef SPD_opteed
#include <optee_utils.h> #include <lib/optee_utils.h>
#endif #endif
#include <pl011.h> #include <plat/common/platform.h>
#include <platform.h>
#include <platform_def.h> /* also includes hikey_def.h and hikey_layout.h*/
#include <string.h>
#include <hi6220.h>
#include <hisi_mcu.h>
#include <hisi_sram_map.h>
#include "hikey_private.h" #include "hikey_private.h"
/* /*
......
...@@ -4,21 +4,24 @@ ...@@ -4,21 +4,24 @@
* 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 <cci.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <gicv2.h>
#include <platform_def.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <common/interrupt_props.h>
#include <drivers/arm/cci.h>
#include <drivers/arm/gicv2.h>
#include <drivers/arm/pl011.h>
#include <lib/mmio.h>
#include <hi6220.h> #include <hi6220.h>
#include <hikey_def.h> #include <hikey_def.h>
#include <hisi_ipc.h> #include <hisi_ipc.h>
#include <hisi_pwrc.h> #include <hisi_pwrc.h>
#include <interrupt_props.h>
#include <mmio.h>
#include <pl011.h>
#include <platform_def.h>
#include "hikey_private.h" #include "hikey_private.h"
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
*/ */
#include <arch_helpers.h> #include <arch_helpers.h>
#include <gpio.h> #include <drivers/arm/pl061_gpio.h>
#include <drivers/arm/sp804_delay_timer.h>
#include <drivers/gpio.h>
#include <lib/mmio.h>
#include <hi6220.h> #include <hi6220.h>
#include <hi6553.h> #include <hi6553.h>
#include <mmio.h>
#include <pl061_gpio.h>
#include <sp804_delay_timer.h>
#include "hikey_private.h" #include "hikey_private.h"
void hikey_sp804_init(void) void hikey_sp804_init(void)
......
...@@ -4,16 +4,17 @@ ...@@ -4,16 +4,17 @@
* 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 <errno.h> #include <errno.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/arm/sp804_delay_timer.h>
#include <lib/mmio.h>
#include <hi6220.h> #include <hi6220.h>
#include <hi6553.h> #include <hi6553.h>
#include <hisi_sram_map.h> #include <hisi_sram_map.h>
#include <mmio.h>
#include <sp804_delay_timer.h>
#include "hikey_private.h" #include "hikey_private.h"
static void init_pll(void) static void init_pll(void)
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h> #include <common/bl_common.h>
#include <desc_image_load.h> #include <common/desc_image_load.h>
#include <platform.h> #include <plat/common/platform.h>
/******************************************************************************* /*******************************************************************************
* This function flushes the data structures so that they are visible * This function flushes the data structures so that they are visible
......
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