xref: /rk3399_ARM-atf/plat/arm/board/fvp_ve/platform.mk (revision 4a135bc33e4d22c6666167a2df67bf10caa30d0a)
1#
2# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7ifdef ARM_CORTEX_A5
8# Use the SP804 timer instead of the generic one
9FVP_VE_USE_SP804_TIMER	:= 1
10$(eval $(call add_define,FVP_VE_USE_SP804_TIMER))
11BL2_SOURCES		+=	drivers/arm/sp804/sp804_delay_timer.c
12endif
13
14# Include GICv2 driver files
15include drivers/arm/gic/v2/gicv2.mk
16
17FVP_VE_GIC_SOURCES	:=	${GICV2_SOURCES}		\
18				plat/common/plat_gicv2.c	\
19				plat/arm/common/arm_gicv2.c
20
21FVP_VE_SECURITY_SOURCES	:=	plat/arm/board/fvp_ve/fvp_ve_security.c
22
23PLAT_INCLUDES		:=	-Iplat/arm/board/fvp_ve/include
24
25PLAT_BL_COMMON_SOURCES	:=	plat/arm/board/fvp_ve/fvp_ve_common.c		\
26				plat/arm/common/${ARCH}/arm_helpers.S		\
27				plat/arm/common/arm_common.c			\
28				plat/arm/common/arm_console.c			\
29				drivers/arm/pl011/${ARCH}/pl011_console.S	\
30				plat/arm/board/common/${ARCH}/board_arm_helpers.S
31
32ifdef ARM_CORTEX_A5
33FVP_VE_CPU_LIBS		:=	lib/cpus/aarch32/cortex_a5.S
34else
35FVP_VE_CPU_LIBS		:=	lib/cpus/aarch32/cortex_a7.S
36endif
37
38BL1_SOURCES		+=	drivers/arm/sp805/sp805.c			\
39				drivers/io/io_fip.c				\
40				drivers/io/io_memmap.c				\
41				drivers/io/io_storage.c				\
42				plat/arm/common/arm_bl1_setup.c			\
43				plat/arm/common/arm_err.c			\
44				plat/arm/board/fvp_ve/fvp_ve_err.c		\
45				plat/arm/common/arm_io_storage.c		\
46				plat/arm/common/fconf/arm_fconf_io.c		\
47				drivers/cfi/v2m/v2m_flash.c			\
48				plat/arm/board/fvp_ve/${ARCH}/fvp_ve_helpers.S	\
49				plat/arm/board/fvp_ve/fvp_ve_bl1_setup.c	\
50				lib/aarch32/arm32_aeabi_divmod.c		\
51				lib/aarch32/arm32_aeabi_divmod_a32.S		\
52				${FVP_VE_CPU_LIBS}					\
53				${DYN_CFG_SOURCES}
54
55BL2_SOURCES		+=	plat/arm/board/fvp_ve/fvp_ve_bl2_setup.c		\
56				lib/aarch32/arm32_aeabi_divmod.c		\
57				lib/aarch32/arm32_aeabi_divmod_a32.S		\
58				drivers/delay_timer/delay_timer.c		\
59				drivers/delay_timer/generic_delay_timer.c	\
60				drivers/cfi/v2m/v2m_flash.c			\
61				drivers/io/io_fip.c				\
62				drivers/io/io_memmap.c				\
63				drivers/io/io_storage.c				\
64				plat/arm/common/arm_bl2_setup.c			\
65				plat/arm/common/arm_err.c			\
66				plat/arm/board/fvp_ve/fvp_ve_err.c		\
67				plat/arm/common/arm_io_storage.c		\
68				plat/arm/common/fconf/arm_fconf_io.c		\
69				plat/arm/common/${ARCH}/arm_bl2_mem_params_desc.c	\
70				plat/arm/common/arm_image_load.c		\
71				common/desc_image_load.c			\
72				${DYN_CFG_SOURCES}				\
73				${FVP_VE_SECURITY_SOURCES}
74
75# Add the FDT_SOURCES and options for Dynamic Config (only for Unix env)
76ifdef UNIX_MK
77
78FDT_SOURCES		+=	plat/arm/board/fvp_ve/fdts/fvp_ve_fw_config.dts	\
79				plat/arm/board/fvp_ve/fdts/fvp_ve_tb_fw_config.dts
80
81FVP_FW_CONFIG		:=	${BUILD_PLAT}/fdts/fvp_ve_fw_config.dtb
82FVP_TB_FW_CONFIG	:=	${BUILD_PLAT}/fdts/fvp_ve_tb_fw_config.dtb
83
84# Add the FW_CONFIG to FIP and specify the same to certtool
85$(eval $(call TOOL_ADD_PAYLOAD,${FVP_FW_CONFIG},--fw-config))
86# Add the TB_FW_CONFIG to FIP and specify the same to certtool
87$(eval $(call TOOL_ADD_PAYLOAD,${FVP_TB_FW_CONFIG},--tb-fw-config))
88
89FDT_SOURCES		+=	${FVP_HW_CONFIG_DTS}
90$(eval FVP_HW_CONFIG	:=	${BUILD_PLAT}/$(patsubst %.dts,%.dtb, \
91	fdts/$(notdir ${FVP_HW_CONFIG_DTS})))
92# Add the HW_CONFIG to FIP and specify the same to certtool
93$(eval $(call TOOL_ADD_PAYLOAD,${FVP_HW_CONFIG},--hw-config))
94endif
95
96NEED_BL32 := yes
97
98# Modification of arm_common.mk
99
100# Process ARM_DISABLE_TRUSTED_WDOG flag
101# By default, Trusted Watchdog is always enabled unless SPIN_ON_BL1_EXIT is set
102ARM_DISABLE_TRUSTED_WDOG	:=	0
103ifeq (${SPIN_ON_BL1_EXIT}, 1)
104ARM_DISABLE_TRUSTED_WDOG	:=	1
105endif
106$(eval $(call assert_boolean,ARM_DISABLE_TRUSTED_WDOG))
107$(eval $(call add_define,ARM_DISABLE_TRUSTED_WDOG))
108
109# Use translation tables library v1 if using Cortex-A5
110ifdef ARM_CORTEX_A5
111ARM_XLAT_TABLES_LIB_V1		:=	1
112else
113ARM_XLAT_TABLES_LIB_V1		:=	0
114endif
115$(eval $(call assert_boolean,ARM_XLAT_TABLES_LIB_V1))
116$(eval $(call add_define,ARM_XLAT_TABLES_LIB_V1))
117
118ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1)
119	# Only use nonlpae version of xlatv1 otherwise use xlat v2
120	PLAT_BL_COMMON_SOURCES	+=	lib/xlat_tables/${ARCH}/nonlpae_tables.c
121else
122	include lib/xlat_tables_v2/xlat_tables.mk
123	PLAT_BL_COMMON_SOURCES	+=	${XLAT_TABLES_LIB_SRCS}
124endif
125
126# Firmware Configuration Framework sources
127include lib/fconf/fconf.mk
128
129# Add `libfdt` and Arm common helpers required for Dynamic Config
130include lib/libfdt/libfdt.mk
131
132DYN_CFG_SOURCES		+=	plat/arm/common/arm_dyn_cfg.c		\
133				plat/arm/common/arm_dyn_cfg_helpers.c	\
134				common/fdt_wrappers.c
135
136