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,15 +4,17 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <errno.h>
#include <gicv2.h>
#include <mmio.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <drivers/arm/gicv2.h>
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include <plat_arm.h>
#include <platform.h>
#include <psci.h>
#include "pm_api_sys.h"
#include "pm_client.h"
#include "zynqmp_private.h"
......
......@@ -4,10 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <debug.h>
#include <mmio.h>
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/mmio.h>
#include "zynqmp_def.h"
#include "zynqmp_private.h"
......
......@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <platform.h>
#include <plat/common/platform.h>
#include "zynqmp_private.h"
int plat_core_pos_by_mpidr(u_register_t mpidr)
......
......@@ -8,11 +8,13 @@
* ZynqMP system level PM-API functions for clock control.
*/
#include <arch_helpers.h>
#include <mmio.h>
#include <platform.h>
#include <stdbool.h>
#include <string.h>
#include <arch_helpers.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include "pm_api_clock.h"
#include "pm_api_sys.h"
#include "pm_client.h"
......
......@@ -11,7 +11,8 @@
#ifndef PM_API_CLOCK_H
#define PM_API_CLOCK_H
#include <utils_def.h>
#include <lib/utils_def.h>
#include "pm_common.h"
#define CLK_NAME_LEN U(15)
......
......@@ -9,9 +9,10 @@
*/
#include <arch_helpers.h>
#include <delay_timer.h>
#include <mmio.h>
#include <platform.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include "pm_api_clock.h"
#include "pm_api_ioctl.h"
#include "pm_api_sys.h"
......
......@@ -8,9 +8,11 @@
* ZynqMP system level PM-API functions for pin control.
*/
#include <arch_helpers.h>
#include <platform.h>
#include <string.h>
#include <arch_helpers.h>
#include <plat/common/platform.h>
#include "pm_api_pinctrl.h"
#include "pm_api_sys.h"
#include "pm_client.h"
......
......@@ -10,7 +10,8 @@
*/
#include <arch_helpers.h>
#include <platform.h>
#include <plat/common/platform.h>
#include "pm_api_clock.h"
#include "pm_api_ioctl.h"
#include "pm_api_pinctrl.h"
......
......@@ -8,6 +8,7 @@
#define PM_API_SYS_H
#include <stdint.h>
#include "pm_defs.h"
enum pm_query_id {
......
......@@ -10,13 +10,15 @@
*/
#include <assert.h>
#include <bakery_lock.h>
#include <bl_common.h>
#include <gic_common.h>
#include <gicv2.h>
#include <mmio.h>
#include <string.h>
#include <utils.h>
#include <common/bl_common.h>
#include <drivers/arm/gic_common.h>
#include <drivers/arm/gicv2.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <lib/utils.h>
#include "../zynqmp_def.h"
#include "pm_api_sys.h"
#include "pm_client.h"
......
......@@ -12,8 +12,10 @@
#ifndef PM_COMMON_H
#define PM_COMMON_H
#include <debug.h>
#include <stdint.h>
#include <common/debug.h>
#include "pm_defs.h"
#define PAYLOAD_ARG_CNT 6U
......
......@@ -5,9 +5,10 @@
*/
#include <arch_helpers.h>
#include <bakery_lock.h>
#include <mmio.h>
#include <platform.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include "../zynqmp_ipi.h"
#include "../zynqmp_private.h"
#include "pm_ipi.h"
......
......@@ -10,18 +10,20 @@
*/
#include <errno.h>
#include <runtime_svc.h>
#include <common/runtime_svc.h>
#if ZYNQMP_WDT_RESTART
#include <arch_helpers.h>
#include <drivers/arm/gicv2.h>
#include <lib/mmio.h>
#include <lib/spinlock.h>
#include <plat/common/platform.h>
#endif
#include "../zynqmp_private.h"
#include "pm_api_sys.h"
#include "pm_client.h"
#include "pm_ipi.h"
#if ZYNQMP_WDT_RESTART
#include <arch_helpers.h>
#include <gicv2.h>
#include <mmio.h>
#include <platform.h>
#include <spinlock.h>
#endif
#define PM_SET_SUSPEND_MODE 0xa02
#define PM_GET_TRUSTZONE_VERSION 0xa03
......
......@@ -6,8 +6,9 @@
/* Top level SMC handler for SiP calls. Dispatch PM calls to PM SMC handler. */
#include <runtime_svc.h>
#include <uuid.h>
#include <common/runtime_svc.h>
#include <tools_share/uuid.h>
#include "ipi_mailbox_svc.h"
#include "pm_svc_main.h"
#include "zynqmp_ipi.h"
......
......@@ -4,11 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <bl_common.h>
#include <console.h>
#include <debug.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <drivers/console.h>
#include <plat_arm.h>
#include <platform_tsp.h>
#include "../zynqmp_private.h"
#define BL32_END (unsigned long)(&__BL32_END__)
......
......@@ -7,7 +7,7 @@
#ifndef ZYNQMP_DEF_H
#define ZYNQMP_DEF_H
#include <common_def.h>
#include <plat/common/common_def.h>
#define ZYNQMP_CONSOLE_ID_cadence 1
#define ZYNQMP_CONSOLE_ID_cadence0 1
......
......@@ -8,12 +8,14 @@
* Zynq UltraScale+ MPSoC IPI agent registers access management
*/
#include <bakery_lock.h>
#include <debug.h>
#include <errno.h>
#include <mmio.h>
#include <runtime_svc.h>
#include <string.h>
#include <common/debug.h>
#include <common/runtime_svc.h>
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include "zynqmp_ipi.h"
#include "../zynqmp_private.h"
......
......@@ -7,10 +7,11 @@
#ifndef ZYNQMP_PRIVATE_H
#define ZYNQMP_PRIVATE_H
#include <bl_common.h>
#include <interrupt_mgmt.h>
#include <stdint.h>
#include <bl31/interrupt_mgmt.h>
#include <common/bl_common.h>
void zynqmp_config_setup(void);
unsigned int zynqmp_calc_core_pos(u_register_t mpidr);
......
......@@ -4,14 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arm_arch_svc.h>
#include <debug.h>
#include <errata_report.h>
#include <runtime_svc.h>
#include <smccc.h>
#include <common/debug.h>
#include <common/runtime_svc.h>
#include <lib/cpus/errata_report.h>
#include <lib/cpus/wa_cve_2017_5715.h>
#include <lib/cpus/wa_cve_2018_3639.h>
#include <lib/smccc.h>
#include <services/arm_arch_svc.h>
#include <smccc_helpers.h>
#include <wa_cve_2017_5715.h>
#include <wa_cve_2018_3639.h>
static int32_t smccc_version(void)
{
......
......@@ -4,12 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <assert.h>
#include <bl_common.h>
#include <context_mgmt.h>
#include <string.h>
#include <utils.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/utils.h>
#include "opteed_private.h"
/*******************************************************************************
......
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