Introduce a compile time option to select a default programmer
Heavily influenced by a discussion with (and based on code from) Peter Stuge.
Please read the comment in the Makefile before using this option.
Corresponding to flashrom svn r1607.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Peter Stuge <peter@stuge.se>
diff --git a/cli_classic.c b/cli_classic.c
index 58696ad..4ae375c 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -402,11 +402,17 @@
}
if (prog == PROGRAMMER_INVALID) {
- msg_perr("Please select a programmer with the --programmer parameter.\n"
- "Valid choices are:\n");
- list_programmers_linebreak(0, 80, 0);
- ret = 1;
- goto out;
+ if (CONFIG_DEFAULT_PROGRAMMER != PROGRAMMER_INVALID) {
+ prog = CONFIG_DEFAULT_PROGRAMMER;
+ msg_pinfo("Using default programmer \"%s\".\n",
+ programmer_table[CONFIG_DEFAULT_PROGRAMMER].name);
+ } else {
+ msg_perr("Please select a programmer with the --programmer parameter.\n"
+ "Valid choices are:\n");
+ list_programmers_linebreak(0, 80, 0);
+ ret = 1;
+ goto out;
+ }
}
/* FIXME: Delay calibration should happen in programmer code. */