Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14571
-gerrit
commit d1d90185fa05de08273153199def7da189d4aa50 Author: Patrick Georgi pgeorgi@chromium.org Date: Mon May 2 17:02:53 2016 +0800
fmaptool: Export some fmap knowledge to the build environment
By exporting base and offset of CBFS-formatted fmap regions, the code can use these when it's not prudent to do a runtime lookup.
Change-Id: I20523b5cea68880af4cb1fcea4b37bb8ac2a23db Signed-off-by: Patrick Georgi pgeorgi@chromium.org --- util/cbfstool/fmaptool.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/util/cbfstool/fmaptool.c b/util/cbfstool/fmaptool.c index 1eda822..5aafffd 100644 --- a/util/cbfstool/fmaptool.c +++ b/util/cbfstool/fmaptool.c @@ -101,6 +101,20 @@ static bool write_header(const char *out_fname, fputs("#ifndef FMAPTOOL_GENERATED_HEADER_H_\n", header); fputs("#define FMAPTOOL_GENERATED_HEADER_H_\n\n", header); fprintf(header, "#define %s %#x\n\n", HEADER_FMAP_OFFSET, fmap_offset); + + /* also add defines for each CBFS-carrying fmap region: base and size */ + cbfs_section_iterator_t cbfs_it = cbfs_sections_iterator(); + while (cbfs_it) { + const struct flashmap_descriptor *item = + cbfs_sections_iterator_deref(cbfs_it); + assert(item->offset_known && item->size_known); + fprintf(header, "#define ___FMAP__%s_BASE 0x%x\n", + item->name, item->offset); + fprintf(header, "#define ___FMAP__%s_SIZE 0x%x\n", + item->name, item->size); + cbfs_sections_iterator_advance(&cbfs_it); + } + fputs("#endif\n", header);
fclose(header);