Martin L Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/69486 )
Change subject: lib/fmap.c: Show error on fmd flash size mismatch with Kconfig ......................................................................
lib/fmap.c: Show error on fmd flash size mismatch with Kconfig
It's quite surprising to change the rom size in Kconfig and not have it change the ROM size of the output, but if an fmap file is present, the output size depends on the fmap, not the Kconfig file size.
It seems like more needs to be done, but this is at least a first step in helping to eliminate the confusion.
Signed-off-by: Martin Roth gaumless@gmail.com Change-Id: I5ed8e09125567f7c04baca292f102dacee974144 --- M src/lib/fmap.c 1 file changed, 23 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/69486/1
diff --git a/src/lib/fmap.c b/src/lib/fmap.c index 3889dd5..fbbd92f 100644 --- a/src/lib/fmap.c +++ b/src/lib/fmap.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */
+#include <assert.h> #include <boot_device.h> #include <cbmem.h> #include <console/console.h> @@ -19,6 +20,11 @@ static int fmap_print_once; static struct region_device fmap_cache;
+#ifdef FMAP_SECTION_FLASH_SIZE +_Static_assert(CONFIG_ROM_SIZE == FMAP_SECTION_FLASH_SIZE, + "Kconfig ROM size != FMAP rom size. Check your FMD file."); +#endif + #define print_once(...) do { \ if (!fmap_print_once) \ printk(__VA_ARGS__); \