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,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>
/******************************************************************************* /*******************************************************************************
* Following descriptor provides BL image/ep information that gets used * Following descriptor provides BL image/ep information that gets used
* by BL2 to load the images and also subset of this information is * by BL2 to load the images and also subset of this information is
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <desc_image_load.h> #include <common/desc_image_load.h>
#include <platform.h> #include <plat/common/platform.h>
/******************************************************************************* /*******************************************************************************
* This function flushes the data structures so that they are visible * This function flushes the data structures so that they are visible
......
...@@ -22,9 +22,8 @@ PLAT_PARTITION_MAX_ENTRIES := $(shell echo $$(($(STM32_TF_A_COPIES) + 1))) ...@@ -22,9 +22,8 @@ PLAT_PARTITION_MAX_ENTRIES := $(shell echo $$(($(STM32_TF_A_COPIES) + 1)))
$(eval $(call add_define,PLAT_PARTITION_MAX_ENTRIES)) $(eval $(call add_define,PLAT_PARTITION_MAX_ENTRIES))
PLAT_INCLUDES := -Iplat/st/stm32mp1/include/ PLAT_INCLUDES := -Iplat/st/stm32mp1/include/
PLAT_INCLUDES += -Iplat/st/stm32mp1/
PLAT_INCLUDES += -Iinclude/common/tbbr PLAT_INCLUDES += -Iinclude/common/tbbr
PLAT_INCLUDES += -Iinclude/drivers/partition
PLAT_INCLUDES += -Iinclude/drivers/st
# Device tree # Device tree
STM32_DTB_FILE_NAME ?= stm32mp157c-ev1.dtb STM32_DTB_FILE_NAME ?= stm32mp157c-ev1.dtb
......
...@@ -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 <string.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/tzc400.h>
#include <debug.h> #include <drivers/generic_delay_timer.h>
#include <drivers/st/stm32_console.h>
#include <drivers/st/stm32mp1_clk.h>
#include <dt-bindings/clock/stm32mp1-clks.h> #include <dt-bindings/clock/stm32mp1-clks.h>
#include <generic_delay_timer.h> #include <lib/el3_runtime/context_mgmt.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 <platform_sp_min.h> #include <platform_sp_min.h>
#include <stm32_console.h>
#include <stm32mp1_clk.h>
#include <stm32mp1_dt.h> #include <stm32mp1_dt.h>
#include <stm32mp1_private.h> #include <stm32mp1_private.h>
#include <string.h>
#include <tzc400.h>
#include <xlat_tables_v2.h>
/****************************************************************************** /******************************************************************************
* Placeholder variables for copying the arguments that have been passed to * Placeholder variables for copying the arguments that have been passed to
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#ifndef STM32MP1_LD_S #ifndef STM32MP1_LD_S
#define STM32MP1_LD_S #define STM32MP1_LD_S
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <platform_def.h> #include <platform_def.h>
#include <xlat_tables_defs.h>
OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
OUTPUT_ARCH(PLATFORM_LINKER_ARCH) OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
......
...@@ -4,16 +4,19 @@ ...@@ -4,16 +4,19 @@
* 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 <debug.h>
#include <gicv2.h>
#include <mmio.h>
#include <platform_def.h> #include <platform_def.h>
#include <platform.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/arm/gicv2.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <plat/common/platform.h>
#include <stm32mp1_private.h> #include <stm32mp1_private.h>
#include <xlat_tables_v2.h>
#define MAP_SRAM MAP_REGION_FLAT(STM32MP1_SRAM_BASE, \ #define MAP_SRAM MAP_REGION_FLAT(STM32MP1_SRAM_BASE, \
STM32MP1_SRAM_SIZE, \ STM32MP1_SRAM_SIZE, \
......
...@@ -4,11 +4,14 @@ ...@@ -4,11 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <errno.h> #include <errno.h>
#include <mmio.h>
#include <platform_def.h> #include <platform_def.h>
#include <stm32mp1_clk.h>
#include <drivers/st/stm32mp1_clk.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <lib/mmio.h>
#include <stm32mp1_context.h> #include <stm32mp1_context.h>
#define TAMP_BOOT_ITF_BACKUP_REG_ID U(20) #define TAMP_BOOT_ITF_BACKUP_REG_ID U(20)
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
#ifndef STM32MP1_DEF_H #ifndef STM32MP1_DEF_H
#define STM32MP1_DEF_H #define STM32MP1_DEF_H
#include <tbbr_img_def.h> #include <common/tbbr/tbbr_img_def.h>
#include <utils_def.h> #include <lib/utils_def.h>
#include <xlat_tables_defs.h> #include <lib/xlat_tables/xlat_tables_defs.h>
/******************************************************************************* /*******************************************************************************
* STM32MP1 memory map related constants * STM32MP1 memory map related constants
......
...@@ -5,15 +5,19 @@ ...@@ -5,15 +5,19 @@
*/ */
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <libfdt.h> #include <libfdt.h>
#include <platform_def.h> #include <platform_def.h>
#include <stm32_gpio.h>
#include <stm32mp1_clk.h> #include <common/debug.h>
#include <stm32mp1_clkfunc.h> #include <drivers/st/stm32_gpio.h>
#include <stm32mp1_ddr.h> #include <drivers/st/stm32mp1_clk.h>
#include <drivers/st/stm32mp1_clkfunc.h>
#include <drivers/st/stm32mp1_ddr.h>
#include <drivers/st/stm32mp1_ram.h>
#include <stm32mp1_dt.h> #include <stm32mp1_dt.h>
#include <stm32mp1_ram.h>
#define DT_GPIO_BANK_SHIFT 12 #define DT_GPIO_BANK_SHIFT 12
#define DT_GPIO_BANK_MASK 0x1F000U #define DT_GPIO_BANK_MASK 0x1F000U
......
...@@ -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 <gicv2.h>
#include <platform.h>
#include <platform_def.h> #include <platform_def.h>
#include <utils.h>
#include <common/bl_common.h>
#include <drivers/arm/gicv2.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <stm32mp1_private.h> #include <stm32mp1_private.h>
......
...@@ -4,12 +4,13 @@ ...@@ -4,12 +4,13 @@
* 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 <platform_def.h> #include <drivers/st/stm32_gpio.h>
#include <stm32_gpio.h> #include <drivers/st/stm32mp1_rcc.h>
#include <stm32mp1_rcc.h>
#define GPIO_BANK_G_ADDRESS 0x50008000 #define GPIO_BANK_G_ADDRESS 0x50008000
#define GPIO_TX_PORT 11 #define GPIO_TX_PORT 11
......
...@@ -4,21 +4,24 @@ ...@@ -4,21 +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 <boot_api.h>
#include <debug.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <errno.h> #include <errno.h>
#include <gic_common.h>
#include <gicv2.h>
#include <mmio.h>
#include <platform_def.h> #include <platform_def.h>
#include <platform.h>
#include <psci.h> #include <arch_helpers.h>
#include <stm32mp1_clk.h> #include <common/debug.h>
#include <drivers/arm/gic_common.h>
#include <drivers/arm/gicv2.h>
#include <drivers/st/stm32mp1_clk.h>
#include <drivers/st/stm32mp1_rcc.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include <boot_api.h>
#include <stm32mp1_private.h> #include <stm32mp1_private.h>
#include <stm32mp1_rcc.h>
static uint32_t stm32_sec_entrypoint; static uint32_t stm32_sec_entrypoint;
static uint32_t cntfrq_core0; static uint32_t cntfrq_core0;
......
...@@ -4,16 +4,19 @@ ...@@ -4,16 +4,19 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <mmio.h>
#include <stdint.h> #include <stdint.h>
#include <stm32mp1_clk.h>
#include <platform_def.h>
#include <common/debug.h>
#include <drivers/arm/tzc400.h>
#include <drivers/st/stm32mp1_clk.h>
#include <drivers/st/stm32mp1_rcc.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <lib/mmio.h>
#include <stm32mp1_dt.h> #include <stm32mp1_dt.h>
#include <stm32mp1_private.h> #include <stm32mp1_private.h>
#include <stm32mp1_rcc.h>
#include <tzc400.h>
#include "platform_def.h"
/******************************************************************************* /*******************************************************************************
* Initialize the TrustZone Controller. Configure Region 0 with Secure RW access * Initialize the TrustZone Controller. Configure Region 0 with Secure RW access
......
...@@ -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 <platform.h>
#include <stdint.h> #include <stdint.h>
#include <arch_helpers.h>
#include <plat/common/platform.h>
#define RANDOM_CANARY_VALUE 2144346116U #define RANDOM_CANARY_VALUE 2144346116U
u_register_t plat_get_stack_protector_canary(void) u_register_t plat_get_stack_protector_canary(void)
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
*/ */
#include <platform_def.h> #include <platform_def.h>
#include <platform.h>
#include <psci.h> #include <lib/psci/psci.h>
#include <plat/common/platform.h>
/* 1 cluster, all cores into */ /* 1 cluster, all cores into */
static const unsigned char stm32mp1_power_domain_tree_desc[] = { static const unsigned char stm32mp1_power_domain_tree_desc[] = {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef BOARD_DEF_H #ifndef BOARD_DEF_H
#define BOARD_DEF_H #define BOARD_DEF_H
#include <utils_def.h> #include <lib/utils_def.h>
/* The ports must be in order and contiguous */ /* The ports must be in order and contiguous */
#define K3_CLUSTER0_CORE_COUNT 2 #define K3_CLUSTER0_CORE_COUNT 2
......
...@@ -7,14 +7,16 @@ ...@@ -7,14 +7,16 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <mmio.h>
#include <platform_def.h>
#include <stdlib.h> #include <stdlib.h>
#include <utils.h>
#include <utils_def.h> #include <platform_def.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <lib/utils.h>
#include <lib/utils_def.h>
#include "sec_proxy.h" #include "sec_proxy.h"
......
...@@ -7,13 +7,14 @@ ...@@ -7,13 +7,14 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <platform_def.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include <platform_def.h>
#include <common/debug.h>
#include <sec_proxy.h> #include <sec_proxy.h>
#include "ti_sci_protocol.h" #include "ti_sci_protocol.h"
......
...@@ -4,17 +4,20 @@ ...@@ -4,17 +4,20 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h>
#include <string.h>
#include <platform_def.h>
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <assert.h> #include <common/bl_common.h>
#include <bl_common.h> #include <common/debug.h>
#include <debug.h> #include <lib/xlat_tables/xlat_tables_v2.h>
#include <k3_console.h> #include <k3_console.h>
#include <k3_gicv3.h> #include <k3_gicv3.h>
#include <platform_def.h>
#include <string.h>
#include <ti_sci.h> #include <ti_sci.h>
#include <xlat_tables_v2.h>
/* Table of regions to map using the MMU */ /* Table of regions to map using the MMU */
const mmap_region_t plat_k3_mmap[] = { const mmap_region_t plat_k3_mmap[] = {
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <console.h>
#include <k3_console.h>
#include <platform_def.h> #include <platform_def.h>
#include <uart_16550.h>
#include <drivers/console.h>
#include <drivers/ti/uart/uart_16550.h>
#include <k3_console.h>
void bl31_console_setup(void) void bl31_console_setup(void)
{ {
......
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