1#
2# Copyright (c) 2019-2022, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7# Making sure the corstone700 platform type is specified
8ifeq ($(filter ${TARGET_PLATFORM}, fpga fvp),)
9        $(error TARGET_PLATFORM must be fpga or fvp)
10endif
11
12CORSTONE700_CPU_LIBS	+=	lib/cpus/aarch32/cortex_a32.S
13
14BL32_SOURCES		+=	plat/arm/common/aarch32/arm_helpers.S	\
15				plat/arm/common/arm_console.c	\
16				plat/arm/common/arm_common.c	\
17				lib/xlat_tables/aarch32/xlat_tables.c	\
18				lib/xlat_tables/xlat_tables_common.c	\
19				${CORSTONE700_CPU_LIBS}	\
20				plat/arm/board/corstone700/common/drivers/mhu/corstone700_mhu.c
21
22PLAT_INCLUDES		:=	-Iplat/arm/board/corstone700/common/include	\
23				-Iinclude/plat/arm/common	\
24				-Iplat/arm/board/corstone700/common/drivers/mhu
25
26NEED_BL32		:=	yes
27
28# Include GICv2 driver files
29include drivers/arm/gic/v2/gicv2.mk
30
31CORSTONE700_GIC_SOURCES	:=	${GICV2_SOURCES}			\
32				plat/common/plat_gicv2.c		\
33				plat/arm/common/arm_gicv2.c
34
35# BL1/BL2 Image not a part of the capsule Image for Corstone700
36override NEED_BL1	:=	no
37override NEED_BL2	:=	no
38override NEED_BL2U	:=	no
39override NEED_BL33	:=	yes
40
41#TFA for Corstone700 starts from BL32
42override RESET_TO_SP_MIN	:=	1
43
44#Device tree
45CORSTONE700_HW_CONFIG_DTS	:=	fdts/corstone700_${TARGET_PLATFORM}.dts
46CORSTONE700_HW_CONFIG		:=	${BUILD_PLAT}/fdts/corstone700_${TARGET_PLATFORM}.dtb
47FDT_SOURCES			+=	${CORSTONE700_HW_CONFIG_DTS}
48$(eval CORSTONE700_HW_CONFIG	:=	${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(CORSTONE700_HW_CONFIG_DTS)))
49
50# Add the HW_CONFIG to FIP and specify the same to certtool
51$(eval $(call TOOL_ADD_PAYLOAD,${CORSTONE700_HW_CONFIG},--hw-config,${CORSTONE700_HW_CONFIG}))
52
53# Check for Linux kernel as a BL33 image by default
54$(eval $(call add_define,ARM_LINUX_KERNEL_AS_BL33))
55  ifndef ARM_PRELOADED_DTB_BASE
56    $(error "ARM_PRELOADED_DTB_BASE must be set if ARM_LINUX_KERNEL_AS_BL33 is used.")
57  endif
58  $(eval $(call add_define,ARM_PRELOADED_DTB_BASE))
59
60# Adding TARGET_PLATFORM as a GCC define (-D option)
61$(eval $(call add_define,TARGET_PLATFORM_$(call uppercase,${TARGET_PLATFORM})))
62
63include plat/arm/board/common/board_common.mk
64