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
......@@ -7,7 +7,7 @@
#ifndef TZC_COMMON_H
#define TZC_COMMON_H
#include <utils_def.h>
#include <lib/utils_def.h>
/*
* Offset of core registers from the start of the base of configuration
......
......@@ -7,8 +7,8 @@
#ifndef TZC_DMC500_H
#define TZC_DMC500_H
#include <tzc_common.h>
#include <utils_def.h>
#include <drivers/arm/tzc_common.h>
#include <lib/utils_def.h>
#define SI_STATUS_OFFSET U(0x000)
#define SI_STATE_CTRL_OFFSET U(0x030)
......
......@@ -7,7 +7,7 @@
#ifndef TZC_DMC620_H
#define TZC_DMC620_H
#include <utils_def.h>
#include <lib/utils_def.h>
/* DMC-620 memc register offsets */
#define DMC620_MEMC_STATUS U(0x0000)
......
......@@ -9,10 +9,10 @@
#if TRUSTED_BOARD_BOOT
#include <auth_common.h>
#include <cot_def.h>
#include <img_parser_mod.h>
#include <tbbr_img_def.h>
#include <common/tbbr/cot_def.h>
#include <common/tbbr/tbbr_img_def.h>
#include <drivers/auth/auth_common.h>
#include <drivers/auth/img_parser_mod.h>
/*
* Image flags
......
......@@ -7,7 +7,7 @@
#ifndef IMG_PARSER_MOD_H
#define IMG_PARSER_MOD_H
#include <auth_common.h>
#include <drivers/auth/auth_common.h>
/*
* Return values
......
......@@ -7,7 +7,7 @@
#ifndef CDNS_UART_H
#define CDNS_UART_H
#include <console.h>
#include <drivers/console.h>
/* This is very minimalistic and will only work in QEMU. */
......
......@@ -7,7 +7,7 @@
#ifndef CONSOLE_H
#define CONSOLE_H
#include <utils_def.h>
#include <lib/utils_def.h>
#define CONSOLE_T_NEXT (U(0) * REGSZ)
#define CONSOLE_T_FLAGS (U(1) * REGSZ)
......@@ -44,7 +44,9 @@ typedef struct console {
int (*const flush)(struct console *console);
/* Additional private driver data may follow here. */
} console_t;
#include <console_assertions.h> /* offset macro assertions for console_t */
/* offset macro assertions for console_t */
#include <drivers/console_assertions.h>
/*
* NOTE: There is no publicly accessible console_register() function. Consoles
......
......@@ -7,7 +7,7 @@
#ifndef CONSOLE_ASSERTIONS_H
#define CONSOLE_ASSERTIONS_H
#include <cassert.h>
#include <lib/cassert.h>
/*
* This file contains some separate assertions about console_t, moved here to
......
......@@ -7,7 +7,7 @@
#ifndef CBMEM_CONSOLE_H
#define CBMEM_CONSOLE_H
#include <console.h>
#include <drivers/console.h>
#define CONSOLE_T_CBMC_BASE CONSOLE_T_DRVDATA
#define CONSOLE_T_CBMC_SIZE (CONSOLE_T_DRVDATA + REGSZ)
......
......@@ -7,7 +7,7 @@
#ifndef IO_BLOCK_H
#define IO_BLOCK_H
#include <io_storage.h>
#include <drivers/io/io_storage.h>
/* block devices ops */
typedef struct io_block_ops {
......
......@@ -7,9 +7,9 @@
#ifndef IO_DRIVER_H
#define IO_DRIVER_H
#include <io_storage.h>
#include <stdint.h>
#include <drivers/io/io_storage.h>
/* Generic IO entity structure,representing an accessible IO construct on the
* device, such as a file */
......
......@@ -10,8 +10,8 @@
#include <errno.h>
#include <stdint.h>
#include <stdio.h> /* For ssize_t */
#include <uuid.h>
#include <tools_share/uuid.h>
/* Device type which can be used to enable policy decisions about which device
* to access */
......
......@@ -11,7 +11,7 @@
#define CCU_H
#ifndef __ASSEMBLY__
#include <addr_map.h>
#include <drivers/marvell/addr_map.h>
#endif
/* CCU registers definitions */
......
......@@ -10,7 +10,7 @@
#ifndef GWIN_H
#define GWIN_H
#include <addr_map.h>
#include <drivers/marvell/addr_map.h>
int init_gwin(int ap_index);
void gwin_temp_win_insert(int ap_index, struct addr_map_win *win, int size);
......
......@@ -10,7 +10,7 @@
#ifndef IO_WIN_H
#define IO_WIN_H
#include <addr_map.h>
#include <drivers/marvell/addr_map.h>
int init_io_win(int ap_index);
void iow_temp_win_insert(int ap_index, struct addr_map_win *win, int size);
......
......@@ -10,7 +10,7 @@
#ifndef IOB_H
#define IOB_H
#include <addr_map.h>
#include <drivers/marvell/addr_map.h>
enum target_ids_iob {
INTERNAL_TID = 0x0,
......
......@@ -10,7 +10,8 @@
#ifndef CP110_SETUP_H
#define CP110_SETUP_H
#include <mmio.h>
#include <lib/mmio.h>
#include <mvebu_def.h>
#define MVEBU_DEVICE_ID_REG (MVEBU_CP_DFX_OFFSET + 0x40)
......
......@@ -8,7 +8,7 @@
#ifndef A3700_CONSOLE_H
#define A3700_CONSOLE_H
#include <console.h>
#include <drivers/console.h>
/* MVEBU UART Registers */
#define UART_RX_REG 0x00
......
......@@ -7,7 +7,7 @@
#ifndef MESON_CONSOLE_H
#define MESON_CONSOLE_H
#include <console.h>
#include <drivers/console.h>
#define CONSOLE_T_MESON_BASE CONSOLE_T_DRVDATA
......
......@@ -8,7 +8,8 @@
#define MMC_H
#include <stdint.h>
#include <utils_def.h>
#include <lib/utils_def.h>
#define MMC_BLOCK_SIZE U(512)
#define MMC_BLOCK_MASK (MMC_BLOCK_SIZE - U(1))
......
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