add option to bypass reset in SPI write mode. Adapt altera accordingly

This commit is contained in:
Gwenhael Goavec-Merou
2022-05-24 07:29:35 +02:00
parent e066c7f5b0
commit 051e2ecbfb
5 changed files with 24 additions and 9 deletions
+5 -2
View File
@@ -69,6 +69,7 @@ struct arguments {
bool unprotect_flash;
string flash_sector;
bool skip_load_bridge;
bool skip_reset;
};
int parse_opt(int argc, char **argv, struct arguments *args, jtag_pins_conf_t *pins_config);
@@ -85,7 +86,7 @@ int main(int argc, char **argv)
struct arguments args = {0, false, false, false, 0, "", "", "-", "", -1,
0, false, "-", false, false, false, false, Device::PRG_NONE, false,
false, false, "", "", "", -1, 0, false, -1, 0, 0, "127.0.0.1",
0, false, "", false};
0, false, "", false, false};
/* parse arguments */
try {
if (parse_opt(argc, argv, &args, &pins_config))
@@ -468,7 +469,7 @@ int main(int argc, char **argv)
} else if (fab == "altera") {
fpga = new Altera(jtag, args.bit_file, args.file_type,
args.prg_type, args.fpga_part, args.verify, args.verbose,
args.skip_load_bridge);
args.skip_load_bridge, args.skip_reset);
} else if (fab == "anlogic") {
fpga = new Anlogic(jtag, args.bit_file, args.file_type,
args.prg_type, args.verify, args.verbose);
@@ -638,6 +639,8 @@ int parse_opt(int argc, char **argv, struct arguments *args, jtag_pins_conf_t *p
cxxopts::value<bool>(args->reset))
("skip-load-bridge", "skip writing bridge to SRAM when in write-flash mode",
cxxopts::value<bool>(args->skip_load_bridge))
("skip-reset", "skip resetting the device when in write-flash mode",
cxxopts::value<bool>(args->skip_load_bridge))
("spi", "SPI mode (only for FTDI in serial mode)",
cxxopts::value<bool>(args->spi))
("unprotect-flash", "Unprotect flash blocks",