Merge pull request #890 from masahir0y/scp
authordavidcunado-arm <david.cunado@arm.com>
Fri, 14 Apr 2017 00:49:34 +0000 (01:49 +0100)
committerGitHub <noreply@github.com>
Fri, 14 Apr 2017 00:49:34 +0000 (01:49 +0100)
Build: add generic way to include SCP_BL2 into FIP image

1  2 
Makefile

diff --combined Makefile
index 9f9061c4a8ba80b31822ad21ada0d16e28824b8a,06916dcf89d2591562882eb7f3662dbfe7d2773f..02aa50e3d87dcccb36d462b8c13da35aab1b93bd
+++ b/Makefile
@@@ -246,12 -246,6 +246,12 @@@ endi
          # over the sources.
  endif
  
 +################################################################################
 +# Include libraries' Makefile that are used in all BL
 +################################################################################
 +
 +include lib/stack_protector/stack_protector.mk
 +
  
  ################################################################################
  # Include the platform specific Makefile after the SPD Makefile (the platform
@@@ -347,6 -341,11 +347,11 @@@ ifdef BL2_SOURCE
          endif
  endif
  
+ # If SCP_BL2 is given, we always want FIP to include it.
+ ifdef SCP_BL2
+         NEED_SCP_BL2          :=      yes
+ endif
  # Process TBB related flags
  ifneq (${GENERATE_COT},0)
          # Common cert_create options
@@@ -380,55 -379,6 +385,55 @@@ CRTTOOL                  ?=      ${CRTTOOLPATH}/cert_create
  FIPTOOLPATH           ?=      tools/fiptool
  FIPTOOL                       ?=      ${FIPTOOLPATH}/fiptool${BIN_EXT}
  
 +################################################################################
 +# Include BL specific makefiles
 +################################################################################
 +ifdef BL1_SOURCES
 +NEED_BL1 := yes
 +include bl1/bl1.mk
 +endif
 +
 +ifdef BL2_SOURCES
 +NEED_BL2 := yes
 +include bl2/bl2.mk
 +endif
 +
 +# For AArch32, BL31 is not applicable, and BL2U is not supported at present.
 +ifneq (${ARCH},aarch32)
 +ifdef BL2U_SOURCES
 +NEED_BL2U := yes
 +include bl2u/bl2u.mk
 +endif
 +
 +ifdef BL31_SOURCES
 +# When booting an EL3 payload, there is no need to compile the BL31 image nor
 +# put it in the FIP.
 +ifndef EL3_PAYLOAD_BASE
 +NEED_BL31 := yes
 +include bl31/bl31.mk
 +endif
 +endif
 +endif
 +
 +ifeq (${ARCH},aarch32)
 +NEED_BL32 := yes
 +
 +################################################################################
 +# Build `AARCH32_SP` as BL32 image for AArch32
 +################################################################################
 +ifneq (${AARCH32_SP},none)
 +# We expect to locate an sp.mk under the specified AARCH32_SP directory
 +AARCH32_SP_MAKE       :=      $(wildcard bl32/${AARCH32_SP}/${AARCH32_SP}.mk)
 +
 +ifeq (${AARCH32_SP_MAKE},)
 +  $(error Error: No bl32/${AARCH32_SP}/${AARCH32_SP}.mk located)
 +endif
 +
 +$(info Including ${AARCH32_SP_MAKE})
 +include ${AARCH32_SP_MAKE}
 +endif
 +
 +endif
  
  ################################################################################
  # Build options checks
@@@ -514,6 -464,56 +519,6 @@@ els
          $(eval $(call add_define,AARCH64))
  endif
  
 -################################################################################
 -# Include BL specific makefiles
 -################################################################################
 -ifdef BL1_SOURCES
 -NEED_BL1 := yes
 -include bl1/bl1.mk
 -endif
 -
 -ifdef BL2_SOURCES
 -NEED_BL2 := yes
 -include bl2/bl2.mk
 -endif
 -
 -# For AArch32, BL31 is not applicable, and BL2U is not supported at present.
 -ifneq (${ARCH},aarch32)
 -ifdef BL2U_SOURCES
 -NEED_BL2U := yes
 -include bl2u/bl2u.mk
 -endif
 -
 -ifdef BL31_SOURCES
 -# When booting an EL3 payload, there is no need to compile the BL31 image nor
 -# put it in the FIP.
 -ifndef EL3_PAYLOAD_BASE
 -NEED_BL31 := yes
 -include bl31/bl31.mk
 -endif
 -endif
 -endif
 -
 -ifeq (${ARCH},aarch32)
 -NEED_BL32 := yes
 -
 -################################################################################
 -# Build `AARCH32_SP` as BL32 image for AArch32
 -################################################################################
 -ifneq (${AARCH32_SP},none)
 -# We expect to locate an sp.mk under the specified AARCH32_SP directory
 -AARCH32_SP_MAKE       :=      $(wildcard bl32/${AARCH32_SP}/${AARCH32_SP}.mk)
 -
 -ifeq (${AARCH32_SP_MAKE},)
 -  $(error Error: No bl32/${AARCH32_SP}/${AARCH32_SP}.mk located)
 -endif
 -
 -$(info Including ${AARCH32_SP_MAKE})
 -include ${AARCH32_SP_MAKE}
 -endif
 -
 -endif
 -
  ################################################################################
  # Build targets
  ################################################################################
@@@ -541,6 -541,10 +546,10 @@@ $(if ${BL2}, $(eval $(call MAKE_TOOL_AR
        $(eval $(call MAKE_BL,2,tb-fw)))
  endif
  
+ ifeq (${NEED_SCP_BL2},yes)
+ $(eval $(call FIP_ADD_IMG,SCP_BL2,--scp-fw))
+ endif
  ifeq (${NEED_BL31},yes)
  BL31_SOURCES += ${SPD_SOURCES}
  $(if ${BL31}, $(eval $(call MAKE_TOOL_ARGS,31,${BL31},soc-fw)),\