Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10918
-gerrit
commit 5a82d724be3f5769216d43d9ed139c8d0d897466 Author: Patrick Georgi pgeorgi@chromium.org Date: Tue Jul 14 22:18:23 2015 +0200
cbfstool: fix alignment to 64 byte
It's not like we _ever_ changed it, so drop the option and make cbfstool use the default. always.
Change-Id: Ia1b99fda03d5852137a362422e979f4a4dffc5ed Signed-off-by: Patrick Georgi pgeorgi@chromium.org --- Makefile.inc | 2 +- util/cbfstool/cbfs.h | 4 +++- util/cbfstool/cbfstool.c | 11 +++++------ 3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc index 347e07b..14fa990 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -573,7 +573,7 @@ prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file)))
$(obj)/coreboot.pre1: $(objcbfs)/bootblock.bin $$(prebuilt-files) $(FMAPTOOL) $(CBFSTOOL) $$(cpu_ucode_cbfs_file) $(CBFSTOOL) $@.tmp create \ - -B $(objcbfs)/bootblock.bin -a 64 \ + -B $(objcbfs)/bootblock.bin \ $(CBFSTOOL_PRE1_OPTS) $(prebuild-files) true $(call add-cpu-microcode-to-cbfs,$@.tmp) diff --git a/util/cbfstool/cbfs.h b/util/cbfstool/cbfs.h index 8092057..14a7a37 100644 --- a/util/cbfstool/cbfs.h +++ b/util/cbfstool/cbfs.h @@ -47,12 +47,14 @@ #define CBFS_HEADER_VERSION2 0x31313132 #define CBFS_HEADER_VERSION CBFS_HEADER_VERSION2
+#define CBFS_ALIGNMENT 64 + struct cbfs_header { uint32_t magic; uint32_t version; uint32_t romsize; uint32_t bootblocksize; - uint32_t align; + uint32_t align; /* hard coded to 64 byte */ uint32_t offset; uint32_t architecture; /* Version 2 */ uint32_t pad[1]; diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 06d0cef..901fe5c 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -372,9 +372,8 @@ static int cbfs_create(void) param.baseaddress_assigned || param.headeroffset_assigned || param.cbfsoffset_assigned || - param.alignment || param.bootblock) { - ERROR("Since -M was provided, -m, -s, -b, -o, -H, -a, and -B should be omitted\n"); + ERROR("Since -M was provided, -m, -s, -b, -o, -H, and -B should be omitted\n"); return 1; }
@@ -395,7 +394,7 @@ static int cbfs_create(void) }
if (!param.alignment) - param.alignment = 64; // default CBFS entry alignment + param.alignment = CBFS_ALIGNMENT;
// Set default offsets. x86, as usual, needs to be a special snowflake. if (!param.baseaddress_assigned) { @@ -430,7 +429,7 @@ static int cbfs_create(void) } else { param.cbfsoffset = align_up(param.headeroffset + sizeof(struct cbfs_header), - param.alignment); + CBFS_ALIGNMENT); DEBUG("CBFS entries start beind master header (%#x).\n", param.cbfsoffset); } @@ -438,7 +437,7 @@ static int cbfs_create(void)
int ret = cbfs_legacy_image_create(&image, param.arch, - param.alignment, + CBFS_ALIGNMENT, &bootblock, param.baseaddress, param.headeroffset, @@ -743,7 +742,7 @@ static const struct command commands[] = { {"add-stage", "H:r:f:n:t:c:b:S:vh?", cbfs_add_stage, true, true}, {"add-int", "H:r:i:n:b:vh?", cbfs_add_integer, true, true}, {"copy", "H:D:s:h?", cbfs_copy, true, true}, - {"create", "M:r:s:B:b:H:a:o:m:vh?", cbfs_create, true, true}, + {"create", "M:r:s:B:b:H:o:m:vh?", cbfs_create, true, true}, {"extract", "H:r:n:f:vh?", cbfs_extract, true, false}, {"locate", "H:r:f:n:P:a:Tvh?", cbfs_locate, true, false}, {"layout", "wvh?", cbfs_layout, false, false},