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,25 +4,27 @@ ...@@ -4,25 +4,27 @@
* 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_ufs.h>
#include <errno.h> #include <errno.h>
#include <generic_delay_timer.h> #include <string.h>
#include <hi3660.h>
#include <mmio.h> #include <platform_def.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/dw_ufs.h>
#include <drivers/generic_delay_timer.h>
#include <drivers/ufs.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 <platform_def.h>
#include <string.h>
#include <ufs.h>
#include <hi3660.h>
#include "hikey960_def.h" #include "hikey960_def.h"
#include "hikey960_private.h" #include "hikey960_private.h"
......
...@@ -4,24 +4,26 @@ ...@@ -4,24 +4,26 @@
* 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 <console.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <generic_delay_timer.h>
#include <gicv2.h>
#include <hi3660.h>
#include <mmio.h>
#include <hisi_ipc.h>
#include <interrupt_mgmt.h>
#include <interrupt_props.h>
#include <pl011.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <arch_helpers.h>
#include <bl31/interrupt_mgmt.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 <drivers/console.h>
#include <drivers/generic_delay_timer.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <hi3660.h>
#include <hisi_ipc.h>
#include "hikey960_def.h" #include "hikey960_def.h"
#include "hikey960_private.h" #include "hikey960_private.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 <delay_timer.h> #include <drivers/arm/pl061_gpio.h>
#include <hi3660.h> #include <drivers/delay_timer.h>
#include <mmio.h> #include <lib/mmio.h>
#include <pl061_gpio.h>
#include <hi3660.h>
#include "hikey960_private.h" #include "hikey960_private.h"
void hikey960_clk_init(void) void hikey960_clk_init(void)
......
...@@ -5,12 +5,13 @@ ...@@ -5,12 +5,13 @@
*/ */
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <delay_timer.h>
#include <errno.h> #include <errno.h>
#include <hi3660.h>
#include <mmio.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <hi3660.h>
#include "hikey960_private.h" #include "hikey960_private.h"
#define ADC_ADCIN0 0 #define ADC_ADCIN0 0
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#ifndef HIKEY960_DEF_H #ifndef HIKEY960_DEF_H
#define HIKEY960_DEF_H #define HIKEY960_DEF_H
#include <common_def.h> #include <common/tbbr/tbbr_img_def.h>
#include <tbbr_img_def.h> #include <plat/common/common_def.h>
#define DDR_BASE 0x0 #define DDR_BASE 0x0
#define DDR_SIZE 0xC0000000 #define DDR_SIZE 0xC0000000
......
...@@ -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
......
...@@ -4,21 +4,23 @@ ...@@ -4,21 +4,23 @@
* 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 <firmware_image_package.h>
#include <io_block.h>
#include <io_driver.h>
#include <io_fip.h>
#include <io_memmap.h>
#include <io_storage.h>
#include <mmio.h>
#include <platform_def.h>
#include <semihosting.h> /* For FOPEN_MODE_... */
#include <string.h> #include <string.h>
#include <ufs.h>
#include <platform_def.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/ufs.h>
#include <drivers/io/io_block.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_fip.h>
#include <drivers/io/io_memmap.h>
#include <drivers/io/io_storage.h>
#include <lib/mmio.h>
#include <lib/semihosting.h>
#include <tools_share/firmware_image_package.h>
struct plat_io_policy { struct plat_io_policy {
uintptr_t *dev_handle; uintptr_t *dev_handle;
......
...@@ -4,16 +4,18 @@ ...@@ -4,16 +4,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 <debug.h>
#include <delay_timer.h>
#include <errno.h> #include <errno.h>
#include <hi3660.h>
#include <mmio.h>
#include <string.h> #include <string.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <hi3660.h>
#define ADDR_CONVERT(addr) ((addr) < 0x40000 ? \ #define ADDR_CONVERT(addr) ((addr) < 0x40000 ? \
(addr) + 0xFFF30000 : \ (addr) + 0xFFF30000 : \
(addr) + 0x40000000) (addr) + 0x40000000)
......
...@@ -4,19 +4,21 @@ ...@@ -4,19 +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 <cci.h>
#include <debug.h> #include <arch_helpers.h>
#include <delay_timer.h> #include <common/debug.h>
#include <gicv2.h> #include <drivers/arm/cci.h>
#include <drivers/arm/gicv2.h>
#include <drivers/arm/pl011.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <hi3660.h> #include <hi3660.h>
#include <hi3660_crg.h> #include <hi3660_crg.h>
#include <mmio.h>
#include <pl011.h>
#include <psci.h>
#include "drivers/pwrc/hisi_pwrc.h"
#include "drivers/pwrc/hisi_pwrc.h"
#include "hikey960_def.h" #include "hikey960_def.h"
#include "hikey960_private.h" #include "hikey960_private.h"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef HIKEY960_PRIVATE_H #ifndef HIKEY960_PRIVATE_H
#define HIKEY960_PRIVATE_H #define HIKEY960_PRIVATE_H
#include <bl_common.h> #include <common/bl_common.h>
/* /*
* Function and variable prototypes * Function and variable prototypes
......
...@@ -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 hikey960_rotpk_hash[], hikey960_rotpk_hash_end[]; extern char hikey960_rotpk_hash[], hikey960_rotpk_hash_end[];
......
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <platform_def.h> #include <platform_def.h>
#include <psci.h>
#include <arch.h>
#include <lib/psci/psci.h>
/* /*
* The HiKey power domain tree descriptor. The cluster power domains * The HiKey power domain tree descriptor. The cluster power domains
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#ifndef PLAT_MACROS_S #ifndef PLAT_MACROS_S
#define PLAT_MACROS_S #define PLAT_MACROS_S
#include <cci.h> #include <drivers/arm/cci.h>
#include <gicv2.h> #include <drivers/arm/gicv2.h>
#include <hi3660.h> #include <hi3660.h>
#include <platform_def.h> #include <platform_def.h>
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <arch.h> #include <arch.h>
#include <utils_def.h> #include <lib/utils_def.h>
#include "../hikey960_def.h" #include "../hikey960_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 */
......
...@@ -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 <delay_timer.h>
#include <errno.h> #include <errno.h>
#include <mmio.h>
#include <platform.h> #include <arch_helpers.h>
#include <xlat_tables.h> #include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/platform.h>
#include "hi3798cv200.h" #include "hi3798cv200.h"
#include "platform_def.h" #include "platform_def.h"
......
...@@ -4,22 +4,25 @@ ...@@ -4,22 +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 <generic_delay_timer.h>
#include <mmc.h>
#include <mmio.h>
#include <pl011.h>
#include <pl061_gpio.h>
#include <platform.h>
#include <platform_def.h>
#include <string.h> #include <string.h>
#include <tbbr_img_def.h>
#include "../../bl1/bl1_private.h" #include <platform_def.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <common/tbbr/tbbr_img_def.h>
#include <drivers/arm/pl011.h>
#include <drivers/arm/pl061_gpio.h>
#include <drivers/generic_delay_timer.h>
#include <drivers/mmc.h>
#include <drivers/synopsys/dw_mmc.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include "../../../bl1/bl1_private.h"
#include "hi3798cv200.h" #include "hi3798cv200.h"
#include "plat_private.h" #include "plat_private.h"
......
...@@ -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> #include <platform_def.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,21 +4,23 @@ ...@@ -4,21 +4,23 @@
* 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 <desc_image_load.h>
#include <dw_mmc.h>
#include <errno.h> #include <errno.h>
#include <generic_delay_timer.h>
#include <mmc.h>
#include <mmio.h>
#include <optee_utils.h>
#include <partition/partition.h>
#include <pl011.h>
#include <platform.h>
#include <string.h> #include <string.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/generic_delay_timer.h>
#include <drivers/partition/partition.h>
#include <drivers/synopsys/dw_mmc.h>
#include <drivers/mmc.h>
#include <lib/mmio.h>
#include <lib/optee_utils.h>
#include <plat/common/platform.h>
#include "hi3798cv200.h" #include "hi3798cv200.h"
#include "plat_private.h" #include "plat_private.h"
......
...@@ -4,21 +4,24 @@ ...@@ -4,21 +4,24 @@
* 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 <bl31.h>
#include <bl_common.h>
#include <cortex_a53.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <generic_delay_timer.h>
#include <mmio.h>
#include <pl011.h>
#include <platform.h>
#include <platform_def.h>
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include <platform_def.h>
#include <arch.h>
#include <arch_helpers.h>
#include <bl31/bl31.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <cortex_a53.h>
#include <drivers/arm/pl011.h>
#include <drivers/generic_delay_timer.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include "hi3798cv200.h" #include "hi3798cv200.h"
#include "plat_private.h" #include "plat_private.h"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef HI3798CV200_H #ifndef HI3798CV200_H
#define HI3798CV200_H #define HI3798CV200_H
#include <utils_def.h> #include <lib/utils_def.h>
/* PL011 */ /* PL011 */
#define PL011_UART0_BASE (0xF8B00000) #define PL011_UART0_BASE (0xF8B00000)
......
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