diff options
author | Vikram Narayanan <vikram186@gmail.com> | 2012-04-14 15:25:13 +0530 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2012-04-21 09:36:24 +0200 |
commit | a8111cf980e01e9f8706024f06c05840b5fc8bcf (patch) | |
tree | f08af47ce9c1efa72b08b4a44e64b2ddc866cc2d /util/nvramtool/cli/nvramtool.c | |
parent | c3fc4b933708a594d169e40a82d5f29f304d11c9 (diff) | |
download | coreboot-a8111cf980e01e9f8706024f06c05840b5fc8bcf.tar.xz |
nvramtool: Unify nvramtool and build_opt_tbl
As cmos.layout parsing capabilities are already there in nvramtool,
use those than using build_opt_tbl.c. Add binary and header file
generation in nvramtool. Make appropriate changes to Makefile.inc.
Change-Id: Iaf3f5d4f51451aeb33c92800a0c895045f2388cf
Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
Reviewed-on: http://review.coreboot.org/898
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'util/nvramtool/cli/nvramtool.c')
-rw-r--r-- | util/nvramtool/cli/nvramtool.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/util/nvramtool/cli/nvramtool.c b/util/nvramtool/cli/nvramtool.c index bcb10bbf34..f3fb16d1b1 100644 --- a/util/nvramtool/cli/nvramtool.c +++ b/util/nvramtool/cli/nvramtool.c @@ -62,6 +62,8 @@ static void op_write_cmos_dump(void); static void op_read_cmos_dump(void); static void op_show_cmos_hex_dump(void); static void op_show_cmos_dumpfile(void); +static void op_write_cmos_layout_bin(void); +static void op_write_cmos_layout_header(void); static int list_one_param(const char name[], int show_name); static int list_all_params(void); static void list_param_enums(const char name[]); @@ -86,9 +88,23 @@ static const op_fn_t op_fns[] = { op_show_version, op_write_cmos_dump, op_read_cmos_dump, op_show_cmos_hex_dump, - op_show_cmos_dumpfile + op_show_cmos_dumpfile, + op_write_cmos_layout_bin, + op_write_cmos_layout_header }; +static void op_write_cmos_layout_bin(void) +{ + get_layout_from_file(); + write_cmos_output_bin(nvramtool_op.param); +} + +static void op_write_cmos_layout_header(void) +{ + get_layout_from_file(); + write_cmos_layout_header(nvramtool_op.param); +} + static const hexdump_format_t cmos_dump_format = { 16, 2, "", " | ", " ", " | ", '.' }; |