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,16 @@ ...@@ -4,13 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <css_def.h>
#include <debug.h>
#include <delay_timer.h>
#include <platform.h>
#include <stdint.h> #include <stdint.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <plat/common/platform.h>
#include <css_def.h>
#include "css_scp.h" #include "css_scp.h"
#include "../sds/sds.h" #include "../sds/sds.h"
......
...@@ -4,13 +4,16 @@ ...@@ -4,13 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <css_def.h>
#include <debug.h>
#include <platform.h>
#include <string.h> #include <string.h>
#include <utils.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <css_def.h>
#include "../mhu/css_mhu.h" #include "../mhu/css_mhu.h"
#include "css_scpi.h" #include "css_scpi.h"
......
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
* 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 <css_def.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <css_def.h>
#include "sds.h" #include "sds.h"
#include "sds_private.h" #include "sds_private.h"
......
...@@ -7,15 +7,16 @@ ...@@ -7,15 +7,16 @@
#ifndef SGI_BASE_PLATFORM_DEF_H #ifndef SGI_BASE_PLATFORM_DEF_H
#define SGI_BASE_PLATFORM_DEF_H #define SGI_BASE_PLATFORM_DEF_H
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_defs.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 <board_css_def.h> #include <board_css_def.h>
#include <common_def.h>
#include <css_def.h> #include <css_def.h>
#include <soc_css_def.h> #include <soc_css_def.h>
#include <utils_def.h>
#include <v2m_def.h> #include <v2m_def.h>
#include <xlat_tables_defs.h>
#define PLATFORM_CORE_COUNT (PLAT_ARM_CLUSTER_COUNT * \ #define PLATFORM_CORE_COUNT (PLAT_ARM_CLUSTER_COUNT * \
CSS_SGI_MAX_CPUS_PER_CLUSTER * \ CSS_SGI_MAX_CPUS_PER_CLUSTER * \
......
...@@ -5,12 +5,16 @@ ...@@ -5,12 +5,16 @@
*/ */
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <debug.h>
#include <libfdt.h> #include <libfdt.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <sgi_ras.h> #include <sgi_ras.h>
#include <sgi_variant.h> #include <sgi_variant.h>
#include "../../css/drivers/scmi/scmi.h" #include "../../css/drivers/scmi/scmi.h"
#include "../../css/drivers/mhu/css_mhu_doorbell.h" #include "../../css/drivers/mhu/css_mhu_doorbell.h"
......
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <debug.h>
#include <desc_image_load.h>
#include <libfdt.h> #include <libfdt.h>
#include <platform.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <common/desc_image_load.h>
#include <plat/common/platform.h>
#include <sgi_variant.h> #include <sgi_variant.h>
/******************************************************************************* /*******************************************************************************
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
*/ */
#include <arch_helpers.h> #include <arch_helpers.h>
#include <debug.h> #include <common/debug.h>
/* /*
* For SGI575 which support FCM (with automatic interconnect enter/exit), * For SGI575 which support FCM (with automatic interconnect enter/exit),
......
...@@ -4,16 +4,19 @@ ...@@ -4,16 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h>
#include <platform_def.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/arm/ccn.h>
#include <plat/common/platform.h>
#include <services/secure_partition.h>
#include <arm_def.h> #include <arm_def.h>
#include <arm_spm_def.h> #include <arm_spm_def.h>
#include <assert.h>
#include <bl_common.h>
#include <ccn.h>
#include <debug.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform_def.h>
#include <platform.h>
#include <secure_partition.h>
#include "../../../../bl1/bl1_private.h" #include "../../../../bl1/bl1_private.h"
#if USE_COHERENT_MEM #if USE_COHERENT_MEM
......
...@@ -4,18 +4,20 @@ ...@@ -4,18 +4,20 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arm_spm_def.h>
#include <assert.h> #include <assert.h>
#include <context_mgmt.h>
#include <interrupt_mgmt.h>
#include <mm_svc.h>
#include <ras.h>
#include <sgi_ras.h>
#include <platform.h>
#include <spm_svc.h>
#include <sdei.h>
#include <string.h> #include <string.h>
#include <bl31/interrupt_mgmt.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/extensions/ras.h>
#include <plat/common/platform.h>
#include <services/mm_svc.h>
#include <services/sdei.h>
#include <services/spm_svc.h>
#include <arm_spm_def.h>
#include <sgi_ras.h>
static int sgi_ras_intr_handler(const struct err_record_info *err_rec, static int sgi_ras_intr_handler(const struct err_record_info *err_rec,
int probe_data, int probe_data,
const struct err_handler_data *const data); const struct err_handler_data *const data);
......
...@@ -7,13 +7,14 @@ ...@@ -7,13 +7,14 @@
#ifndef SGM_BASE_PLATFORM_DEF_H #ifndef SGM_BASE_PLATFORM_DEF_H
#define SGM_BASE_PLATFORM_DEF_H #define SGM_BASE_PLATFORM_DEF_H
#include <drivers/arm/tzc400.h>
#include <drivers/arm/tzc_common.h>
#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>
#include <soc_css_def.h> #include <soc_css_def.h>
#include <tzc400.h>
#include <tzc_common.h>
#include <v2m_def.h> #include <v2m_def.h>
/* CPU topology */ /* CPU topology */
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#ifndef SGM_PLAT_CONFIG_H #ifndef SGM_PLAT_CONFIG_H
#define SGM_PLAT_CONFIG_H #define SGM_PLAT_CONFIG_H
#include <ccn.h> #include <drivers/arm/ccn.h>
#include <gicv3.h> #include <drivers/arm/gicv3.h>
/* The type of interconnect */ /* The type of interconnect */
typedef enum { typedef enum {
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h> #include <common/bl_common.h>
#include <debug.h> #include <common/debug.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <sgm_plat_config.h> #include <sgm_plat_config.h>
#include <soc_css.h> #include <soc_css.h>
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h> #include <common/bl_common.h>
#include <debug.h> #include <common/debug.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <sgm_plat_config.h> #include <sgm_plat_config.h>
#include "../../css/drivers/scmi/scmi.h" #include "../../css/drivers/scmi/scmi.h"
#include "../../css/drivers/mhu/css_mhu_doorbell.h" #include "../../css/drivers/mhu/css_mhu_doorbell.h"
......
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <platform_def.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <arm_def.h> #include <arm_def.h>
#include <bl_common.h>
#include <debug.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform_def.h>
#include <sgm_variant.h> #include <sgm_variant.h>
/* /*
......
...@@ -5,12 +5,15 @@ ...@@ -5,12 +5,15 @@
*/ */
#include <assert.h> #include <assert.h>
#include <debug.h> #include <string.h>
#include <plat_arm.h>
#include <platform_def.h> #include <platform_def.h>
#include <common/debug.h>
#include <plat_arm.h>
#include <sgm_plat_config.h> #include <sgm_plat_config.h>
#include <sgm_variant.h> #include <sgm_variant.h>
#include <string.h>
static css_plat_config_t *css_plat_info; static css_plat_config_t *css_plat_info;
......
...@@ -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 <drivers/arm/tzc_dmc500.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <sgm_variant.h> #include <sgm_variant.h>
#include <soc_css.h> #include <soc_css.h>
#include <tzc_dmc500.h>
/* Is populated with the DMC-500 controllers base addresses */ /* Is populated with the DMC-500 controllers base addresses */
static tzc_dmc500_driver_data_t plat_driver_data; static tzc_dmc500_driver_data_t plat_driver_data;
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <board_css_def.h>
#include <mmio.h>
#include <nic_400.h>
#include <platform_def.h> #include <platform_def.h>
#include <drivers/arm/nic_400.h>
#include <lib/mmio.h>
#include <board_css_def.h>
#include <soc_css.h> #include <soc_css.h>
#include <soc_css_def.h> #include <soc_css_def.h>
......
...@@ -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,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <platform.h> #include <lib/xlat_tables/xlat_mmu_helpers.h>
#include <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
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <console.h> #include <drivers/console.h>
#include <platform.h> #include <plat/common/platform.h>
#include <platform_sp_min.h> #include <platform_sp_min.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