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,16 +4,18 @@ ...@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <stdbool.h>
#include <string.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <arm_sip_svc.h>
#include <context.h> #include <context.h>
#include <context_mgmt.h> #include <lib/el3_runtime/context_mgmt.h>
#include <plat_arm.h> #include <lib/psci/psci.h>
#include <psci.h> #include <lib/utils.h>
#include <smccc_helpers.h> #include <smccc_helpers.h>
#include <stdbool.h>
#include <string.h> #include <arm_sip_svc.h>
#include <utils.h> #include <plat_arm.h>
/* /*
* Handle SMC from a lower exception level to switch its execution state * Handle SMC from a lower exception level to switch its execution state
......
...@@ -5,15 +5,18 @@ ...@@ -5,15 +5,18 @@
*/ */
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <console.h>
#include <debug.h>
#include <mmio.h>
#include <pl011.h>
#include <plat_arm.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <platform_sp_min.h>
#include <bl32/sp_min/platform_sp_min.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/arm/pl011.h>
#include <drivers/console.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <plat_arm.h>
static entry_point_info_t bl33_image_ep_info; static entry_point_info_t bl33_image_ep_info;
......
...@@ -4,15 +4,18 @@ ...@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arm_def.h>
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <console.h>
#include <debug.h>
#include <pl011.h>
#include <plat_arm.h>
#include <platform_def.h> #include <platform_def.h>
#include <platform_tsp.h>
#include <bl32/tsp/platform_tsp.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/arm/pl011.h>
#include <drivers/console.h>
#include <arm_def.h>
#include <plat_arm.h>
#define BL32_END (unsigned long)(&__BL32_END__) #define BL32_END (unsigned long)(&__BL32_END__)
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
* 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/common/platform.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform.h>
#include <soc_css.h> #include <soc_css.h>
void bl1_platform_setup(void) void bl1_platform_setup(void)
......
...@@ -4,13 +4,16 @@ ...@@ -4,13 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h> #include <string.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <lib/utils.h>
#include <css_def.h> #include <css_def.h>
#include <debug.h>
#include <mmio.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <string.h>
#include <utils.h>
#include "../drivers/scp/css_scp.h" #include "../drivers/scp/css_scp.h"
/* Weak definition may be overridden in specific CSS based platform */ /* Weak definition may be overridden in specific CSS based platform */
......
...@@ -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/common/platform.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform.h>
#include "../drivers/scp/css_scp.h" #include "../drivers/scp/css_scp.h"
/* Weak definition may be overridden in specific CSS based platform */ /* Weak definition may be overridden in specific CSS based platform */
......
...@@ -4,15 +4,19 @@ ...@@ -4,15 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <cassert.h>
#include <css_pm.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 <arch_helpers.h>
#include <common/debug.h>
#include <lib/cassert.h>
#include <plat/common/platform.h>
#include <css_pm.h>
#include <plat_arm.h>
#include "../drivers/scp/css_scp.h" #include "../drivers/scp/css_scp.h"
/* Allow CSS platforms to override `plat_arm_psci_pm_ops` */ /* Allow CSS platforms to override `plat_arm_psci_pm_ops` */
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <plat_arm.h>
#include <platform.h>
#include <assert.h> #include <assert.h>
#include <plat/common/platform.h>
#include <plat_arm.h>
#if ARM_PLAT_MT #if ARM_PLAT_MT
#pragma weak plat_arm_get_cpu_pe_count #pragma weak plat_arm_get_cpu_pe_count
#endif #endif
......
...@@ -4,13 +4,17 @@ ...@@ -4,13 +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 <bakery_lock.h>
#include <platform_def.h>
#include <arch_helpers.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <css_def.h> #include <css_def.h>
#include <mmio.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform_def.h>
#include "css_mhu.h" #include "css_mhu.h"
/* SCP MHU secure channel registers */ /* SCP MHU secure channel registers */
......
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <platform_def.h> #include <platform_def.h>
#include <arch_helpers.h>
#include "css_mhu_doorbell.h" #include "css_mhu_doorbell.h"
#include "../scmi/scmi.h" #include "../scmi/scmi.h"
......
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
#ifndef CSS_MHU_DOORBELL_H #ifndef CSS_MHU_DOORBELL_H
#define CSS_MHU_DOORBELL_H #define CSS_MHU_DOORBELL_H
#include <mmio.h>
#include <stdint.h> #include <stdint.h>
#include <lib/mmio.h>
/* MHUv2 Base Address */ /* MHUv2 Base Address */
#define MHUV2_BASE_ADDR PLAT_CSS_MHU_BASE #define MHUV2_BASE_ADDR PLAT_CSS_MHU_BASE
......
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
#ifndef SCMI_H #ifndef SCMI_H
#define SCMI_H #define SCMI_H
#include <bakery_lock.h>
#include <psci.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <spinlock.h>
#include <lib/bakery_lock.h>
#include <lib/psci/psci.h>
#include <lib/spinlock.h>
/* Supported SCMI Protocol Versions */ /* Supported SCMI Protocol Versions */
#define SCMI_AP_CORE_PROTO_VER MAKE_SCMI_VERSION(1, 0) #define SCMI_AP_CORE_PROTO_VER MAKE_SCMI_VERSION(1, 0)
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
* 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 <arch_helpers.h>
#include <common/debug.h>
#include "scmi.h" #include "scmi.h"
#include "scmi_private.h" #include "scmi_private.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 <arch_helpers.h>
#include <common/debug.h>
#include "scmi.h" #include "scmi.h"
#include "scmi_private.h" #include "scmi_private.h"
#if HW_ASSISTED_COHERENCY #if HW_ASSISTED_COHERENCY
#define scmi_lock_init(lock) #define scmi_lock_init(lock)
#define scmi_lock_get(lock) spin_lock(lock) #define scmi_lock_get(lock) spin_lock(lock)
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
* 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 <arch_helpers.h>
#include <common/debug.h>
#include "scmi.h" #include "scmi.h"
#include "scmi_private.h" #include "scmi_private.h"
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
* 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 <arch_helpers.h>
#include <common/debug.h>
#include "scmi.h" #include "scmi.h"
#include "scmi_private.h" #include "scmi_private.h"
......
...@@ -4,12 +4,15 @@ ...@@ -4,12 +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 <css_def.h>
#include <debug.h>
#include <platform.h>
#include <stdint.h> #include <stdint.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <plat/common/platform.h>
#include <css_def.h>
#include "../mhu/css_mhu.h" #include "../mhu/css_mhu.h"
#include "../scpi/css_scpi.h" #include "../scpi/css_scpi.h"
#include "css_scp.h" #include "css_scp.h"
......
...@@ -4,14 +4,17 @@ ...@@ -4,14 +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 <string.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <plat/common/platform.h>
#include <css_def.h> #include <css_def.h>
#include <css_pm.h> #include <css_pm.h>
#include <debug.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <platform.h>
#include <string.h>
#include "../scmi/scmi.h" #include "../scmi/scmi.h"
#include "css_scp.h" #include "css_scp.h"
......
...@@ -4,11 +4,14 @@ ...@@ -4,11 +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 <arch_helpers.h>
#include <common/debug.h>
#include <css_pm.h> #include <css_pm.h>
#include <debug.h>
#include <plat_arm.h> #include <plat_arm.h>
#include "../scpi/css_scpi.h" #include "../scpi/css_scpi.h"
#include "css_scp.h" #include "css_scp.h"
......
...@@ -7,10 +7,12 @@ ...@@ -7,10 +7,12 @@
#ifndef CSS_SCP_H #ifndef CSS_SCP_H
#define CSS_SCP_H #define CSS_SCP_H
#include <cassert.h>
#include <platform_def.h>
#include <stdint.h> #include <stdint.h>
#include <platform_def.h>
#include <lib/cassert.h>
/* Forward declarations */ /* Forward declarations */
struct psci_power_state; struct psci_power_state;
......
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