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,11 @@
#ifndef XLAT_TABLES_PRIVATE_H
#define XLAT_TABLES_PRIVATE_H
#include <platform_def.h>
#include <stdbool.h>
#include <xlat_tables_defs.h>
#include <platform_def.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#if PLAT_XLAT_TABLES_DYNAMIC
/*
......
......@@ -4,17 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <errno.h>
#include <platform_def.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <utils_def.h>
#include <xlat_tables_defs.h>
#include <xlat_tables_v2.h>
#include <platform_def.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include "xlat_tables_private.h"
......
......@@ -5,11 +5,12 @@
*/
#include <assert.h>
#include <debug.h>
#include <errno.h>
#include <string.h>
#include <common/debug.h>
#include <lib/utils.h>
#include <tf_gunzip.h>
#include <utils.h>
#include "zutil.h"
......
......@@ -7,10 +7,11 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
#include <common_def.h>
#include <common/tbbr/tbbr_img_def.h>
#include <lib/utils_def.h>
#include <plat/common/common_def.h>
#include <sunxi_mmap.h>
#include <tbbr/tbbr_img_def.h>
#include <utils_def.h>
#define BL31_BASE SUNXI_SRAM_A2_BASE
#define BL31_LIMIT (SUNXI_SRAM_A2_BASE + SUNXI_SRAM_A2_SIZE)
......
......@@ -4,20 +4,24 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <assert.h>
#include <console.h>
#include <debug.h>
#include <generic_delay_timer.h>
#include <gicv2.h>
#include <libfdt.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h>
#include <arch.h>
#include <common/debug.h>
#include <drivers/arm/gicv2.h>
#include <drivers/console.h>
#include <drivers/generic_delay_timer.h>
#include <drivers/ti/uart/uart_16550.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <sunxi_def.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
#include <uart_16550.h>
static entry_point_info_t bl32_image_ep_info;
......
......@@ -4,16 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <debug.h>
#include <errno.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <plat/common/platform.h>
#include <sunxi_def.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
#include <xlat_tables_v2.h>
static mmap_region_t sunxi_mmap[PLATFORM_MMAP_REGIONS + 1] = {
MAP_REGION_FLAT(SUNXI_SRAM_BASE, SUNXI_SRAM_SIZE,
......
......@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <core_off_arisc.h>
#include <debug.h>
#include <delay_timer.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <lib/utils_def.h>
#include <plat/common/platform.h>
#include <core_off_arisc.h>
#include <sunxi_cpucfg.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
#include <utils_def.h>
static void sunxi_cpu_disable_power(unsigned int cluster, unsigned int core)
{
......
......@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <delay_timer.h>
#include <gicv2.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h>
#include <psci.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/arm/gicv2.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include <sunxi_cpucfg.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
......
......@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <debug.h>
#include <mmio.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
......
......@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <platform.h>
#include <platform_def.h>
#include <arch.h>
#include <plat/common/platform.h>
static unsigned char plat_power_domain_tree_desc[PLAT_MAX_PWR_LVL + 1] = {
/* One root node for the SoC */
1,
......
......@@ -5,14 +5,18 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <allwinner/sunxi_rsb.h>
#include <arch_helpers.h>
#include <debug.h>
#include <delay_timer.h>
#include <errno.h>
#include <libfdt.h>
#include <mmio.h>
#include <platform_def.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/allwinner/sunxi_rsb.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <sunxi_def.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
......
......@@ -5,13 +5,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <debug.h>
#include <delay_timer.h>
#include <errno.h>
#include <mmio.h>
#include <mentor/mi2cv.h>
#include <string.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <drivers/mentor/mi2cv.h>
#include <lib/mmio.h>
#include <sunxi_def.h>
#include <sunxi_mmap.h>
#include <sunxi_private.h>
......
......@@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <asm_macros.S>
#include <bl_common.h>
#include <common/bl_common.h>
#include <v2m_def.h>
.globl plat_report_exception
......
......@@ -3,8 +3,9 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <asm_macros.S>
#include <bl_common.h>
#include <common/bl_common.h>
#include <v2m_def.h>
.globl plat_report_exception
......
......@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arm_def.h>
#include <assert.h>
#include <cassert.h>
#include <platform.h>
#include <stdint.h>
#include <string.h>
#include <tbbr_oid.h>
#include <lib/cassert.h>
#include <plat/common/platform.h>
#include <tools_share/tbbr_oid.h>
#include <arm_def.h>
/* SHA256 algorithm */
#define SHA256_BYTES 32
......@@ -180,9 +182,9 @@ int plat_set_nv_ctr(void *cookie, unsigned int nv_ctr)
}
#else /* ARM_CRYPTOCELL_INTEG */
#include <nvm.h>
#include <nvm_otp.h>
#include <sbrom_bsv_api.h>
#include <drivers/arm/cryptocell/nvm.h>
#include <drivers/arm/cryptocell/nvm_otp.h>
#include <drivers/arm/cryptocell/sbrom_bsv_api.h>
CASSERT(HASH_RESULT_SIZE_IN_BYTES == SHA256_BYTES,
assert_mismatch_in_hash_result_size);
......
......@@ -4,8 +4,7 @@
# SPDX-License-Identifier: BSD-3-Clause
#
PLAT_INCLUDES += -Iinclude/drivers/cfi/ \
-Iinclude/plat/arm/board/common/
PLAT_INCLUDES += -Iinclude/plat/arm/board/common/
PLAT_BL_COMMON_SOURCES += drivers/arm/pl011/${ARCH}/pl011_console.S \
plat/arm/board/common/${ARCH}/board_arm_helpers.S
......
......@@ -6,8 +6,8 @@
#include <arch.h>
#include <asm_macros.S>
#include <gicv2.h>
#include <gicv3.h>
#include <drivers/arm/gicv2.h>
#include <drivers/arm/gicv3.h>
#include <platform_def.h>
#include <v2m_def.h>
#include "../drivers/pwrc/fvp_pwrc.h"
......
......@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <ras.h>
#include <lib/extensions/ras.h>
struct ras_interrupt fvp_ras_interrupts[] = {
};
......
......@@ -4,9 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <bakery_lock.h>
#include <mmio.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <plat_arm.h>
#include "../../fvp_def.h"
#include "../../fvp_private.h"
#include "fvp_pwrc.h"
......
......@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <common/tbbr/tbbr_img_def.h>
#include <plat/common/platform.h>
#include <plat_arm.h>
#include <platform.h>
#include <tbbr_img_def.h>
#include "fvp_private.h"
#include "fvp_private.h"
/*******************************************************************************
* Perform any BL1 specific platform actions.
......
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