Hung-Te Lin (hungte@chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2198
-gerrit
commit 2e54fd950d059343ac266c29aa067dd328580b5c Author: Hung-Te Lin hungte@chromium.org Date: Mon Jan 28 15:27:48 2013 +0800
cbfstool: Change "locate" to "locate-stage".
The "locate" has an implicit rule of constructing stage-style files (adding extra sizeof(struct cbfs_stage) bytes to header size requirement). In other words, if we try to add a component with header larger than stage, it may fail to fit in the space.
To prevent confusion, the command should be renamed to show that it's designed for stage files.
Change-Id: I168ed20d2cb682c22e0f03d42d0d071ec68b5ba7 Signed-off-by: Hung-Te Lin hungte@chromium.org --- src/arch/armv7/Makefile.inc | 2 +- src/arch/x86/Makefile.inc | 2 +- util/cbfstool/cbfstool.c | 12 ++++++------ util/cbfstool/common.c | 4 ++-- util/cbfstool/common.h | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/arch/armv7/Makefile.inc b/src/arch/armv7/Makefile.inc index ba734a6..37b56c3 100644 --- a/src/arch/armv7/Makefile.inc +++ b/src/arch/armv7/Makefile.inc @@ -314,7 +314,7 @@ $(objgenerated)/romstage_xip.ld: $(objgenerated)/romstage_null.ld $(objcbfs)/bas $(objcbfs)/base_xip.txt: $(obj)/coreboot.pre1 $(objcbfs)/romstage_null.bin @printf " generating base_xip.txt\n" rm -f $@ - $(CBFSTOOL) $(obj)/coreboot.pre1 locate -f $(objcbfs)/romstage_null.bin -n $(CONFIG_CBFS_PREFIX)/romstage -a $(CONFIG_XIP_ROM_SIZE) > $@.tmp \ + $(CBFSTOOL) $(obj)/coreboot.pre1 locate-stage -f $(objcbfs)/romstage_null.bin -n $(CONFIG_CBFS_PREFIX)/romstage -a $(CONFIG_XIP_ROM_SIZE) > $@.tmp \ || { echo "The romstage is larger than XIP size. Please expand the CONFIG_XIP_ROM_SIZE" ; exit 1; } mv $@.tmp $@
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc index 190f7cb..1956ceb 100644 --- a/src/arch/x86/Makefile.inc +++ b/src/arch/x86/Makefile.inc @@ -375,7 +375,7 @@ $(objgenerated)/romstage_xip.ld: $(objgenerated)/romstage_null.ld $(objcbfs)/bas
$(objcbfs)/base_xip.txt: $(obj)/coreboot.pre1 $(objcbfs)/romstage_null.bin rm -f $@ - $(CBFSTOOL) $(obj)/coreboot.pre1 locate -f $(objcbfs)/romstage_null.bin -n $(CONFIG_CBFS_PREFIX)/romstage -a $(CONFIG_XIP_ROM_SIZE) > $@.tmp \ + $(CBFSTOOL) $(obj)/coreboot.pre1 locate-stage -f $(objcbfs)/romstage_null.bin -n $(CONFIG_CBFS_PREFIX)/romstage -a $(CONFIG_XIP_ROM_SIZE) > $@.tmp \ || { echo "The romstage is larger than XIP size. Please expand the CONFIG_XIP_ROM_SIZE" ; exit 1; } mv $@.tmp $@
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 88d2dde..4a4c38c 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -363,7 +363,7 @@ static int cbfs_create(void) param.alignment, param.offset); }
-static int cbfs_locate(void) +static int cbfs_locate_stage(void) { uint32_t filesize, location;
@@ -379,8 +379,8 @@ static int cbfs_locate(void)
filesize = getfilesize(param.filename);
- location = cbfs_find_location(param.cbfs_name, filesize, - param.name, param.alignment); + location = cbfs_find_stage_location(param.cbfs_name, filesize, + param.name, param.alignment);
printf("0x%x\n", location); return location == 0 ? 1 : 0; @@ -438,7 +438,7 @@ static const struct command commands[] = { {"add-flat-binary", "f:n:l:e:c:b:vh?", cbfs_add_flat_binary}, {"remove", "n:vh?", cbfs_remove}, {"create", "s:B:a:o:m:vh?", cbfs_create}, - {"locate", "f:n:a:vh?", cbfs_locate}, + {"locate-stage", "f:n:a:vh?", cbfs_locate_stage}, {"print", "vh?", cbfs_print}, {"extract", "n:f:vh?", cbfs_extract}, }; @@ -482,8 +482,8 @@ static void usage(char *name) "Remove a component\n" " create -s size -B bootblock -m ARCH [-a align] [-o offset] " "Create a ROM file\n" - " locate -f FILE -n NAME -a align " - "Find a place for a file of that size\n" + " locate-stage -f FILE -n NAME [-a align] " + "Find a space for a stage file of that size\n" " print " "Show the contents of the ROM\n" " extract -n NAME -f FILE " diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c index 8b4b4b4..3e48534 100644 --- a/util/cbfstool/common.c +++ b/util/cbfstool/common.c @@ -711,8 +711,8 @@ static int in_segment(int addr, int size, int gran) return ((addr & ~(gran - 1)) == ((addr + size) & ~(gran - 1))); }
-uint32_t cbfs_find_location(const char *romfile, uint32_t filesize, - const char *filename, uint32_t alignment) +uint32_t cbfs_find_stage_location(const char *romfile, uint32_t filesize, + const char *filename, uint32_t alignment) { void *rom; size_t filename_size, headersize, totalsize; diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h index 807c22c..6d7a7fd 100644 --- a/util/cbfstool/common.h +++ b/util/cbfstool/common.h @@ -95,8 +95,8 @@ void print_cbfs_directory(const char *filename); int extract_file_from_cbfs(const char *filename, const char *payloadname, const char *outpath); int remove_file_from_cbfs(const char *filename);
-uint32_t cbfs_find_location(const char *romfile, uint32_t filesize, - const char *filename, uint32_t align); +uint32_t cbfs_find_stage_location(const char *romfile, uint32_t filesize, + const char *filename, uint32_t align);
void print_supported_filetypes(void);