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
......@@ -6,9 +6,10 @@
*/
#include <arch_helpers.h>
#include <debug.h>
#include <mentor/mi2cv.h>
#include <mmio.h>
#include <common/debug.h>
#include <drivers/mentor/mi2cv.h>
#include <lib/mmio.h>
#include <mv_ddr_if.h>
#include <mvebu_def.h>
#include <plat_marvell.h>
......
......@@ -6,9 +6,10 @@
*/
#include <arch_helpers.h>
#include <debug.h>
#include <mentor/mi2cv.h>
#include <mmio.h>
#include <common/debug.h>
#include <drivers/mentor/mi2cv.h>
#include <lib/mmio.h>
#include <mv_ddr_if.h>
#include <mvebu_def.h>
#include <plat_marvell.h>
......
......@@ -5,9 +5,10 @@
* https://spdx.org/licenses
*/
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <armada_common.h>
#include <delay_timer.h>
#include <mmio.h>
/*
* If bootrom is currently at BLE there's no need to include the memory
......
......@@ -50,8 +50,6 @@ ATF_INCLUDES := -Iinclude/common/tbbr
PLAT_INCLUDES := -I$(PLAT_FAMILY_BASE)/$(PLAT) \
-I$(PLAT_COMMON_BASE)/include \
-I$(PLAT_INCLUDE_BASE)/common \
-Iinclude/drivers/marvell \
-Iinclude/drivers/marvell/mochi \
$(ATF_INCLUDES)
PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a8k_common.c \
......
......@@ -5,12 +5,11 @@
* https://spdx.org/licenses
*/
#include <platform.h>
#include <arch_helpers.h>
#include <mmio.h>
#include <debug.h>
#include <cache_llc.h>
#include <common/debug.h>
#include <drivers/marvell/cache_llc.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#define CCU_HTC_ASET (MVEBU_CCU_BASE(MVEBU_AP0) + 0x264)
#define MVEBU_IO_AFFINITY (0xF00)
......
......@@ -13,12 +13,12 @@ PLAT_MARVELL = plat/marvell
BLE_SOURCES += $(BLE_PATH)/ble_main.c \
$(BLE_PATH)/ble_mem.S \
drivers/delay_timer/delay_timer.c \
$(PLAT_MARVELL)/common/aarch64/marvell_helpers.S \
$(PLAT_MARVELL)/common/plat_delay_timer.c \
$(PLAT_MARVELL)/common/marvell_console.c
PLAT_INCLUDES += -I$(MV_DDR_PATH) \
-I$(CURDIR)/include/ \
-I$(CURDIR)/include/drivers \
-I$(CURDIR)/include/lib \
-I$(CURDIR)/include/lib/libc \
-I$(CURDIR)/include/lib/libc/aarch64 \
......
......@@ -5,14 +5,17 @@
* https://spdx.org/licenses
*/
#include <string.h>
#include <platform_def.h>
#include <arch_helpers.h>
#include <debug.h>
#include <console.h>
#include <common/debug.h>
#include <drivers/console.h>
#include <marvell_plat_priv.h>
#include <marvell_pm.h>
#include <platform_def.h>
#include <plat_marvell.h>
#include <string.h>
#define BR_FLAG_SILENT 0x1
#define SKIP_IMAGE_CODE 0xDEADB002
......
......@@ -8,14 +8,16 @@
#ifndef PLATFORM_DEF_H
#define PLATFORM_DEF_H
#include <board_marvell_def.h>
#include <gic_common.h>
#include <interrupt_props.h>
#include <mvebu_def.h>
#ifndef __ASSEMBLY__
#include <stdio.h>
#endif /* __ASSEMBLY__ */
#include <common/interrupt_props.h>
#include <drivers/arm/gic_common.h>
#include <board_marvell_def.h>
#include <mvebu_def.h>
/*
* Most platform porting definitions provided by included headers
*/
......
......@@ -5,14 +5,16 @@
* https://spdx.org/licenses
*/
#include <platform_def.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/marvell/ccu.h>
#include <drivers/marvell/mochi/cp110_setup.h>
#include <lib/mmio.h>
#include <armada_common.h>
#include <bl_common.h>
#include <ccu.h>
#include <cp110_setup.h>
#include <debug.h>
#include <marvell_plat_priv.h> /* timer functionality */
#include <mmio.h>
#include <platform_def.h>
#include "mss_scp_bootloader.h"
......
......@@ -5,11 +5,12 @@
* https://spdx.org/licenses
*/
#include <debug.h>
#include <mmio.h>
#include <psci.h>
#include <string.h>
#include <common/debug.h>
#include <lib/psci/psci.h>
#include <lib/mmio.h>
#include <mss_pm_ipc.h>
/*
......
......@@ -5,7 +5,8 @@
* https://spdx.org/licenses
*/
#include <mmio.h>
#include <lib/mmio.h>
#include <plat_marvell.h>
void marvell_bl1_setup_mpps(void)
......
......@@ -5,17 +5,17 @@
* https://spdx.org/licenses
*/
#include <common/debug.h>
#include <drivers/marvell/mci.h>
#include <drivers/marvell/mochi/ap_setup.h>
#include <drivers/marvell/mochi/cp110_setup.h>
#include <lib/mmio.h>
#include <armada_common.h>
#include <ap_setup.h>
#include <cp110_setup.h>
#include <debug.h>
#include <marvell_plat_priv.h>
#include <marvell_pm.h>
#include <mc_trustzone/mc_trustzone.h>
#include <mmio.h>
#include <mci.h>
#include <plat_marvell.h>
#include <mss_ipc_drv.h>
#include <mss_mem.h>
......
......@@ -5,17 +5,18 @@
* https://spdx.org/licenses
*/
#include <ap_setup.h>
#include <common/debug.h>
#include <drivers/marvell/ap807_clocks_init.h>
#include <drivers/marvell/aro.h>
#include <drivers/marvell/ccu.h>
#include <drivers/marvell/io_win.h>
#include <drivers/marvell/mochi/ap_setup.h>
#include <drivers/marvell/mochi/cp110_setup.h>
#include <armada_common.h>
#include <aro.h>
#include <ccu.h>
#include <cp110_setup.h>
#include <debug.h>
#include <io_win.h>
#include <mv_ddr_if.h>
#include <mvebu_def.h>
#include <plat_marvell.h>
#include "ap807_clocks_init.h"
/* Register for skip image use */
#define SCRATCH_PAD_REG2 0xF06F00A8
......
......@@ -5,19 +5,21 @@
* https://spdx.org/licenses
*/
#include <armada_common.h>
#include <assert.h>
#include <bakery_lock.h>
#include <debug.h>
#include <delay_timer.h>
#include <cache_llc.h>
#include <console.h>
#include <gicv2.h>
#include <common/debug.h>
#include <drivers/arm/gicv2.h>
#include <drivers/console.h>
#include <drivers/delay_timer.h>
#include <drivers/marvell/cache_llc.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <armada_common.h>
#include <marvell_pm.h>
#include <mmio.h>
#include <mss_pm_ipc.h>
#include <plat_marvell.h>
#include <platform.h>
#include <plat_pm_trace.h>
#define MVEBU_PRIVATE_UID_REG 0x30
......
......@@ -5,9 +5,10 @@
* https://spdx.org/licenses
*/
#include <mmio.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <mss_mem.h>
#include <platform.h>
#include <plat_pm_trace.h>
#ifdef PM_TRACE_ENABLE
......
......@@ -5,11 +5,12 @@
* https://spdx.org/licenses
*/
#include <debug.h>
#include <delay_timer.h>
#include <mmio.h>
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <drivers/marvell/thermal.h>
#include <lib/mmio.h>
#include <mvebu_def.h>
#include <thermal.h>
#define THERMAL_TIMEOUT 1200
......
......@@ -4,12 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <bl_common.h>
#include <desc_image_load.h>
#include <marvell_def.h>
#include <platform.h>
#include <platform_def.h>
#include <common/bl_common.h>
#include <common/desc_image_load.h>
#include <marvell_def.h>
#include <plat/common/platform.h>
/*******************************************************************************
* Following descriptor provides BL image/ep information that gets used
......
......@@ -5,15 +5,17 @@
* https://spdx.org/licenses
*/
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <mmio.h>
#include <plat_marvell.h>
#include <platform_def.h>
#include <xlat_tables.h>
#include <arch.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables.h>
#include <plat_marvell.h>
/* Weak definitions may be overridden in specific ARM standard platform */
#pragma weak plat_get_ns_image_entrypoint
......
......@@ -7,12 +7,12 @@
#include <asm_macros.S>
#include <cortex_a72.h>
#include <marvell_def.h>
#include <platform_def.h>
#ifndef PLAT_a3700
#include <ccu.h>
#include <cache_llc.h>
#include <drivers/marvell/ccu.h>
#include <drivers/marvell/cache_llc.h>
#endif
#include <marvell_def.h>
#include <platform_def.h>
.weak plat_marvell_calc_core_pos
.weak plat_my_core_pos
......
......@@ -5,15 +5,17 @@
* https://spdx.org/licenses
*/
#include <bl1.h>
#include <bl1/bl1_private.h>
#include <bl_common.h>
#include <console.h>
#include <debug.h>
#include <platform.h>
#include <platform_def.h>
#include <bl1/bl1.h>
#include <bl1/bl1_private.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/arm/sp805.h>
#include <drivers/console.h>
#include <plat/common/platform.h>
#include <plat_marvell.h>
#include <sp805.h>
/* Weak definitions may be overridden in specific Marvell standard platform */
#pragma weak bl1_early_platform_setup
......
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