- Timestamp:
- 01/04/12 01:48:27 (5 months ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
board_enable.c (modified) (3 diffs)
-
cbtable.c (modified) (1 diff)
-
cli_classic.c (modified) (5 diffs)
-
flashrom.8 (modified) (3 diffs)
-
internal.c (modified) (1 diff)
-
layout.c (modified) (2 diffs)
-
print.c (modified) (2 diffs)
-
print_wiki.c (modified) (1 diff)
-
programmer.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/board_enable.c
r1469 r1483 2071 2071 * the ids uniquely matches the coreboot board identification string. When a 2072 2072 * legacy bios is installed and when autodetection is not possible, these ids 2073 * can be used to identify the board through the -m command line argument. 2073 * can be used to identify the board through the -p internal:mainboard= 2074 * programmer parameter. 2074 2075 * 2075 2076 * When a board is identified through its coreboot ids (in both cases), the … … 2246 2247 msg_pinfo("At least vendors '%s' and '%s' match.\n", 2247 2248 partmatch->lb_vendor, board->lb_vendor); 2248 msg_perr("Please use the full -m vendor:part syntax.\n"); 2249 msg_perr("Please use the full -p internal:mainboard=" 2250 "vendor:part syntax.\n"); 2249 2251 return NULL; 2250 2252 } … … 2260 2262 * expected to fix flashrom, too. 2261 2263 */ 2262 msg_perr("\nUnknown vendor:board from -m option: %s:%s\n\n", 2264 msg_perr("\nUnknown vendor:board from -p internal:mainboard=" 2265 " programmer parameter:\n%s:%s\n\n", 2263 2266 vendor, part); 2264 2267 } -
trunk/cbtable.c
r1284 r1483 34 34 int partvendor_from_cbtable = 0; 35 35 36 void lb_vendor_dev_from_string(char *boardstring) 37 { 36 /* Parse the [<vendor>:]<board> string specified by the user as part of 37 * -p internal:mainboard=[<vendor>:]<board> and set lb_vendor and lb_part 38 * to the extracted values. 39 * Note: strtok modifies the original string, so we work on a copy and allocate 40 * memory for lb_vendor and lb_part with strdup. 41 */ 42 void lb_vendor_dev_from_string(const char *boardstring) 43 { 44 /* strtok may modify the original string. */ 45 char *tempstr = strdup(boardstring); 38 46 char *tempstr2 = NULL; 39 strtok( boardstring, ":");47 strtok(tempstr, ":"); 40 48 tempstr2 = strtok(NULL, ":"); 41 49 if (tempstr2) { 42 lb_vendor = boardstring;43 lb_part = tempstr2;50 lb_vendor = strdup(tempstr); 51 lb_part = strdup(tempstr2); 44 52 } else { 45 53 lb_vendor = NULL; 46 lb_part = boardstring; 47 } 54 lb_part = strdup(tempstr); 55 } 56 free(tempstr); 48 57 } 49 58 -
trunk/cli_classic.c
r1482 r1483 107 107 #endif 108 108 "-E|-r <file>|-w <file>|-v <file>]\n" 109 " [-c <chipname>] [- m [<vendor>:]<part>] [-l <file>]\n"109 " [-c <chipname>] [-l <file>]\n" 110 110 " [-i <image>] [-p <programmername>[:<parameters>]]\n\n"); 111 111 … … 129 129 " -c | --chip <chipname> probe only for specified " 130 130 "flash chip\n" 131 #if CONFIG_INTERNAL == 1132 /* FIXME: --mainboard should be a programmer parameter */133 " -m | --mainboard <[vendor:]part> override mainboard "134 "detection\n"135 #endif136 131 " -f | --force force specific operations " 137 132 "(see man page)\n" … … 191 186 {"noverify", 0, NULL, 'n'}, 192 187 {"chip", 1, NULL, 'c'}, 193 {"mainboard", 1, NULL, 'm'},194 188 {"verbose", 0, NULL, 'V'}, 195 189 {"force", 0, NULL, 'f'}, … … 275 269 } 276 270 erase_it = 1; 277 break;278 case 'm':279 #if CONFIG_INTERNAL == 1280 tempstr = strdup(optarg);281 lb_vendor_dev_from_string(tempstr);282 #else283 fprintf(stderr, "Error: Internal programmer support "284 "was not compiled in and --mainboard only\n"285 "applies to the internal programmer. Aborting.\n");286 cli_classic_abort_usage();287 #endif288 271 break; 289 272 case 'f': … … 426 409 if (prog == PROGRAMMER_INVALID) 427 410 prog = default_programmer; 428 429 #if CONFIG_INTERNAL == 1430 if ((prog != PROGRAMMER_INTERNAL) && (lb_part || lb_vendor)) {431 fprintf(stderr, "Error: --mainboard requires the internal "432 "programmer. Aborting.\n");433 cli_classic_abort_usage();434 }435 #endif436 411 437 412 /* FIXME: Delay calibration should happen in programmer code. */ -
trunk/flashrom.8
r1461 r1483 6 6 \fB\-L\fR|\fB\-z\fR|\fB\-E\fR|\fB\-r\fR <file>|\fB\-w\fR <file>|\ 7 7 \fB\-v\fR <file>] 8 [\fB\-c\fR <chipname>] [\fB\-m\fR [<vendor>:]<board>]\8 [\fB\-c\fR <chipname>] \ 9 9 [\fB\-l\fR <file>] 10 10 [\fB\-i\fR <image>] [\fB\-p\fR <programmername>[:<parameters>]] … … 89 89 case sensitive. 90 90 .TP 91 .B "\-m, \-\-mainboard" [<vendor>:]<board>92 Override mainboard settings.93 .sp94 flashrom reads the coreboot table to determine the current mainboard. If no95 coreboot table could be read or if you want to override these values, you can96 specify \-m, e.g.:97 .sp98 .B " flashrom \-\-mainboard AGAMI:ARUMA \-w agami_aruma.rom"99 .sp100 See the 'Known boards' or 'Known laptops' section in the output101 of 'flashrom \-L' for a list of boards which require the specification of102 the board name, if no coreboot table is found.103 .TP104 91 .B "\-f, \-\-force" 105 92 Force one or more of the following actions: … … 246 233 Otherwise, the mainboard is detected by examining the onboard PCI devices 247 234 and possibly DMI info. If PCI and DMI do not contain information to uniquely 248 identify the mainboard (which is the exception), it might be necessary to 249 specify the mainboard using the 250 .B \-m 251 switch (see above). 235 identify the mainboard (which is the exception), or if you want to override 236 the detected mainboard model, you can specify the mainboard using the 237 .sp 238 .B " flashrom \-p internal:mainboard=[<vendor>:]<board>" 239 syntax. 240 .sp 241 See the 'Known boards' or 'Known laptops' section in the output 242 of 'flashrom \-L' for a list of boards which require the specification of 243 the board name, if no coreboot table is found. 252 244 .sp 253 245 Some of these board-specific flash enabling functions (called -
trunk/internal.c
r1474 r1483 214 214 free(arg); 215 215 216 arg = extract_programmer_param("mainboard"); 217 if (arg && strlen(arg)) { 218 lb_vendor_dev_from_string(arg); 219 } else if (arg && !strlen(arg)) { 220 msg_perr("Missing argument for mainboard.\n"); 221 free(arg); 222 return 1; 223 } 224 free(arg); 225 216 226 get_io_perms(); 217 227 if (register_shutdown(internal_shutdown, NULL)) -
trunk/layout.c
r1482 r1483 107 107 /* 108 108 * If lb_vendor is not set, the coreboot table was 109 * not found. Nor was - mVENDOR:PART specified.109 * not found. Nor was -p internal:mainboard=VENDOR:PART specified. 110 110 */ 111 111 if (!lb_vendor || !lb_part) { 112 msg_pinfo("Note: If the following flash access fails, "113 "try -m<vendor>:<mainboard>.\n");112 msg_pinfo("Note: If the following flash access fails, try " 113 "-p internal:mainboard=<vendor>:<mainboard>.\n"); 114 114 return 0; 115 115 } … … 127 127 } else { 128 128 msg_pinfo("ERROR: Your firmware image (%s:%s) does not " 129 "appear to\n be correct for the detected " 130 "mainboard (%s:%s)\n\nOverride with -p internal:" 131 "boardmismatch=force if you are absolutely sure " 132 "that\nyou are using a correct " 133 "image for this mainboard or override\nthe detected " 134 "values with --mainboard <vendor>:<mainboard>.\n\n", 135 mainboard_vendor, mainboard_part, lb_vendor, 136 lb_part); 129 "appear to\n" 130 " be correct for the detected " 131 "mainboard (%s:%s)\n\n" 132 "Override with -p internal:boardmismatch=" 133 "force to ignore the board name in the\n" 134 "firmware image or override the detected " 135 "mainboard with\n" 136 "-p internal:mainboard=<vendor>:<mainboard>." 137 "\n\n", 138 mainboard_vendor, mainboard_part, lb_vendor, 139 lb_part); 137 140 exit(1); 138 141 } -
trunk/print.c
r1472 r1483 390 390 msg_ginfo(" "); 391 391 392 msg_ginfo("Status Required option\n\n"); 392 msg_ginfo("Status Required value for\n"); 393 for (i = 0; i < maxvendorlen + maxboardlen + strlen("Status "); i++) 394 msg_ginfo(" "); 395 msg_ginfo("-p internal:mainboard=\n"); 393 396 394 397 for (b = boards; b->vendor != NULL; b++) { … … 408 411 msg_ginfo("(autodetected)"); 409 412 else 410 msg_ginfo(" -m%s:%s", e->lb_vendor,413 msg_ginfo("%s:%s", e->lb_vendor, 411 414 e->lb_part); 412 415 } -
trunk/print_wiki.c
r1454 r1483 168 168 boards[i].name, 169 169 boards[i].url ? "]" : "", 170 b[k].lb_vendor ? "- m" : "—",170 b[k].lb_vendor ? "-p internal:mainboard=" : "—", 171 171 b[k].lb_vendor ? b[k].lb_vendor : "", 172 172 b[k].lb_vendor ? ":" : "", -
trunk/programmer.h
r1480 r1483 265 265 266 266 /* cbtable.c */ 267 void lb_vendor_dev_from_string(c har *boardstring);267 void lb_vendor_dev_from_string(const char *boardstring); 268 268 int coreboot_init(void); 269 269 extern char *lb_part, *lb_vendor;
Note: See TracChangeset
for help on using the changeset viewer.
