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,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <gic_common.h>
#include <gicv2.h>
#include <interrupt_props.h>
#include <common/debug.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gic_common.h>
#include <drivers/arm/gicv2.h>
#include "../common/gic_common_private.h"
#include "gicv2_private.h"
......
......@@ -4,16 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <gic_common.h>
#include <gicv2.h>
#include <interrupt_props.h>
#include <spinlock.h>
#include <stdbool.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gic_common.h>
#include <drivers/arm/gicv2.h>
#include <lib/spinlock.h>
#include "../common/gic_common_private.h"
#include "gicv2_private.h"
......
......@@ -7,10 +7,11 @@
#ifndef GICV2_PRIVATE_H
#define GICV2_PRIVATE_H
#include <gicv2.h>
#include <mmio.h>
#include <stdint.h>
#include <drivers/arm/gicv2.h>
#include <lib/mmio.h>
/*******************************************************************************
* Private function prototypes
******************************************************************************/
......
......@@ -10,12 +10,13 @@
* APIs that are different to those generic ones in GICv3 driver.
*/
#include <arch_helpers.h>
#include <assert.h>
#include <gicv3.h>
#include <arch_helpers.h>
#include <drivers/arm/arm_gicv3_common.h>
#include <drivers/arm/gicv3.h>
#include "gicv3_private.h"
#include "arm_gicv3_common.h"
/*
* Flush the internal GIC cache of the LPIs pending tables to memory before
......
......@@ -11,9 +11,10 @@
* GIC600 supports independently power-gating redistributor interface.
*/
#include <arch_helpers.h>
#include <assert.h>
#include <gicv3.h>
#include <arch_helpers.h>
#include <drivers/arm/gicv3.h>
#include "gicv3_private.h"
......
......@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <gic_common.h>
#include <interrupt_props.h>
#include <common/debug.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gic_common.h>
#include "../common/gic_common_private.h"
#include "gicv3_private.h"
......
......@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <gicv3.h>
#include <interrupt_props.h>
#include <spinlock.h>
#include <common/debug.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gicv3.h>
#include <lib/spinlock.h>
#include "gicv3_private.h"
const gicv3_driver_data_t *gicv3_driver_data;
......
......@@ -8,10 +8,12 @@
#define GICV3_PRIVATE_H
#include <assert.h>
#include <gic_common.h>
#include <gicv3.h>
#include <mmio.h>
#include <stdint.h>
#include <drivers/arm/gic_common.h>
#include <drivers/arm/gicv3.h>
#include <lib/mmio.h>
#include "../common/gic_common_private.h"
/*******************************************************************************
......
......@@ -8,7 +8,7 @@
#include <assert_macros.S>
#define USE_FINISH_CONSOLE_REG_2
#include <console_macros.S>
#include <pl011.h>
#include <drivers/arm/pl011.h>
#if !MULTI_CONSOLE_API
/*
......
......@@ -8,7 +8,7 @@
#include <assert_macros.S>
#define USE_FINISH_CONSOLE_REG_2
#include <console_macros.S>
#include <pl011.h>
#include <drivers/arm/pl011.h>
#if !MULTI_CONSOLE_API
/*
......
......@@ -9,13 +9,14 @@
*/
#include <assert.h>
#include <cassert.h>
#include <debug.h>
#include <errno.h>
#include <gpio.h>
#include <mmio.h>
#include <pl061_gpio.h>
#include <utils.h>
#include <common/debug.h>
#include <drivers/arm/pl061_gpio.h>
#include <drivers/gpio.h>
#include <lib/cassert.h>
#include <lib/mmio.h>
#include <lib/utils.h>
#if !PLAT_PL061_MAX_GPIOS
# define PLAT_PL061_MAX_GPIOS 32
......
......@@ -5,10 +5,11 @@
*/
#include <cdefs.h>
#include <mmio.h>
#include <smmu_v3.h>
#include <stdbool.h>
#include <drivers/arm/smmu_v3.h>
#include <lib/mmio.h>
static inline uint32_t __init smmuv3_read_s_idr1(uintptr_t base)
{
return mmio_read_32(base + SMMU_S_IDR1);
......
......@@ -5,8 +5,9 @@
*/
#include <assert.h>
#include <delay_timer.h>
#include <mmio.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
uintptr_t sp804_base_addr;
......
......@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <mmio.h>
#include <sp805.h>
#include <stdint.h>
#include <drivers/arm/sp805.h>
#include <lib/mmio.h>
/* Inline register access functions */
static inline void sp805_write_wdog_load(uintptr_t base, uint32_t value)
......
......@@ -5,10 +5,11 @@
*/
#include <assert.h>
#include <debug.h>
#include <mmio.h>
#include <stddef.h>
#include <tzc380.h>
#include <common/debug.h>
#include <drivers/arm/tzc380.h>
#include <lib/mmio.h>
struct tzc380_instance {
uintptr_t base;
......
......@@ -5,10 +5,12 @@
*/
#include <assert.h>
#include <debug.h>
#include <mmio.h>
#include <stddef.h>
#include <tzc400.h>
#include <common/debug.h>
#include <drivers/arm/tzc400.h>
#include <lib/mmio.h>
#include "tzc_common_private.h"
/*
......
......@@ -9,8 +9,8 @@
#include <arch.h>
#include <arch_helpers.h>
#include <mmio.h>
#include <tzc_common.h>
#include <drivers/arm/tzc_common.h>
#include <lib/mmio.h>
#define DEFINE_TZC_COMMON_WRITE_ACTION(fn_name, macro_name) \
static inline void _tzc##fn_name##_write_action( \
......
......@@ -5,10 +5,12 @@
*/
#include <assert.h>
#include <debug.h>
#include <mmio.h>
#include <tzc_dmc500.h>
#include "tzc_common.h"
#include <common/debug.h>
#include <drivers/arm/tzc_dmc500.h>
#include <drivers/arm/tzc_common.h>
#include <lib/mmio.h>
#include "tzc_common_private.h"
/*
......
......@@ -5,9 +5,10 @@
*/
#include <assert.h>
#include <debug.h>
#include <mmio.h>
#include <tzc_dmc620.h>
#include <common/debug.h>
#include <drivers/arm/tzc_dmc620.h>
#include <lib/mmio.h>
/* Mask to extract bit 31 to 16 */
#define MASK_31_16 UINT64_C(0x0000ffff0000)
......
......@@ -5,17 +5,19 @@
*/
#include <assert.h>
#include <auth_common.h>
#include <auth_mod.h>
#include <cot_def.h>
#include <crypto_mod.h>
#include <debug.h>
#include <img_parser_mod.h>
#include <platform.h>
#include <platform_def.h>
#include <stdint.h>
#include <string.h>
#include <platform_def.h>
#include <common/debug.h>
#include <common/tbbr/cot_def.h>
#include <drivers/auth/auth_common.h>
#include <drivers/auth/auth_mod.h>
#include <drivers/auth/crypto_mod.h>
#include <drivers/auth/img_parser_mod.h>
#include <plat/common/platform.h>
/* ASN.1 tags */
#define ASN1_INTEGER 0x02
......
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