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
......@@ -5,11 +5,12 @@
*/
#include <assert.h>
#include <bl_common.h>
#include <console.h>
#include <gicv2.h>
#include <interrupt_props.h>
#include <mmio.h>
#include <common/bl_common.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gicv2.h>
#include <drivers/console.h>
#include <lib/mmio.h>
#include "ls_16550.h"
#include "plat_ls.h"
......
......@@ -3,13 +3,16 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <platform_def.h>
#include <arch.h>
#include <arch_helpers.h>
#include <xlat_tables_v2.h>
#include <assert.h>
#include <debug.h>
#include <mmio.h>
#include "platform_def.h"
#include <common/debug.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
const mmap_region_t *plat_ls_get_mmap(void);
......
......@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <desc_image_load.h>
#include <common/desc_image_load.h>
#include "ls_def.h"
/*******************************************************************************
......
......@@ -3,14 +3,17 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <debug.h>
#include <firmware_image_package.h>
#include <io_driver.h>
#include <io_fip.h>
#include <io_memmap.h>
#include <io_storage.h>
#include "platform_def.h"
#include <platform_def.h>
#include <common/debug.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_fip.h>
#include <drivers/io/io_memmap.h>
#include <drivers/io/io_storage.h>
#include <tools_share/firmware_image_package.h>
/* IO devices */
static const io_dev_connector_t *fip_dev_con;
......
......@@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <mmio.h>
#include <delay_timer.h>
#include <arch_helpers.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#define TIMER_BASE_ADDR 0x02B00000
......
......@@ -4,10 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <debug.h>
#include <mmio.h>
#include <endian.h>
#include "platform_def.h"
#include <platform_def.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include "soc_tzasc.h"
int tzc380_set_region(unsigned int tzasc_base, unsigned int region_id,
......
......@@ -4,11 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <mmio.h>
#include <endian.h>
#include <debug.h>
#include <platform_def.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include "ns_access.h"
#include "platform_def.h"
static void enable_devices_ns_access(struct csu_ns_dev *ns_dev, uint32_t num)
{
......
......@@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <debug.h>
#include <gicv2.h>
#include <interrupt_props.h>
#include <common/debug.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gicv2.h>
#include "ls_16550.h"
#include "plat_ls.h"
......
......@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
* https://spdx.org/licenses
*/
#include <a3700_pm.h>
#include <plat_marvell.h>
......
......@@ -5,10 +5,11 @@
* https://spdx.org/licenses
*/
#include <lib/mmio.h>
#include <armada_common.h>
#include <dram_win.h>
#include <io_addr_dec.h>
#include <mmio.h>
#include <marvell_plat_priv.h>
#include <plat_marvell.h>
......
......@@ -84,14 +84,12 @@ MARVELL_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
plat/common/plat_gicv3.c \
drivers/arm/gic/v3/gic500.c
ATF_INCLUDES := -Iinclude/common/tbbr \
-Iinclude/drivers
ATF_INCLUDES := -Iinclude/common/tbbr
PLAT_INCLUDES := -I$(PLAT_FAMILY_BASE)/$(PLAT) \
-I$(PLAT_COMMON_BASE)/include \
-I$(PLAT_INCLUDE_BASE)/common \
-I$(MARVELL_DRV_BASE) \
-Iinclude/drivers/marvell/uart \
-I$/drivers/arm/gic/common/ \
$(ATF_INCLUDES)
......
......@@ -5,11 +5,13 @@
* https://spdx.org/licenses
*/
#include <debug.h>
#include <common/debug.h>
#include <common/runtime_svc.h>
#include <lib/smccc.h>
#include <marvell_plat_priv.h>
#include <plat_marvell.h>
#include <runtime_svc.h>
#include <smccc.h>
#include "comphy/phy-comphy-3700.h"
/* Comphy related FID's */
......
......@@ -5,12 +5,14 @@
* https://spdx.org/licenses
*/
#include <string.h>
#include <lib/mmio.h>
#include <dram_win.h>
#include <marvell_plat_priv.h>
#include <mmio.h>
#include <mvebu.h>
#include <plat_marvell.h>
#include <string.h>
/* Armada 3700 has 5 configurable windows */
#define MV_CPU_WIN_NUM 5
......
......@@ -8,7 +8,8 @@
#ifndef DRAM_WIN_H
#define DRAM_WIN_H
#include <bl_common.h>
#include <common/bl_common.h>
#include <io_addr_dec.h>
void dram_win_map_build(struct dram_win_map *win_map);
......
......@@ -8,12 +8,13 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
#include <board_marvell_def.h>
#include <mvebu_def.h>
#ifndef __ASSEMBLY__
#include <stdio.h>
#endif /* __ASSEMBLY__ */
#include <board_marvell_def.h>
#include <mvebu_def.h>
/*
* Most platform porting definitions provided by included headers
*/
......
......@@ -4,9 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
* https://spdx.org/licenses
*/
#include <debug.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <io_addr_dec.h>
#include <mmio.h>
#include <plat_marvell.h>
#define MVEBU_DEC_WIN_CTRL_REG(base, win, off) (MVEBU_REGS_BASE + (base) + \
......
......@@ -5,7 +5,8 @@
* https://spdx.org/licenses
*/
#include <bl_common.h>
#include <common/bl_common.h>
#include <io_addr_dec.h>
#include <mvebu_def.h>
......
......@@ -5,22 +5,23 @@
* https://spdx.org/licenses
*/
#include <common/debug.h>
#ifdef USE_CCI
#include <drivers/arm/cci.h>
#endif
#include <lib/psci/psci.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <a3700_pm.h>
#include <arch_helpers.h>
#include <armada_common.h>
#include <debug.h>
#include <dram_win.h>
#include <io_addr_dec.h>
#include <mmio.h>
#include <mvebu.h>
#include <mvebu_def.h>
#include <marvell_plat_priv.h>
#include <platform.h>
#include <plat_marvell.h>
#include <psci.h>
#ifdef USE_CCI
#include <cci.h>
#endif
/* Warm reset register */
#define MVEBU_WARM_RESET_REG (MVEBU_NB_REGS_BASE + 0x840)
......
......@@ -6,7 +6,8 @@
*/
#include <arch_helpers.h>
#include <debug.h>
#include <common/debug.h>
#include <mv_ddr_if.h>
#include <plat_marvell.h>
......
......@@ -6,7 +6,8 @@
*/
#include <arch_helpers.h>
#include <debug.h>
#include <common/debug.h>
#include <mv_ddr_if.h>
#include <plat_marvell.h>
......
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