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
......@@ -9,7 +9,7 @@
#if SPM_DEPRECATED
#include <utils_def.h>
#include <lib/utils_def.h>
#define MM_VERSION_MAJOR U(1)
#define MM_VERSION_MAJOR_SHIFT 16
......
......@@ -7,8 +7,8 @@
#ifndef SDEI_H
#define SDEI_H
#include <spinlock.h>
#include <utils_def.h>
#include <lib/spinlock.h>
#include <lib/utils_def.h>
/* Range 0xC4000020 - 0xC400003F reserved for SDE 64bit smc calls */
#define SDEI_VERSION 0xC4000020U
......
......@@ -10,7 +10,8 @@
#if SPM_DEPRECATED
#include <stdint.h>
#include <utils_def.h>
#include <lib/utils_def.h>
/*
* Flags used by the secure_partition_mp_info structure to describe the
......
......@@ -8,7 +8,8 @@
#define SPM_RES_DESC_H
#include <stdint.h>
#include <sp_res_desc_def.h>
#include <services/sp_res_desc_def.h>
/*******************************************************************************
* Attribute Section
......
......@@ -7,7 +7,7 @@
#ifndef SPM_RES_DESC_DEFS_H
#define SPM_RES_DESC_DEFS_H
#include <utils_def.h>
#include <lib/utils_def.h>
/*******************************************************************************
* Attribute Section
......
......@@ -7,8 +7,8 @@
#ifndef SPCI_SVC_H
#define SPCI_SVC_H
#include <smccc.h>
#include <utils_def.h>
#include <lib/smccc.h>
#include <lib/utils_def.h>
/* SPCI_VERSION helpers */
......
......@@ -9,7 +9,7 @@
#if SPM_DEPRECATED
#include <utils_def.h>
#include <lib/utils_def.h>
#define SPM_VERSION_MAJOR U(0)
#define SPM_VERSION_MAJOR_SHIFT 16
......
......@@ -7,8 +7,8 @@
#ifndef SPRT_SVC_H
#define SPRT_SVC_H
#include <smccc.h>
#include <utils_def.h>
#include <lib/smccc.h>
#include <lib/utils_def.h>
/* SPRT_VERSION helpers */
......
......@@ -8,7 +8,8 @@
#define FIRMWARE_IMAGE_PACKAGE_H
#include <stdint.h>
#include <uuid.h>
#include "uuid.h"
/* This is used as a signature to validate the blob header */
#define TOC_HEADER_NAME 0xAA640001
......
......@@ -7,7 +7,7 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
#include <xlat_tables_defs.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#if !ERROR_DEPRECATED
.globl get_afflvl_shift
......
......@@ -19,6 +19,4 @@ BL31_SOURCES += $(addprefix lib/coreboot/, \
BL31_SOURCES += drivers/coreboot/cbmem_console/${ARCH}/cbmem_console.S
INCLUDES += -Iinclude/drivers/coreboot
endif # COREBOOT
......@@ -5,12 +5,13 @@
*/
#include <assert.h>
#include <cbmem_console.h>
#include <coreboot.h>
#include <debug.h>
#include <mmio.h>
#include <string.h>
#include <xlat_tables_v2.h>
#include <drivers/coreboot/cbmem_console.h>
#include <common/debug.h>
#include <lib/coreboot.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
/*
* Structures describing coreboot's in-memory descriptor tables. See
......
......@@ -3,12 +3,13 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
#include <common/debug.h>
#include <cortex_a53.h>
#include <cpu_macros.S>
#include <debug.h>
#if A53_DISABLE_NON_TEMPORAL_HINT
#undef ERRATA_A53_836870
......
......@@ -6,9 +6,9 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
#include <common/debug.h>
#include <cortex_a57.h>
#include <cpu_macros.S>
#include <debug.h>
/* ---------------------------------------------
* Disable intra-cluster coherency
......
......@@ -6,9 +6,9 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
#include <common/debug.h>
#include <cortex_a72.h>
#include <cpu_macros.S>
#include <debug.h>
/* ---------------------------------------------
* Disable all types of L2 prefetches.
......
......@@ -7,8 +7,8 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
#include <cpu_data.h>
#include <cpu_macros.S>
#include <lib/el3_runtime/cpu_data.h>
#if defined(IMAGE_BL1) || defined(IMAGE_BL32) || (defined(IMAGE_BL2) && BL2_AT_EL3)
/*
......
......@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
#include <bl_common.h>
#include <common/bl_common.h>
#include <cortex_a35.h>
#include <cpu_macros.S>
#include <plat_macros.S>
......
......@@ -5,11 +5,11 @@
*/
#include <arch.h>
#include <asm_macros.S>
#include <bl_common.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <cortex_a53.h>
#include <cpu_macros.S>
#include <debug.h>
#include <errata_report.h>
#include <lib/cpus/errata_report.h>
#include <plat_macros.S>
#if A53_DISABLE_NON_TEMPORAL_HINT
......
......@@ -6,7 +6,7 @@
#include <arch.h>
#include <asm_macros.S>
#include <bl_common.h>
#include <common/bl_common.h>
#include <cortex_a55.h>
#include <cpu_macros.S>
#include <plat_macros.S>
......
......@@ -6,10 +6,10 @@
#include <arch.h>
#include <asm_macros.S>
#include <assert_macros.S>
#include <bl_common.h>
#include <common/bl_common.h>
#include <common/debug.h>
#include <cortex_a57.h>
#include <cpu_macros.S>
#include <debug.h>
#include <plat_macros.S>
/* ---------------------------------------------
......
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