From 91e6f26f96c0ce4088f2c1d5110bd82591e15678 Mon Sep 17 00:00:00 2001 From: Chandni Cherukuri Date: Fri, 10 Aug 2018 11:17:58 +0530 Subject: [PATCH] plat/arm/sgi: reorganize platform macros In preparation of adding support for upcoming SGI platforms, macros common to all the SGI platforms are moved into sgi_base_platform_def.h file. Macros that are specific to sgi575 platform remain in the platform_def.h file. In addition to this, the platform_def.h file is moved to sgi575 board directory. Also the ENT_CPU_SOURCES has been renamed to SGI_CPU_SOURCES and moved from sgi-common.mk to board specific makefile platform.mk Change-Id: Iccdd9f070f4feea232b9fbf4fdcc0ef2e8eccbf2 Signed-off-by: Chandni Cherukuri --- plat/arm/board/sgi575/include/platform_def.h | 18 ++++++++++++++++++ plat/arm/board/sgi575/platform.mk | 11 ++++++++++- ...{platform_def.h => sgi_base_platform_def.h} | 13 +++---------- plat/arm/css/sgi/sgi-common.mk | 6 +----- 4 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 plat/arm/board/sgi575/include/platform_def.h rename plat/arm/css/sgi/include/{platform_def.h => sgi_base_platform_def.h} (96%) diff --git a/plat/arm/board/sgi575/include/platform_def.h b/plat/arm/board/sgi575/include/platform_def.h new file mode 100644 index 00000000..1870fc78 --- /dev/null +++ b/plat/arm/board/sgi575/include/platform_def.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef PLATFORM_DEF_H +#define PLATFORM_DEF_H + +#include + +#define PLAT_ARM_CLUSTER_COUNT 2 +#define CSS_SGI_MAX_CPUS_PER_CLUSTER 4 +#define CSS_SGI_MAX_PE_PER_CPU 1 + +#define PLAT_CSS_MHU_BASE 0x45000000 + +#endif /* PLATFORM_DEF_H */ diff --git a/plat/arm/board/sgi575/platform.mk b/plat/arm/board/sgi575/platform.mk index 078f393c..a18e45bb 100644 --- a/plat/arm/board/sgi575/platform.mk +++ b/plat/arm/board/sgi575/platform.mk @@ -6,9 +6,18 @@ include plat/arm/css/sgi/sgi-common.mk +SGI575_BASE = plat/arm/board/sgi575 + +PLAT_INCLUDES += -I${SGI575_BASE}/include/ + +SGI_CPU_SOURCES := lib/cpus/aarch64/cortex_a75.S + +BL1_SOURCES += ${SGI_CPU_SOURCES} + BL2_SOURCES += lib/utils/mem_region.c \ plat/arm/common/arm_nor_psci_mem_protect.c -BL31_SOURCES += drivers/cfi/v2m/v2m_flash.c \ +BL31_SOURCES += ${SGI_CPU_SOURCES} \ + drivers/cfi/v2m/v2m_flash.c \ lib/utils/mem_region.c \ plat/arm/common/arm_nor_psci_mem_protect.c diff --git a/plat/arm/css/sgi/include/platform_def.h b/plat/arm/css/sgi/include/sgi_base_platform_def.h similarity index 96% rename from plat/arm/css/sgi/include/platform_def.h rename to plat/arm/css/sgi/include/sgi_base_platform_def.h index 62974905..90eb3360 100644 --- a/plat/arm/css/sgi/include/platform_def.h +++ b/plat/arm/css/sgi/include/sgi_base_platform_def.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef PLATFORM_DEF_H -#define PLATFORM_DEF_H +#ifndef SGI_BASE_PLATFORM_DEF_H +#define SGI_BASE_PLATFORM_DEF_H #include #include @@ -17,11 +17,6 @@ #include #include -#define CSS_SGI_MAX_CPUS_PER_CLUSTER 4 - -/* CPU topology */ -#define PLAT_ARM_CLUSTER_COUNT 2 -#define CSS_SGI_MAX_PE_PER_CPU 1 #define PLATFORM_CORE_COUNT (PLAT_ARM_CLUSTER_COUNT * \ CSS_SGI_MAX_CPUS_PER_CLUSTER * \ CSS_SGI_MAX_PE_PER_CPU) @@ -118,8 +113,6 @@ #define PLAT_ARM_NSTIMER_FRAME_ID 0 -#define PLAT_CSS_MHU_BASE 0x45000000 - #define PLAT_ARM_TRUSTED_ROM_BASE 0x0 #define PLAT_ARM_TRUSTED_ROM_SIZE 0x00080000 /* 512KB */ @@ -216,4 +209,4 @@ V2M_FLASH0_SIZE - V2M_FLASH_BLOCK_SIZE) -#endif /* PLATFORM_DEF_H */ +#endif /* SGI_BASE_PLATFORM_DEF_H */ diff --git a/plat/arm/css/sgi/sgi-common.mk b/plat/arm/css/sgi/sgi-common.mk index 24f03dd4..b6383aa7 100644 --- a/plat/arm/css/sgi/sgi-common.mk +++ b/plat/arm/css/sgi/sgi-common.mk @@ -22,8 +22,6 @@ INTERCONNECT_SOURCES := ${CSS_ENT_BASE}/sgi_interconnect.c PLAT_INCLUDES += -I${CSS_ENT_BASE}/include -ENT_CPU_SOURCES := lib/cpus/aarch64/cortex_a75.S - ENT_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \ drivers/arm/gic/v3/gicv3_main.c \ drivers/arm/gic/v3/gicv3_helpers.c \ @@ -36,15 +34,13 @@ PLAT_BL_COMMON_SOURCES += ${CSS_ENT_BASE}/sgi_plat.c \ ${CSS_ENT_BASE}/aarch64/sgi_helper.S BL1_SOURCES += ${INTERCONNECT_SOURCES} \ - ${ENT_CPU_SOURCES} \ ${CSS_ENT_BASE}/sgi_bl1_setup.c \ ${CSS_ENT_BASE}/sgi_plat_config.c BL2_SOURCES += ${CSS_ENT_BASE}/sgi_security.c \ ${CSS_ENT_BASE}/sgi_image_load.c -BL31_SOURCES += ${ENT_CPU_SOURCES} \ - ${INTERCONNECT_SOURCES} \ +BL31_SOURCES += ${INTERCONNECT_SOURCES} \ ${ENT_GIC_SOURCES} \ ${CSS_ENT_BASE}/sgi_bl31_setup.c \ ${CSS_ENT_BASE}/sgi_topology.c \ -- 2.30.2