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 <fishbaozi@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/73627 Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
4b6aa195b4
commit
994ff52464
|
@ -251,7 +251,6 @@ static void usage(void)
|
||||||
printf("\nGeneral options:\n");
|
printf("\nGeneral options:\n");
|
||||||
printf("-c|--config <config file> Config file\n");
|
printf("-c|--config <config file> Config file\n");
|
||||||
printf("-d|--debug Print debug message\n");
|
printf("-d|--debug Print debug message\n");
|
||||||
printf("-l|--list List out the firmware files\n");
|
|
||||||
printf("-h|--help Show this help\n");
|
printf("-h|--help Show this help\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1817,7 +1816,6 @@ enum {
|
||||||
AMDFW_OPT_CONFIG = 'c',
|
AMDFW_OPT_CONFIG = 'c',
|
||||||
AMDFW_OPT_DEBUG = 'd',
|
AMDFW_OPT_DEBUG = 'd',
|
||||||
AMDFW_OPT_HELP = 'h',
|
AMDFW_OPT_HELP = 'h',
|
||||||
AMDFW_OPT_LIST_DEPEND = 'l',
|
|
||||||
|
|
||||||
AMDFW_OPT_XHCI = 128,
|
AMDFW_OPT_XHCI = 128,
|
||||||
AMDFW_OPT_IMC,
|
AMDFW_OPT_IMC,
|
||||||
|
@ -1870,7 +1868,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
static char const optstring[] = {AMDFW_OPT_CONFIG, ':',
|
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[] = {
|
static struct option long_options[] = {
|
||||||
|
@ -1927,7 +1925,6 @@ static struct option long_options[] = {
|
||||||
{"config", required_argument, 0, AMDFW_OPT_CONFIG },
|
{"config", required_argument, 0, AMDFW_OPT_CONFIG },
|
||||||
{"debug", no_argument, 0, AMDFW_OPT_DEBUG },
|
{"debug", no_argument, 0, AMDFW_OPT_DEBUG },
|
||||||
{"help", no_argument, 0, AMDFW_OPT_HELP },
|
{"help", no_argument, 0, AMDFW_OPT_HELP },
|
||||||
{"list", no_argument, 0, AMDFW_OPT_LIST_DEPEND },
|
|
||||||
{NULL, 0, 0, 0 }
|
{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;
|
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;
|
FILE *config_handle;
|
||||||
|
|
||||||
|
@ -2168,7 +2165,7 @@ void open_process_config(char *config, amd_cb_config *cb_config, int list_deps,
|
||||||
config, strerror(errno));
|
config, strerror(errno));
|
||||||
exit(1);
|
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",
|
fprintf(stderr, "Configuration file %s parsing error\n",
|
||||||
config);
|
config);
|
||||||
fclose(config_handle);
|
fclose(config_handle);
|
||||||
|
@ -2215,7 +2212,6 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
amd_cb_config cb_config = { 0 };
|
amd_cb_config cb_config = { 0 };
|
||||||
int debug = 0;
|
int debug = 0;
|
||||||
int list_deps = 0;
|
|
||||||
|
|
||||||
ctx.current_pointer_saved = 0xFFFFFFFF;
|
ctx.current_pointer_saved = 0xFFFFFFFF;
|
||||||
|
|
||||||
|
@ -2432,9 +2428,6 @@ int main(int argc, char **argv)
|
||||||
case AMDFW_OPT_HELP:
|
case AMDFW_OPT_HELP:
|
||||||
usage();
|
usage();
|
||||||
return 0;
|
return 0;
|
||||||
case AMDFW_OPT_LIST_DEPEND:
|
|
||||||
list_deps = 1;
|
|
||||||
break;
|
|
||||||
case AMDFW_OPT_BODY_LOCATION:
|
case AMDFW_OPT_BODY_LOCATION:
|
||||||
body_location = (uint32_t)strtoul(optarg, &tmp, 16);
|
body_location = (uint32_t)strtoul(optarg, &tmp, 16);
|
||||||
if (*tmp != '\0') {
|
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)
|
if (!fuse_defined)
|
||||||
register_fw_fuse(DEFAULT_SOFT_FUSE_CHAIN);
|
register_fw_fuse(DEFAULT_SOFT_FUSE_CHAIN);
|
||||||
|
|
||||||
if (!output && !list_deps) {
|
if (!output) {
|
||||||
fprintf(stderr, "Error: Output value is not specified.\n\n");
|
fprintf(stderr, "Error: Output value is not specified.\n\n");
|
||||||
retval = 1;
|
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"
|
fprintf(stderr, "Error: ROM Size (%d bytes) should be a multiple of"
|
||||||
" 1024 bytes.\n\n", ctx.rom_size);
|
" 1024 bytes.\n\n", ctx.rom_size);
|
||||||
retval = 1;
|
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",
|
fprintf(stderr, "Error: ROM Size (%dKB) must be at least %dKB.\n\n",
|
||||||
ctx.rom_size / 1024, MIN_ROM_KB);
|
ctx.rom_size / 1024, MIN_ROM_KB);
|
||||||
retval = 1;
|
retval = 1;
|
||||||
|
@ -2476,10 +2469,6 @@ int main(int argc, char **argv)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list_deps) {
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
printf(" AMDFWTOOL Using ROM size of %dKB\n", ctx.rom_size / 1024);
|
printf(" AMDFWTOOL Using ROM size of %dKB\n", ctx.rom_size / 1024);
|
||||||
|
|
||||||
rom_base_address = 0xFFFFFFFF - ctx.rom_size + 1;
|
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) {
|
if (cb_config.use_combo && combo_index > 0) {
|
||||||
open_process_config(combo_config[combo_index], &cb_config,
|
open_process_config(combo_config[combo_index], &cb_config,
|
||||||
list_deps, debug);
|
debug);
|
||||||
|
|
||||||
/* In most cases, the address modes are same. */
|
/* In most cases, the address modes are same. */
|
||||||
if (cb_config.need_ish)
|
if (cb_config.need_ish)
|
||||||
|
|
|
@ -409,7 +409,7 @@ typedef struct _amd_cb_config {
|
||||||
} amd_cb_config;
|
} amd_cb_config;
|
||||||
|
|
||||||
void register_fw_fuse(char *str);
|
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
|
#define OK 0
|
||||||
|
|
||||||
|
|
|
@ -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,
|
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 *path_filename, *fn = &(oneline[match[2].rm_so]);
|
||||||
char *fw_type_str = &(oneline[match[1].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) {
|
fw_type_str, path_filename, ch_lvl, cb_config) == 0) {
|
||||||
fprintf(stderr, "Module's name \"%s\" is not valid\n", fw_type_str);
|
fprintf(stderr, "Module's name \"%s\" is not valid\n", fw_type_str);
|
||||||
return 0; /* Stop parsing. */
|
return 0; /* Stop parsing. */
|
||||||
} else {
|
|
||||||
if (print_deps)
|
|
||||||
printf(" %s ", path_filename);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (print_deps)
|
|
||||||
printf(" %s ", path_filename);
|
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -710,7 +704,7 @@ static bool is_second_gen(enum platform platform_type)
|
||||||
0: The config file can not be parsed correctly.
|
0: The config file can not be parsed correctly.
|
||||||
1: The config file can 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];
|
char oneline[MAX_LINE_SIZE];
|
||||||
regmatch_t match[N_MATCHES];
|
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) {
|
strcmp(&(oneline[match[1].rm_so]), "SOC_NAME") == 0) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
if (process_one_line(oneline, match, dir, print_deps,
|
if (process_one_line(oneline, match, dir,
|
||||||
cb_config) == 0)
|
cb_config) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue