Enable platforms to omit some bootloaders

If a platform doesn't specify a BLx_SOURCE variable, then building
of the corresponding bootloader isn't attempted. Also allow BL3-3 to
be omitted from the FIP.

Note, this change also removes support for PLAT=all and the 'fip' target
from the 'all' recipe.

Fixes ARM-software/tf-issues#30

Change-Id: Ibdfead0440256eaf364617ecff65290ca6fe6240
Signed-off-by: Jon Medhurst <tixy@linaro.org>
This commit is contained in:
Jon Medhurst 2014-02-13 15:19:28 +00:00 committed by Dan Handley
parent fb05246201
commit 4bfc2d21a1
2 changed files with 31 additions and 35 deletions

View File

@ -71,7 +71,7 @@ BL_COMMON_SOURCES := misc_helpers.S \
ARCH ?= aarch64 ARCH ?= aarch64
# By default, build all platforms available # By default, build all platforms available
PLAT ?= all PLAT ?= fvp
# By default, build no SPD component # By default, build no SPD component
SPD ?= none SPD ?= none
@ -85,31 +85,30 @@ HELP_PLATFORMS := $(shell echo ${PLATFORMS} | sed 's/ /|/g')
ifeq (${PLAT},) ifeq (${PLAT},)
$(error "Error: Unknown platform. Please use PLAT=<platform name> to specify the platform.") $(error "Error: Unknown platform. Please use PLAT=<platform name> to specify the platform.")
endif endif
ifeq ($(findstring ${PLAT},${PLATFORMS} all),) ifeq ($(findstring ${PLAT},${PLATFORMS}),)
$(error "Error: Invalid platform. The following platforms are available: ${PLATFORMS}") $(error "Error: Invalid platform. The following platforms are available: ${PLATFORMS}")
endif endif
ifeq (${PLAT},all) all: msg_start
all: ${PLATFORMS}
else
all: msg_start fip
endif
msg_start: msg_start:
@echo "Building ${PLAT}" @echo "Building ${PLAT}"
${PLATFORMS}: include plat/${PLAT}/platform.mk
${MAKE} PLAT=$@ all
ifneq (${PLAT},all) ifdef BL1_SOURCES
$(info Including ${PLAT}/platform.mk) NEED_BL1 := yes
include plat/${PLAT}/platform.mk include bl1/bl1.mk
$(info Including bl1.mk) endif
include bl1/bl1.mk
$(info Including bl2.mk) ifdef BL2_SOURCES
include bl2/bl2.mk NEED_BL2 := yes
$(info Including bl31.mk) include bl2/bl2.mk
include bl31/bl31.mk endif
ifdef BL31_SOURCES
NEED_BL31 := yes
include bl31/bl31.mk
endif endif
# Include SPD Makefile if one has been specified # Include SPD Makefile if one has been specified
@ -128,7 +127,7 @@ ifneq (${SPD},none)
# variable to "yes" # variable to "yes"
endif endif
.PHONY: all msg_start ${PLATFORMS} clean realclean distclean cscope locate-checkpatch checkcodebase checkpatch fiptool fip locate-bl33 .PHONY: all msg_start ${PLATFORMS} clean realclean distclean cscope locate-checkpatch checkcodebase checkpatch fiptool fip
.SUFFIXES: .SUFFIXES:
@ -158,6 +157,7 @@ vpath %.ld.S bl1:bl2:bl31
vpath %.c bl1:bl2:bl31 vpath %.c bl1:bl2:bl31
vpath %.c bl1/${ARCH}:bl2/${ARCH}:bl31/${ARCH} vpath %.c bl1/${ARCH}:bl2/${ARCH}:bl31/${ARCH}
vpath %.S bl1/${ARCH}:bl2/${ARCH}:bl31/${ARCH} vpath %.S bl1/${ARCH}:bl2/${ARCH}:bl31/${ARCH}
vpath %.c lib/arch/${ARCH} # One of the missing paths needed for BL_COMMON_SOURCES
ifneq (${DEBUG}, 0) ifneq (${DEBUG}, 0)
@ -203,17 +203,6 @@ ifeq (,$(wildcard ${CHECKPATCH}))
endif endif
endif endif
locate-bl33:
ifndef BL33
$(error "Please set BL33 to point to the Normal World binary, eg: BL33=../uefi/FVP_AARCH64_EFI.fd")
else
ifeq (,$(wildcard ${BL33}))
$(error "The file BL33 points to cannot be found (${BL33})")
endif
FIP_DEPS += ${BL33}
endif
clean: clean:
@echo " CLEAN" @echo " CLEAN"
${Q}rm -rf ${BUILD_PLAT} ${Q}rm -rf ${BUILD_PLAT}
@ -381,18 +370,25 @@ $(eval FIP_ARGS += $(if $2,--bl$(1) $(BIN),))
endef endef
ifeq (${NEED_BL1},yes)
$(eval $(call MAKE_BL,1)) $(eval $(call MAKE_BL,1))
endif
ifeq (${NEED_BL2},yes)
$(eval $(call MAKE_BL,2,in_fip)) $(eval $(call MAKE_BL,2,in_fip))
endif
ifeq (${NEED_BL31},yes)
BL31_SOURCES += ${SPD_SOURCES} BL31_SOURCES += ${SPD_SOURCES}
$(eval $(call MAKE_BL,31,in_fip)) $(eval $(call MAKE_BL,31,in_fip))
endif
ifeq (${NEED_BL32},yes) ifeq (${NEED_BL32},yes)
$(eval $(call MAKE_BL,32,in_fip)) $(eval $(call MAKE_BL,32,in_fip))
endif endif
${BUILD_PLAT}/fip.bin: locate-bl33 ${FIP_DEPS} ${FIPTOOL} ${BUILD_PLAT}/fip.bin: ${FIP_DEPS} ${BL33} ${FIPTOOL}
$(if ${BL33},,$(error "To build a FIP, please set BL33 to point to the Normal World binary, eg: BL33=../uefi/FVP_AARCH64_EFI.fd"))
${Q}${FIPTOOL} --dump \ ${Q}${FIPTOOL} --dump \
${FIP_ARGS} \ ${FIP_ARGS} \
--bl33 ${BL33} \ --bl33 ${BL33} \

View File

@ -81,7 +81,7 @@ To build the software for the FVPs, follow these steps:
CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \ CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \
BL33=<path-to>/<bl33_image> \ BL33=<path-to>/<bl33_image> \
make PLAT=fvp make PLAT=fvp all fip
By default this produces a release version of the build. To produce a debug By default this produces a release version of the build. To produce a debug
version instead, refer to the "Debugging options" section below. UEFI can be version instead, refer to the "Debugging options" section below. UEFI can be
@ -101,7 +101,7 @@ To build the software for the FVPs, follow these steps:
either `debug` or `release`. A Firmare Image Package(FIP) will be created as either `debug` or `release`. A Firmare Image Package(FIP) will be created as
part of the build. It contains all boot loader images except for `bl1.bin`. part of the build. It contains all boot loader images except for `bl1.bin`.
* `build/<platform>/<build-type>/fip.bin` * `build/<platform>/<build-type>/fip.bin`
For more information on FIPs, see the "Firmware Image Package" section in For more information on FIPs, see the "Firmware Image Package" section in
the [Firmware Design]. the [Firmware Design].
@ -182,7 +182,7 @@ To compile a debug version and make the build more verbose use
CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \ CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \
BL33=<path-to>/<bl33_image> \ BL33=<path-to>/<bl33_image> \
make PLAT=fvp DEBUG=1 V=1 make PLAT=fvp DEBUG=1 V=1 all fip
AArch64 GCC uses DWARF version 4 debugging symbols by default. Some tools (for AArch64 GCC uses DWARF version 4 debugging symbols by default. Some tools (for
example DS-5) might not support this and may need an older version of DWARF example DS-5) might not support this and may need an older version of DWARF
@ -201,7 +201,7 @@ Extra debug options can be passed to the build system by setting `CFLAGS`:
CFLAGS='-O0 -gdwarf-2' \ CFLAGS='-O0 -gdwarf-2' \
CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \ CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-none-elf- \
BL33=<path-to>/<bl33_image> \ BL33=<path-to>/<bl33_image> \
make PLAT=fvp DEBUG=1 V=1 make PLAT=fvp DEBUG=1 V=1 all fip
NOTE: The Foundation FVP does not provide a debugger interface. NOTE: The Foundation FVP does not provide a debugger interface.