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
...@@ -4,9 +4,12 @@ ...@@ -4,9 +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 "qemu_private.h" #include "qemu_private.h"
/* The power domain tree descriptor */ /* The power domain tree descriptor */
......
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
#include <arch.h> #include <arch.h>
#include <asm_macros.S> #include <asm_macros.S>
#include <bl_common.h> #include <common/bl_common.h>
#include <common/runtime_svc.h>
#include <cortex_a57.h> #include <cortex_a57.h>
#include <platform_def.h> #include <platform_def.h>
#include <runtime_svc.h>
#include "rcar_def.h" #include "rcar_def.h"
.globl plat_get_my_entrypoint .globl plat_get_my_entrypoint
......
...@@ -5,17 +5,19 @@ ...@@ -5,17 +5,19 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <platform_def.h>
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <bl_common.h> #include <common/bl_common.h>
#include <debug.h> #include <common/debug.h>
#include <gicv2.h> #include <common/interrupt_props.h>
#include <gic_common.h> #include <drivers/arm/gicv2.h>
#include <interrupt_props.h> #include <drivers/arm/gic_common.h>
#include <mmio.h> #include <lib/mmio.h>
#include <platform.h> #include <lib/xlat_tables/xlat_tables_v2.h>
#include <platform_def.h> #include <plat/common/platform.h>
#include <xlat_tables_v2.h>
#include "rcar_def.h" #include "rcar_def.h"
#include "rcar_private.h" #include "rcar_private.h"
#include "rcar_version.h" #include "rcar_version.h"
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h> #include <common/debug.h>
#include <mmio.h> #include <lib/mmio.h>
#include "rcar_def.h" #include "rcar_def.h"
#include "cpg_registers.h" #include "cpg_registers.h"
#include "rcar_private.h" #include "rcar_private.h"
......
...@@ -5,11 +5,12 @@ ...@@ -5,11 +5,12 @@
*/ */
#include <arch_helpers.h> #include <arch_helpers.h>
#include <bl_common.h> #include <common/bl_common.h>
#include <debug.h> #include <common/debug.h>
#include <gicv2.h> #include <common/runtime_svc.h>
#include <mmio.h> #include <drivers/arm/gicv2.h>
#include <runtime_svc.h> #include <lib/mmio.h>
#include "rcar_def.h" #include "rcar_def.h"
#define SWDT_ERROR_ID (1024U) #define SWDT_ERROR_ID (1024U)
......
...@@ -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 <xlat_tables_defs.h>
#include <common/bl_common.h>
#include <common/desc_image_load.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <plat/common/platform.h>
#if (RCAR_BL33_EXECUTION_EL != 0) && (RCAR_BL33_EXECUTION_EL != 1) #if (RCAR_BL33_EXECUTION_EL != 0) && (RCAR_BL33_EXECUTION_EL != 1)
#error #error
......
...@@ -4,18 +4,21 @@ ...@@ -4,18 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <desc_image_load.h> #include <string.h>
#include <arch_helpers.h>
#include <bl_common.h>
#include <bl1.h>
#include <console.h>
#include <debug.h>
#include <libfdt.h> #include <libfdt.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <string.h>
#include <xlat_tables_defs.h> #include <arch_helpers.h>
#include <bl1/bl1.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <common/desc_image_load.h>
#include <drivers/console.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <plat/common/platform.h>
#include "avs_driver.h" #include "avs_driver.h"
#include "boot_init_dram.h" #include "boot_init_dram.h"
......
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <lib/mmio.h>
#include <lib/utils_def.h>
#include "axi_registers.h" #include "axi_registers.h"
#include "lifec_registers.h" #include "lifec_registers.h"
#include "micro_delay.h" #include "micro_delay.h"
#include "mmio.h"
#include "utils_def.h"
static void lifec_security_setting(void); static void lifec_security_setting(void);
static void axi_security_setting(void); static void axi_security_setting(void);
......
...@@ -5,16 +5,18 @@ ...@@ -5,16 +5,18 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <stddef.h>
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <bl_common.h> #include <bl31/bl31.h>
#include <bl31.h> #include <common/bl_common.h>
#include <cci.h> #include <common/debug.h>
#include <console.h> #include <drivers/arm/cci.h>
#include <mmio.h> #include <drivers/console.h>
#include <platform.h> #include <lib/mmio.h>
#include <stddef.h> #include <plat/common/platform.h>
#include <debug.h>
#include "pwrc.h" #include "pwrc.h"
#include "rcar_def.h" #include "rcar_def.h"
#include "rcar_private.h" #include "rcar_private.h"
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
#ifndef RCAR_PLAT_LD_S #ifndef RCAR_PLAT_LD_S
#define RCAR_PLAT_LD_S #define RCAR_PLAT_LD_S
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <platform_def.h> #include <platform_def.h>
#include <xlat_tables_defs.h>
MEMORY { MEMORY {
SRAM (rwx): ORIGIN = BL31_SRAM_BASE, LENGTH = DEVICE_SRAM_SIZE SRAM (rwx): ORIGIN = BL31_SRAM_BASE, LENGTH = DEVICE_SRAM_SIZE
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
* 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 "rcar_def.h" #include "rcar_def.h"
.section .rodata.gic_reg_name, "aS" .section .rodata.gic_reg_name, "aS"
......
...@@ -7,10 +7,12 @@ ...@@ -7,10 +7,12 @@
#ifndef PLATFORM_DEF_H #ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <arch.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#include <arch.h>
#include "rcar_def.h" #include "rcar_def.h"
/******************************************************************************* /*******************************************************************************
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#ifndef RCAR_DEF_H #ifndef RCAR_DEF_H
#define RCAR_DEF_H #define RCAR_DEF_H
#include <tbbr_img_def.h> #include <common/tbbr/tbbr_img_def.h>
#include <utils_def.h> #include <lib/utils_def.h>
#define RCAR_PRIMARY_CPU 0x0 #define RCAR_PRIMARY_CPU 0x0
#define RCAR_TRUSTED_SRAM_BASE 0x44000000 #define RCAR_TRUSTED_SRAM_BASE 0x44000000
......
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
#ifndef RCAR_PRIVATE_H #ifndef RCAR_PRIVATE_H
#define RCAR_PRIVATE_H #define RCAR_PRIVATE_H
#include <bakery_lock.h>
#include <bl_common.h>
#include <cpu_data.h>
#include <platform_def.h> #include <platform_def.h>
#include <common/bl_common.h>
#include <lib/bakery_lock.h>
#include <lib/el3_runtime/cpu_data.h>
typedef volatile struct mailbox { typedef volatile struct mailbox {
unsigned long value __aligned(CACHE_WRITEBACK_GRANULE); unsigned long value __aligned(CACHE_WRITEBACK_GRANULE);
} mailbox_t; } mailbox_t;
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h> #include <common/bl_common.h>
#include <desc_image_load.h> #include <common/desc_image_load.h>
#include <platform.h> #include <plat/common/platform.h>
extern void bl2_plat_flush_bl31_params(void); extern void bl2_plat_flush_bl31_params(void);
......
...@@ -4,17 +4,19 @@ ...@@ -4,17 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <bakery_lock.h>
#include <bl_common.h>
#include <cci.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/bl_common.h>
#include <common/debug.h>
#include <drivers/arm/cci.h>
#include <drivers/arm/gicv2.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include "iic_dvfs.h" #include "iic_dvfs.h"
#include "pwrc.h" #include "pwrc.h"
......
...@@ -4,12 +4,15 @@ ...@@ -4,12 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <io_driver.h>
#include <io_storage.h>
#include <io_semihosting.h>
#include <platform_def.h>
#include <string.h> #include <string.h>
#include <platform_def.h>
#include <common/debug.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_storage.h>
#include <drivers/io/io_semihosting.h>
#include "io_common.h" #include "io_common.h"
#include "io_rcar.h" #include "io_rcar.h"
#include "io_memdrv.h" #include "io_memdrv.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 <platform_def.h> #include <platform_def.h>
#include <psci.h>
#include <common/debug.h>
#include <lib/psci/psci.h>
static const unsigned char rcar_power_domain_tree_desc[] = { static const unsigned char rcar_power_domain_tree_desc[] = {
1, 1,
......
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <platform_def.h>
#include <arch.h> #include <arch.h>
#include <asm_macros.S> #include <asm_macros.S>
#include <bl_common.h> #include <common/bl_common.h>
#include <cortex_a53.h> #include <cortex_a53.h>
#include <cortex_a72.h> #include <cortex_a72.h>
#include <plat_private.h> #include <plat_private.h>
#include <platform_def.h>
#include <plat_pmu_macros.S> #include <plat_pmu_macros.S>
.globl cpuson_entry_point .globl cpuson_entry_point
......
...@@ -4,15 +4,18 @@ ...@@ -4,15 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <string.h>
#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 <plat_private.h> #include <plat_private.h>
#include <platform_def.h>
#include <string.h>
#include <utils.h>
#include <xlat_tables.h>
#ifdef PLAT_RK_CCI_BASE #ifdef PLAT_RK_CCI_BASE
static const int cci_map[] = { static const int cci_map[] = {
......
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