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,17 +5,20 @@ ...@@ -5,17 +5,20 @@
* https://spdx.org/licenses * https://spdx.org/licenses
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <bl_common.h> #include <string.h>
#include <console.h>
#include <debug.h>
#include <desc_image_load.h>
#include <marvell_def.h>
#include <platform_def.h> #include <platform_def.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <common/desc_image_load.h>
#include <drivers/console.h>
#include <lib/utils.h>
#include <marvell_def.h>
#include <plat_marvell.h> #include <plat_marvell.h>
#include <string.h>
#include <utils.h>
/* Data structure which holds the extents of the trusted SRAM for BL2 */ /* Data structure which holds the extents of the trusted SRAM for BL2 */
static meminfo_t bl2_tzram_layout __aligned(CACHE_WRITEBACK_GRANULE); static meminfo_t bl2_tzram_layout __aligned(CACHE_WRITEBACK_GRANULE);
......
...@@ -5,18 +5,19 @@ ...@@ -5,18 +5,19 @@
* https://spdx.org/licenses * https://spdx.org/licenses
*/ */
#include <arch.h>
#include <assert.h> #include <assert.h>
#include <console.h>
#include <debug.h>
#include <marvell_def.h>
#include <marvell_plat_priv.h>
#include <plat_marvell.h>
#include <platform.h>
#include <arch.h>
#include <common/debug.h>
#ifdef USE_CCI #ifdef USE_CCI
#include <cci.h> #include <drivers/arm/cci.h>
#endif #endif
#include <drivers/console.h>
#include <plat/common/platform.h>
#include <marvell_def.h>
#include <marvell_plat_priv.h>
#include <plat_marvell.h>
/* /*
* The next 3 constants identify the extents of the code, RO data region and the * The next 3 constants identify the extents of the code, RO data region and the
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
* https://spdx.org/licenses * https://spdx.org/licenses
*/ */
#include <cci.h> #include <drivers/arm/cci.h>
#include <plat_marvell.h> #include <plat_marvell.h>
static const int cci_map[] = { static const int cci_map[] = {
......
...@@ -4,18 +4,21 @@ ...@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h> #include <assert.h>
#include <console.h>
#include <debug.h>
#include <plat_marvell.h>
#include <platform_def.h> #include <platform_def.h>
#include <common/debug.h>
#include <drivers/console.h>
#include <plat_marvell.h>
#ifdef PLAT_a3700 #ifdef PLAT_a3700
#include <a3700_console.h> #include <drivers/marvell/uart/a3700_console.h>
static console_a3700_t marvell_boot_console; static console_a3700_t marvell_boot_console;
static console_a3700_t marvell_runtime_console; static console_a3700_t marvell_runtime_console;
#else #else
#include <uart_16550.h> #include <drivers/ti/uart/uart_16550.h>
static console_16550_t marvell_boot_console; static console_16550_t marvell_boot_console;
static console_16550_t marvell_runtime_console; static console_16550_t marvell_runtime_console;
......
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
* https://spdx.org/licenses * https://spdx.org/licenses
*/ */
#include <debug.h>
#include <platform_def.h> #include <platform_def.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <ddr_info.h> #include <ddr_info.h>
#include <mmio.h>
#define DRAM_CH0_MMAP_LOW_REG(iface, cs, base) \ #define DRAM_CH0_MMAP_LOW_REG(iface, cs, base) \
(base + DRAM_CH0_MMAP_LOW_OFFSET + (iface) * 0x10000 + (cs) * 0x8) (base + DRAM_CH0_MMAP_LOW_OFFSET + (iface) * 0x10000 + (cs) * 0x8)
......
...@@ -5,15 +5,17 @@ ...@@ -5,15 +5,17 @@
* https://spdx.org/licenses * https://spdx.org/licenses
*/ */
#include <bakery_lock.h>
#include <debug.h>
#include <gicv2.h>
#include <interrupt_mgmt.h>
#include <mmio.h>
#include <plat_marvell.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <bl31/interrupt_mgmt.h>
#include <common/debug.h>
#include <drivers/arm/gicv2.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <plat_marvell.h>
/* /*
* The following functions are defined as weak to allow a platform to override * The following functions are defined as weak to allow a platform to override
* the way the GICv2 driver is initialised and used. * the way the GICv2 driver is initialised and used.
......
...@@ -5,13 +5,15 @@ ...@@ -5,13 +5,15 @@
* https://spdx.org/licenses * https://spdx.org/licenses
*/ */
#include <debug.h> #include <platform_def.h>
#include <gicv3.h>
#include <interrupt_props.h> #include <common/debug.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gicv3.h>
#include <plat/common/platform.h>
#include <marvell_def.h> #include <marvell_def.h>
#include <plat_marvell.h> #include <plat_marvell.h>
#include <platform.h>
#include <platform_def.h>
/****************************************************************************** /******************************************************************************
* The following functions are defined as weak to allow a platform to override * The following functions are defined as weak to allow a platform to override
......
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h>
#include <desc_image_load.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <common/bl_common.h>
#include <common/desc_image_load.h>
#include <plat/common/platform.h>
/******************************************************************************* /*******************************************************************************
* This function flushes the data structures so that they are visible * This function flushes the data structures so that they are visible
* in memory for the next BL image. * in memory for the next BL image.
......
...@@ -6,16 +6,18 @@ ...@@ -6,16 +6,18 @@
*/ */
#include <assert.h> #include <assert.h>
#include <bl_common.h> /* For ARRAY_SIZE */
#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 <string.h> #include <string.h>
#include <platform_def.h>
#include <common/bl_common.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 */ /* IO devices */
static const io_dev_connector_t *fip_dev_con; static const io_dev_connector_t *fip_dev_con;
static uintptr_t fip_dev_handle; static uintptr_t fip_dev_handle;
......
...@@ -5,9 +5,11 @@ ...@@ -5,9 +5,11 @@
* https://spdx.org/licenses * https://spdx.org/licenses
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <psci.h>
#include <arch_helpers.h>
#include <lib/psci/psci.h>
#include <marvell_pm.h> #include <marvell_pm.h>
/* Standard ARM platforms are expected to export plat_arm_psci_pm_ops */ /* Standard ARM platforms are expected to export plat_arm_psci_pm_ops */
......
...@@ -5,13 +5,15 @@ ...@@ -5,13 +5,15 @@
* https://spdx.org/licenses * https://spdx.org/licenses
*/ */
#include <ap_setup.h> #include <common/debug.h>
#include <cache_llc.h> #include <common/runtime_svc.h>
#include <debug.h> #include <drivers/marvell/cache_llc.h>
#include <drivers/marvell/mochi/ap_setup.h>
#include <lib/smccc.h>
#include <marvell_plat_priv.h> #include <marvell_plat_priv.h>
#include <plat_marvell.h> #include <plat_marvell.h>
#include <runtime_svc.h>
#include <smccc.h>
#include "comphy/phy-comphy-cp110.h" #include "comphy/phy-comphy-cp110.h"
/* #define DEBUG_COMPHY */ /* #define DEBUG_COMPHY */
......
...@@ -5,11 +5,13 @@ ...@@ -5,11 +5,13 @@
* https://spdx.org/licenses * https://spdx.org/licenses
*/ */
#include <plat_marvell.h>
#include <debug.h>
#include <string.h> #include <string.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <plat_marvell.h>
#include <mss_ipc_drv.h> #include <mss_ipc_drv.h>
#include <mmio.h>
#define IPC_MSG_BASE_MASK MVEBU_REGS_BASE_MASK #define IPC_MSG_BASE_MASK MVEBU_REGS_BASE_MASK
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#ifndef MSS_IPC_DRV_H #ifndef MSS_IPC_DRV_H
#define MSS_IPC_DRV_H #define MSS_IPC_DRV_H
#include <psci.h> #include <lib/psci/psci.h>
#define MV_PM_FW_IPC_VERSION_MAGIC (0xCA530000) /* Do NOT change */ #define MV_PM_FW_IPC_VERSION_MAGIC (0xCA530000) /* Do NOT change */
/* Increament for each version */ /* Increament for each version */
......
...@@ -6,11 +6,13 @@ ...@@ -6,11 +6,13 @@
*/ */
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <mmio.h>
#include <arch_helpers.h> /* for cache maintanance operations */
#include <platform_def.h> #include <platform_def.h>
#include <delay_timer.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <plat_pm_trace.h> #include <plat_pm_trace.h>
#include <mss_scp_bootloader.h> #include <mss_scp_bootloader.h>
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
*/ */
#include <arch_helpers.h> #include <arch_helpers.h>
#include <delay_timer.h> #include <drivers/delay_timer.h>
#include <mvebu_def.h> #include <mvebu_def.h>
#define SYS_COUNTER_FREQ_IN_MHZ (COUNTER_FREQUENCY/1000000) #define SYS_COUNTER_FREQ_IN_MHZ (COUNTER_FREQUENCY/1000000)
......
...@@ -3,15 +3,18 @@ ...@@ -3,15 +3,18 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h>
#include <stdint.h>
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <assert.h> #include <common/debug.h>
#include <debug.h> #include <common/runtime_svc.h>
#include <plat/common/platform.h>
#include <tools_share/uuid.h>
#include <oem_svc.h> #include <oem_svc.h>
#include <platform.h>
#include <runtime_svc.h>
#include <stdint.h>
#include <uuid.h>
/* OEM Service UUID */ /* OEM Service UUID */
DEFINE_SVC_UUID2(oem_svc_uid, DEFINE_SVC_UUID2(oem_svc_uid,
......
...@@ -3,17 +3,19 @@ ...@@ -3,17 +3,19 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h> #include <arch_helpers.h>
#include <bl_common.h> #include <common/bl_common.h>
#include <cci.h> #include <common/debug.h>
#include <console.h> #include <drivers/arm/cci.h>
#include <debug.h> #include <drivers/console.h>
#include <mmio.h> #include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/platform.h>
#include <mtk_plat_common.h> #include <mtk_plat_common.h>
#include <mtk_sip_svc.h> #include <mtk_sip_svc.h>
#include <plat_private.h> #include <plat_private.h>
#include <platform.h>
#include <xlat_tables.h>
struct atf_arg_t gteearg; struct atf_arg_t gteearg;
......
...@@ -6,10 +6,11 @@ ...@@ -6,10 +6,11 @@
#ifndef MTK_PLAT_COMMON_H #ifndef MTK_PLAT_COMMON_H
#define MTK_PLAT_COMMON_H #define MTK_PLAT_COMMON_H
#include <bl_common.h>
#include <param_header.h>
#include <stdint.h> #include <stdint.h>
#include <common/bl_common.h>
#include <common/param_header.h>
/******************************************************************************* /*******************************************************************************
* Function and variable prototypes * Function and variable prototypes
******************************************************************************/ ******************************************************************************/
......
...@@ -3,15 +3,18 @@ ...@@ -3,15 +3,18 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h> #include <assert.h>
#include <console.h>
#include <debug.h> #include <common/debug.h>
#include <mmio.h> #include <common/runtime_svc.h>
#include <drivers/console.h>
#include <lib/mmio.h>
#include <tools_share/uuid.h>
#include <mtk_plat_common.h> #include <mtk_plat_common.h>
#include <mtk_sip_svc.h> #include <mtk_sip_svc.h>
#include <plat_sip_calls.h> #include <plat_sip_calls.h>
#include <runtime_svc.h>
#include <uuid.h>
/* Mediatek SiP Service UUID */ /* Mediatek SiP Service UUID */
DEFINE_SVC_UUID2(mtk_sip_svc_uid, DEFINE_SVC_UUID2(mtk_sip_svc_uid,
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <platform_def.h> #include <platform_def.h>
#include <xlat_tables_defs.h>
OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
OUTPUT_ARCH(PLATFORM_LINKER_ARCH) OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
......
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