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
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
#ifndef IMX_WDOG_H #ifndef IMX_WDOG_H
#define IMX_WDOG_H #define IMX_WDOG_H
#include <arch.h>
#include <stdint.h> #include <stdint.h>
#include <arch.h>
struct wdog_regs { struct wdog_regs {
uint16_t wcr; uint16_t wcr;
uint16_t wsr; uint16_t wsr;
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#ifndef PLAT_IMX8_H #ifndef PLAT_IMX8_H
#define PLAT_IMX8_H #define PLAT_IMX8_H
#include <gicv3.h> #include <drivers/arm/gicv3.h>
#include <psci.h> #include <lib/psci/psci.h>
unsigned int plat_calc_core_pos(uint64_t mpidr); unsigned int plat_calc_core_pos(uint64_t mpidr);
void imx_mailbox_init(uintptr_t base_addr); void imx_mailbox_init(uintptr_t base_addr);
......
...@@ -13,9 +13,10 @@ ...@@ -13,9 +13,10 @@
/* Includes */ /* Includes */
#include <stdbool.h>
#include <sci/sci_types.h> #include <sci/sci_types.h>
#include <sci/sci_ipc.h> #include <sci/sci_ipc.h>
#include <stdbool.h>
/* Defines */ /* Defines */
......
...@@ -4,13 +4,15 @@ ...@@ -4,13 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bl_common.h>
#include <gicv3.h>
#include <interrupt_props.h>
#include <plat_imx8.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <utils.h>
#include <common/bl_common.h>
#include <common/interrupt_props.h>
#include <drivers/arm/gicv3.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <plat_imx8.h>
/* the GICv3 driver only needs to be initialized in EL3 */ /* the GICv3 driver only needs to be initialized in EL3 */
uintptr_t rdistif_base_addrs[PLATFORM_CORE_COUNT]; uintptr_t rdistif_base_addrs[PLATFORM_CORE_COUNT];
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <mmio.h> #include <lib/mmio.h>
#include "imx8_mu.h" #include "imx8_mu.h"
void MU_EnableRxFullInt(uint32_t base, uint32_t index) void MU_EnableRxFullInt(uint32_t base, uint32_t index)
......
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <bakery_lock.h> #include <stdlib.h>
#include <lib/bakery_lock.h>
#include <sci/sci_scfw.h> #include <sci/sci_scfw.h>
#include <sci/sci_ipc.h> #include <sci/sci_ipc.h>
#include <sci/sci_rpc.h> #include <sci/sci_rpc.h>
#include <stdlib.h>
#include "imx8_mu.h" #include "imx8_mu.h"
DEFINE_BAKERY_LOCK(sc_ipc_bakery_lock); DEFINE_BAKERY_LOCK(sc_ipc_bakery_lock);
......
...@@ -14,11 +14,12 @@ ...@@ -14,11 +14,12 @@
/* Includes */ /* Includes */
#include <stdlib.h>
#include <sci/sci_types.h> #include <sci/sci_types.h>
#include <sci/svc/rm/sci_rm_api.h> #include <sci/svc/rm/sci_rm_api.h>
#include <sci/svc/pad/sci_pad_api.h> #include <sci/svc/pad/sci_pad_api.h>
#include <sci/sci_rpc.h> #include <sci/sci_rpc.h>
#include <stdlib.h>
#include "sci_pad_rpc.h" #include "sci_pad_rpc.h"
/* Local Defines */ /* Local Defines */
......
...@@ -14,11 +14,13 @@ ...@@ -14,11 +14,13 @@
/* Includes */ /* Includes */
#include <stdlib.h>
#include <sci/sci_types.h> #include <sci/sci_types.h>
#include <sci/svc/rm/sci_rm_api.h> #include <sci/svc/rm/sci_rm_api.h>
#include <sci/svc/pm/sci_pm_api.h> #include <sci/svc/pm/sci_pm_api.h>
#include <sci/sci_rpc.h> #include <sci/sci_rpc.h>
#include <stdlib.h>
#include "sci_pm_rpc.h" #include "sci_pm_rpc.h"
/* Local Defines */ /* Local Defines */
......
...@@ -14,10 +14,12 @@ ...@@ -14,10 +14,12 @@
/* Includes */ /* Includes */
#include <stdlib.h>
#include <sci/sci_types.h> #include <sci/sci_types.h>
#include <sci/svc/rm/sci_rm_api.h> #include <sci/svc/rm/sci_rm_api.h>
#include <sci/sci_rpc.h> #include <sci/sci_rpc.h>
#include <stdlib.h>
#include "sci_rm_rpc.h" #include "sci_rm_rpc.h"
/* Local Defines */ /* Local Defines */
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#define PLATFORM_DEF_H #define PLATFORM_DEF_H
#include <arch.h> #include <arch.h>
#include <common_def.h> #include <common/tbbr/tbbr_img_def.h>
#include <tbbr_img_def.h> #include <plat/common/common_def.h>
#define PLATFORM_STACK_SIZE 0x1000 #define PLATFORM_STACK_SIZE 0x1000
......
...@@ -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 <bl_common.h>
#include <console.h>
#include <debug.h>
#include <desc_image_load.h>
#include <mmc.h>
#include <mmio.h>
#include <optee_utils.h>
#include <platform_def.h> #include <platform_def.h>
#include <utils.h>
#include <xlat_mmu_helpers.h> #include <arch_helpers.h>
#include <xlat_tables_defs.h> #include <common/bl_common.h>
#include <common/debug.h>
#include <common/desc_image_load.h>
#include <drivers/console.h>
#include <drivers/mmc.h>
#include <lib/xlat_tables/xlat_mmu_helpers.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <lib/mmio.h>
#include <lib/optee_utils.h>
#include <lib/utils.h>
#include <imx_aips.h> #include <imx_aips.h>
#include <imx_caam.h> #include <imx_caam.h>
#include <imx_clock.h> #include <imx_clock.h>
...@@ -27,6 +30,7 @@ ...@@ -27,6 +30,7 @@
#include <imx_snvs.h> #include <imx_snvs.h>
#include <imx_usdhc.h> #include <imx_usdhc.h>
#include <imx_wdog.h> #include <imx_wdog.h>
#include "warp7_private.h" #include "warp7_private.h"
#define UART1_CLK_SELECT (CCM_TARGET_ROOT_ENABLE |\ #define UART1_CLK_SELECT (CCM_TARGET_ROOT_ENABLE |\
......
...@@ -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>
static bl_mem_params_node_t bl2_mem_params_descs[] = { static bl_mem_params_node_t bl2_mem_params_descs[] = {
{ {
.image_id = BL32_IMAGE_ID, .image_id = BL32_IMAGE_ID,
......
...@@ -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>
void plat_flush_next_bl_params(void) void plat_flush_next_bl_params(void)
{ {
......
...@@ -3,16 +3,19 @@ ...@@ -3,16 +3,19 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <mmc.h>
#include <firmware_image_package.h>
#include <io_block.h>
#include <io_driver.h>
#include <io_fip.h>
#include <io_memmap.h>
#include <platform_def.h> #include <platform_def.h>
#include <common/debug.h>
#include <drivers/io/io_block.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_fip.h>
#include <drivers/io/io_memmap.h>
#include <drivers/mmc.h>
#include <tools_share/firmware_image_package.h>
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;
......
...@@ -4,15 +4,17 @@ ...@@ -4,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <gpc.h>
#include <mmio.h>
#include <platform_def.h>
#include <psci.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <std_svc.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <platform_def.h>
#include <services/std_svc.h>
#include <gpc.h>
void imx_set_cpu_secure_entry(unsigned int core_id, uintptr_t sec_entrypoint) void imx_set_cpu_secure_entry(unsigned int core_id, uintptr_t sec_entrypoint)
{ {
......
...@@ -4,22 +4,25 @@ ...@@ -4,22 +4,25 @@
* 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 <stdbool.h>
#include <console.h>
#include <platform_def.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <context.h> #include <context.h>
#include <context_mgmt.h> #include <drivers/arm/tzc380.h>
#include <debug.h> #include <drivers/console.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/platform.h>
#include <gpc.h> #include <gpc.h>
#include <imx_uart.h> #include <imx_uart.h>
#include <stdbool.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h>
#include <plat_imx8.h> #include <plat_imx8.h>
#include <xlat_tables.h>
#include <tzc380.h>
IMPORT_SYM(uintptr_t, __COHERENT_RAM_START__, BL31_COHERENT_RAM_START); IMPORT_SYM(uintptr_t, __COHERENT_RAM_START__, BL31_COHERENT_RAM_START);
IMPORT_SYM(uintptr_t, __COHERENT_RAM_END__, BL31_COHERENT_RAM_END); IMPORT_SYM(uintptr_t, __COHERENT_RAM_END__, BL31_COHERENT_RAM_END);
......
...@@ -4,14 +4,16 @@ ...@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <stdbool.h>
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <debug.h> #include <common/debug.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <gpc.h> #include <gpc.h>
#include <stdbool.h>
#include <plat_imx8.h> #include <plat_imx8.h>
#include <psci.h>
#include <mmio.h>
#define CORE_PWR_STATE(state) ((state)->pwr_domain_state[MPIDR_AFFLVL0]) #define CORE_PWR_STATE(state) ((state)->pwr_domain_state[MPIDR_AFFLVL0])
#define CLUSTER_PWR_STATE(state) ((state)->pwr_domain_state[MPIDR_AFFLVL1]) #define CLUSTER_PWR_STATE(state) ((state)->pwr_domain_state[MPIDR_AFFLVL1])
......
...@@ -4,25 +4,28 @@ ...@@ -4,25 +4,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 <stdbool.h>
#include <cci.h>
#include <console.h> #include <platform_def.h>
#include <arch_helpers.h>
#include <context.h> #include <context.h>
#include <context_mgmt.h> #include <common/bl_common.h>
#include <debug.h> #include <common/debug.h>
#include <drivers/arm/cci.h>
#include <drivers/console.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat/common/platform.h>
#include <imx8qm_pads.h> #include <imx8qm_pads.h>
#include <imx8_iomux.h> #include <imx8_iomux.h>
#include <imx8_lpuart.h> #include <imx8_lpuart.h>
#include <mmio.h>
#include <platform.h>
#include <platform_def.h>
#include <plat_imx8.h> #include <plat_imx8.h>
#include <sci/sci.h> #include <sci/sci.h>
#include <sec_rsrc.h> #include <sec_rsrc.h>
#include <stdbool.h>
#include <xlat_tables.h>
IMPORT_SYM(unsigned long, __COHERENT_RAM_START__, BL31_COHERENT_RAM_START); IMPORT_SYM(unsigned long, __COHERENT_RAM_START__, BL31_COHERENT_RAM_START);
IMPORT_SYM(unsigned long, __COHERENT_RAM_END__, BL31_COHERENT_RAM_END); IMPORT_SYM(unsigned long, __COHERENT_RAM_END__, BL31_COHERENT_RAM_END);
......
...@@ -4,16 +4,18 @@ ...@@ -4,16 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <stdbool.h>
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <cci.h> #include <common/debug.h>
#include <debug.h> #include <drivers/arm/cci.h>
#include <gicv3.h> #include <drivers/arm/gicv3.h>
#include <mmio.h> #include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <plat_imx8.h> #include <plat_imx8.h>
#include <psci.h>
#include <sci/sci.h> #include <sci/sci.h>
#include <stdbool.h>
#define CORE_PWR_STATE(state) \ #define CORE_PWR_STATE(state) \
((state)->pwr_domain_state[MPIDR_AFFLVL0]) ((state)->pwr_domain_state[MPIDR_AFFLVL0])
......
...@@ -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 PLATFORM_LINKER_FORMAT "elf64-littleaarch64" #define PLATFORM_LINKER_FORMAT "elf64-littleaarch64"
#define PLATFORM_LINKER_ARCH aarch64 #define PLATFORM_LINKER_ARCH aarch64
......
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