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
......@@ -7,7 +7,7 @@
#ifndef PLAT_MACROS_S
#define PLAT_MACROS_S
#include <gicv2.h>
#include <drivers/arm/gicv2.h>
#include <platform_def.h>
.section .rodata.gic_reg_name, "aS"
......
......@@ -8,7 +8,7 @@
#define PLATFORM_DEF_H
#include <arch.h>
#include <utils_def.h>
#include <lib/utils_def.h>
#include "../gxbb_def.h"
......
......@@ -6,8 +6,7 @@
include lib/xlat_tables_v2/xlat_tables.mk
PLAT_INCLUDES := -Iinclude/drivers/meson/ \
-Iplat/meson/gxbb/include
PLAT_INCLUDES := -Iplat/meson/gxbb/include
GXBB_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
drivers/arm/gic/v2/gicv2_main.c \
......
......@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <arch_helpers.h>
#include <cortex_a53.h>
#include <debug.h>
#include <delay_timer.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <flowctrl.h>
#include <mmio.h>
#include <pmc.h>
#include <tegra_def.h>
......
......@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <string.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <lib/utils.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <memctrl.h>
#include <memctrl_v1.h>
#include <mmio.h>
#include <string.h>
#include <tegra_def.h>
#include <utils.h>
#include <xlat_tables_v2.h>
/* Video Memory base and size (live values) */
static uint64_t video_mem_base;
......
......@@ -4,20 +4,22 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
#include <debug.h>
#include <string.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <lib/utils.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <mce.h>
#include <memctrl.h>
#include <memctrl_v2.h>
#include <mmio.h>
#include <smmu.h>
#include <string.h>
#include <tegra_def.h>
#include <tegra_platform.h>
#include <utils.h>
#include <xlat_tables_v2.h>
/* Video Memory base and size (live values) */
static uint64_t video_mem_base;
......
......@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <mmio.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <pmc.h>
#include <tegra_def.h>
......
......@@ -5,11 +5,14 @@
*/
#include <assert.h>
#include <bl_common.h>
#include <debug.h>
#include <string.h>
#include <platform_def.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <smmu.h>
#include <string.h>
#include <tegra_private.h>
extern void memcpy16(void *dest, const void *src, unsigned int length);
......
......@@ -4,27 +4,30 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <errno.h>
#include <stddef.h>
#include <string.h>
#include <platform_def.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <bl31.h>
#include <bl_common.h>
#include <console.h>
#include <bl31/bl31.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <cortex_a53.h>
#include <cortex_a57.h>
#include <debug.h>
#include <denver.h>
#include <errno.h>
#include <drivers/console.h>
#include <lib/mmio.h>
#include <lib/utils.h>
#include <lib/utils_def.h>
#include <plat/common/platform.h>
#include <memctrl.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h>
#include <stddef.h>
#include <string.h>
#include <tegra_def.h>
#include <tegra_private.h>
#include <utils.h>
#include <utils_def.h>
/* length of Trusty's input parameters (in bytes) */
#define TRUSTY_PARAMS_LEN_BYTES (4096*2)
......
......@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <delay_timer.h>
#include <mmio.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <tegra_def.h>
#include <tegra_private.h>
......
......@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <bakery_lock.h>
#include <bl_common.h>
#include <arch_helpers.h>
#include <bl31/interrupt_mgmt.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <context.h>
#include <context_mgmt.h>
#include <debug.h>
#include <denver.h>
#include <interrupt_mgmt.h>
#include <platform.h>
#include <lib/bakery_lock.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <plat/common/platform.h>
#include <tegra_def.h>
#include <tegra_private.h>
......
......@@ -5,12 +5,15 @@
*/
#include <assert.h>
#include <bl_common.h>
#include <gicv2.h>
#include <platform_def.h>
#include <common/bl_common.h>
#include <drivers/arm/gicv2.h>
#include <lib/utils.h>
#include <tegra_private.h>
#include <tegra_def.h>
#include <utils.h>
/******************************************************************************
* Tegra common helper to setup the GICv2 driver data.
......
......@@ -5,7 +5,8 @@
*/
#include <arch_helpers.h>
#include <mmio.h>
#include <lib/mmio.h>
#include <tegra_def.h>
#include <tegra_platform.h>
#include <tegra_private.h>
......
......@@ -4,19 +4,22 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
#include <console.h>
#include <platform_def.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <context.h>
#include <context_mgmt.h>
#include <debug.h>
#include <drivers/console.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include <memctrl.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h>
#include <pmc.h>
#include <psci.h>
#include <tegra_def.h>
#include <tegra_private.h>
......
......@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
#include <debug.h>
#include <errno.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <common/runtime_svc.h>
#include <lib/mmio.h>
#include <memctrl.h>
#include <mmio.h>
#include <runtime_svc.h>
#include <tegra_platform.h>
#include <tegra_private.h>
......
......@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <platform_def.h>
#include <psci.h>
#include <arch.h>
#include <lib/psci/psci.h>
extern const unsigned char tegra_power_domain_tree_desc[];
#pragma weak plat_core_pos_by_mpidr
......
......@@ -7,7 +7,8 @@
#ifndef FLOWCTRL_H
#define FLOWCTRL_H
#include <mmio.h>
#include <lib/mmio.h>
#include <tegra_def.h>
#define FLOWCTRL_HALT_CPU0_EVENTS 0x0U
......
......@@ -7,7 +7,8 @@
#ifndef MCE_H
#define MCE_H
#include <mmio.h>
#include <lib/mmio.h>
#include <tegra_def.h>
/*******************************************************************************
......
......@@ -7,7 +7,8 @@
#ifndef MEMCTRL_V1_H
#define MEMCTRL_V1_H
#include <mmio.h>
#include <lib/mmio.h>
#include <tegra_def.h>
/* SMMU registers */
......
......@@ -407,7 +407,7 @@ typedef struct tegra_mc_settings {
#ifndef __ASSEMBLY__
#include <mmio.h>
#include <lib/mmio.h>
static inline uint32_t tegra_mc_read_32(uint32_t off)
{
......
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