diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2012-09-24 21:29:29 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2012-09-24 21:29:29 +0000 |
commit | fa9fa7131a4c5a0bc49c17a428bb0388f9bc88e7 (patch) | |
tree | 183ed67b551d6e3c31010bed83cb7e6bc0db2af2 /board_enable.c | |
parent | 4e6d346c6ec0188aa309bfa2fe86ce52b9487ec6 (diff) | |
download | flashrom-fa9fa7131a4c5a0bc49c17a428bb0388f9bc88e7.tar.gz flashrom-fa9fa7131a4c5a0bc49c17a428bb0388f9bc88e7.tar.bz2 flashrom-fa9fa7131a4c5a0bc49c17a428bb0388f9bc88e7.zip |
Fix flashrom running on boards with coreboot
In r1577 we removed the discrimination of coreboot IDs and user-specified
mainboards. The problem is that the board enable code required to find
a board enable if either of these model strings were set. Therefore boards
running coreboot that do not need a board enable failed to execute flashrom
since then. This patch fixes this by handling coreboot IDs and user-supplied
IDs differently again.
Corresponding to flashrom svn r1605.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Idwer Vollering <vidwer@gmail.com>
Diffstat (limited to 'board_enable.c')
-rw-r--r-- | board_enable.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/board_enable.c b/board_enable.c index 7f301809..28a8fcd3 100644 --- a/board_enable.c +++ b/board_enable.c @@ -2499,7 +2499,6 @@ static const struct board_match *board_match_name(const char *vendor, const char if (partmatch) return partmatch; - msg_perr("No suitable board enable found for vendor=\"%s\", model=\"%s\".\n", vendor, model); return NULL; } @@ -2609,16 +2608,27 @@ void board_handle_before_laptop(void) board_handle_phase(P2); } -int board_flash_enable(const char *vendor, const char *model) +int board_flash_enable(const char *vendor, const char *model, const char *cb_vendor, const char *cb_model) { const struct board_match *board = NULL; int ret = 0; - if (vendor && model) { + if (vendor != NULL && model != NULL) { board = board_match_name(vendor, model); - if (!board) /* if a board was given it has to match, else we abort here. */ + if (!board) { /* If a board was given by the user it has to match, else we abort here. */ + msg_perr("No suitable board enable found for vendor=\"%s\", model=\"%s\".\n", + vendor, model); return 1; - } else { + } + } + if (board == NULL && cb_vendor != NULL && cb_model != NULL) { + board = board_match_name(cb_vendor, cb_model); + if (!board) { /* Failure is an option here, because many cb boards don't require an enable. */ + msg_pdbg2("No board enable found matching coreboot IDs vendor=\"%s\", model=\"%s\".\n", + cb_vendor, cb_model); + } + } + if (board == NULL) { board = board_match_pci_ids(P3); if (!board) /* i.e. there is just no board enable available for this board */ return 0; |