plat/arm: Fix header dependencies

From now on, platform_def.h must include any header with definitions that
are platform-specific (like arm_def.h) and the included headers mustn't
include back platform_def.h, and shouldn't be used by other files. Only
platform_def.h should be included in other files. This will ensure that all
needed definitions are present, rather than needing to include all the
headers in all the definitions' headers just in case.

This also prevents problems like cyclic dependencies.

Change-Id: I9d3cf4d1de4b956fa035c79545222697acdaf5ca
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
This commit is contained in:
Antonio Nino Diaz 2019-01-15 14:19:50 +00:00
parent fe77b53e32
commit 234bc7f88e
50 changed files with 35 additions and 76 deletions

View File

@ -6,8 +6,6 @@
#ifndef ARM_DEF_H
#define ARM_DEF_H
#include <platform_def.h>
#include <arch.h>
#include <common/interrupt_props.h>
#include <common/tbbr/tbbr_img_def.h>

View File

@ -9,8 +9,6 @@
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <arm_def.h>
/*
* Reserve 4 MiB for binaries of Secure Partitions and Resource Description
* blobs.

View File

@ -11,8 +11,6 @@
#include <drivers/arm/gic_common.h>
#include <drivers/arm/tzc400.h>
#include <arm_def.h>
/*************************************************************************
* Definitions common to all ARM Compute SubSystems (CSS)
*************************************************************************/

View File

@ -6,7 +6,7 @@
#include <asm_macros.S>
#include <common/bl_common.h>
#include <v2m_def.h>
#include <platform_def.h>
.globl plat_report_exception

View File

@ -6,7 +6,7 @@
#include <asm_macros.S>
#include <common/bl_common.h>
#include <v2m_def.h>
#include <platform_def.h>
.globl plat_report_exception

View File

@ -11,8 +11,7 @@
#include <lib/cassert.h>
#include <plat/common/platform.h>
#include <tools_share/tbbr_oid.h>
#include <arm_def.h>
#include <platform_def.h>
/* SHA256 algorithm */
#define SHA256_BYTES 32

View File

@ -7,8 +7,8 @@
#include <arch.h>
#include <asm_macros.S>
#include <platform_def.h>
#include "../drivers/pwrc/fvp_pwrc.h"
#include "../fvp_def.h"
.globl plat_secondary_cold_boot_setup
.globl plat_get_my_entrypoint

View File

@ -9,9 +9,8 @@
#include <drivers/arm/gicv2.h>
#include <drivers/arm/gicv3.h>
#include <platform_def.h>
#include <v2m_def.h>
#include "../drivers/pwrc/fvp_pwrc.h"
#include "../fvp_def.h"
.globl plat_secondary_cold_boot_setup
.globl plat_get_my_entrypoint

View File

@ -6,10 +6,9 @@
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <platform_def.h>
#include <plat_arm.h>
#include "../../fvp_def.h"
#include "../../fvp_private.h"
#include "fvp_pwrc.h"

View File

@ -8,10 +8,9 @@
#include <drivers/generic_delay_timer.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <platform_def.h>
#include <plat_arm.h>
#include <v2m_def.h>
#include "fvp_def.h"
#include "fvp_private.h"
void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3)

View File

@ -5,9 +5,9 @@
*/
#include <plat/common/platform.h>
#include <platform_def.h>
#include <plat_arm.h>
#include "fvp_def.h"
#include "fvp_private.h"
void bl2u_early_platform_setup(struct meminfo *mem_layout, void *plat_info)

View File

@ -13,15 +13,12 @@
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables_compat.h>
#include <plat/common/platform.h>
#include <platform_def.h>
#include <services/secure_partition.h>
#include <arm_config.h>
#include <arm_def.h>
#include <arm_spm_def.h>
#include <plat_arm.h>
#include <v2m_def.h>
#include "../fvp_def.h"
#include "fvp_private.h"
/* Defines for GIC Driver build time selection */

View File

@ -14,14 +14,13 @@
#include <lib/mmio.h>
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include <platform_def.h>
#include <arm_config.h>
#include <plat_arm.h>
#include <v2m_def.h>
#include "../../../../drivers/arm/gic/v3/gicv3_private.h"
#include "drivers/pwrc/fvp_pwrc.h"
#include "fvp_def.h"
#include "fvp_private.h"

View File

@ -9,10 +9,9 @@
#include <string.h>
#include <plat/common/platform.h>
#include <platform_def.h>
#include <tools_share/tbbr_oid.h>
#include "fvp_def.h"
/*
* Store a new non-volatile counter value. On some FVP versions, the
* non-volatile counters are RO. On these versions we expect the values in the

View File

@ -7,8 +7,7 @@
#define PLAT_MACROS_S
#include <arm_macros.S>
#include <v2m_def.h>
#include "../fvp_def.h"
#include <platform_def.h>
/* ---------------------------------------------
* The below required platform porting macro

View File

@ -11,9 +11,7 @@
#include <cortex_a57.h>
#include <cortex_a72.h>
#include <cpu_macros.S>
#include <v2m_def.h>
#include "../juno_def.h"
#include <platform_def.h>
.globl plat_reset_handler
.globl plat_arm_calc_core_pos

View File

@ -11,10 +11,7 @@
#include <cortex_a57.h>
#include <cortex_a72.h>
#include <cpu_macros.S>
#include <css_def.h>
#include <v2m_def.h>
#include "../juno_def.h"
#include <platform_def.h>
.globl plat_reset_handler
.globl plat_arm_calc_core_pos

View File

@ -11,10 +11,10 @@
#include <common/tbbr/tbbr_img_def.h>
#include <drivers/arm/sp805.h>
#include <plat/common/platform.h>
#include <platform_def.h>
#include <plat_arm.h>
#include <sds.h>
#include <v2m_def.h>
void juno_reset_to_aarch32_state(void);

View File

@ -3,7 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arm_def.h>
#include <platform_def.h>
#include <plat_arm.h>
/*

View File

@ -8,8 +8,7 @@
#include <arch_helpers.h>
#include <plat/common/platform.h>
#include <v2m_def.h>
#include <platform_def.h>
/*
* Juno error handler

View File

@ -7,10 +7,10 @@
#include <common/debug.h>
#include <drivers/arm/nic_400.h>
#include <lib/mmio.h>
#include <platform_def.h>
#include <plat_arm.h>
#include <soc_css.h>
#include "juno_def.h"
#include "juno_tzmp1_def.h"
#ifdef JUNO_TZMP1

View File

@ -7,9 +7,9 @@
#include <arch_helpers.h>
#include <common/debug.h>
#include <lib/utils.h>
#include <platform_def.h>
#include "juno_decl.h"
#include "juno_def.h"
u_register_t plat_get_stack_protector_canary(void)
{

View File

@ -5,11 +5,10 @@
*/
#include <plat/common/platform.h>
#include <platform_def.h>
#include <arm_def.h>
#include <css_pm.h>
#include <plat_arm.h>
#include "juno_def.h"
#include "../../css/drivers/scmi/scmi.h"
#include "../../css/drivers/mhu/css_mhu_doorbell.h"

View File

@ -9,9 +9,9 @@
#include <lib/mmio.h>
#include <lib/utils_def.h>
#include <platform_def.h>
#include "juno_decl.h"
#include "juno_def.h"
#define NSAMPLE_CLOCKS 1 /* min 1 cycle, max 231 cycles */
#define NRETRIES 5

View File

@ -7,8 +7,6 @@
#ifndef JUNO_TZMP1_DEF_H
#define JUNO_TZMP1_DEF_H
#include <plat_arm.h>
/*
* Public memory regions for both protected and non-protected mode
*

View File

@ -9,6 +9,7 @@
#include <arm_def.h>
#include <css_def.h>
#include <v2m_def.h>
/* UART related constants */
#define PLAT_ARM_BOOT_UART_BASE 0x2A400000

View File

@ -10,7 +10,6 @@
#include <common/debug.h>
#include <plat/common/platform.h>
#include <arm_def.h>
#include <plat_arm.h>
/*

View File

@ -16,7 +16,6 @@
#include <lib/xlat_tables/xlat_tables_compat.h>
#include <plat/common/platform.h>
#include <arm_def.h>
#include <plat_arm.h>
#include "../../../bl1/bl1_private.h"

View File

@ -8,8 +8,8 @@
#include <drivers/generic_delay_timer.h>
#include <plat/common/platform.h>
#include <platform_def.h>
#include <arm_def.h>
#include <plat_arm.h>
#pragma weak bl2_el3_early_platform_setup

View File

@ -20,7 +20,6 @@
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <arm_def.h>
#include <plat_arm.h>
/* Data structure which holds the extents of the trusted SRAM for BL2 */

View File

@ -14,7 +14,6 @@
#include <drivers/generic_delay_timer.h>
#include <plat/common/platform.h>
#include <arm_def.h>
#include <plat_arm.h>
/* Weak definitions may be overridden in specific ARM standard platform */

View File

@ -16,8 +16,8 @@
#include <lib/utils.h>
#include <lib/xlat_tables/xlat_tables_compat.h>
#include <plat/common/platform.h>
#include <platform_def.h>
#include <arm_def.h>
#include <plat_arm.h>
/*

View File

@ -11,7 +11,6 @@
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <arm_def.h>
#include <plat_arm.h>
/******************************************************************************

View File

@ -8,7 +8,6 @@
#include <common/desc_image_load.h>
#include <plat/common/platform.h>
#include <arm_def.h>
#include <plat_arm.h>
#pragma weak plat_flush_next_bl_params

View File

@ -13,7 +13,6 @@
#include <lib/psci/psci.h>
#include <plat/common/platform.h>
#include <arm_def.h>
#include <plat_arm.h>
/* Allow ARM Standard platforms to override these functions */

View File

@ -9,8 +9,6 @@
#include <common/debug.h>
#include <drivers/arm/tzc400.h>
#include <arm_def.h>
#include <arm_spm_def.h>
#include <plat_arm.h>
/* Weak definitions may be overridden in specific ARM standard platform */

View File

@ -11,7 +11,6 @@
#include <common/debug.h>
#include <drivers/arm/tzc_dmc500.h>
#include <arm_def.h>
#include <plat_arm.h>
/*******************************************************************************

View File

@ -14,7 +14,6 @@
#include <drivers/arm/pl011.h>
#include <drivers/console.h>
#include <arm_def.h>
#include <plat_arm.h>
#define BL32_END (unsigned long)(&__BL32_END__)

View File

@ -3,10 +3,11 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <asm_macros.S>
#include <cpu_macros.S>
#include <css_def.h>
#include <platform_def.h>
.weak plat_secondary_cold_boot_setup
.weak plat_get_my_entrypoint

View File

@ -3,10 +3,11 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <asm_macros.S>
#include <cpu_macros.S>
#include <css_def.h>
#include <platform_def.h>
.weak plat_secondary_cold_boot_setup
.weak plat_get_my_entrypoint

View File

@ -10,8 +10,8 @@
#include <common/debug.h>
#include <lib/mmio.h>
#include <lib/utils.h>
#include <platform_def.h>
#include <css_def.h>
#include <plat_arm.h>
#include "../drivers/scp/css_scp.h"

View File

@ -12,7 +12,6 @@
#include <lib/bakery_lock.h>
#include <lib/mmio.h>
#include <css_def.h>
#include <plat_arm.h>
#include "css_mhu.h"

View File

@ -10,8 +10,7 @@
#include <arch_helpers.h>
#include <common/debug.h>
#include <plat/common/platform.h>
#include <css_def.h>
#include <platform_def.h>
#include "../mhu/css_mhu.h"
#include "../scpi/css_scpi.h"

View File

@ -10,8 +10,8 @@
#include <arch_helpers.h>
#include <common/debug.h>
#include <plat/common/platform.h>
#include <platform_def.h>
#include <css_def.h>
#include <css_pm.h>
#include <plat_arm.h>

View File

@ -11,8 +11,7 @@
#include <common/debug.h>
#include <drivers/delay_timer.h>
#include <plat/common/platform.h>
#include <css_def.h>
#include <platform_def.h>
#include "css_scp.h"
#include "../sds/sds.h"

View File

@ -11,8 +11,7 @@
#include <common/debug.h>
#include <lib/utils.h>
#include <plat/common/platform.h>
#include <css_def.h>
#include <platform_def.h>
#include "../mhu/css_mhu.h"
#include "css_scpi.h"

View File

@ -10,8 +10,8 @@
#include <arch_helpers.h>
#include <common/debug.h>
#include <platform_def.h>
#include <css_def.h>
#include "sds.h"
#include "sds_private.h"

View File

@ -14,8 +14,6 @@
#include <plat/common/platform.h>
#include <services/secure_partition.h>
#include <arm_def.h>
#include <arm_spm_def.h>
#include <plat_arm.h>
#include "../../../../bl1/bl1_private.h"

View File

@ -9,7 +9,6 @@
#include <common/bl_common.h>
#include <common/debug.h>
#include <arm_def.h>
#include <plat_arm.h>
#include <sgm_variant.h>

View File

@ -9,9 +9,7 @@
#include <drivers/arm/nic_400.h>
#include <lib/mmio.h>
#include <board_css_def.h>
#include <soc_css.h>
#include <soc_css_def.h>
void soc_css_init_nic400(void)
{