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
...@@ -3,12 +3,15 @@ ...@@ -3,12 +3,15 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <platform_def.h>
#include <arch.h> #include <arch.h>
#include <debug.h> #include <common/debug.h>
#include <mmio.h> #include <lib/mmio.h>
#include <plat/common/platform.h>
#include <mt8173_def.h> #include <mt8173_def.h>
#include <platform.h>
#include <platform_def.h>
#include <spm.h> #include <spm.h>
#include <spm_hotplug.h> #include <spm_hotplug.h>
#include <spm_mcdi.h> #include <spm_mcdi.h>
......
...@@ -3,10 +3,12 @@ ...@@ -3,10 +3,12 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bakery_lock.h>
#include <debug.h> #include <common/debug.h>
#include <delay_timer.h> #include <drivers/delay_timer.h>
#include <mmio.h> #include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <mt8173_def.h> #include <mt8173_def.h>
#include <spm.h> #include <spm.h>
#include <spm_suspend.h> #include <spm_suspend.h>
......
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h> #include <arch_helpers.h>
#include <lib/mmio.h>
#include <mcucfg.h> #include <mcucfg.h>
#include <mmio.h>
#include <mt8173_def.h> #include <mt8173_def.h>
#include <mt_cpuxgpt.h> #include <mt_cpuxgpt.h>
......
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
#ifndef MCUCFG_H #ifndef MCUCFG_H
#define MCUCFG_H #define MCUCFG_H
#include <mt8173_def.h>
#include <stdint.h> #include <stdint.h>
#include <mt8173_def.h>
struct mt8173_mcucfg_regs { struct mt8173_mcucfg_regs {
uint32_t mp0_ca7l_cache_config; uint32_t mp0_ca7l_cache_config;
struct { struct {
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <cci.h> #include <drivers/arm/cci.h>
#include <gic_common.h> #include <drivers/arm/gic_common.h>
#include <gicv2.h> #include <drivers/arm/gicv2.h>
#include <mt8173_def.h> #include <mt8173_def.h>
.section .rodata.gic_reg_name, "aS" .section .rodata.gic_reg_name, "aS"
......
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
#ifndef PLATFORM_DEF_H #ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <gic_common.h> #include <common/interrupt_props.h>
#include <interrupt_props.h> #include <drivers/arm/gic_common.h>
#include <utils_def.h> #include <lib/utils_def.h>
#include "mt8173_def.h" #include "mt8173_def.h"
/******************************************************************************* /*******************************************************************************
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h> #include <common/bl_common.h>
#include <lib/utils.h>
#include <mt8173_def.h> #include <mt8173_def.h>
#include <utils.h>
const unsigned int mt_irq_sec_array[] = { const unsigned int mt_irq_sec_array[] = {
MT_IRQ_SEC_SGI_0, MT_IRQ_SEC_SGI_0,
......
...@@ -4,22 +4,24 @@ ...@@ -4,22 +4,24 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <bakery_lock.h>
#include <cci.h>
#include <console.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <gicv2.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/arm/cci.h>
#include <drivers/arm/gicv2.h>
#include <drivers/console.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <mcucfg.h> #include <mcucfg.h>
#include <mmio.h>
#include <mt8173_def.h> #include <mt8173_def.h>
#include <mt_cpuxgpt.h> /* generic_timer_backup() */ #include <mt_cpuxgpt.h> /* generic_timer_backup() */
#include <plat_arm.h> #include <plat_arm.h>
#include <plat_private.h> #include <plat_private.h>
#include <power_tracer.h> #include <power_tracer.h>
#include <psci.h>
#include <rtc.h> #include <rtc.h>
#include <scu.h> #include <scu.h>
#include <spm_hotplug.h> #include <spm_hotplug.h>
......
...@@ -3,13 +3,15 @@ ...@@ -3,13 +3,15 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <common/debug.h>
#include <common/runtime_svc.h>
#include <lib/mmio.h>
#include <crypt.h> #include <crypt.h>
#include <debug.h>
#include <mmio.h>
#include <mtcmos.h> #include <mtcmos.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>
/* Authorized secure register list */ /* Authorized secure register list */
enum { enum {
......
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <platform_def.h> #include <platform_def.h>
#include <psci.h>
#include <arch.h>
#include <lib/psci/psci.h>
const unsigned char mtk_power_domain_tree_desc[] = { const unsigned char mtk_power_domain_tree_desc[] = {
/* No of root nodes */ /* No of root nodes */
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
*/ */
#include <arch.h> #include <arch.h>
#include <debug.h> #include <common/debug.h>
#include <power_tracer.h> #include <power_tracer.h>
#define trace_log(...) INFO("psci: " __VA_ARGS__) #define trace_log(...) INFO("psci: " __VA_ARGS__)
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
*/ */
#include <arch.h> #include <arch.h>
#include <lib/mmio.h>
#include <mcucfg.h> #include <mcucfg.h>
#include <mmio.h>
void disable_scu(unsigned long mpidr) void disable_scu(unsigned long mpidr)
{ {
......
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
*/ */
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <gicv2.h>
#include <interrupt_props.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <xlat_mmu_helpers.h>
#include <common/bl_common.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gicv2.h>
#include <lib/xlat_tables/xlat_mmu_helpers.h>
#include <plat/common/platform.h>
#include "gxbb_private.h" #include "gxbb_private.h"
......
...@@ -5,15 +5,17 @@ ...@@ -5,15 +5,17 @@
*/ */
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <debug.h>
#include <ep_info.h>
#include <interrupt_mgmt.h>
#include <meson_console.h>
#include <mmio.h>
#include <platform_def.h>
#include <stdint.h> #include <stdint.h>
#include <xlat_tables_v2.h>
#include <platform_def.h>
#include <bl31/interrupt_mgmt.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <common/ep_info.h>
#include <drivers/meson/meson_console.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
/******************************************************************************* /*******************************************************************************
* Platform memory map regions * Platform memory map regions
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef GXBB_DEF_H #ifndef GXBB_DEF_H
#define GXBB_DEF_H #define GXBB_DEF_H
#include <utils_def.h> #include <lib/utils_def.h>
/******************************************************************************* /*******************************************************************************
* System oscillator * System oscillator
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bakery_lock.h>
#include <mmio.h>
#include <platform_def.h> #include <platform_def.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
static DEFINE_BAKERY_LOCK(mhu_lock); static DEFINE_BAKERY_LOCK(mhu_lock);
void mhu_secure_message_start(void) void mhu_secure_message_start(void)
......
...@@ -4,16 +4,18 @@ ...@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <console.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <gicv2.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <psci.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/arm/gicv2.h>
#include <drivers/console.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include "gxbb_private.h" #include "gxbb_private.h"
......
...@@ -5,11 +5,13 @@ ...@@ -5,11 +5,13 @@
*/ */
#include <assert.h> #include <assert.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h>
#include <string.h> #include <string.h>
#include <platform_def.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include "gxbb_private.h" #include "gxbb_private.h"
#define SIZE_SHIFT 20 #define SIZE_SHIFT 20
......
...@@ -4,12 +4,14 @@ ...@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <mmio.h>
#include <platform_def.h>
#include <runtime_svc.h>
#include <stdint.h> #include <stdint.h>
#include <platform_def.h>
#include <common/debug.h>
#include <common/runtime_svc.h>
#include <lib/mmio.h>
#include "gxbb_private.h" #include "gxbb_private.h"
/******************************************************************************* /*******************************************************************************
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <platform_def.h>
#include <stdint.h> #include <stdint.h>
#include <platform_def.h>
#include <arch.h>
#include "gxbb_private.h" #include "gxbb_private.h"
/* The power domain tree descriptor */ /* The power domain tree descriptor */
......
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