From 994ff52464d38275a6861454ba3f981fe75e6855 Mon Sep 17 00:00:00 2001 From: Zheng Bao Date: Thu, 9 Mar 2023 11:43:55 +0800 Subject: amdfwtool: Remove the option --list which nobody uses It was used for printing the dependencies which is now taken by macro DEP_FILES in soc/amd/common/Makefile.inc. TEST=binary identical test on google/guybrush amd/chausie Change-Id: I1b86df2cb2ed178cf0a263c50ccb3e2254a3852b Signed-off-by: Zheng Bao Reviewed-on: https://review.coreboot.org/c/coreboot/+/73627 Reviewed-by: Fred Reitberger Tested-by: build bot (Jenkins) --- util/amdfwtool/amdfwtool.c | 27 ++++++++------------------- util/amdfwtool/amdfwtool.h | 2 +- util/amdfwtool/data_parse.c | 12 +++--------- 3 files changed, 12 insertions(+), 29 deletions(-) (limited to 'util') diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 1c7f6dc4e6..ac5aa19698 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -251,7 +251,6 @@ static void usage(void) printf("\nGeneral options:\n"); printf("-c|--config Config file\n"); printf("-d|--debug Print debug message\n"); - printf("-l|--list List out the firmware files\n"); printf("-h|--help Show this help\n"); } @@ -1817,7 +1816,6 @@ enum { AMDFW_OPT_CONFIG = 'c', AMDFW_OPT_DEBUG = 'd', AMDFW_OPT_HELP = 'h', - AMDFW_OPT_LIST_DEPEND = 'l', AMDFW_OPT_XHCI = 128, AMDFW_OPT_IMC, @@ -1870,7 +1868,7 @@ enum { }; static char const optstring[] = {AMDFW_OPT_CONFIG, ':', - AMDFW_OPT_DEBUG, AMDFW_OPT_HELP, AMDFW_OPT_LIST_DEPEND + AMDFW_OPT_DEBUG, AMDFW_OPT_HELP }; static struct option long_options[] = { @@ -1927,7 +1925,6 @@ static struct option long_options[] = { {"config", required_argument, 0, AMDFW_OPT_CONFIG }, {"debug", no_argument, 0, AMDFW_OPT_DEBUG }, {"help", no_argument, 0, AMDFW_OPT_HELP }, - {"list", no_argument, 0, AMDFW_OPT_LIST_DEPEND }, {NULL, 0, 0, 0 } }; @@ -2157,7 +2154,7 @@ static ssize_t write_body(char *output, void *body_offset, ssize_t body_size, co return bytes; } -void open_process_config(char *config, amd_cb_config *cb_config, int list_deps, int debug) +void open_process_config(char *config, amd_cb_config *cb_config, int debug) { FILE *config_handle; @@ -2168,7 +2165,7 @@ void open_process_config(char *config, amd_cb_config *cb_config, int list_deps, config, strerror(errno)); exit(1); } - if (process_config(config_handle, cb_config, list_deps) == 0) { + if (process_config(config_handle, cb_config) == 0) { fprintf(stderr, "Configuration file %s parsing error\n", config); fclose(config_handle); @@ -2215,7 +2212,6 @@ int main(int argc, char **argv) amd_cb_config cb_config = { 0 }; int debug = 0; - int list_deps = 0; ctx.current_pointer_saved = 0xFFFFFFFF; @@ -2432,9 +2428,6 @@ int main(int argc, char **argv) case AMDFW_OPT_HELP: usage(); return 0; - case AMDFW_OPT_LIST_DEPEND: - list_deps = 1; - break; case AMDFW_OPT_BODY_LOCATION: body_location = (uint32_t)strtoul(optarg, &tmp, 16); if (*tmp != '\0') { @@ -2449,23 +2442,23 @@ int main(int argc, char **argv) } } - open_process_config(config, &cb_config, list_deps, debug); + open_process_config(config, &cb_config, debug); if (!fuse_defined) register_fw_fuse(DEFAULT_SOFT_FUSE_CHAIN); - if (!output && !list_deps) { + if (!output) { fprintf(stderr, "Error: Output value is not specified.\n\n"); retval = 1; } - if ((ctx.rom_size % 1024 != 0) && !list_deps) { + if ((ctx.rom_size % 1024 != 0)) { fprintf(stderr, "Error: ROM Size (%d bytes) should be a multiple of" " 1024 bytes.\n\n", ctx.rom_size); retval = 1; } - if ((ctx.rom_size < MIN_ROM_KB * 1024) && !list_deps) { + if ((ctx.rom_size < MIN_ROM_KB * 1024)) { fprintf(stderr, "Error: ROM Size (%dKB) must be at least %dKB.\n\n", ctx.rom_size / 1024, MIN_ROM_KB); retval = 1; @@ -2476,10 +2469,6 @@ int main(int argc, char **argv) return retval; } - if (list_deps) { - return retval; - } - printf(" AMDFWTOOL Using ROM size of %dKB\n", ctx.rom_size / 1024); rom_base_address = 0xFFFFFFFF - ctx.rom_size + 1; @@ -2636,7 +2625,7 @@ int main(int argc, char **argv) */ if (cb_config.use_combo && combo_index > 0) { open_process_config(combo_config[combo_index], &cb_config, - list_deps, debug); + debug); /* In most cases, the address modes are same. */ if (cb_config.need_ish) diff --git a/util/amdfwtool/amdfwtool.h b/util/amdfwtool/amdfwtool.h index 42a2c1d638..2dc25a2560 100644 --- a/util/amdfwtool/amdfwtool.h +++ b/util/amdfwtool/amdfwtool.h @@ -409,7 +409,7 @@ typedef struct _amd_cb_config { } amd_cb_config; void register_fw_fuse(char *str); -uint8_t process_config(FILE *config, amd_cb_config *cb_config, uint8_t print_deps); +uint8_t process_config(FILE *config, amd_cb_config *cb_config); #define OK 0 diff --git a/util/amdfwtool/data_parse.c b/util/amdfwtool/data_parse.c index 8b6ecb70d1..aa4732f2e5 100644 --- a/util/amdfwtool/data_parse.c +++ b/util/amdfwtool/data_parse.c @@ -643,7 +643,7 @@ char get_level_from_config(char *line, regoff_t level_index, amd_cb_config *cb_c } static uint8_t process_one_line(char *oneline, regmatch_t *match, char *dir, - uint8_t print_deps, amd_cb_config *cb_config) + amd_cb_config *cb_config) { char *path_filename, *fn = &(oneline[match[2].rm_so]); char *fw_type_str = &(oneline[match[1].rm_so]); @@ -664,13 +664,7 @@ static uint8_t process_one_line(char *oneline, regmatch_t *match, char *dir, fw_type_str, path_filename, ch_lvl, cb_config) == 0) { fprintf(stderr, "Module's name \"%s\" is not valid\n", fw_type_str); return 0; /* Stop parsing. */ - } else { - if (print_deps) - printf(" %s ", path_filename); } - } else { - if (print_deps) - printf(" %s ", path_filename); } return 1; } @@ -710,7 +704,7 @@ static bool is_second_gen(enum platform platform_type) 0: The config file can not be parsed correctly. 1: The config file can be parsed correctly. */ -uint8_t process_config(FILE *config, amd_cb_config *cb_config, uint8_t print_deps) +uint8_t process_config(FILE *config, amd_cb_config *cb_config) { char oneline[MAX_LINE_SIZE]; regmatch_t match[N_MATCHES]; @@ -776,7 +770,7 @@ uint8_t process_config(FILE *config, amd_cb_config *cb_config, uint8_t print_dep strcmp(&(oneline[match[1].rm_so]), "SOC_NAME") == 0) { continue; } else { - if (process_one_line(oneline, match, dir, print_deps, + if (process_one_line(oneline, match, dir, cb_config) == 0) return 0; } -- cgit v1.2.1