From 5f24ce968ed2fa7749379b8a56aaeea333921e88 Mon Sep 17 00:00:00 2001 From: Manish Pandey Date: Wed, 6 Oct 2021 10:59:52 +0100 Subject: [PATCH 1/2] refactor(Makefile): move NEED_ before their use In later patch tbbr_tools.mk requires NEED_BL2 definition which is defined after inclusion of this mk file. Move NEED_ definitions earlier to their use Signed-off-by: Manish Pandey Change-Id: Ieff999b255690755779d0cd35d5aba2d3794873c --- Makefile | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 59d14ba02..ef815977e 100644 --- a/Makefile +++ b/Makefile @@ -776,10 +776,16 @@ endif # Process platform overrideable behaviour ################################################################################ -# Using BL2 implies that a BL33 image also needs to be supplied for the FIP and -# Certificate generation tools. This flag can be overridden by the platform. +ifdef BL1_SOURCES +NEED_BL1 := yes +endif + ifdef BL2_SOURCES - ifdef EL3_PAYLOAD_BASE + NEED_BL2 := yes + + # Using BL2 implies that a BL33 image also needs to be supplied for the FIP and + # Certificate generation tools. This flag can be overridden by the platform. + ifdef EL3_PAYLOAD_BASE # If booting an EL3 payload there is no need for a BL33 image # in the FIP file. NEED_BL33 := no @@ -794,6 +800,10 @@ ifdef BL2_SOURCES endif endif +ifdef BL2U_SOURCES +NEED_BL2U := yes +endif + # If SCP_BL2 is given, we always want FIP to include it. ifdef SCP_BL2 NEED_SCP_BL2 := yes @@ -831,6 +841,10 @@ ifneq (${FIP_ALIGN},0) FIP_ARGS += --align ${FIP_ALIGN} endif +ifdef FDT_SOURCES +NEED_FDT := yes +endif + ################################################################################ # Include libraries' Makefile that are used in all BL ################################################################################ @@ -874,30 +888,22 @@ DOCS_PATH ?= docs ################################################################################ # Include BL specific makefiles ################################################################################ -ifdef BL1_SOURCES -NEED_BL1 := yes + +ifeq (${NEED_BL1},yes) include bl1/bl1.mk endif -ifdef BL2_SOURCES -NEED_BL2 := yes +ifeq (${NEED_BL2},yes) include bl2/bl2.mk endif -ifdef BL2U_SOURCES -NEED_BL2U := yes +ifeq (${NEED_BL2U},yes) include bl2u/bl2u.mk endif ifeq (${NEED_BL31},yes) -ifdef BL31_SOURCES include bl31/bl31.mk endif -endif - -ifdef FDT_SOURCES -NEED_FDT := yes -endif ################################################################################ # Build options checks From 08c699e738ff8937f654f1ac23891e89536f10bb Mon Sep 17 00:00:00 2001 From: Manish Pandey Date: Fri, 1 Oct 2021 14:34:33 +0100 Subject: [PATCH 2/2] refactor(tbbr): remove "fvp_r" platform specific check fvp_r is a unique platform which does not have BL2 binary and image loading functionality is performed by BL1 itself. To avoid generating certificate for BL2 there was platform specific check added which looks bit ugly, replacing that check. Signed-off-by: Manish Pandey Change-Id: I11360fa753f847768906c42dce652296245b4a63 --- make_helpers/tbbr/tbbr_tools.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/make_helpers/tbbr/tbbr_tools.mk b/make_helpers/tbbr/tbbr_tools.mk index 293e85487..0a280b4ed 100644 --- a/make_helpers/tbbr/tbbr_tools.mk +++ b/make_helpers/tbbr/tbbr_tools.mk @@ -11,6 +11,7 @@ # Expected environment: # # BUILD_PLAT: output directory +# NEED_BL2: indicates whether BL2 is needed by the platform # NEED_BL32: indicates whether BL32 is needed by the platform # BL2: image filename (optional). Default is IMG_BIN(2) (see macro IMG_BIN) # SCP_BL2: image filename (optional). Default is IMG_BIN(30) @@ -67,8 +68,8 @@ $(if ${NON_TRUSTED_WORLD_KEY},$(eval $(call CERT_ADD_CMD_OPT,${NON_TRUSTED_WORLD # Add the BL2 CoT (image cert) +ifeq (${NEED_BL2},yes) ifeq (${BL2_AT_EL3}, 0) -ifneq (${PLAT},fvp_r) $(eval $(call TOOL_ADD_PAYLOAD,${BUILD_PLAT}/tb_fw.crt,--tb-fw-cert)) endif endif