Lines Matching +full:supported +full:- +full:buses

6  * Copyright (C) 2005-2008 coresystems GmbH
7 * Copyright (C) 2008,2009,2010 Carl-Daniel Hailfinger
84 printf("Usage: %s [-h|-R|-L|" in cli_classic_usage()
86 "-z|" in cli_classic_usage()
88 "\n\t-p <programmername>[:<parameters>] [-c <chipname>]\n" in cli_classic_usage()
89 "\t\t(--flash-name|--flash-size|\n" in cli_classic_usage()
90 "\t\t [-E|-x|(-r|-w|-v) [<file>]]\n" in cli_classic_usage()
91 "\t\t [(-l <layoutfile>|--ifd|--fmap|--fmap-file <fmapfile>) [-i <region>[:<file>]]...]\n" in cli_classic_usage()
92 "\t\t [-n] [-N] [-f])]\n" in cli_classic_usage()
93 "\t[-V[V[V]]] [-o <logfile>]\n\n", name); in cli_classic_usage()
95 printf(" -h | --help print this help text\n" in cli_classic_usage()
96 " -R | --version print version (release)\n" in cli_classic_usage()
97 " -r | --read [<file>] read flash and save to <file>\n" in cli_classic_usage()
98 " -w | --write [<file>|-] write <file> or the content provided\n" in cli_classic_usage()
100 " -v | --verify [<file>|-] verify flash against <file>\n" in cli_classic_usage()
102 " -E | --erase erase flash memory\n" in cli_classic_usage()
103 " -V | --verbose more verbose output\n" in cli_classic_usage()
104 " -c | --chip <chipname> probe only for specified flash chip\n" in cli_classic_usage()
105 " -f | --force force specific operations (see man page)\n" in cli_classic_usage()
106 " -n | --noverify don't auto-verify\n" in cli_classic_usage()
107 " -N | --noverify-all verify included regions only (cf. -i)\n" in cli_classic_usage()
108 " -x | --extract extract regions to files\n" in cli_classic_usage()
109 " -l | --layout <layoutfile> read ROM layout from <layoutfile>\n" in cli_classic_usage()
110 " --wp-disable disable write protection\n" in cli_classic_usage()
111 " --wp-enable enable write protection\n" in cli_classic_usage()
112 " --wp-list list supported write protection ranges\n" in cli_classic_usage()
113 " --wp-status show write protection status\n" in cli_classic_usage()
114 " --wp-range=<start>,<len> set write protection range (use --wp-range=0,0\n" in cli_classic_usage()
116 " --wp-region <region> set write protection region\n" in cli_classic_usage()
117 " --flash-name read out the detected flash name\n" in cli_classic_usage()
118 " --flash-size read out the detected flash size\n" in cli_classic_usage()
119 " --fmap read ROM layout from fmap embedded in ROM\n" in cli_classic_usage()
120 " --fmap-file <fmapfile> read ROM layout from fmap in <fmapfile>\n" in cli_classic_usage()
121 " --ifd read layout from an Intel Firmware Descriptor\n" in cli_classic_usage()
122 " -i | --include <region>[:<file>] only read/write image <region> from layout\n" in cli_classic_usage()
124 " --image <region>[:<file>] deprecated, please use --include\n" in cli_classic_usage()
125 " -o | --output <logfile> log output to <logfile>\n" in cli_classic_usage()
126 " --flash-contents <ref-file> assume flash contents to be <ref-file>\n" in cli_classic_usage()
127 " -L | --list-supported print supported devices\n" in cli_classic_usage()
129 " -z | --list-supported-wiki print supported devices in wiki syntax\n" in cli_classic_usage()
131 " --progress show progress percentage on the standard output\n" in cli_classic_usage()
132 " -p | --programmer <name>[:<param>] specify the programmer device. One of\n"); in cli_classic_usage()
134 printf(".\n\nYou can specify one of -h, -R, -L, " in cli_classic_usage()
136 "-z, " in cli_classic_usage()
138 "-E, -r, -w, -v or no operation.\n" in cli_classic_usage()
146 printf("Please run \"flashrom --help\" for usage info.\n"); in cli_classic_abort_usage()
164 if (filename[0] == '-' && filename[1] != '\0') in check_filename()
165 fprintf(stderr, "Warning: Supplied %s file name starts with -\n", type); in check_filename()
184 msg_gerr("Error: No wp-range values provided\n"); in parse_wp_range()
185 return -1; in parse_wp_range()
190 msg_gerr("Error: Invalid wp-range argument format\n"); in parse_wp_range()
191 return -1; in parse_wp_range()
197 msg_gerr("Error: Invalid wp-range argument format\n"); in parse_wp_range()
198 return -1; in parse_wp_range()
221 if (start == chip_len - len) in print_wp_range()
249 return "the requested protection mode is not supported"; in get_wp_error_str()
251 return "the requested protection range is not supported"; in get_wp_error_str()
333 msg_gerr("Note: power-cycle status register protection is enabled. " in wp_cli()
334 "A power-off, power-on cycle is usually required to change " in wp_cli()
415 /* filename was supplied in optarg (i.e. -rfilename) */ in get_optional_filename()
418 /* filename is on optind if it is not another flag (i.e. -r filename) in get_optional_filename()
419 * - is treated as stdin, so we still strdup in this case in get_optional_filename()
422 (argv[optind][0] != '-' || argv[optind][1] == '\0')) in get_optional_filename()
457 * individual regions using the partial read syntax ('-i <region>[:<filename>]')
462 * @param buf Chip-sized buffer to write data to
470 * Content will be read from -i args, so they must not overlap since in read_buf_from_include_args()
479 if (!entry->file) in read_buf_from_include_args()
481 const struct flash_region *region = &entry->region; in read_buf_from_include_args()
482 if (read_buf_from_file(buf + region->start, in read_buf_from_include_args()
483 region->end - region->start + 1, entry->file)) in read_buf_from_include_args()
493 * individual regions using the partial read syntax ('-i <region>[:<filename>]')
498 * @param buf Chip-sized buffer to read data from
506 if (!entry->file) in write_buf_to_include_args()
508 const struct flash_region *region = &entry->region; in write_buf_to_include_args()
509 if (write_buf_to_file(buf + region->start, in write_buf_to_include_args()
510 region->end - region->start + 1, entry->file)) in write_buf_to_include_args()
563 /* Read '-w' argument first... */ in do_write()
569 * ... then update newcontents with contents from files provided to '-i' in do_write()
599 /* Read '-v' argument first... */ in do_verify()
605 * ... then update newcontents with contents from files provided to '-i' in do_verify()
618 /* Returns the number of buses commonly supported by the current programmer and flash chip where th…
624 uint32_t size = flash->chip->total_size * 1024; in count_max_decode_exceedings()
625 enum chipbustype buses = flash->mst->buses_supported & flash->chip->bustype; in count_max_decode_exceedings() local
627 if ((buses & BUS_PARALLEL) && (max_rom_decode_->parallel < size)) { in count_max_decode_exceedings()
629 msg_pdbg("Chip size %"PRIu32" kB is bigger than supported " in count_max_decode_exceedings()
633 max_rom_decode_->parallel / 1024, "Parallel"); in count_max_decode_exceedings()
635 if ((buses & BUS_LPC) && (max_rom_decode_->lpc < size)) { in count_max_decode_exceedings()
637 msg_pdbg("Chip size %"PRIu32" kB is bigger than supported " in count_max_decode_exceedings()
641 max_rom_decode_->lpc / 1024, "LPC"); in count_max_decode_exceedings()
643 if ((buses & BUS_FWH) && (max_rom_decode_->fwh < size)) { in count_max_decode_exceedings()
645 msg_pdbg("Chip size %"PRIu32" kB is bigger than supported " in count_max_decode_exceedings()
649 max_rom_decode_->fwh / 1024, "FWH"); in count_max_decode_exceedings()
651 if ((buses & BUS_SPI) && (max_rom_decode_->spi < size)) { in count_max_decode_exceedings()
653 msg_pdbg("Chip size %"PRIu32" kB is bigger than supported " in count_max_decode_exceedings()
657 max_rom_decode_->spi / 1024, "SPI"); in count_max_decode_exceedings()
671 * line parsing to allow --help overriding everything else. in parse_options()
678 options->filename = get_optional_filename(argv); in parse_options()
679 options->read_it = true; in parse_options()
683 options->filename = get_optional_filename(argv); in parse_options()
684 options->write_it = true; in parse_options()
687 //FIXME: gracefully handle superfluous -v in parse_options()
689 if (options->dont_verify_it) { in parse_options()
690 cli_classic_abort_usage("--verify and --noverify are mutually exclusive. Aborting.\n"); in parse_options()
692 options->filename = get_optional_filename(argv); in parse_options()
693 options->verify_it = true; in parse_options()
696 if (options->verify_it) { in parse_options()
697 cli_classic_abort_usage("--verify and --noverify are mutually exclusive. Aborting.\n"); in parse_options()
699 options->dont_verify_it = true; in parse_options()
702 options->dont_verify_all = true; in parse_options()
706 options->extract_it = true; in parse_options()
709 options->chip_to_probe = strdup(optarg); in parse_options()
718 options->erase_it = true; in parse_options()
721 options->force = true; in parse_options()
724 if (options->layoutfile) in parse_options()
725 cli_classic_abort_usage("Error: --layout specified more than once. Aborting.\n"); in parse_options()
726 if (options->ifd) in parse_options()
727 cli_classic_abort_usage("Error: --layout and --ifd both specified. Aborting.\n"); in parse_options()
728 if (options->fmap) in parse_options()
729 cli_classic_abort_usage("Error: --layout and --fmap-file both specified. Aborting.\n"); in parse_options()
730 options->layoutfile = strdup(optarg); in parse_options()
733 if (options->layoutfile) in parse_options()
734 cli_classic_abort_usage("Error: --layout and --ifd both specified. Aborting.\n"); in parse_options()
735 if (options->fmap) in parse_options()
736 cli_classic_abort_usage("Error: --fmap-file and --ifd both specified. Aborting.\n"); in parse_options()
737 options->ifd = true; in parse_options()
740 if (options->fmap) in parse_options()
741 cli_classic_abort_usage("Error: --fmap or --fmap-file specified " in parse_options()
743 if (options->ifd) in parse_options()
744 cli_classic_abort_usage("Error: --fmap-file and --ifd both specified. Aborting.\n"); in parse_options()
745 if (options->layoutfile) in parse_options()
746 cli_classic_abort_usage("Error: --fmap-file and --layout both specified. Aborting.\n"); in parse_options()
747 options->fmapfile = strdup(optarg); in parse_options()
748 options->fmap = true; in parse_options()
751 if (options->fmap) in parse_options()
752 cli_classic_abort_usage("Error: --fmap or --fmap-file specified " in parse_options()
754 if (options->ifd) in parse_options()
755 cli_classic_abort_usage("Error: --fmap and --ifd both specified. Aborting.\n"); in parse_options()
756 if (options->layoutfile) in parse_options()
757 cli_classic_abort_usage("Error: --layout and --fmap both specified. Aborting.\n"); in parse_options()
758 options->fmap = true; in parse_options()
761 if (register_include_arg(&options->include_args, optarg)) in parse_options()
765 if (options->referencefile) in parse_options()
766 cli_classic_abort_usage("Error: --flash-contents specified more than once." in parse_options()
768 options->referencefile = strdup(optarg); in parse_options()
772 options->flash_name = true; in parse_options()
776 options->flash_size = true; in parse_options()
779 options->print_wp_status = true; in parse_options()
782 options->print_wp_ranges = true; in parse_options()
785 if (parse_wp_range(&options->wp_start, &options->wp_len) < 0) in parse_options()
786 cli_classic_abort_usage("Incorrect wp-range arguments provided.\n"); in parse_options()
788 options->set_wp_range = true; in parse_options()
791 options->set_wp_region = true; in parse_options()
792 options->wp_region = strdup(optarg); in parse_options()
795 options->enable_wp = true; in parse_options()
798 options->disable_wp = true; in parse_options()
802 options->list_supported = true; in parse_options()
807 options->list_supported_wiki = true; in parse_options()
814 if (options->prog != NULL) { in parse_options()
815 cli_classic_abort_usage("Error: --programmer specified " in parse_options()
823 name = programmer_table[p]->name; in parse_options()
828 options->pparam = strdup(optarg + namelen + 1); in parse_options()
829 if (!strlen(options->pparam)) { in parse_options()
830 free(options->pparam); in parse_options()
831 options->pparam = NULL; in parse_options()
833 options->prog = programmer_table[p]; in parse_options()
836 options->prog = programmer_table[p]; in parse_options()
849 if (options->prog == NULL) { in parse_options()
868 if (options->logfile) { in parse_options()
869 fprintf(stderr, "Warning: -o/--output specified multiple times.\n"); in parse_options()
870 free(options->logfile); in parse_options()
873 options->logfile = strdup(optarg); in parse_options()
874 if (options->logfile[0] == '\0') { in parse_options()
879 options->show_progress = true; in parse_options()
893 cleanup_include_args(&options->include_args); in free_options()
894 free(options->filename); in free_options()
895 free(options->fmapfile); in free_options()
896 free(options->referencefile); in free_options()
897 free(options->layoutfile); in free_options()
898 free(options->pparam); in free_options()
899 free(options->wp_region); in free_options()
900 free(options->logfile); in free_options()
901 free((char *)options->chip_to_probe); in free_options()
911 int startchip = -1, chipcount = 0; in main()
923 {"noverify-all", 0, NULL, 'N'}, in main()
931 {"fmap-file", 1, NULL, OPTION_FMAP_FILE}, in main()
934 {"flash-contents", 1, NULL, OPTION_FLASH_CONTENTS}, in main()
935 {"flash-name", 0, NULL, OPTION_FLASH_NAME}, in main()
936 {"flash-size", 0, NULL, OPTION_FLASH_SIZE}, in main()
937 {"get-size", 0, NULL, OPTION_FLASH_SIZE}, // (deprecated): back compatibility. in main()
938 {"wp-status", 0, NULL, OPTION_WP_STATUS}, in main()
939 {"wp-list", 0, NULL, OPTION_WP_LIST}, in main()
940 {"wp-range", 1, NULL, OPTION_WP_SET_RANGE}, in main()
941 {"wp-region", 1, NULL, OPTION_WP_SET_REGION}, in main()
942 {"wp-enable", 0, NULL, OPTION_WP_ENABLE}, in main()
943 {"wp-disable", 0, NULL, OPTION_WP_DISABLE}, in main()
944 {"list-supported", 0, NULL, 'L'}, in main()
945 {"list-supported-wiki", 0, NULL, 'z'}, in main()
955 * Safety-guard against a user who has (mistakenly) closed in main()
1000 msg_gdbg("Command line (%i args):", argc - 1); in main()
1011 /* If the user specifies a -i argument and no layout, then we do fmap in main()
1014 msg_gdbg("-i argument specified, set fmap.\n"); in main()
1024 for (chip = flashchips; chip && chip->name; chip++) in main()
1025 if (!strcmp(chip->name, options.chip_to_probe)) in main()
1027 if (!chip || !chip->name) { in main()
1029 msg_gerr("Run flashrom -L to view the hardware supported in this flashrom version.\n"); in main()
1044 default_programmer->name, options.pparam); in main()
1046 msg_perr("Please select a programmer with the --programmer parameter.\n" in main()
1068 msg_pdbg("The following protocols are supported: %s.\n", tempstr ? tempstr : "?"); in main()
1076 if (startchip == -1) in main()
1085 flashes[0].chip->name); in main()
1087 msg_cinfo(", \"%s\"", flashes[i].chip->name); in main()
1088 msg_cinfo("\nPlease specify which chip definition to use with the -c <chipname> option.\n"); in main()
1100 msg_cinfo("Force read (-f -r -c) requested, pretending the chip is there:\n"); in main()
1105 if (mst->buses_supported & chip->bustype) in main()
1119 if (startchip != -1) in main()
1122 if (startchip == -1) { in main()
1138 tempstr = flashbuses_to_text(flashes[0].chip->bustype); in main()
1140 flashes[0].chip->vendor, flashes[0].chip->name, flashes[0].chip->total_size, in main()
1154 print_chip_support_status(fill_flash->chip); in main()
1158 enum chipbustype commonbuses = fill_flash->mst->buses_supported & fill_flash->chip->bustype; in main()
1161 * and the limit is not exceeded on all buses. Tell the user. */ in main()
1166 msg_cerr("This flash chip is too big for this programmer (--verbose/-V gives details).\n" in main()
1167 "Use --force/-f to override at your own risk.\n"); in main()
1186 msg_ginfo("Error: --wp-enable and --wp-disable are mutually exclusive\n"); in main()
1191 msg_gerr("Error: Cannot use both --wp-range and --wp-region simultaneously.\n"); in main()
1197 * Common rules for -r/-w/-v syntax parsing: in main()
1198 * - If no filename is specified at all, quit. in main()
1199 * - If no filename is specified for -r/-w/-v, but files are specified in main()
1200 * for -i, then the number of file arguments for -i options must be in main()
1201 * equal to the total number of -i options. in main()
1204 * - If files are specified for -i args but not -r, do partial reads for in main()
1205 * each -i arg, creating a new file for each region. Each -i option in main()
1207 * - If filenames are specified for -r and -i args, then: in main()
1208 * - Do partial read for each -i arg, creating a new file for in main()
1209 * each region where a filename is provided (-i region:filename). in main()
1210 * - Create a ROM-sized file with partially filled content. For each in main()
1211 * -i arg, fill the corresponding offset with content from ROM. in main()
1214 * - If files are specified for both -w/-v and -i args, -i files take in main()
1216 * - If file is specified for -w/-v and no files are specified with -i in main()
1219 * - If files are specified for -i args but not -w, do partial writes in main()
1220 * for each -i arg. Likewise for -v and -i args. All -i args must in main()
1222 * - Regions with a filename associated must not overlap. This is also in main()
1240 if (fill_flash->chip->vendor && fill_flash->chip->name) { in main()
1242 fill_flash->chip->vendor, in main()
1243 fill_flash->chip->name); in main()
1245 ret = -1; in main()
1287 msg_gerr("Error: A flash layout must be specified to use --wp-region.\n"); in main()