diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2018-12-14 00:18:21 +0000 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2019-01-04 10:43:17 +0000 |
commit | 09d40e0e08283a249e7dce0e106c07c5141f9b7e (patch) | |
tree | 46e7af7b5be2738948b359b2a07078e4cf1bbec1 /plat/mediatek/mt6795 | |
parent | f5478dedf9e096d9539362b38ceb096b940ba3e2 (diff) | |
download | platform_external_arm-trusted-firmware-09d40e0e08283a249e7dce0e106c07c5141f9b7e.tar.gz platform_external_arm-trusted-firmware-09d40e0e08283a249e7dce0e106c07c5141f9b7e.tar.bz2 platform_external_arm-trusted-firmware-09d40e0e08283a249e7dce0e106c07c5141f9b7e.zip |
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: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform
to avoid collision."). More recently, this patch has had similar
problems: 46f9b2c3a282 ("drivers: add tzc380 support").
This problem was introduced in commit 4ecca33988b9 ("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: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'plat/mediatek/mt6795')
-rw-r--r-- | plat/mediatek/mt6795/bl31.ld.S | 2 | ||||
-rw-r--r-- | plat/mediatek/mt6795/bl31_plat_setup.c | 29 | ||||
-rw-r--r-- | plat/mediatek/mt6795/drivers/timer/mt_cpuxgpt.c | 10 | ||||
-rw-r--r-- | plat/mediatek/mt6795/include/mcucfg.h | 3 | ||||
-rw-r--r-- | plat/mediatek/mt6795/include/plat_macros.S | 2 | ||||
-rw-r--r-- | plat/mediatek/mt6795/include/plat_private.h | 3 | ||||
-rw-r--r-- | plat/mediatek/mt6795/include/platform_def.h | 2 | ||||
-rw-r--r-- | plat/mediatek/mt6795/plat_delay_timer.c | 5 | ||||
-rw-r--r-- | plat/mediatek/mt6795/plat_mt_gic.c | 7 | ||||
-rw-r--r-- | plat/mediatek/mt6795/plat_pm.c | 19 | ||||
-rw-r--r-- | plat/mediatek/mt6795/plat_topology.c | 5 | ||||
-rw-r--r-- | plat/mediatek/mt6795/power_tracer.c | 3 | ||||
-rw-r--r-- | plat/mediatek/mt6795/scu.c | 3 |
13 files changed, 54 insertions, 39 deletions
diff --git a/plat/mediatek/mt6795/bl31.ld.S b/plat/mediatek/mt6795/bl31.ld.S index 8f391df7e..6ec7a1ab4 100644 --- a/plat/mediatek/mt6795/bl31.ld.S +++ b/plat/mediatek/mt6795/bl31.ld.S @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <lib/xlat_tables/xlat_tables_defs.h> #include <platform_def.h> -#include <xlat_tables_defs.h> OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) OUTPUT_ARCH(PLATFORM_LINKER_ARCH) diff --git a/plat/mediatek/mt6795/bl31_plat_setup.c b/plat/mediatek/mt6795/bl31_plat_setup.c index 8df7dada8..2051fe763 100644 --- a/plat/mediatek/mt6795/bl31_plat_setup.c +++ b/plat/mediatek/mt6795/bl31_plat_setup.c @@ -3,25 +3,28 @@ * * SPDX-License-Identifier: BSD-3-Clause */ -#include <arch_helpers.h> + #include <assert.h> -#include <bl_common.h> -#include <cci.h> -#include <common_def.h> -#include <console.h> -#include <context_mgmt.h> -#include <debug.h> -#include <generic_delay_timer.h> +#include <string.h> + +#include <arch_helpers.h> +#include <common/bl_common.h> +#include <common/debug.h> +#include <drivers/arm/cci.h> +#include <drivers/console.h> +#include <drivers/generic_delay_timer.h> +#include <lib/el3_runtime/context_mgmt.h> +#include <lib/mmio.h> +#include <lib/utils_def.h> +#include <lib/xlat_tables/xlat_tables.h> +#include <plat/common/common_def.h> +#include <plat/common/platform.h> + #include <mcucfg.h> -#include <mmio.h> #include <mt_cpuxgpt.h> #include <mtk_plat_common.h> #include <mtk_sip_svc.h> #include <plat_private.h> -#include <platform.h> -#include <string.h> -#include <utils_def.h> -#include <xlat_tables.h> /******************************************************************************* * Declarations of linker defined symbols which will help us find the layout diff --git a/plat/mediatek/mt6795/drivers/timer/mt_cpuxgpt.c b/plat/mediatek/mt6795/drivers/timer/mt_cpuxgpt.c index b357972e4..3696f8eec 100644 --- a/plat/mediatek/mt6795/drivers/timer/mt_cpuxgpt.c +++ b/plat/mediatek/mt6795/drivers/timer/mt_cpuxgpt.c @@ -4,13 +4,15 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <stdint.h> #include <arch_helpers.h> -#include <debug.h> -#include <mmio.h> +#include <common/debug.h> +#include <lib/mmio.h> +#include <plat/common/platform.h> + #include <mt_cpuxgpt.h> -#include <platform.h> -#include <stdint.h> + #define CPUXGPT_BASE 0x10200000 #define INDEX_BASE (CPUXGPT_BASE+0x0674) #define CTL_BASE (CPUXGPT_BASE+0x0670) diff --git a/plat/mediatek/mt6795/include/mcucfg.h b/plat/mediatek/mt6795/include/mcucfg.h index 7f6a78655..21c539462 100644 --- a/plat/mediatek/mt6795/include/mcucfg.h +++ b/plat/mediatek/mt6795/include/mcucfg.h @@ -7,9 +7,10 @@ #ifndef MCUCFG_H #define MCUCFG_H -#include <platform_def.h> #include <stdint.h> +#include <platform_def.h> + struct mt6795_mcucfg_regs { uint32_t mp0_ca7l_cache_config; struct { diff --git a/plat/mediatek/mt6795/include/plat_macros.S b/plat/mediatek/mt6795/include/plat_macros.S index 7485647f3..d198fdc11 100644 --- a/plat/mediatek/mt6795/include/plat_macros.S +++ b/plat/mediatek/mt6795/include/plat_macros.S @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include <cci.h> +#include <drivers/arm/cci.h> #include <platform_def.h> .section .rodata.gic_reg_name, "aS" diff --git a/plat/mediatek/mt6795/include/plat_private.h b/plat/mediatek/mt6795/include/plat_private.h index 10baa23d9..f7450ca1c 100644 --- a/plat/mediatek/mt6795/include/plat_private.h +++ b/plat/mediatek/mt6795/include/plat_private.h @@ -8,7 +8,8 @@ #define PLAT_PRIVATE_H #include <stdint.h> -#include <xlat_tables.h> + +#include <lib/xlat_tables/xlat_tables.h> void plat_configure_mmu_el3(unsigned long total_base, unsigned long total_size, diff --git a/plat/mediatek/mt6795/include/platform_def.h b/plat/mediatek/mt6795/include/platform_def.h index 0110e192d..301610d4c 100644 --- a/plat/mediatek/mt6795/include/platform_def.h +++ b/plat/mediatek/mt6795/include/platform_def.h @@ -7,7 +7,7 @@ #ifndef PLATFORM_DEF_H #define PLATFORM_DEF_H -#include <utils_def.h> +#include <lib/utils_def.h> #define PLAT_PRIMARY_CPU 0x0 diff --git a/plat/mediatek/mt6795/plat_delay_timer.c b/plat/mediatek/mt6795/plat_delay_timer.c index 9df286771..965b65348 100644 --- a/plat/mediatek/mt6795/plat_delay_timer.c +++ b/plat/mediatek/mt6795/plat_delay_timer.c @@ -4,10 +4,11 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include <arch_helpers.h> -#include <delay_timer.h> #include <platform_def.h> +#include <arch_helpers.h> +#include <drivers/delay_timer.h> + static uint32_t plat_get_timer_value(void) { /* diff --git a/plat/mediatek/mt6795/plat_mt_gic.c b/plat/mediatek/mt6795/plat_mt_gic.c index 11282fc54..20cb26d5e 100644 --- a/plat/mediatek/mt6795/plat_mt_gic.c +++ b/plat/mediatek/mt6795/plat_mt_gic.c @@ -4,11 +4,12 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include <gicv2.h> -#include <interrupt_props.h> -#include <platform.h> #include <platform_def.h> +#include <common/interrupt_props.h> +#include <drivers/arm/gicv2.h> +#include <plat/common/platform.h> + static const interrupt_prop_t g0_interrupt_props[] = { INTR_PROP_DESC(FIQ_SMP_CALL_SGI, GIC_HIGHEST_SEC_PRIORITY, GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL), diff --git a/plat/mediatek/mt6795/plat_pm.c b/plat/mediatek/mt6795/plat_pm.c index d0506645f..0dfbd1846 100644 --- a/plat/mediatek/mt6795/plat_pm.c +++ b/plat/mediatek/mt6795/plat_pm.c @@ -4,19 +4,22 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include <arch_helpers.h> #include <assert.h> -#include <bakery_lock.h> -#include <cci.h> -#include <console.h> -#include <debug.h> #include <errno.h> + +#include <platform_def.h> + +#include <arch_helpers.h> +#include <common/debug.h> +#include <drivers/arm/cci.h> +#include <drivers/console.h> +#include <lib/bakery_lock.h> +#include <lib/mmio.h> +#include <lib/psci/psci.h> + #include <mcucfg.h> -#include <mmio.h> #include <plat_private.h> -#include <platform_def.h> #include <power_tracer.h> -#include <psci.h> #include <scu.h> struct core_context { diff --git a/plat/mediatek/mt6795/plat_topology.c b/plat/mediatek/mt6795/plat_topology.c index 0a0cf8d78..7425d2667 100644 --- a/plat/mediatek/mt6795/plat_topology.c +++ b/plat/mediatek/mt6795/plat_topology.c @@ -4,9 +4,10 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include <arch.h> #include <platform_def.h> -#include <psci.h> + +#include <arch.h> +#include <lib/psci/psci.h> unsigned int plat_get_aff_count(unsigned int aff_lvl, unsigned long mpidr) { diff --git a/plat/mediatek/mt6795/power_tracer.c b/plat/mediatek/mt6795/power_tracer.c index 56e22402f..64d086d80 100644 --- a/plat/mediatek/mt6795/power_tracer.c +++ b/plat/mediatek/mt6795/power_tracer.c @@ -5,7 +5,8 @@ */ #include <arch.h> -#include <debug.h> +#include <common/debug.h> + #include <power_tracer.h> #define trace_log(...) INFO("psci: " __VA_ARGS__) diff --git a/plat/mediatek/mt6795/scu.c b/plat/mediatek/mt6795/scu.c index 9add19e5a..3b7452787 100644 --- a/plat/mediatek/mt6795/scu.c +++ b/plat/mediatek/mt6795/scu.c @@ -5,8 +5,9 @@ */ #include <arch.h> +#include <lib/mmio.h> + #include <mcucfg.h> -#include <mmio.h> void disable_scu(unsigned long mpidr) { |