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,10 +4,11 @@ ...@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <plat/common/platform.h>
#include <arm_def.h> #include <arm_def.h>
#include <css_pm.h> #include <css_pm.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform.h>
#include "juno_def.h" #include "juno_def.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"
......
...@@ -5,9 +5,11 @@ ...@@ -5,9 +5,11 @@
*/ */
#include <assert.h> #include <assert.h>
#include <mmio.h>
#include <string.h> #include <string.h>
#include <utils_def.h>
#include <lib/mmio.h>
#include <lib/utils_def.h>
#include "juno_decl.h" #include "juno_decl.h"
#include "juno_def.h" #include "juno_def.h"
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <platform_def.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"
#include <plat_arm.h> #include <plat_arm.h>
#include <platform_def.h>
static scmi_channel_plat_info_t n1sdp_scmi_plat_info = { static scmi_channel_plat_info_t n1sdp_scmi_plat_info = {
.scmi_mbx_mem = N1SDP_SCMI_PAYLOAD_BASE, .scmi_mbx_mem = N1SDP_SCMI_PAYLOAD_BASE,
......
...@@ -4,12 +4,14 @@ ...@@ -4,12 +4,14 @@
* 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 <plat/common/platform.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.h>
#include <platform_def.h>
/* /*
* Table of regions to map using the MMU. * Table of regions to map using the MMU.
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#ifndef PLATFORM_DEF_H #ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <lib/utils_def.h>
#include <sgi_base_platform_def.h> #include <sgi_base_platform_def.h>
#include <utils_def.h>
#define PLAT_ARM_CLUSTER_COUNT 2 #define PLAT_ARM_CLUSTER_COUNT 2
#define CSS_SGI_MAX_CPUS_PER_CLUSTER 4 #define CSS_SGI_MAX_CPUS_PER_CLUSTER 4
......
...@@ -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>
unsigned int plat_arm_sgi_get_platform_id(void) unsigned int plat_arm_sgi_get_platform_id(void)
{ {
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <platform_def.h> #include <platform_def.h>
#include <tzc_dmc620.h>
#include <common/debug.h>
#include <drivers/arm/tzc_dmc620.h>
uintptr_t sgi575_dmc_base[] = { uintptr_t sgi575_dmc_base[] = {
SGI575_DMC620_BASE0, SGI575_DMC620_BASE0,
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#ifndef PLATFORM_DEF_H #ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <lib/utils_def.h>
#include <sgi_base_platform_def.h> #include <sgi_base_platform_def.h>
#include <utils_def.h>
#define PLAT_ARM_CLUSTER_COUNT 2 #define PLAT_ARM_CLUSTER_COUNT 2
#define CSS_SGI_MAX_CPUS_PER_CLUSTER 4 #define CSS_SGI_MAX_CPUS_PER_CLUSTER 4
......
...@@ -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>
unsigned int plat_arm_sgi_get_platform_id(void) unsigned int plat_arm_sgi_get_platform_id(void)
{ {
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <platform_def.h> #include <platform_def.h>
#include <tzc_dmc620.h>
#include <common/debug.h>
#include <drivers/arm/tzc_dmc620.h>
uintptr_t sgiclarka_dmc_base[] = { uintptr_t sgiclarka_dmc_base[] = {
SGICLARKA_DMC620_BASE0, SGICLARKA_DMC620_BASE0,
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
#ifndef PLATFORM_DEF_H #ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <lib/utils_def.h>
#include <sgi_base_platform_def.h> #include <sgi_base_platform_def.h>
#include <utils_def.h>
#define PLAT_ARM_CLUSTER_COUNT 2 #define PLAT_ARM_CLUSTER_COUNT 2
#define CSS_SGI_MAX_CPUS_PER_CLUSTER 8 #define CSS_SGI_MAX_CPUS_PER_CLUSTER 8
......
...@@ -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>
unsigned int plat_arm_sgi_get_platform_id(void) unsigned int plat_arm_sgi_get_platform_id(void)
{ {
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <platform_def.h> #include <platform_def.h>
#include <tzc_dmc620.h>
#include <common/debug.h>
#include <drivers/arm/tzc_dmc620.h>
uintptr_t sgiclarkh_dmc_base[] = { uintptr_t sgiclarkh_dmc_base[] = {
SGICLARKH_DMC620_BASE0, SGICLARKH_DMC620_BASE0,
......
...@@ -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,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,9 +4,10 @@ ...@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <ehf.h>
#include <platform_def.h> #include <platform_def.h>
#include <bl31/ehf.h>
/* /*
* Enumeration of priority levels on ARM platforms. * Enumeration of priority levels on ARM platforms.
*/ */
......
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
/* SDEI configuration for ARM platforms */ /* SDEI configuration for ARM platforms */
#include <ehf.h>
#include <platform_def.h> #include <platform_def.h>
#include <sdei.h>
#include <bl31/ehf.h>
#include <services/sdei.h>
/* Private event mappings */ /* Private event mappings */
static sdei_ev_map_t arm_sdei_private[] = { static sdei_ev_map_t arm_sdei_private[] = {
......
...@@ -5,14 +5,17 @@ ...@@ -5,14 +5,17 @@
*/ */
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <plat_arm.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <tbbr_img_desc.h>
#include <utils.h> #include <bl1/tbbr/tbbr_img_desc.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <plat_arm.h>
/* Struct to keep track of usable memory */ /* Struct to keep track of usable memory */
typedef struct bl1_mem_info { typedef struct bl1_mem_info {
......
...@@ -4,17 +4,20 @@ ...@@ -4,17 +4,20 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h>
#include <platform_def.h>
#include <arch.h> #include <arch.h>
#include <bl1/bl1.h>
#include <common/bl_common.h>
#include <drivers/arm/sp805.h>
#include <lib/utils.h>
#include <lib/xlat_tables/xlat_tables_compat.h>
#include <plat/common/platform.h>
#include <arm_def.h> #include <arm_def.h>
#include <assert.h>
#include <bl1.h>
#include <bl_common.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform.h>
#include <platform_def.h>
#include <sp805.h>
#include <utils.h>
#include <xlat_tables_compat.h>
#include "../../../bl1/bl1_private.h" #include "../../../bl1/bl1_private.h"
......
...@@ -3,11 +3,14 @@ ...@@ -3,11 +3,14 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arm_def.h>
#include <assert.h> #include <assert.h>
#include <generic_delay_timer.h>
#include <drivers/generic_delay_timer.h>
#include <plat/common/platform.h>
#include <arm_def.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform.h>
#pragma weak bl2_el3_early_platform_setup #pragma weak bl2_el3_early_platform_setup
#pragma weak bl2_el3_plat_arch_setup #pragma weak bl2_el3_plat_arch_setup
......
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