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,7 +3,9 @@ ...@@ -3,7 +3,9 @@
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h> #include <arch_helpers.h>
#include "emmc_config.h" #include "emmc_config.h"
#include "emmc_hal.h" #include "emmc_hal.h"
#include "emmc_std.h" #include "emmc_std.h"
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h> #include <common/debug.h>
#include "emmc_config.h" #include "emmc_config.h"
#include "emmc_hal.h" #include "emmc_hal.h"
#include "emmc_std.h" #include "emmc_std.h"
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <mmio.h> #include <common/debug.h>
#include <debug.h> #include <lib/mmio.h>
#include "rcar_def.h" #include "rcar_def.h"
#include "cpg_registers.h" #include "cpg_registers.h"
#include "iic_dvfs.h" #include "iic_dvfs.h"
......
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <io_driver.h>
#include <io_storage.h>
#include <string.h> #include <string.h>
#include <common/debug.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_storage.h>
#include "io_common.h" #include "io_common.h"
#include "io_emmcdrv.h" #include "io_emmcdrv.h"
#include "io_private.h" #include "io_private.h"
......
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <debug.h>
#include <io_driver.h>
#include <io_storage.h>
#include <string.h> #include <string.h>
#include <common/debug.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_storage.h>
#include "io_common.h" #include "io_common.h"
#include "io_private.h" #include "io_private.h"
#include "io_memdrv.h" #include "io_memdrv.h"
......
...@@ -4,23 +4,27 @@ ...@@ -4,23 +4,27 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <auth_mod.h>
#include <bl_common.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <firmware_image_package.h>
#include <io_driver.h>
#include <io_storage.h>
#include <platform.h>
#include <platform_def.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <uuid.h>
#include <mmio.h> #include <platform_def.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/auth/auth_mod.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_storage.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <tools_share/firmware_image_package.h>
#include <tools_share/uuid.h>
#include "io_rcar.h" #include "io_rcar.h"
#include "io_common.h" #include "io_common.h"
#include "io_private.h" #include "io_private.h"
extern int32_t plat_get_drv_source(uint32_t id, uintptr_t *dev, extern int32_t plat_get_drv_source(uint32_t id, uintptr_t *dev,
uintptr_t *image_spec); uintptr_t *image_spec);
......
...@@ -4,14 +4,16 @@ ...@@ -4,14 +4,16 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <bakery_lock.h>
#include <debug.h>
#include <mmio.h>
#include <string.h> #include <string.h>
#include <xlat_tables_v2.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include "iic_dvfs.h" #include "iic_dvfs.h"
#include "rcar_def.h" #include "rcar_def.h"
#include "rcar_private.h" #include "rcar_private.h"
......
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <mmio.h>
#include <stdint.h> #include <stdint.h>
#include <lib/mmio.h>
#include "rcar_def.h" #include "rcar_def.h"
#include "rom_api.h" #include "rom_api.h"
......
...@@ -4,12 +4,14 @@ ...@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <mmio.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include "cpg_registers.h" #include "cpg_registers.h"
#include "rpc_registers.h" #include "rpc_registers.h"
#include "debug.h"
#include "rcar_private.h" #include "rcar_private.h"
#define MSTPSR9_RPC_BIT (0x00020000U) #define MSTPSR9_RPC_BIT (0x00020000U)
......
...@@ -5,9 +5,10 @@ ...@@ -5,9 +5,10 @@
*/ */
#include <arch_helpers.h> #include <arch_helpers.h>
#include <debug.h> #include <common/debug.h>
#include <gicv2.h> #include <drivers/arm/gicv2.h>
#include <mmio.h> #include <lib/mmio.h>
#include "rcar_def.h" #include "rcar_def.h"
extern void gicd_set_icenabler(uintptr_t base, unsigned int id); extern void gicd_set_icenabler(uintptr_t base, unsigned int id);
......
...@@ -4,26 +4,29 @@ ...@@ -4,26 +4,29 @@
* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause * SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
*/ */
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <delay_timer.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <dt-bindings/clock/stm32mp1-clksrc.h>
#include <errno.h> #include <errno.h>
#include <generic_delay_timer.h>
#include <libfdt.h>
#include <mmio.h>
#include <platform.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stm32mp1_clk.h>
#include <stm32mp1_clkfunc.h> #include <libfdt.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <drivers/generic_delay_timer.h>
#include <drivers/st/stm32mp1_clk.h>
#include <drivers/st/stm32mp1_clkfunc.h>
#include <drivers/st/stm32mp1_rcc.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <dt-bindings/clock/stm32mp1-clksrc.h>
#include <lib/mmio.h>
#include <lib/utils_def.h>
#include <plat/common/platform.h>
#include <stm32mp1_dt.h> #include <stm32mp1_dt.h>
#include <stm32mp1_private.h> #include <stm32mp1_private.h>
#include <stm32mp1_rcc.h>
#include <utils_def.h>
#define MAX_HSI_HZ 64000000 #define MAX_HSI_HZ 64000000
......
...@@ -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-clksrc.h>
#include <errno.h> #include <errno.h>
#include <libfdt.h> #include <libfdt.h>
#include <stm32mp1_clk.h>
#include <stm32mp1_clkfunc.h> #include <drivers/st/stm32mp1_clk.h>
#include <drivers/st/stm32mp1_clkfunc.h>
#include <dt-bindings/clock/stm32mp1-clksrc.h>
#include <stm32mp1_dt.h> #include <stm32mp1_dt.h>
#define DT_RCC_NODE_NAME "rcc@50000000" #define DT_RCC_NODE_NAME "rcc@50000000"
......
...@@ -4,22 +4,25 @@ ...@@ -4,22 +4,25 @@
* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause * SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
*/ */
#include <stddef.h>
#include <arch.h> #include <arch.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <debug.h> #include <common/debug.h>
#include <delay_timer.h> #include <drivers/delay_timer.h>
#include <drivers/st/stm32mp1_clk.h>
#include <drivers/st/stm32mp1_ddr.h>
#include <drivers/st/stm32mp1_ddr_regs.h>
#include <drivers/st/stm32mp1_pmic.h>
#include <drivers/st/stm32mp1_pwr.h>
#include <drivers/st/stm32mp1_ram.h>
#include <drivers/st/stm32mp1_rcc.h>
#include <dt-bindings/clock/stm32mp1-clks.h> #include <dt-bindings/clock/stm32mp1-clks.h>
#include <mmio.h> #include <lib/mmio.h>
#include <platform.h> #include <plat/common/platform.h>
#include <stddef.h>
#include <stm32mp1_clk.h> #include <stm32mp1_def.h>
#include <stm32mp1_ddr.h>
#include <stm32mp1_ddr_regs.h>
#include <stm32mp1_dt.h> #include <stm32mp1_dt.h>
#include <stm32mp1_pmic.h>
#include <stm32mp1_pwr.h>
#include <stm32mp1_ram.h>
#include <stm32mp1_rcc.h>
struct reg_desc { struct reg_desc {
const char *name; const char *name;
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <mmio.h>
#include <platform_def.h> #include <platform_def.h>
#include <stm32mp1_ddr_helpers.h>
#include <stm32mp1_rcc.h> #include <drivers/st/stm32mp1_ddr_helpers.h>
#include <drivers/st/stm32mp1_rcc.h>
#include <lib/mmio.h>
void ddr_enable_clock(void) void ddr_enable_clock(void)
{ {
......
...@@ -4,21 +4,25 @@ ...@@ -4,21 +4,25 @@
* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause * SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <boot_api.h>
#include <debug.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <errno.h> #include <errno.h>
#include <libfdt.h> #include <libfdt.h>
#include <mmio.h>
#include <platform_def.h> #include <platform_def.h>
#include <stm32mp1_clk.h>
#include <stm32mp1_ddr.h> #include <arch_helpers.h>
#include <stm32mp1_ddr_helpers.h> #include <common/debug.h>
#include <drivers/st/stm32mp1_clk.h>
#include <drivers/st/stm32mp1_ddr.h>
#include <drivers/st/stm32mp1_ddr_helpers.h>
#include <drivers/st/stm32mp1_ram.h>
#include <drivers/st/stm32mp1_rcc.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <lib/mmio.h>
#include <boot_api.h>
#include <stm32mp1_dt.h> #include <stm32mp1_dt.h>
#include <stm32mp1_private.h> #include <stm32mp1_private.h>
#include <stm32mp1_ram.h>
#include <stm32mp1_rcc.h>
#define DDR_PATTERN 0xAAAAAAAAU #define DDR_PATTERN 0xAAAAAAAAU
#define DDR_ANTIPATTERN 0x55555555U #define DDR_ANTIPATTERN 0x55555555U
......
...@@ -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 <debug.h>
#include <mmio.h>
#include <stdbool.h> #include <stdbool.h>
#include <stm32_gpio.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/st/stm32_gpio.h>
#include <lib/mmio.h>
static bool check_gpio(uint32_t bank, uint32_t pin) static bool check_gpio(uint32_t bank, uint32_t pin)
{ {
......
...@@ -5,15 +5,16 @@ ...@@ -5,15 +5,16 @@
*/ */
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <io_driver.h>
#include <io_mmc.h>
#include <io_storage.h>
#include <mmc.h>
#include <stm32_sdmmc2.h>
#include <string.h> #include <string.h>
#include <common/debug.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_storage.h>
#include <drivers/mmc.h>
#include <drivers/st/io_mmc.h>
#include <drivers/st/stm32_sdmmc2.h>
/* SDMMC device functions */ /* SDMMC device functions */
static int mmc_dev_open(const uintptr_t init_params, io_dev_info_t **dev_info); static int mmc_dev_open(const uintptr_t init_params, io_dev_info_t **dev_info);
static int mmc_block_open(io_dev_info_t *dev_info, const uintptr_t spec, static int mmc_block_open(io_dev_info_t *dev_info, const uintptr_t spec,
......
...@@ -5,17 +5,20 @@ ...@@ -5,17 +5,20 @@
*/ */
#include <assert.h> #include <assert.h>
#include <boot_api.h>
#include <debug.h>
#include <errno.h> #include <errno.h>
#include <io_driver.h>
#include <io_stm32image.h>
#include <io_storage.h>
#include <platform.h>
#include <platform_def.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <utils.h>
#include <platform_def.h>
#include <common/debug.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_storage.h>
#include <drivers/st/io_stm32image.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <boot_api.h>
static uintptr_t backend_dev_handle; static uintptr_t backend_dev_handle;
static uintptr_t backend_image_spec; static uintptr_t backend_image_spec;
......
...@@ -4,25 +4,27 @@ ...@@ -4,25 +4,27 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h>
#include <errno.h>
#include <string.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 <drivers/mmc.h>
#include <drivers/st/stm32_sdmmc2.h>
#include <drivers/st/stm32mp1_clk.h>
#include <drivers/st/stm32mp1_rcc.h>
#include <drivers/st/stm32mp1_reset.h>
#include <dt-bindings/clock/stm32mp1-clks.h> #include <dt-bindings/clock/stm32mp1-clks.h>
#include <dt-bindings/reset/stm32mp1-resets.h> #include <dt-bindings/reset/stm32mp1-resets.h>
#include <errno.h>
#include <libfdt.h> #include <libfdt.h>
#include <mmc.h> #include <lib/mmio.h>
#include <mmio.h> #include <lib/utils.h>
#include <platform.h> #include <plat/common/platform.h>
#include <stm32_sdmmc2.h>
#include <stm32mp1_clk.h>
#include <stm32mp1_dt.h> #include <stm32mp1_dt.h>
#include <stm32mp1_rcc.h>
#include <stm32mp1_reset.h>
#include <string.h>
#include <utils.h>
/* Registers offsets */ /* Registers offsets */
#define SDMMC_POWER 0x00U #define SDMMC_POWER 0x00U
......
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <arch_helpers.h>
#include <delay_timer.h>
#include <errno.h> #include <errno.h>
#include <mmio.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include <stm32_i2c.h>
#include <arch_helpers.h>
#include <drivers/delay_timer.h>
#include <drivers/st/stm32_i2c.h>
#include <lib/mmio.h>
/* STM32 I2C registers offsets */ /* STM32 I2C registers offsets */
#define I2C_CR1 0x00U #define I2C_CR1 0x00U
......
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