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,9 +7,10 @@
#ifndef PMC_H
#define PMC_H
#include <mmio.h>
#include <lib/mmio.h>
#include <lib/utils_def.h>
#include <tegra_def.h>
#include <utils_def.h>
#define PMC_CONFIG U(0x0)
#define PMC_PWRGATE_STATUS U(0x38)
......
......@@ -7,8 +7,9 @@
#ifndef SMMU_H
#define SMMU_H
#include <lib/mmio.h>
#include <memctrl_v2.h>
#include <mmio.h>
#include <tegra_def.h>
/*******************************************************************************
......
......@@ -7,7 +7,7 @@
#ifndef __TEGRA_GIC_H__
#define __TEGRA_GIC_H__
#include <interrupt_props.h>
#include <common/interrupt_props.h>
/*******************************************************************************
* Per-CPU struct describing FIQ state to be stored
......
......@@ -8,9 +8,10 @@
#define PLATFORM_DEF_H
#include <arch.h>
#include <common_def.h>
#include <lib/utils_def.h>
#include <plat/common/common_def.h>
#include <tegra_def.h>
#include <utils_def.h>
/*******************************************************************************
* Generic platform constants
......
......@@ -7,7 +7,7 @@
#ifndef TEGRA_DEF_H
#define TEGRA_DEF_H
#include <utils_def.h>
#include <lib/utils_def.h>
/*******************************************************************************
* This value is used by the PSCI implementation during the `SYSTEM_SUSPEND`
......
......@@ -7,7 +7,7 @@
#ifndef TEGRA_DEF_H
#define TEGRA_DEF_H
#include <utils_def.h>
#include <lib/utils_def.h>
/*******************************************************************************
* MCE apertures used by the ARI interface
......
......@@ -7,7 +7,7 @@
#ifndef TEGRA_DEF_H
#define TEGRA_DEF_H
#include <utils_def.h>
#include <lib/utils_def.h>
/*******************************************************************************
* Power down state IDs
......
......@@ -7,12 +7,14 @@
#ifndef TEGRA_PRIVATE_H
#define TEGRA_PRIVATE_H
#include <platform_def.h>
#include <arch.h>
#include <arch_helpers.h>
#include <platform_def.h>
#include <psci.h>
#include <lib/psci/psci.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <tegra_gic.h>
#include <xlat_tables_v2.h>
/*******************************************************************************
* Tegra DRAM memory base address
......
......@@ -4,17 +4,20 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <platform_def.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <delay_timer.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <denver.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <flowctrl.h>
#include <mmio.h>
#include <platform_def.h>
#include <pmc.h>
#include <psci.h>
#include <tegra_def.h>
#include <tegra_private.h>
......
......@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <denver.h>
#include <mmio.h>
#include <platform.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include <pmc.h>
#include <psci.h>
#include <tegra_def.h>
#define SB_CSR 0x0
......
......@@ -5,10 +5,11 @@
*/
#include <arch_helpers.h>
#include <bl_common.h>
#include <common/bl_common.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <tegra_def.h>
#include <tegra_private.h>
#include <xlat_tables_v2.h>
/*******************************************************************************
* The Tegra power domain tree has a single system level power domain i.e. a
......
......@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
#include <context_mgmt.h>
#include <debug.h>
#include <errno.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <tegra_private.h>
#define NS_SWITCH_AARCH32 1
......
......@@ -7,7 +7,8 @@
#ifndef MCE_PRIVATE_H
#define MCE_PRIVATE_H
#include <mmio.h>
#include <lib/mmio.h>
#include <tegra_def.h>
/*******************************************************************************
......
......@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <errno.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <delay_timer.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <denver.h>
#include <errno.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <mce_private.h>
#include <mmio.h>
#include <platform.h>
#include <t18x_ari.h>
/*******************************************************************************
......
......@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <context.h>
#include <context_mgmt.h>
#include <debug.h>
#include <denver.h>
#include <errno.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/mmio.h>
#include <mce.h>
#include <mce_private.h>
#include <mmio.h>
#include <string.h>
#include <t18x_ari.h>
#include <tegra_def.h>
#include <tegra_platform.h>
......
......@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <errno.h>
#include <arch.h>
#include <arch_helpers.h>
#include <debug.h>
#include <common/debug.h>
#include <denver.h>
#include <errno.h>
#include <lib/mmio.h>
#include <mce_private.h>
#include <mmio.h>
#include <t18x_ari.h>
int32_t nvg_enter_cstate(uint32_t ari_base, uint32_t state, uint32_t wake_time)
......
......@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <bl_common.h>
#include <common/bl_common.h>
#include <memctrl_v2.h>
/*******************************************************************************
......
......@@ -4,19 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <string.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <context.h>
#include <context_mgmt.h>
#include <debug.h>
#include <denver.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include <mce.h>
#include <platform.h>
#include <psci.h>
#include <smmu.h>
#include <string.h>
#include <t18x_ari.h>
#include <tegra_private.h>
......
......@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <string.h>
#include <arch_helpers.h>
#include <debug.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <mce.h>
#include <mmio.h>
#include <string.h>
#include <tegra_def.h>
#include <tegra_private.h>
......
......@@ -4,26 +4,28 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <bl31.h>
#include <bl_common.h>
#include <console.h>
#include <arch_helpers.h>
#include <bl31/bl31.h>
#include <bl31/interrupt_mgmt.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <common/interrupt_props.h>
#include <context.h>
#include <context_mgmt.h>
#include <cortex_a57.h>
#include <debug.h>
#include <denver.h>
#include <gic_common.h>
#include <gicv2.h>
#include <interrupt_mgmt.h>
#include <interrupt_props.h>
#include <drivers/arm/gic_common.h>
#include <drivers/arm/gicv2.h>
#include <drivers/console.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <plat/common/platform.h>
#include <mce.h>
#include <platform.h>
#include <tegra_def.h>
#include <tegra_platform.h>
#include <tegra_private.h>
#include <xlat_tables_v2.h>
DEFINE_RENAME_SYSREG_RW_FUNCS(l2ctlr_el1, CORTEX_A57_L2CTLR_EL1)
extern uint64_t tegra_enable_l2_ecc_parity_prot;
......
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