From f8df08213d8abff2e53e90cc8f03056ff5a8e24a Mon Sep 17 00:00:00 2001 From: Felix Held Date: Fri, 27 Aug 2021 04:11:10 +0200 Subject: soc/amd/common/fsp/Makefile: check if CONFIG_FSP_M_FILE is defined When CONFIG_FSP_M_FILE isn't defined, the parameter of the file-size call evaluates to an empty string, so the file-size call will run "cat | wc -c" which will cause make to get stuck in there. Also print a message when no FSP-M file is specified that the resulting image won't boot successfully. Signed-off-by: Felix Held Change-Id: I6b02774e2c79d12554fd076aa01bbe972176f372 Reviewed-on: https://review.coreboot.org/c/coreboot/+/57189 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Paul Menzel Reviewed-by: Martin Roth --- src/soc/amd/common/fsp/Makefile.inc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/soc/amd/common/fsp') diff --git a/src/soc/amd/common/fsp/Makefile.inc b/src/soc/amd/common/fsp/Makefile.inc index 2541f27754..ee5e1ac19a 100644 --- a/src/soc/amd/common/fsp/Makefile.inc +++ b/src/soc/amd/common/fsp/Makefile.inc @@ -7,11 +7,15 @@ ramstage-$(CONFIG_SOC_AMD_COMMON_FSP_DMI_TABLES) += dmi.c subdirs-y += ./* +ifeq ($(CONFIG_FSP_M_FILE),) +$(info There's no FSP-M binary file specified. The resulting image won't boot successfully.) +else ifeq ($(call int-gt,\ $(call file-size,$(call strip_quotes,$(CONFIG_FSP_M_FILE)))\ $(shell printf "%d" $(CONFIG_FSP_M_SIZE))),\ 1) $(error FSP-M binary larger than FSP_M_FILE.) endif +endif # CONFIG_FSP_M_FILE endif # CONFIG_PLATFORM_USES_FSP2_0 -- cgit v1.2.3