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
......@@ -5,14 +5,16 @@
*/
#include <assert.h>
#include <debug.h>
#include <errno.h>
#include <io_block.h>
#include <io_driver.h>
#include <io_storage.h>
#include <platform_def.h>
#include <string.h>
#include <utils.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_storage.h>
#include <lib/utils.h>
typedef struct {
io_block_dev_spec_t *dev_spec;
......
......@@ -5,12 +5,13 @@
*/
#include <assert.h>
#include <debug.h>
#include <io_driver.h>
#include <io_dummy.h>
#include <io_storage.h>
#include <string.h>
#include <common/debug.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_dummy.h>
#include <drivers/io/io_storage.h>
struct file_state {
int in_use;
size_t size;
......
......@@ -5,19 +5,21 @@
*/
#include <assert.h>
#include <bl_common.h>
#include <debug.h>
#include <errno.h>
#include <firmware_image_package.h>
#include <io_driver.h>
#include <io_fip.h>
#include <io_storage.h>
#include <platform.h>
#include <platform_def.h>
#include <stdint.h>
#include <string.h>
#include <utils.h>
#include <uuid.h>
#include <platform_def.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_fip.h>
#include <drivers/io/io_storage.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <tools_share/firmware_image_package.h>
#include <tools_share/uuid.h>
#ifndef MAX_FIP_DEVICES
#define MAX_FIP_DEVICES 1
......
......@@ -5,13 +5,15 @@
*/
#include <assert.h>
#include <debug.h>
#include <io_driver.h>
#include <io_memmap.h>
#include <io_storage.h>
#include <platform_def.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_memmap.h>
#include <drivers/io/io_storage.h>
#include <lib/utils.h>
/* As we need to be able to keep state for seek, only one file can be open
* at a time. Make this a structure and point to the entity->info. When we
......
......@@ -5,13 +5,13 @@
*/
#include <assert.h>
#include <io_driver.h>
#include <io_semihosting.h>
#include <io_storage.h>
#include <platform_def.h>
#include <semihosting.h>
#include <platform_def.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_semihosting.h>
#include <drivers/io/io_storage.h>
#include <lib/semihosting.h>
/* Identify the device type as semihosting */
static io_type_t device_type_sh(void)
......
......@@ -5,11 +5,12 @@
*/
#include <assert.h>
#include <io_driver.h>
#include <io_storage.h>
#include <platform_def.h>
#include <stddef.h>
#include <platform_def.h>
#include <drivers/io/io_driver.h>
#include <drivers/io/io_storage.h>
/* Storage for a fixed maximum number of IO entities, definable by platform */
static io_entity_t entity_pool[MAX_IO_HANDLES];
......
......@@ -7,9 +7,10 @@
/* AXI to M-Bridge decoding unit driver for Marvell Armada 8K and 8K+ SoCs */
#include <common/debug.h>
#include <lib/mmio.h>
#include <armada_common.h>
#include <debug.h>
#include <mmio.h>
#include <mvebu.h>
#include <mvebu_def.h>
......
......@@ -5,10 +5,11 @@
* https://spdx.org/licenses
*/
#include <drivers/delay_timer.h>
#include <drivers/marvell/aro.h>
#include <lib/mmio.h>
#include <a8k_plat_def.h>
#include <aro.h>
#include <delay_timer.h>
#include <mmio.h>
/* Notify bootloader on DRAM setup */
#define AP807_CPU_ARO_CTRL(cluster) \
......
......@@ -9,11 +9,13 @@
* for Marvell SoCs in AP806, AP807, and AP810
*/
#include <arch_helpers.h>
#include <assert.h>
#include <cache_llc.h>
#include <ccu.h>
#include <mmio.h>
#include <arch_helpers.h>
#include <drivers/marvell/cache_llc.h>
#include <drivers/marvell/ccu.h>
#include <lib/mmio.h>
#include <mvebu_def.h>
#define CCU_HTC_CR(ap_index) (MVEBU_CCU_BASE(ap_index) + 0x200)
......
......@@ -7,10 +7,11 @@
/* CCU unit device driver for Marvell AP807, AP807 and AP810 SoCs */
#include <common/debug.h>
#include <drivers/marvell/ccu.h>
#include <lib/mmio.h>
#include <armada_common.h>
#include <ccu.h>
#include <debug.h>
#include <mmio.h>
#include <mvebu.h>
#include <mvebu_def.h>
......
......@@ -5,13 +5,16 @@
* https://spdx.org/licenses
*/
#include <debug.h>
#include <delay_timer.h>
#include <errno.h>
#include <mmio.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <lib/spinlock.h>
#include <mvebu.h>
#include <mvebu_def.h>
#include <spinlock.h>
#include "phy-comphy-3700.h"
#include "phy-comphy-common.h"
......
......@@ -7,12 +7,14 @@
/* Marvell CP110 SoC COMPHY unit driver */
#include <debug.h>
#include <delay_timer.h>
#include <errno.h>
#include <mmio.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <lib/spinlock.h>
#include <mvebu_def.h>
#include <spinlock.h>
#include "mvebu.h"
#include "comphy-cp110.h"
#include "phy-comphy-cp110.h"
......
......@@ -7,10 +7,11 @@
/* GWIN unit device driver for Marvell AP810 SoC */
#include <common/debug.h>
#include <drivers/marvell/gwin.h>
#include <lib/mmio.h>
#include <armada_common.h>
#include <debug.h>
#include <gwin.h>
#include <mmio.h>
#include <mvebu.h>
#include <mvebu_def.h>
......
......@@ -7,10 +7,11 @@
/* IO Window unit device driver for Marvell AP807, AP807 and AP810 SoCs */
#include <common/debug.h>
#include <drivers/marvell/io_win.h>
#include <lib/mmio.h>
#include <armada_common.h>
#include <debug.h>
#include <io_win.h>
#include <mmio.h>
#include <mvebu.h>
#include <mvebu_def.h>
......
......@@ -7,11 +7,12 @@
/* IOW unit device driver for Marvell CP110 and CP115 SoCs */
#include <armada_common.h>
#include <arch_helpers.h>
#include <debug.h>
#include <iob.h>
#include <mmio.h>
#include <common/debug.h>
#include <drivers/marvell/iob.h>
#include <lib/mmio.h>
#include <armada_common.h>
#include <mvebu.h>
#include <mvebu_def.h>
......
......@@ -5,10 +5,12 @@
* https://spdx.org/licenses
*/
#include <addr_map.h>
#include <debug.h>
#include <mmio.h>
#include <common/debug.h>
#include <drivers/marvell/addr_map.h>
#include <lib/mmio.h>
#include <mvebu_def.h>
#include "mc_trustzone.h"
#define TZ_SIZE(x) ((x) >> 13)
......
......@@ -8,7 +8,7 @@
#ifndef MC_TRUSTZONE_H
#define MC_TRUSTZONE_H
#include <addr_map.h>
#include <drivers/marvell/addr_map.h>
#define MVEBU_TZ_MAX_WINS 16
......
......@@ -7,10 +7,11 @@
/* MCI bus driver for Marvell ARMADA 8K and 8K+ SoCs */
#include <debug.h>
#include <delay_timer.h>
#include <mmio.h>
#include <mci.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <drivers/marvell/mci.h>
#include <lib/mmio.h>
#include <mvebu.h>
#include <mvebu_def.h>
#include <plat_marvell.h>
......
......@@ -7,13 +7,14 @@
/* AP807 Marvell SoC driver */
#include <ap_setup.h>
#include <cache_llc.h>
#include <ccu.h>
#include <debug.h>
#include <io_win.h>
#include <mci.h>
#include <mmio.h>
#include <common/debug.h>
#include <drivers/marvell/cache_llc.h>
#include <drivers/marvell/ccu.h>
#include <drivers/marvell/io_win.h>
#include <drivers/marvell/mci.h>
#include <drivers/marvell/mochi/ap_setup.h>
#include <lib/mmio.h>
#include <mvebu_def.h>
#define SMMU_sACR (MVEBU_SMMU_BASE + 0x10)
......
......@@ -7,13 +7,14 @@
/* AP806 Marvell SoC driver */
#include <ap_setup.h>
#include <ccu.h>
#include <cache_llc.h>
#include <debug.h>
#include <io_win.h>
#include <mci.h>
#include <mmio.h>
#include <common/debug.h>
#include <drivers/marvell/ccu.h>
#include <drivers/marvell/cache_llc.h>
#include <drivers/marvell/io_win.h>
#include <drivers/marvell/mci.h>
#include <drivers/marvell/mochi/ap_setup.h>
#include <lib/mmio.h>
#include <mvebu_def.h>
#define SMMU_sACR (MVEBU_SMMU_BASE + 0x10)
......
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