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,25 +3,28 @@ ...@@ -3,25 +3,28 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <bl_common.h> #include <string.h>
#include <cci.h>
#include <common_def.h> #include <arch_helpers.h>
#include <console.h> #include <common/bl_common.h>
#include <context_mgmt.h> #include <common/debug.h>
#include <debug.h> #include <drivers/arm/cci.h>
#include <generic_delay_timer.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 <mcucfg.h>
#include <mmio.h>
#include <mt_cpuxgpt.h> #include <mt_cpuxgpt.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 <string.h>
#include <utils_def.h>
#include <xlat_tables.h>
/******************************************************************************* /*******************************************************************************
* Declarations of linker defined symbols which will help us find the layout * Declarations of linker defined symbols which will help us find the layout
......
...@@ -4,13 +4,15 @@ ...@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <stdint.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <debug.h> #include <common/debug.h>
#include <mmio.h> #include <lib/mmio.h>
#include <plat/common/platform.h>
#include <mt_cpuxgpt.h> #include <mt_cpuxgpt.h>
#include <platform.h>
#include <stdint.h>
#define CPUXGPT_BASE 0x10200000 #define CPUXGPT_BASE 0x10200000
#define INDEX_BASE (CPUXGPT_BASE+0x0674) #define INDEX_BASE (CPUXGPT_BASE+0x0674)
#define CTL_BASE (CPUXGPT_BASE+0x0670) #define CTL_BASE (CPUXGPT_BASE+0x0670)
......
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
#ifndef MCUCFG_H #ifndef MCUCFG_H
#define MCUCFG_H #define MCUCFG_H
#include <platform_def.h>
#include <stdint.h> #include <stdint.h>
#include <platform_def.h>
struct mt6795_mcucfg_regs { struct mt6795_mcucfg_regs {
uint32_t mp0_ca7l_cache_config; uint32_t mp0_ca7l_cache_config;
struct { struct {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <cci.h> #include <drivers/arm/cci.h>
#include <platform_def.h> #include <platform_def.h>
.section .rodata.gic_reg_name, "aS" .section .rodata.gic_reg_name, "aS"
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
#define PLAT_PRIVATE_H #define PLAT_PRIVATE_H
#include <stdint.h> #include <stdint.h>
#include <xlat_tables.h>
#include <lib/xlat_tables/xlat_tables.h>
void plat_configure_mmu_el3(unsigned long total_base, void plat_configure_mmu_el3(unsigned long total_base,
unsigned long total_size, unsigned long total_size,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef PLATFORM_DEF_H #ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <utils_def.h> #include <lib/utils_def.h>
#define PLAT_PRIMARY_CPU 0x0 #define PLAT_PRIMARY_CPU 0x0
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <delay_timer.h>
#include <platform_def.h> #include <platform_def.h>
#include <arch_helpers.h>
#include <drivers/delay_timer.h>
static uint32_t plat_get_timer_value(void) static uint32_t plat_get_timer_value(void)
{ {
/* /*
......
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <gicv2.h>
#include <interrupt_props.h>
#include <platform.h>
#include <platform_def.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[] = { static const interrupt_prop_t g0_interrupt_props[] = {
INTR_PROP_DESC(FIQ_SMP_CALL_SGI, GIC_HIGHEST_SEC_PRIORITY, INTR_PROP_DESC(FIQ_SMP_CALL_SGI, GIC_HIGHEST_SEC_PRIORITY,
GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL), GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
......
...@@ -4,19 +4,22 @@ ...@@ -4,19 +4,22 @@
* 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 <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 <mcucfg.h>
#include <mmio.h>
#include <plat_private.h> #include <plat_private.h>
#include <platform_def.h>
#include <power_tracer.h> #include <power_tracer.h>
#include <psci.h>
#include <scu.h> #include <scu.h>
struct core_context { struct core_context {
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
* 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>
unsigned int plat_get_aff_count(unsigned int aff_lvl, unsigned long mpidr) unsigned int plat_get_aff_count(unsigned int aff_lvl, unsigned long mpidr)
{ {
......
...@@ -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)
{ {
......
...@@ -3,14 +3,17 @@ ...@@ -3,14 +3,17 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <platform_def.h>
#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 <debug.h> #include <drivers/arm/cci.h>
#include <lib/utils.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <mt8173_def.h> #include <mt8173_def.h>
#include <platform_def.h>
#include <utils.h>
#include <xlat_tables.h>
static const int cci_map[] = { static const int cci_map[] = {
PLAT_MT_CCI_CLUSTER0_SL_IFACE_IX, PLAT_MT_CCI_CLUSTER0_SL_IFACE_IX,
......
...@@ -3,19 +3,22 @@ ...@@ -3,19 +3,22 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h> #include <assert.h>
#include <bl_common.h>
#include <common_def.h> #include <common/bl_common.h>
#include <console.h> #include <common/debug.h>
#include <debug.h> #include <drivers/console.h>
#include <generic_delay_timer.h> #include <drivers/generic_delay_timer.h>
#include <lib/mmio.h>
#include <plat/common/common_def.h>
#include <plat/common/platform.h>
#include <mcucfg.h> #include <mcucfg.h>
#include <mmio.h>
#include <mtcmos.h> #include <mtcmos.h>
#include <mtk_plat_common.h> #include <mtk_plat_common.h>
#include <plat_arm.h> #include <plat_arm.h>
#include <plat_private.h> #include <plat_private.h>
#include <platform.h>
#include <spm.h> #include <spm.h>
static entry_point_info_t bl32_ep_info; static entry_point_info_t bl32_ep_info;
......
...@@ -3,12 +3,15 @@ ...@@ -3,12 +3,15 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.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 <drivers/delay_timer.h>
#include <delay_timer.h> #include <lib/mmio.h>
#include <mmio.h>
#include <mt8173_def.h> #include <mt8173_def.h>
#include <mtk_sip_svc.h> #include <mtk_sip_svc.h>
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h> #include <common/debug.h>
#include <delay_timer.h> #include <drivers/delay_timer.h>
#include <mmio.h> #include <lib/mmio.h>
#include <mt8173_def.h> #include <mt8173_def.h>
#include <mtcmos.h> #include <mtcmos.h>
#include <spm.h> #include <spm.h>
......
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <delay_timer.h> #include <common/debug.h>
#include <mmio.h> #include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <mt8173_def.h> #include <mt8173_def.h>
#include <pmic_wrap_init.h> #include <pmic_wrap_init.h>
......
...@@ -3,9 +3,12 @@ ...@@ -3,9 +3,12 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <delay_timer.h> #include <common/debug.h>
#include <drivers/delay_timer.h>
#include <mt8173_def.h> #include <mt8173_def.h>
#include <pmic_wrap_init.h> #include <pmic_wrap_init.h>
#include <rtc.h> #include <rtc.h>
......
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bakery_lock.h>
#include <debug.h> #include <common/debug.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,10 +3,12 @@ ...@@ -3,10 +3,12 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h> #include <arch.h>
#include <mmio.h> #include <lib/mmio.h>
#include <mt8173_def.h> #include <mt8173_def.h>
#include <platform.h> #include <plat/common/platform.h>
#include <spm.h> #include <spm.h>
#include <spm_hotplug.h> #include <spm_hotplug.h>
#include <spm_mcdi.h> #include <spm_mcdi.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