From ba319725dca7784933ebce8dbfe98298acef43c1 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Sat, 29 Oct 2016 00:10:53 -0700 Subject: [PATCH] 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 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. Change-Id: Iaa073ec11dabed7265620d370fcd01ea8c0c2054 Signed-off-by: Julius Werner Reviewed-on: https://chromium-review.googlesource.com/405110 Reviewed-by: Aaron Durbin --- src/arch/arm64/Makefile.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/arch/arm64/Makefile.inc b/src/arch/arm64/Makefile.inc index 6e3f080087..cf4e45a4a7 100644 --- a/src/arch/arm64/Makefile.inc +++ b/src/arch/arm64/Makefile.inc @@ -139,6 +139,8 @@ $(objcbfs)/ramstage.debug: $$(ramstage-objs) ifeq ($(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE),y) 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) BL31_MAKEARGS += V=1 @@ -153,7 +155,7 @@ BL31_MAKEARGS += LOG_LEVEL=0 endif # CONFIG_CONSOLE_SERIAL # 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)" # Set a consistent build timestamp: the same coreboot has # The \# \" complications exist to satisfy both gnu make's parser and editors @@ -171,8 +173,8 @@ $(BL31): $(obj)/build.h CROSS_COMPILE="$(CROSS_COMPILE_arm64)" \ CFLAGS="$(BL31_CFLAGS)" \ LDFLAGS="$(BL31_LDFLAGS)" \ - $(MAKE) -C $(BL31_SOURCE) $(BL31_MAKEARGS) bl31 - mv $(obj)/3rdparty/arm-trusted-firmware/bl31/bl31.elf $@ + $(MAKE) -C $(BL31_SOURCE) $(BL31_MAKEARGS) $(BL31_TARGET) + mv $(BL31_TARGET) $@ .PHONY: $(BL31)