MCPcopy Create free account
hub / github.com/coreboot/coreboot / main

Function main

util/ifdtool/ifdtool.c:2277–2787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2275}
2276
2277int main(int argc, char *argv[])
2278{
2279 int opt, option_index = 0;
2280 int mode_dump = 0, mode_extract = 0, mode_inject = 0, mode_spifreq = 0;
2281 int mode_em100 = 0, mode_locked = 0, mode_unlocked = 0, mode_validate = 0;
2282 int mode_layout = 0, mode_newlayout = 0, mode_density = 0, mode_setstrap = 0;
2283 int mode_read = 0, mode_altmedisable = 0, altmedisable = 0, mode_fmap_template = 0;
2284 int mode_gpr0_disable = 0, mode_gpr0_enable = 0, mode_gpr0_status = 0;
2285 int mode_settopswapsize = 0;
2286 char *region_type_string = NULL, *region_fname = NULL, *layout_fname = NULL;
2287 char *new_filename = NULL, *top_swap_size_arg = NULL;
2288 int region_type = -1, inputfreq = 0;
2289 unsigned int value = 0;
2290 unsigned int pchstrap = 0;
2291 unsigned int new_density = 0;
2292 enum spi_frequency spifreq = SPI_FREQUENCY_20MHZ;
2293
2294 static const struct option long_options[] = {
2295 {"dump", 0, NULL, 'd'},
2296 {"layout", 1, NULL, 'f'},
2297 {"fmap-template", 1, NULL, 'F'},
2298 {"extract", 0, NULL, 'x'},
2299 {"inject", 1, NULL, 'i'},
2300 {"newlayout", 1, NULL, 'n'},
2301 {"output", 1, NULL, 'O'},
2302 {"spifreq", 1, NULL, 's'},
2303 {"density", 1, NULL, 'D'},
2304 {"chip", 1, NULL, 'C'},
2305 {"altmedisable", 1, NULL, 'M'},
2306 {"em100", 0, NULL, 'e'},
2307 {"lock", 0, NULL, 'l'},
2308 {"read", 0, NULL, 'r'},
2309 {"unlock", 0, NULL, 'u'},
2310 {"gpr0-disable", 0, NULL, 'g'},
2311 {"gpr0-enable", 0, NULL, 'E'},
2312 {"gpr0-status", 0, NULL, 'c'},
2313 {"version", 0, NULL, 'v'},
2314 {"help", 0, NULL, 'h'},
2315 {"platform", 1, NULL, 'p'},
2316 {"validate", 0, NULL, 't'},
2317 {"setpchstrap", 1, NULL, 'S'},
2318 {"newvalue", 1, NULL, 'V'},
2319 {"topswapsize", 1, NULL, 'T'},
2320 {0, 0, 0, 0}
2321 };
2322
2323 while ((opt = getopt_long(argc, argv, "S:V:df:F:D:C:M:xi:n:O:s:p:T:elrugEcvth?",
2324 long_options, &option_index)) != EOF) {
2325 switch (opt) {
2326 case 'd':
2327 mode_dump = 1;
2328 break;
2329 case 'S':
2330 mode_setstrap = 1;
2331 pchstrap = strtoul(optarg, NULL, 0);
2332 break;
2333 case 'V':
2334 value = strtoul(optarg, NULL, 0);

Callers

nothing calls this directly

Calls 15

getopt_longFunction · 0.85
fprintfFunction · 0.85
exitFunction · 0.85
strcasecmpFunction · 0.85
printfFunction · 0.85
perrorFunction · 0.85
readFunction · 0.85
strlenFunction · 0.85
strcatFunction · 0.85
check_ifd_versionFunction · 0.85
dump_fdFunction · 0.85
dump_flashrom_layoutFunction · 0.85

Tested by

no test coverage detected