arm64: arm_tf: Do not build raw bl31.bin binary

coreboot's build system picks up the BL31 image as an ELF from the ARM
Trusted Firmware submodule and inserts it into CBFS. However, the
generic 'bl31' build target we run in the ARM Trusted Firmware build
system also generates a raw bl31.bin binary file.

We don't need that binary, and with the recently added support for
multiple non-contiguous program segments in BL31 it can grow close to
4GB in size (by having one section mapped near the start and one near
the end of the address space). To avoid clogging up people's hard drives
with 4GB of zeroes, let's only build the target we actually need.

BRANCH=gru
BUG=chrome-os-partner:56314,chromium:661124
TEST=FEATURES=noclean emerge-kevin coreboot, confirm that there's no
giant build/3rdparty/arm-trusted-firmware/bl31.bin file left in the
build artifacts, and that we still generate .d prerequisite files.

Change-Id: I8e7bd50632f7831cc7b8bec69025822aec5bad27
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 31699820f4c36fd441a3e7271871af4e1474129f
Original-Change-Id: Iaa073ec11dabed7265620d370fcd01ea8c0c2056
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/407110
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/17380
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Julius Werner 2016-10-29 00:10:53 -07:00 committed by Martin Roth
parent 8e1a99546b
commit 50e76709ed
1 changed files with 8 additions and 3 deletions

View File

@ -139,6 +139,8 @@ $(objcbfs)/ramstage.debug: $$(ramstage-objs)
ifeq ($(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE),y) ifeq ($(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE),y)
BL31_SOURCE := $(top)/3rdparty/arm-trusted-firmware BL31_SOURCE := $(top)/3rdparty/arm-trusted-firmware
BL31_BUILD := $(abspath $(obj)/3rdparty/arm-trusted-firmware)
BL31_TARGET := $(BL31_BUILD)/bl31/bl31.elf
ifeq ($(V),1) ifeq ($(V),1)
BL31_MAKEARGS += V=1 BL31_MAKEARGS += V=1
@ -153,7 +155,10 @@ BL31_MAKEARGS += LOG_LEVEL=0
endif # CONFIG_CONSOLE_SERIAL endif # CONFIG_CONSOLE_SERIAL
# Avoid build/release|build/debug distinction by overriding BUILD_PLAT directly # Avoid build/release|build/debug distinction by overriding BUILD_PLAT directly
BL31_MAKEARGS += BUILD_PLAT="$(abspath $(obj)/3rdparty/arm-trusted-firmware)" BL31_MAKEARGS += BUILD_PLAT="$(BL31_BUILD)"
# Force making .d files and output directories even though target is not 'bl31'
BL31_MAKEARGS += IS_ANYTHING_TO_BUILD=1
# Set a consistent build timestamp: the same coreboot has # Set a consistent build timestamp: the same coreboot has
# The \# \" complications exist to satisfy both gnu make's parser and editors # The \# \" complications exist to satisfy both gnu make's parser and editors
@ -171,8 +176,8 @@ $(BL31): $(obj)/build.h
CROSS_COMPILE="$(CROSS_COMPILE_arm64)" \ CROSS_COMPILE="$(CROSS_COMPILE_arm64)" \
CFLAGS="$(BL31_CFLAGS)" \ CFLAGS="$(BL31_CFLAGS)" \
LDFLAGS="$(BL31_LDFLAGS)" \ LDFLAGS="$(BL31_LDFLAGS)" \
$(MAKE) -C $(BL31_SOURCE) $(BL31_MAKEARGS) bl31 $(MAKE) -C $(BL31_SOURCE) $(BL31_MAKEARGS) $(BL31_TARGET)
mv $(obj)/3rdparty/arm-trusted-firmware/bl31/bl31.elf $@ mv $(BL31_TARGET) $@
.PHONY: $(BL31) .PHONY: $(BL31)