summaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfstool.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-09-15 21:30:58 -0500
committerAaron Durbin <adurbin@chromium.org>2015-09-16 14:11:25 +0000
commit9b9d4b3a474a4be3e9fd62651258152cffde6c82 (patch)
tree1bf6acc18b9b192e924fad6f3b4ab88f105e5e4e /util/cbfstool/cbfstool.c
parent294ce854241db5c50af7ab012f5fdb23b033fabf (diff)
downloadcoreboot-9b9d4b3a474a4be3e9fd62651258152cffde6c82.tar.xz
cbfstool: remove locate command
The locate command was previously being used for x86 romstage linking as well as alignment handling of files. The add command already supports alignment so there's no more users of the locate command. Remove the command as well as the '-T' (top-aligned) option. BUG=chrome-os-partner:44827 BRANCH=None TEST=Built rambi. Noted microcode being directly added. Change-Id: I3b6647bd4cac04a113ab3592f345281fbcd681af Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11671 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util/cbfstool/cbfstool.c')
-rw-r--r--util/cbfstool/cbfstool.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 6f8f1f4cc4..c45f316f6f 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -70,7 +70,6 @@ static struct param {
uint32_t cbfsoffset;
uint32_t cbfsoffset_assigned;
uint32_t arch;
- bool top_aligned;
bool fill_partial_upward;
bool fill_partial_downward;
bool show_immutable;
@@ -155,10 +154,6 @@ static int do_cbfs_locate(int32_t *cbfs_addr, size_t metadata_size)
return 1;
}
- if (param.top_aligned)
- address = -convert_to_from_top_aligned(param.image_region,
- address);
-
*cbfs_addr = address;
return 0;
}
@@ -394,16 +389,6 @@ static int cbfstool_convert_mkflatpayload(struct buffer *buffer,
return 0;
}
-static size_t cbfs_default_metadata_size(void)
-{
- /* TODO Old cbfstool always assume input is a stage file (and adding
- * sizeof(cbfs_stage) for header. We should fix that by adding "-t"
- * (type) param in future. For right now, we assume cbfs_stage is the
- * largest structure and add it into header size. */
- assert(sizeof(struct cbfs_stage) >= sizeof(struct cbfs_payload));
- return sizeof(struct cbfs_stage);
-}
-
static int cbfs_add(void)
{
int32_t address;
@@ -414,7 +399,9 @@ static int cbfs_add(void)
}
if (param.alignment) {
- if (do_cbfs_locate(&address, cbfs_default_metadata_size()))
+ /* CBFS compression file attribute is unconditionally added. */
+ size_t metadata_sz = sizeof(struct cbfs_file_attr_compression);
+ if (do_cbfs_locate(&address, metadata_sz))
return 1;
param.baseaddress = address;
}
@@ -593,17 +580,6 @@ static int cbfs_create(void)
return ret;
}
-static int cbfs_locate(void)
-{
- int32_t address;
-
- if (do_cbfs_locate(&address, cbfs_default_metadata_size()) != 0)
- return 1;
-
- printf("0x%x\n", address);
- return 0;
-}
-
static int cbfs_layout(void)
{
const struct fmap *fmap = partitioned_file_get_fmap(param.image_file);
@@ -858,7 +834,6 @@ static const struct command commands[] = {
{"copy", "H:D:s:h?", cbfs_copy, 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},
{"print", "H:r:vh?", cbfs_print, true, false},
{"read", "r:f:vh?", cbfs_read, true, false},
@@ -1153,9 +1128,6 @@ int main(int argc, char **argv)
case 'i':
param.u64val = strtoull(optarg, NULL, 0);
break;
- case 'T':
- param.top_aligned = true;
- break;
case 'u':
param.fill_partial_upward = true;
break;