diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2021-08-25 01:07:31 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-08-26 15:18:58 +0000 |
commit | e44dad3096a21ca86398f08f882da13dff6e68ac (patch) | |
tree | 2d872946d3d8f531d1f5dd0760515a388ceab543 | |
parent | 5ff1808f20a70912796b274c03cec3d91ddf890a (diff) |
soc/amd/common/fsp/Makefile: check if FSP-M is larger than FSP_M_SIZE
The FSP-M binary needs to fit into the memory region that starts at
FSP_M_ADDR and is FSP_M_SIZE bytes large, so error out during build time
if the uncompressed FSP-M file is larger than the size of the region it
will be copied into.
BUG=b:186149011
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Suggested-by: Furquan Shaikh <furquan@google.com>
Change-Id: Ice4a59e5a723c3c0a40b1f3f3227aee6b9dcb39a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57129
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
-rw-r--r-- | src/soc/amd/common/fsp/Makefile.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/soc/amd/common/fsp/Makefile.inc b/src/soc/amd/common/fsp/Makefile.inc index 8a5cef5ffe..503d3bfc0e 100644 --- a/src/soc/amd/common/fsp/Makefile.inc +++ b/src/soc/amd/common/fsp/Makefile.inc @@ -6,4 +6,11 @@ ramstage-$(CONFIG_SOC_AMD_COMMON_FSP_DMI_TABLES) += dmi.c subdirs-y += ./* +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_PLATFORM_USES_FSP2_0 |