1#
2# Copyright (c) 2015-2022, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7
8# By default, SCP images are needed by CSS platforms.
9CSS_LOAD_SCP_IMAGES	?=	1
10
11# By default, SCMI driver is disabled for CSS platforms
12CSS_USE_SCMI_SDS_DRIVER	?=	0
13
14PLAT_INCLUDES		+=	-Iinclude/plat/arm/css/common/aarch64
15
16
17PLAT_BL_COMMON_SOURCES	+=	plat/arm/css/common/${ARCH}/css_helpers.S
18
19BL1_SOURCES		+=	plat/arm/css/common/css_bl1_setup.c
20
21BL2_SOURCES		+=	plat/arm/css/common/css_bl2_setup.c
22
23BL2U_SOURCES		+=	plat/arm/css/common/css_bl2u_setup.c
24
25BL31_SOURCES		+=	plat/arm/css/common/css_pm.c			\
26				plat/arm/css/common/css_topology.c
27
28ifeq (${CSS_USE_SCMI_SDS_DRIVER},0)
29BL31_SOURCES		+=	drivers/arm/css/mhu/css_mhu.c			\
30				drivers/arm/css/scp/css_pm_scpi.c		\
31				drivers/arm/css/scpi/css_scpi.c
32else
33BL31_SOURCES		+=	drivers/arm/css/mhu/css_mhu_doorbell.c		\
34				drivers/arm/css/scmi/scmi_ap_core_proto.c	\
35				drivers/arm/css/scmi/scmi_common.c		\
36				drivers/arm/css/scmi/scmi_pwr_dmn_proto.c	\
37				drivers/arm/css/scmi/scmi_sys_pwr_proto.c	\
38				drivers/delay_timer/delay_timer.c		\
39				drivers/arm/css/scp/css_pm_scmi.c
40endif
41
42# Process CSS_LOAD_SCP_IMAGES flag
43$(eval $(call assert_boolean,CSS_LOAD_SCP_IMAGES))
44$(eval $(call add_define,CSS_LOAD_SCP_IMAGES))
45
46ifeq (${CSS_LOAD_SCP_IMAGES},1)
47  NEED_SCP_BL2 := yes
48  ifneq (${TRUSTED_BOARD_BOOT},0)
49    $(eval $(call TOOL_ADD_IMG,scp_bl2u,--scp-fwu-cfg,FWU_))
50  endif
51
52  ifeq (${CSS_USE_SCMI_SDS_DRIVER},1)
53    BL2U_SOURCES	+=	drivers/arm/css/scp/css_sds.c			\
54				drivers/arm/css/sds/sds.c
55
56    BL2_SOURCES		+=	drivers/arm/css/scp/css_sds.c			\
57				drivers/arm/css/sds/sds.c
58  else
59    BL2U_SOURCES	+=	drivers/arm/css/mhu/css_mhu.c			\
60				drivers/arm/css/scp/css_bom_bootloader.c	\
61				drivers/arm/css/scpi/css_scpi.c
62
63    BL2_SOURCES		+=	drivers/arm/css/mhu/css_mhu.c			\
64				drivers/arm/css/scp/css_bom_bootloader.c	\
65				drivers/arm/css/scpi/css_scpi.c
66    # Enable option to detect whether the SCP ROM firmware in use predates version
67    # 1.7.0 and therefore, is incompatible.
68    CSS_DETECT_PRE_1_7_0_SCP	:=	1
69
70    # Process CSS_DETECT_PRE_1_7_0_SCP flag
71    $(eval $(call assert_boolean,CSS_DETECT_PRE_1_7_0_SCP))
72    $(eval $(call add_define,CSS_DETECT_PRE_1_7_0_SCP))
73  endif
74endif
75
76ifeq (${CSS_USE_SCMI_SDS_DRIVER},1)
77  PLAT_BL_COMMON_SOURCES	+=	drivers/arm/css/sds/${ARCH}/sds_helpers.S
78endif
79
80# Process CSS_USE_SCMI_SDS_DRIVER flag
81$(eval $(call assert_boolean,CSS_USE_SCMI_SDS_DRIVER))
82$(eval $(call add_define,CSS_USE_SCMI_SDS_DRIVER))
83
84# Process CSS_NON_SECURE_UART flag
85# This undocumented build option is only to enable debug access to the UART
86# from non secure code, which is useful on some platforms.
87# Default (obviously) is off.
88CSS_NON_SECURE_UART		:= 0
89$(eval $(call assert_boolean,CSS_NON_SECURE_UART))
90$(eval $(call add_define,CSS_NON_SECURE_UART))
91
92# Process CSS_SYSTEM_GRACEFUL_RESET flag
93# This build option can be used on CSS platforms that require all the CPUs
94# to execute the CPU specific power down sequence to complete a warm reboot
95# sequence in which only the CPUs are power cycled.
96CSS_SYSTEM_GRACEFUL_RESET	:= 0
97$(eval $(call add_define,CSS_SYSTEM_GRACEFUL_RESET))
98