blob: 78704b583e2aaa4c108d85bc3425aa680cd23c7b [file] [log] [blame]
Sandrine Bailleux798140d2014-07-17 16:06:39 +01001#
Max Shvetsov06dba292019-12-06 11:50:12 +00002# Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
Sandrine Bailleux798140d2014-07-17 16:06:39 +01003#
dp-armfa3cf0b2017-05-03 09:38:09 +01004# SPDX-License-Identifier: BSD-3-Clause
Sandrine Bailleux798140d2014-07-17 16:06:39 +01005#
6
Alexei Fedorovcaa18022020-07-14 10:47:25 +01007# Include GICv2 driver files
8include drivers/arm/gic/v2/gicv2.mk
9
10JUNO_GIC_SOURCES := ${GICV2_SOURCES} \
Achin Gupta1fa7eb62015-11-03 14:18:34 +000011 plat/common/plat_gicv2.c \
12 plat/arm/common/arm_gicv2.c
13
Vikram Kanigirifbb13012016-02-15 11:54:14 +000014JUNO_INTERCONNECT_SOURCES := drivers/arm/cci/cci.c \
15 plat/arm/common/arm_cci.c
16
Soby Mathew9c708b52016-02-26 14:23:19 +000017JUNO_SECURITY_SOURCES := drivers/arm/tzc/tzc400.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +000018 plat/arm/board/juno/juno_security.c \
dp-arm8f59e152017-02-27 12:21:43 +000019 plat/arm/board/juno/juno_trng.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +000020 plat/arm/common/arm_tzc400.c
21
dp-armb3263b32017-02-28 14:43:15 +000022ifneq (${ENABLE_STACK_PROTECTOR}, 0)
23JUNO_SECURITY_SOURCES += plat/arm/board/juno/juno_stack_protector.c
24endif
Vikram Kanigirifbb13012016-02-15 11:54:14 +000025
Sathees Balya22576072018-09-03 17:41:13 +010026# Select SCMI/SDS drivers instead of SCPI/BOM driver for communicating with the
27# SCP during power management operations and for SCP RAM Firmware transfer.
28CSS_USE_SCMI_SDS_DRIVER := 1
29
Antonio Nino Diaz09d58762019-01-23 19:06:55 +000030PLAT_INCLUDES := -Iplat/arm/board/juno/include
Juan Castillo921b8772014-09-05 17:29:38 +010031
Antonio Nino Diazcbc68262018-10-10 11:02:34 +010032PLAT_BL_COMMON_SOURCES := plat/arm/board/juno/${ARCH}/juno_helpers.S \
33 plat/arm/board/juno/juno_common.c
Juan Castillo921b8772014-09-05 17:29:38 +010034
Yatharth Kocharede39cb2016-11-14 12:01:04 +000035# Flag to enable support for AArch32 state on JUNO
36JUNO_AARCH32_EL3_RUNTIME := 0
37$(eval $(call assert_boolean,JUNO_AARCH32_EL3_RUNTIME))
38$(eval $(call add_define,JUNO_AARCH32_EL3_RUNTIME))
39
Summer Qin13b95c22018-03-02 15:51:14 +080040# Flag to enable support for TZMP1 on JUNO
41JUNO_TZMP1 := 0
42$(eval $(call assert_boolean,JUNO_TZMP1))
43ifeq (${JUNO_TZMP1}, 1)
44$(eval $(call add_define,JUNO_TZMP1))
45endif
46
Soby Mathewbf169232017-11-14 14:10:10 +000047ifeq (${JUNO_AARCH32_EL3_RUNTIME}, 1)
48# Include BL32 in FIP
49NEED_BL32 := yes
50# BL31 is not required
51override BL31_SOURCES =
52
53# The BL32 needs to be built separately invoking the AARCH32 compiler and
54# be specifed via `BL32` build option.
55 ifneq (${ARCH}, aarch32)
56 override BL32_SOURCES =
57 endif
58endif
59
Yatharth Kocharede39cb2016-11-14 12:01:04 +000060ifeq (${ARCH},aarch64)
Dan Handley7bef8002015-03-19 19:22:44 +000061BL1_SOURCES += lib/cpus/aarch64/cortex_a53.S \
Brendan Jackmana443d222015-10-30 16:25:12 +000062 lib/cpus/aarch64/cortex_a57.S \
Juan Castillob6132f12015-10-06 14:01:35 +010063 lib/cpus/aarch64/cortex_a72.S \
Sathees Balya22576072018-09-03 17:41:13 +010064 plat/arm/board/juno/juno_err.c \
Yatharth Kochar736a3bf2015-10-11 14:14:55 +010065 plat/arm/board/juno/juno_bl1_setup.c \
Aditya Angadi20b48412019-04-16 11:29:14 +053066 drivers/arm/sp805/sp805.c \
dp-armb3263b32017-02-28 14:43:15 +000067 ${JUNO_INTERCONNECT_SOURCES} \
68 ${JUNO_SECURITY_SOURCES}
Juan Castillo921b8772014-09-05 17:29:38 +010069
Ambroise Vincentfa42c9e2019-07-04 14:58:45 +010070BL2_SOURCES += drivers/arm/sp805/sp805.c \
71 lib/utils/mem_region.c \
Sathees Balya22576072018-09-03 17:41:13 +010072 plat/arm/board/juno/juno_err.c \
Roberto Vargasb96ee4b2018-08-06 13:35:31 +010073 plat/arm/board/juno/juno_bl2_setup.c \
74 plat/arm/common/arm_nor_psci_mem_protect.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +000075 ${JUNO_SECURITY_SOURCES}
Juan Castillo921b8772014-09-05 17:29:38 +010076
Vikram Kanigiri70752bb2016-02-10 14:50:53 +000077BL2U_SOURCES += ${JUNO_SECURITY_SOURCES}
Yatharth Kochar3a11eda2015-10-14 15:28:11 +010078
Antonio Nino Diazd7da2f82018-10-10 11:14:44 +010079BL31_SOURCES += drivers/cfi/v2m/v2m_flash.c \
80 lib/cpus/aarch64/cortex_a53.S \
Soby Mathew61e8d0b2015-10-12 17:32:29 +010081 lib/cpus/aarch64/cortex_a57.S \
Brendan Jackmana443d222015-10-30 16:25:12 +000082 lib/cpus/aarch64/cortex_a72.S \
Roberto Vargasb96ee4b2018-08-06 13:35:31 +010083 lib/utils/mem_region.c \
Chandni Cherukurie4bf6a02018-11-14 13:43:59 +053084 plat/arm/board/juno/juno_pm.c \
Soby Mathew47e43f22016-02-01 14:04:34 +000085 plat/arm/board/juno/juno_topology.c \
Roberto Vargasb96ee4b2018-08-06 13:35:31 +010086 plat/arm/common/arm_nor_psci_mem_protect.c \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +000087 ${JUNO_GIC_SOURCES} \
Vikram Kanigirifbb13012016-02-15 11:54:14 +000088 ${JUNO_INTERCONNECT_SOURCES} \
Vikram Kanigiri70752bb2016-02-10 14:50:53 +000089 ${JUNO_SECURITY_SOURCES}
Sathees Balya22576072018-09-03 17:41:13 +010090
91ifeq (${CSS_USE_SCMI_SDS_DRIVER},1)
Antonio Nino Diaz09d58762019-01-23 19:06:55 +000092BL1_SOURCES += drivers/arm/css/sds/sds.c
Yatharth Kocharede39cb2016-11-14 12:01:04 +000093endif
Juan Castillo921b8772014-09-05 17:29:38 +010094
Max Shvetsov06dba292019-12-06 11:50:12 +000095ifeq (${TRUSTED_BOARD_BOOT}, 1)
96BL1_SOURCES += plat/arm/board/juno/juno_trusted_boot.c
97BL2_SOURCES += plat/arm/board/juno/juno_trusted_boot.c
98endif
99
Sathees Balya22576072018-09-03 17:41:13 +0100100endif
101
Deepak Pandeyb0971f92018-05-25 12:43:30 +0530102ifneq (${RESET_TO_BL31},0)
Sandrine Bailleux1e32d322019-01-07 15:35:37 +0100103 $(error "Using BL31 as the reset vector is not supported on ${PLAT} platform. \
Deepak Pandeyb0971f92018-05-25 12:43:30 +0530104 Please set RESET_TO_BL31 to 0.")
105endif
106
Sathees Balya6f07a602018-11-02 14:56:06 +0000107ifeq ($(USE_ROMLIB),1)
108all : bl1_romlib.bin
109endif
110
111bl1_romlib.bin : $(BUILD_PLAT)/bl1.bin $(BUILD_PLAT)/romlib/romlib.bin
112 @echo "Building combined BL1 and ROMLIB binary for Juno $@"
113 ./lib/romlib/gen_combined_bl1_romlib.sh -o bl1_romlib.bin $(BUILD_PLAT)
114
Eleanor Bonnici8392aab2017-08-04 15:03:51 +0100115# Errata workarounds for Cortex-A53:
Ambroise Vincentbde42462019-02-22 14:19:16 +0000116ERRATA_A53_819472 := 1
117ERRATA_A53_824069 := 1
Eleanor Bonnici8392aab2017-08-04 15:03:51 +0100118ERRATA_A53_826319 := 1
Ambroise Vincentbde42462019-02-22 14:19:16 +0000119ERRATA_A53_827319 := 1
Douglas Raillardd56fb042017-06-19 15:38:02 +0100120ERRATA_A53_835769 := 1
Eleanor Bonnici8392aab2017-08-04 15:03:51 +0100121ERRATA_A53_836870 := 1
Douglas Raillardd56fb042017-06-19 15:38:02 +0100122ERRATA_A53_843419 := 1
Andre Przywara00eefd92016-10-06 16:54:53 +0100123ERRATA_A53_855873 := 1
Eleanor Bonnici8392aab2017-08-04 15:03:51 +0100124
125# Errata workarounds for Cortex-A57:
Vikram Kanigirieade34c2016-01-20 15:57:35 +0000126ERRATA_A57_806969 := 0
Antonio Nino Diaz3f13c352017-02-24 11:39:22 +0000127ERRATA_A57_813419 := 1
Vikram Kanigirieade34c2016-01-20 15:57:35 +0000128ERRATA_A57_813420 := 1
Ambroise Vincentbde42462019-02-22 14:19:16 +0000129ERRATA_A57_814670 := 1
130ERRATA_A57_817169 := 1
Douglas Raillard71d4fe22017-02-28 17:56:15 +0000131ERRATA_A57_826974 := 1
132ERRATA_A57_826977 := 1
133ERRATA_A57_828024 := 1
134ERRATA_A57_829520 := 1
135ERRATA_A57_833471 := 1
Eleanor Bonnici8392aab2017-08-04 15:03:51 +0100136ERRATA_A57_859972 := 0
Douglas Raillard71d4fe22017-02-28 17:56:15 +0000137
Eleanor Bonnici8392aab2017-08-04 15:03:51 +0100138# Errata workarounds for Cortex-A72:
139ERRATA_A72_859971 := 0
Soby Mathew937488b2014-09-22 14:13:34 +0100140
141# Enable option to skip L1 data cache flush during the Cortex-A57 cluster
142# power down sequence
143SKIP_A57_L1_FLUSH_PWR_DWN := 1
Dan Handley7bef8002015-03-19 19:22:44 +0000144
David Cunadoc5b0c0f2017-10-31 23:19:21 +0000145# Do not enable SVE
146ENABLE_SVE_FOR_NS := 0
147
Antonio Nino Diaz4e6408c2019-01-23 16:23:07 +0000148# Enable the dynamic translation tables library.
149ifeq (${ARCH},aarch32)
150 ifeq (${RESET_TO_SP_MIN},1)
Masahiro Yamada1adc5f52020-04-01 14:28:24 +0900151 BL32_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC
Antonio Nino Diaz4e6408c2019-01-23 16:23:07 +0000152 endif
153else
154 ifeq (${RESET_TO_BL31},1)
Masahiro Yamada1adc5f52020-04-01 14:28:24 +0900155 BL31_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC
Antonio Nino Diaz4e6408c2019-01-23 16:23:07 +0000156 endif
157endif
158
Petre-Ionut Tudore5a6fef2019-11-07 15:18:03 +0000159ifeq (${ALLOW_RO_XLAT_TABLES}, 1)
160 ifeq (${JUNO_AARCH32_EL3_RUNTIME}, 1)
Masahiro Yamada1adc5f52020-04-01 14:28:24 +0900161 BL32_CPPFLAGS += -DPLAT_RO_XLAT_TABLES
Petre-Ionut Tudore5a6fef2019-11-07 15:18:03 +0000162 else
Masahiro Yamada1adc5f52020-04-01 14:28:24 +0900163 BL31_CPPFLAGS += -DPLAT_RO_XLAT_TABLES
Petre-Ionut Tudore5a6fef2019-11-07 15:18:03 +0000164 endif
165endif
166
Louis Mayencourt65cac462019-07-29 10:40:17 +0100167# Add the FDT_SOURCES and options for Dynamic Config
Manish V Badarkhe64616a52020-05-31 08:53:40 +0100168FDT_SOURCES += plat/arm/board/juno/fdts/${PLAT}_fw_config.dts \
169 plat/arm/board/juno/fdts/${PLAT}_tb_fw_config.dts
170
171FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
172TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
Louis Mayencourt65cac462019-07-29 10:40:17 +0100173
Manish V Badarkhe64616a52020-05-31 08:53:40 +0100174# Add the FW_CONFIG to FIP and specify the same to certtool
Anders Dellien3f694742020-08-23 19:32:48 +0100175$(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
Louis Mayencourt65cac462019-07-29 10:40:17 +0100176# Add the TB_FW_CONFIG to FIP and specify the same to certtool
Anders Dellien3f694742020-08-23 19:32:48 +0100177$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
Louis Mayencourt65cac462019-07-29 10:40:17 +0100178
Antonio Nino Diazcbc68262018-10-10 11:02:34 +0100179include plat/arm/board/common/board_common.mk
Dan Handley7bef8002015-03-19 19:22:44 +0000180include plat/arm/common/arm_common.mk
181include plat/arm/soc/common/soc_css.mk
182include plat/arm/css/common/css_common.mk