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,13 +4,15 @@ ...@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h>
#include <gicv3.h>
#include <interrupt_props.h>
#include <k3_gicv3.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <utils.h>
#include <common/bl_common.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gicv3.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <k3_gicv3.h>
/* The GICv3 driver only needs to be initialized in EL3 */ /* The GICv3 driver only needs to be initialized in EL3 */
uintptr_t rdistif_base_addrs[PLATFORM_CORE_COUNT]; uintptr_t rdistif_base_addrs[PLATFORM_CORE_COUNT];
......
...@@ -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 <cpu_data.h>
#include <debug.h>
#include <k3_gicv3.h>
#include <psci.h>
/* Need to flush psci internal locks before shutdown or their values are lost */
#include <../../lib/psci/psci_private.h>
#include <platform.h>
#include <stdbool.h> #include <stdbool.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/el3_runtime/cpu_data.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include <k3_gicv3.h>
#include <ti_sci.h> #include <ti_sci.h>
/* Need to flush psci internal locks before shutdown or their values are lost */
#include "../../../../lib/psci/psci_private.h"
#define STUB() ERROR("stub %s called\n", __func__) #define STUB() ERROR("stub %s called\n", __func__)
uintptr_t k3_sec_entrypoint; uintptr_t k3_sec_entrypoint;
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
*/ */
#include <platform_def.h> #include <platform_def.h>
#include <psci.h>
#include <lib/psci/psci.h>
/* The power domain tree descriptor */ /* The power domain tree descriptor */
static unsigned char power_domain_tree_desc[] = { static unsigned char power_domain_tree_desc[] = {
......
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <arch.h> #include <arch.h>
#include <plat/common/common_def.h>
#include <board_def.h> #include <board_def.h>
#include <common_def.h>
/******************************************************************************* /*******************************************************************************
* Generic platform constants * Generic platform constants
......
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h> #include <common/debug.h>
#include <generic_delay_timer.h> #include <drivers/generic_delay_timer.h>
#include <mmio.h> #include <lib/mmio.h>
#include <platform.h> #include <lib/xlat_tables/xlat_tables.h>
#include <xlat_tables.h> #include <plat/common/platform.h>
#include "../versal_def.h" #include "../versal_def.h"
#include "../versal_private.h" #include "../versal_private.h"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <arch.h> #include <arch.h>
#include <asm_macros.S> #include <asm_macros.S>
#include <gicv3.h> #include <drivers/arm/gicv3.h>
#include <platform_def.h> #include <platform_def.h>
.globl plat_secondary_cold_boot_setup .globl plat_secondary_cold_boot_setup
......
...@@ -5,14 +5,16 @@ ...@@ -5,14 +5,16 @@
*/ */
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <bl31.h>
#include <console.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <platform.h>
#include <pl011.h> #include <bl31/bl31.h>
#include <xlat_tables.h> #include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/arm/pl011.h>
#include <drivers/console.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/platform.h>
#include "versal_private.h" #include "versal_private.h"
static entry_point_info_t bl32_image_ep_info; static entry_point_info_t bl32_image_ep_info;
......
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
#ifndef PLAT_MACROS_S #ifndef PLAT_MACROS_S
#define PLAT_MACROS_S #define PLAT_MACROS_S
#include <drivers/arm/gic_common.h>
#include <drivers/arm/gicv2.h>
#include <drivers/arm/gicv3.h>
#include "../include/platform_def.h" #include "../include/platform_def.h"
#include <gic_common.h>
#include <gicv2.h>
#include <gicv3.h>
.section .rodata.gic_reg_name, "aS" .section .rodata.gic_reg_name, "aS"
/* Applicable only to GICv2 and GICv3 with SRE disabled (legacy mode) */ /* Applicable only to GICv2 and GICv3 with SRE disabled (legacy mode) */
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <arch.h> #include <arch.h>
#include "../versal_def.h" #include "../versal_def.h"
/******************************************************************************* /*******************************************************************************
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
* 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 <platform.h> #include <lib/psci/psci.h>
#include <psci.h> #include <plat/common/platform.h>
#include "versal_private.h" #include "versal_private.h"
static uintptr_t versal_sec_entry; static uintptr_t versal_sec_entry;
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <platform.h>
#include <plat/common/platform.h>
#include "versal_private.h" #include "versal_private.h"
int plat_core_pos_by_mpidr(u_register_t mpidr) int plat_core_pos_by_mpidr(u_register_t mpidr)
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
/* Top level SMC handler for SiP calls. Dispatch PM calls to PM SMC handler. */ /* Top level SMC handler for SiP calls. Dispatch PM calls to PM SMC handler. */
#include <debug.h> #include <common/debug.h>
#include <runtime_svc.h> #include <common/runtime_svc.h>
#include <uuid.h> #include <tools_share/uuid.h>
/* SMC function IDs for SiP Service queries */ /* SMC function IDs for SiP Service queries */
#define VERSAL_SIP_SVC_CALL_COUNT 0x8200ff00 #define VERSAL_SIP_SVC_CALL_COUNT 0x8200ff00
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef VERSAL_DEF_H #ifndef VERSAL_DEF_H
#define VERSAL_DEF_H #define VERSAL_DEF_H
#include <common_def.h> #include <plat/common/common_def.h>
/* List all consoles */ /* List all consoles */
#define VERSAL_CONSOLE_ID_pl011 1 #define VERSAL_CONSOLE_ID_pl011 1
......
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <gicv3.h>
#include <interrupt_props.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <utils.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gicv3.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include "versal_private.h" #include "versal_private.h"
/****************************************************************************** /******************************************************************************
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef VERSAL_PRIVATE_H #ifndef VERSAL_PRIVATE_H
#define VERSAL_PRIVATE_H #define VERSAL_PRIVATE_H
#include <xlat_tables.h> #include <lib/xlat_tables/xlat_tables.h>
void versal_config_setup(void); void versal_config_setup(void);
......
...@@ -4,13 +4,15 @@ ...@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <generic_delay_timer.h>
#include <mmio.h>
#include <platform.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include <xlat_tables.h>
#include <common/debug.h>
#include <drivers/generic_delay_timer.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/platform.h>
#include "../zynqmp_private.h" #include "../zynqmp_private.h"
#include "pm_api_sys.h" #include "pm_api_sys.h"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
#include <asm_macros.S> #include <asm_macros.S>
#include <gicv2.h> #include <drivers/arm/gicv2.h>
#include <platform_def.h> #include <platform_def.h>
.globl plat_secondary_cold_boot_setup .globl plat_secondary_cold_boot_setup
......
...@@ -5,13 +5,15 @@ ...@@ -5,13 +5,15 @@
*/ */
#include <assert.h> #include <assert.h>
#include <bl31.h>
#include <bl_common.h>
#include <console.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <bl31/bl31.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/console.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform.h> #include <plat/common/platform.h>
#include "zynqmp_private.h" #include "zynqmp_private.h"
#define BL31_END (unsigned long)(&__BL31_END__) #define BL31_END (unsigned long)(&__BL31_END__)
......
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <arch.h> #include <arch.h>
#include <gic_common.h> #include <common/interrupt_props.h>
#include <interrupt_props.h> #include <drivers/arm/gic_common.h>
#include <utils_def.h> #include <lib/utils_def.h>
#include "../zynqmp_def.h" #include "../zynqmp_def.h"
/******************************************************************************* /*******************************************************************************
......
...@@ -8,12 +8,14 @@ ...@@ -8,12 +8,14 @@
* Top-level SMC handler for ZynqMP IPI Mailbox doorbell functions. * Top-level SMC handler for ZynqMP IPI Mailbox doorbell functions.
*/ */
#include <bakery_lock.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <mmio.h>
#include <runtime_svc.h>
#include <string.h> #include <string.h>
#include <common/debug.h>
#include <common/runtime_svc.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include "ipi_mailbox_svc.h" #include "ipi_mailbox_svc.h"
#include "../zynqmp_ipi.h" #include "../zynqmp_ipi.h"
#include "../zynqmp_private.h" #include "../zynqmp_private.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