summaryrefslogtreecommitdiffstats
path: root/internal.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2012-09-24 21:29:29 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2012-09-24 21:29:29 +0000
commitfa9fa7131a4c5a0bc49c17a428bb0388f9bc88e7 (patch)
tree183ed67b551d6e3c31010bed83cb7e6bc0db2af2 /internal.c
parent4e6d346c6ec0188aa309bfa2fe86ce52b9487ec6 (diff)
downloadflashrom-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 'internal.c')
-rw-r--r--internal.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/internal.c b/internal.c
index d31808d5e..eda4d594a 100644
--- a/internal.c
+++ b/internal.c
@@ -257,12 +257,8 @@ int internal_init(void)
}
#if defined(__i386__) || defined(__x86_64__)
- if (cb_parse_table(&cb_vendor, &cb_model) == 0) { /* coreboot IDs valid */
- /* If no -p internal:mainboard was given but there are valid coreboot IDs then use those. */
- if (board_vendor == NULL || board_model == NULL) {
- board_vendor = cb_vendor;
- board_model = cb_model;
- } else if (strcasecmp(board_vendor, cb_vendor) || strcasecmp(board_model, cb_model)) {
+ if ((cb_parse_table(&cb_vendor, &cb_model) == 0) && (board_vendor != NULL) && (board_model != NULL)) {
+ if (strcasecmp(board_vendor, cb_vendor) || strcasecmp(board_model, cb_model)) {
msg_pinfo("WARNING: The mainboard IDs set by -p internal:mainboard (%s:%s) do not\n"
" match the current coreboot IDs of the mainboard (%s:%s).\n",
board_vendor, board_model, cb_vendor, cb_model);
@@ -339,7 +335,7 @@ int internal_init(void)
init_superio_ite();
#endif
- if (board_flash_enable(board_vendor, board_model)) {
+ if (board_flash_enable(board_vendor, board_model, cb_vendor, cb_model)) {
msg_perr("Aborting to be safe.\n");
return 1;
}